Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelPeerNodeQueryService;
-import org.eclipse.tcf.te.tcf.locator.nodes.PeerRedirector;
-
-/**
- * Locator model property tester.
- */
-public class LocatorModelPropertyTester extends 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(final Object receiver, final String property, final Object[] args, final Object expectedValue) {
- // The receiver is expected to be a peer model node or a peer
- if (receiver instanceof IPeerModel || receiver instanceof IPeer) {
- final AtomicBoolean result = new AtomicBoolean();
-
- // If we have to test for local or remote services, we have to handle it special
- if ("hasLocalService".equals(property) || "hasRemoteService".equals(property)) { //$NON-NLS-1$ //$NON-NLS-2$
- // This tests must happen outside the TCF dispatch thread's
- if (!Protocol.isDispatchThread()) {
- result.set(testServices((IPeerModel) receiver, property, args, expectedValue));
- }
- }
- else {
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- if (receiver instanceof IPeerModel) {
- result.set(testPeerModel((IPeerModel) receiver, property, args, expectedValue));
- } else {
- result.set(testPeer((IPeer) receiver, property, args, expectedValue));
- }
- }
- };
-
- if (Protocol.isDispatchThread()) {
- runnable.run();
- }
- else {
- Protocol.invokeAndWait(runnable);
- }
- }
-
- return result.get();
- }
- return false;
- }
-
- /**
- * Test the specific peer model node properties.
- *
- * @param node The model node. Must not be <code>null</code>.
- * @param property The property to test.
- * @param args The property arguments.
- * @param expectedValue The expected value.
- *
- * @return <code>True</code> if the property to test has the expected value, <code>false</code>
- * otherwise.
- */
- protected boolean testPeerModel(IPeerModel node, String property, Object[] args, Object expectedValue) {
- Assert.isNotNull(node);
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- return testPeer(node.getPeer(), property, args, expectedValue);
- }
-
- /**
- * Test the specific peer properties.
- *
- * @param node The peer. Must not be <code>null</code>.
- * @param property The property to test.
- * @param args The property arguments.
- * @param expectedValue The expected value.
- *
- * @return <code>True</code> if the property to test has the expected value, <code>false</code>
- * otherwise.
- */
- protected boolean testPeer(IPeer node, String property, Object[] args, Object expectedValue) {
- Assert.isNotNull(node);
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- if ("name".equals(property)) { //$NON-NLS-1$
- if (node.getName() != null && node.getName().equals(expectedValue)) {
- return true;
- }
- }
-
- if ("nameRegex".equals(property) && expectedValue instanceof String) { //$NON-NLS-1$
- if (node.getName() != null && node.getName().matches((String)expectedValue)) {
- return true;
- }
- }
-
- if ("osName".equals(property)) { //$NON-NLS-1$
- if (node.getOSName() != null && node.getOSName().equals(expectedValue)) {
- return true;
- }
- }
-
- if ("osNameRegex".equals(property) && expectedValue instanceof String) { //$NON-NLS-1$
- if (node.getOSName() != null && node.getOSName().matches((String)expectedValue)) {
- return true;
- }
- }
-
- if ("isStaticPeer".equals(property)) { //$NON-NLS-1$
- String value = node.getAttributes().get("static.transient"); //$NON-NLS-1$
- boolean isStaticPeer = value != null && Boolean.parseBoolean(value.trim());
- if (expectedValue instanceof Boolean) {
- return ((Boolean) expectedValue).booleanValue() == isStaticPeer;
- }
- }
-
- if ("isRedirected".equals(property)) { //$NON-NLS-1$
- boolean isRedirected = node instanceof PeerRedirector;
- if (expectedValue instanceof Boolean) {
- return ((Boolean) expectedValue).booleanValue() == isRedirected;
- }
- }
-
- if ("isProxy".equals(property)) { //$NON-NLS-1$
- boolean isProxy = node.getAttributes().containsKey("Proxy"); //$NON-NLS-1$
- if (expectedValue instanceof Boolean) {
- return ((Boolean) expectedValue).booleanValue() == isProxy;
- }
- }
-
- if ("isValueAdd".equals(property)) { //$NON-NLS-1$
- String value = node.getAttributes().get("ValueAdd"); //$NON-NLS-1$
- boolean isValueAdd = value != null && ("1".equals(value.trim()) || Boolean.parseBoolean(value.trim())); //$NON-NLS-1$
- if (expectedValue instanceof Boolean) {
- return ((Boolean) expectedValue).booleanValue() == isValueAdd;
- }
- }
-
- if ("isOfType".equals(property)) { //$NON-NLS-1$
- String value = node.getAttributes().get(IPeerModelProperties.PROP_TYPE);
- if (expectedValue instanceof String) {
- return value != null ? ((String)expectedValue).equals(value) : ((String)expectedValue).equalsIgnoreCase("null"); //$NON-NLS-1$
- }
- }
-
- if ("hasAttribute".equals(property)) { //$NON-NLS-1$
- String name = args != null && args.length > 0 ? (String)args[0] : null;
- boolean hasAttribute = name != null && !"".equals(name) ? node.getAttributes().containsKey(name) : false; //$NON-NLS-1$
- if (expectedValue instanceof Boolean) {
- return ((Boolean) expectedValue).booleanValue() == hasAttribute;
- }
- }
-
- if ("isAttribute".equals(property)) { //$NON-NLS-1$
- String name = args != null && args.length > 0 ? (String)args[0] : null;
- String value = name != null && !"".equals(name) ? node.getAttributes().get(name) : null; //$NON-NLS-1$
- if (expectedValue != null) {
- return expectedValue.toString().equals(value);
- }
- }
-
- if ("hasOfflineService".equals(property)) { //$NON-NLS-1$
- String services = node.getAttributes().get(IPeerModelProperties.PROP_OFFLINE_SERVICES);
- List<String> list = services != null ? Arrays.asList(services.split(",\\s*")) : Collections.EMPTY_LIST; //$NON-NLS-1$
- return list.contains(expectedValue);
- }
-
- return false;
- }
-
- /**
- * Test for the peer model node local or remote services.
- * <p>
- * <b>Node:</b> This method cannot be called from within the TCF Dispatch Thread.
- *
- * @param node The model node. Must not be <code>null</code>.
- * @param property The property to test.
- * @param args The property arguments.
- * @param expectedValue The expected value.
- *
- * @return <code>True</code> if the property to test has the expected value, <code>false</code>
- * otherwise.
- */
- protected boolean testServices(final IPeerModel node, final String property, final Object[] args, final Object expectedValue) {
- Assert.isNotNull(node);
- Assert.isTrue(!Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- String services = null;
-
- ILocatorModel model = node.getModel();
- ILocatorModelPeerNodeQueryService queryService = model.getService(ILocatorModelPeerNodeQueryService.class);
- if ("hasLocalService".equals(property)) { //$NON-NLS-1$
- services = queryService.queryLocalServices(node);
- } else {
- services = queryService.queryRemoteServices(node);
- }
-
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(ITracing.ID_TRACE_PROPERTY_TESTER)) {
- CoreBundleActivator.getTraceHandler().trace("testServices: property = " + property + ", expectedValue = " + expectedValue + ", services = " + services, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- ITracing.ID_TRACE_PROPERTY_TESTER, LocatorModelPropertyTester.this);
- }
-
- if (services != null) {
- // Lookup each service individually to avoid "accidental" matching
- for (String service : services.split(",")) { //$NON-NLS-1$
- if (service != null && service.trim().equals(expectedValue)) {
- return true;
- }
- }
- }
-
- 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.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.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelPeerNodeQueryService;
+import org.eclipse.tcf.te.tcf.locator.nodes.PeerRedirector;
+
+/**
+ * Locator model property tester.
+ */
+public class LocatorModelPropertyTester extends 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(final Object receiver, final String property, final Object[] args, final Object expectedValue) {
+ // The receiver is expected to be a peer model node or a peer
+ if (receiver instanceof IPeerModel || receiver instanceof IPeer) {
+ final AtomicBoolean result = new AtomicBoolean();
+
+ // If we have to test for local or remote services, we have to handle it special
+ if ("hasLocalService".equals(property) || "hasRemoteService".equals(property)) { //$NON-NLS-1$ //$NON-NLS-2$
+ // This tests must happen outside the TCF dispatch thread's
+ if (!Protocol.isDispatchThread()) {
+ result.set(testServices((IPeerModel) receiver, property, args, expectedValue));
+ }
+ }
+ else {
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ if (receiver instanceof IPeerModel) {
+ result.set(testPeerModel((IPeerModel) receiver, property, args, expectedValue));
+ } else {
+ result.set(testPeer((IPeer) receiver, property, args, expectedValue));
+ }
+ }
+ };
+
+ if (Protocol.isDispatchThread()) {
+ runnable.run();
+ }
+ else {
+ Protocol.invokeAndWait(runnable);
+ }
+ }
+
+ return result.get();
+ }
+ return false;
+ }
+
+ /**
+ * Test the specific peer model node properties.
+ *
+ * @param node The model node. Must not be <code>null</code>.
+ * @param property The property to test.
+ * @param args The property arguments.
+ * @param expectedValue The expected value.
+ *
+ * @return <code>True</code> if the property to test has the expected value, <code>false</code>
+ * otherwise.
+ */
+ protected boolean testPeerModel(IPeerModel node, String property, Object[] args, Object expectedValue) {
+ Assert.isNotNull(node);
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+
+ return testPeer(node.getPeer(), property, args, expectedValue);
+ }
+
+ /**
+ * Test the specific peer properties.
+ *
+ * @param node The peer. Must not be <code>null</code>.
+ * @param property The property to test.
+ * @param args The property arguments.
+ * @param expectedValue The expected value.
+ *
+ * @return <code>True</code> if the property to test has the expected value, <code>false</code>
+ * otherwise.
+ */
+ protected boolean testPeer(IPeer node, String property, Object[] args, Object expectedValue) {
+ Assert.isNotNull(node);
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+
+ if ("name".equals(property)) { //$NON-NLS-1$
+ if (node.getName() != null && node.getName().equals(expectedValue)) {
+ return true;
+ }
+ }
+
+ if ("nameRegex".equals(property) && expectedValue instanceof String) { //$NON-NLS-1$
+ if (node.getName() != null && node.getName().matches((String)expectedValue)) {
+ return true;
+ }
+ }
+
+ if ("osName".equals(property)) { //$NON-NLS-1$
+ if (node.getOSName() != null && node.getOSName().equals(expectedValue)) {
+ return true;
+ }
+ }
+
+ if ("osNameRegex".equals(property) && expectedValue instanceof String) { //$NON-NLS-1$
+ if (node.getOSName() != null && node.getOSName().matches((String)expectedValue)) {
+ return true;
+ }
+ }
+
+ if ("isStaticPeer".equals(property)) { //$NON-NLS-1$
+ String value = node.getAttributes().get("static.transient"); //$NON-NLS-1$
+ boolean isStaticPeer = value != null && Boolean.parseBoolean(value.trim());
+ if (expectedValue instanceof Boolean) {
+ return ((Boolean) expectedValue).booleanValue() == isStaticPeer;
+ }
+ }
+
+ if ("isRedirected".equals(property)) { //$NON-NLS-1$
+ boolean isRedirected = node instanceof PeerRedirector;
+ if (expectedValue instanceof Boolean) {
+ return ((Boolean) expectedValue).booleanValue() == isRedirected;
+ }
+ }
+
+ if ("isProxy".equals(property)) { //$NON-NLS-1$
+ boolean isProxy = node.getAttributes().containsKey("Proxy"); //$NON-NLS-1$
+ if (expectedValue instanceof Boolean) {
+ return ((Boolean) expectedValue).booleanValue() == isProxy;
+ }
+ }
+
+ if ("isValueAdd".equals(property)) { //$NON-NLS-1$
+ String value = node.getAttributes().get("ValueAdd"); //$NON-NLS-1$
+ boolean isValueAdd = value != null && ("1".equals(value.trim()) || Boolean.parseBoolean(value.trim())); //$NON-NLS-1$
+ if (expectedValue instanceof Boolean) {
+ return ((Boolean) expectedValue).booleanValue() == isValueAdd;
+ }
+ }
+
+ if ("isOfType".equals(property)) { //$NON-NLS-1$
+ String value = node.getAttributes().get(IPeerModelProperties.PROP_TYPE);
+ if (expectedValue instanceof String) {
+ return value != null ? ((String)expectedValue).equals(value) : ((String)expectedValue).equalsIgnoreCase("null"); //$NON-NLS-1$
+ }
+ }
+
+ if ("hasAttribute".equals(property)) { //$NON-NLS-1$
+ String name = args != null && args.length > 0 ? (String)args[0] : null;
+ boolean hasAttribute = name != null && !"".equals(name) ? node.getAttributes().containsKey(name) : false; //$NON-NLS-1$
+ if (expectedValue instanceof Boolean) {
+ return ((Boolean) expectedValue).booleanValue() == hasAttribute;
+ }
+ }
+
+ if ("isAttribute".equals(property)) { //$NON-NLS-1$
+ String name = args != null && args.length > 0 ? (String)args[0] : null;
+ String value = name != null && !"".equals(name) ? node.getAttributes().get(name) : null; //$NON-NLS-1$
+ if (expectedValue != null) {
+ return expectedValue.toString().equals(value);
+ }
+ }
+
+ if ("hasOfflineService".equals(property)) { //$NON-NLS-1$
+ String services = node.getAttributes().get(IPeerModelProperties.PROP_OFFLINE_SERVICES);
+ List<String> list = services != null ? Arrays.asList(services.split(",\\s*")) : Collections.EMPTY_LIST; //$NON-NLS-1$
+ return list.contains(expectedValue);
+ }
+
+ return false;
+ }
+
+ /**
+ * Test for the peer model node local or remote services.
+ * <p>
+ * <b>Node:</b> This method cannot be called from within the TCF Dispatch Thread.
+ *
+ * @param node The model node. Must not be <code>null</code>.
+ * @param property The property to test.
+ * @param args The property arguments.
+ * @param expectedValue The expected value.
+ *
+ * @return <code>True</code> if the property to test has the expected value, <code>false</code>
+ * otherwise.
+ */
+ protected boolean testServices(final IPeerModel node, final String property, final Object[] args, final Object expectedValue) {
+ Assert.isNotNull(node);
+ Assert.isTrue(!Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+
+ String services = null;
+
+ ILocatorModel model = node.getModel();
+ ILocatorModelPeerNodeQueryService queryService = model.getService(ILocatorModelPeerNodeQueryService.class);
+ if ("hasLocalService".equals(property)) { //$NON-NLS-1$
+ services = queryService.queryLocalServices(node);
+ } else {
+ services = queryService.queryRemoteServices(node);
+ }
+
+ if (CoreBundleActivator.getTraceHandler().isSlotEnabled(ITracing.ID_TRACE_PROPERTY_TESTER)) {
+ CoreBundleActivator.getTraceHandler().trace("testServices: property = " + property + ", expectedValue = " + expectedValue + ", services = " + services, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ ITracing.ID_TRACE_PROPERTY_TESTER, LocatorModelPropertyTester.this);
+ }
+
+ if (services != null) {
+ // Lookup each service individually to avoid "accidental" matching
+ for (String service : services.split(",")) { //$NON-NLS-1$
+ if (service != null && service.trim().equals(expectedValue)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/AdapterFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/AdapterFactory.java
index ce2af3de0..6fe13635e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/AdapterFactory.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/adapters/AdapterFactory.java
@@ -1,120 +1,120 @@
-/*******************************************************************************
- * 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.adapters;
-
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.tcf.protocol.IPeer;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.model.factory.Factory;
-import org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableURIProvider;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-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.IPeerModelProvider;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
-import org.eclipse.tcf.te.tcf.locator.model.Model;
-
-/**
- * Static peers adapter factory implementation.
- */
-public class AdapterFactory implements IAdapterFactory {
- // The single instance adapter references
- private final IPersistableURIProvider peerModelPersistableURIProvider = new PeerPersistableURIProvider();
-
- private static final Class<?>[] CLASSES = new Class[] {
- IPersistableURIProvider.class, IPeerModel.class
- };
-
- /* (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 Map) {
- if (IPersistableURIProvider.class.equals(adapterType)) {
- Assert.isTrue(false);
- }
- }
- if (ILocatorModel.class.isAssignableFrom(adapterType)) {
- if (adaptableObject instanceof IPeerModel) {
- return ((IPeerModel)adaptableObject).getModel();
- }
- }
- if (adaptableObject instanceof IPeerModel || adaptableObject instanceof IPeer || adaptableObject instanceof IPeerModelProvider) {
- if (IPersistableURIProvider.class.equals(adapterType)) {
- return peerModelPersistableURIProvider;
- }
- if (IPeerModel.class.equals(adapterType)) {
- if (adaptableObject instanceof IPeer) {
- final AtomicReference<IPeerModel> node = new AtomicReference<IPeerModel>();
- final IPeer peer = (IPeer)adaptableObject;
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- String id = peer.getID();
- ILocatorModel model = Model.getModel();
- Assert.isNotNull(model);
- IPeerModel candidate = model.getService(ILocatorModelLookupService.class).lkupPeerModelById(id);
- if (candidate != null) node.set(candidate);
- else {
- candidate = Factory.getInstance().newInstance(IPeerModel.class, new Object[] { model, peer });
- if (candidate != null) node.set(candidate);
- }
- }
- };
-
- if (Protocol.isDispatchThread()) runnable.run();
- else Protocol.invokeAndWait(runnable);
-
- return node.get();
- }
- else if (adaptableObject instanceof IPeerModel) {
- return adaptableObject;
- }
- else if (adaptableObject instanceof IPeerModelProvider) {
- final AtomicReference<IPeerModel> node = new AtomicReference<IPeerModel>();
- final IPeerModelProvider provider = (IPeerModelProvider)adaptableObject;
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- node.set(provider.getPeerModel());
- }
- };
-
- if (Protocol.isDispatchThread()) runnable.run();
- else Protocol.invokeAndWait(runnable);
-
- return node.get();
- }
- }
- if (IStepContext.class.equals(adapterType)) {
- if (adaptableObject instanceof IPeerModel) {
- return new PeerModelStepContext((IPeerModel)adaptableObject);
- }
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- @Override
- public Class[] getAdapterList() {
- return CLASSES;
- }
-
-}
+/*******************************************************************************
+ * 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.locator.internal.adapters;
+
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.tcf.protocol.IPeer;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.runtime.model.factory.Factory;
+import org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistableURIProvider;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+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.IPeerModelProvider;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
+import org.eclipse.tcf.te.tcf.locator.model.Model;
+
+/**
+ * Static peers adapter factory implementation.
+ */
+public class AdapterFactory implements IAdapterFactory {
+ // The single instance adapter references
+ private final IPersistableURIProvider peerModelPersistableURIProvider = new PeerPersistableURIProvider();
+
+ private static final Class<?>[] CLASSES = new Class[] {
+ IPersistableURIProvider.class, IPeerModel.class
+ };
+
+ /* (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 Map) {
+ if (IPersistableURIProvider.class.equals(adapterType)) {
+ Assert.isTrue(false);
+ }
+ }
+ if (ILocatorModel.class.isAssignableFrom(adapterType)) {
+ if (adaptableObject instanceof IPeerModel) {
+ return ((IPeerModel)adaptableObject).getModel();
+ }
+ }
+ if (adaptableObject instanceof IPeerModel || adaptableObject instanceof IPeer || adaptableObject instanceof IPeerModelProvider) {
+ if (IPersistableURIProvider.class.equals(adapterType)) {
+ return peerModelPersistableURIProvider;
+ }
+ if (IPeerModel.class.equals(adapterType)) {
+ if (adaptableObject instanceof IPeer) {
+ final AtomicReference<IPeerModel> node = new AtomicReference<IPeerModel>();
+ final IPeer peer = (IPeer)adaptableObject;
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ String id = peer.getID();
+ ILocatorModel model = Model.getModel();
+ Assert.isNotNull(model);
+ IPeerModel candidate = model.getService(ILocatorModelLookupService.class).lkupPeerModelById(id);
+ if (candidate != null) node.set(candidate);
+ else {
+ candidate = Factory.getInstance().newInstance(IPeerModel.class, new Object[] { model, peer });
+ if (candidate != null) node.set(candidate);
+ }
+ }
+ };
+
+ if (Protocol.isDispatchThread()) runnable.run();
+ else Protocol.invokeAndWait(runnable);
+
+ return node.get();
+ }
+ else if (adaptableObject instanceof IPeerModel) {
+ return adaptableObject;
+ }
+ else if (adaptableObject instanceof IPeerModelProvider) {
+ final AtomicReference<IPeerModel> node = new AtomicReference<IPeerModel>();
+ final IPeerModelProvider provider = (IPeerModelProvider)adaptableObject;
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ node.set(provider.getPeerModel());
+ }
+ };
+
+ if (Protocol.isDispatchThread()) runnable.run();
+ else Protocol.invokeAndWait(runnable);
+
+ return node.get();
+ }
+ }
+ if (IStepContext.class.equals(adapterType)) {
+ if (adaptableObject instanceof IPeerModel) {
+ return new PeerModelStepContext((IPeerModel)adaptableObject);
+ }
+ }
+ }
+ 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.locator/src/org/eclipse/tcf/te/tcf/locator/listener/LocatorListener.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/LocatorListener.java
index 24496674b..f1df6b3b0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/LocatorListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/LocatorListener.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/listener/ModelAdapter.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ModelAdapter.java
index 02f9a5f2c..2da4ca45c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ModelAdapter.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ModelAdapter.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/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nls/Messages.java
index f13750054..92c2e1c4a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nls/Messages.java
@@ -1,72 +1,72 @@
-/*******************************************************************************
- * 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.tcf.locator.nls;
-
-import java.lang.reflect.Field;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Target Explorer TCF Locator plug-in externalized strings management.
- */
-public class Messages extends NLS {
-
- // The plug-in resource bundle name
- private static final String BUNDLE_NAME = "org.eclipse.tcf.te.tcf.locator.nls.Messages"; //$NON-NLS-1$
-
- /**
- * Static constructor.
- */
- static {
- // Load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- /**
- * Returns if or if not this NLS manager contains a constant for
- * the given externalized strings key.
- *
- * @param key The externalized strings key or <code>null</code>.
- * @return <code>True</code> if a constant for the given key exists, <code>false</code> otherwise.
- */
- public static boolean hasString(String key) {
- if (key != null) {
- try {
- Field field = Messages.class.getDeclaredField(key);
- return field != null;
- } catch (NoSuchFieldException e) { /* ignored on purpose */ }
- }
-
- return false;
- }
-
- /**
- * Returns the corresponding string for the given externalized strings
- * key or <code>null</code> if the key does not exist.
- *
- * @param key The externalized strings key or <code>null</code>.
- * @return The corresponding string or <code>null</code>.
- */
- public static String getString(String key) {
- if (key != null) {
- try {
- Field field = Messages.class.getDeclaredField(key);
- return (String)field.get(null);
- } catch (Exception e) { /* ignored on purpose */ }
- }
-
- return null;
- }
-
- // **** Declare externalized string id's down here *****
-
- public static String WaitForReadyStep_error_timeout;
- public static String WaitForReadyStep_error_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
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.locator.nls;
+
+import java.lang.reflect.Field;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Target Explorer TCF Locator plug-in externalized strings management.
+ */
+public class Messages extends NLS {
+
+ // The plug-in resource bundle name
+ private static final String BUNDLE_NAME = "org.eclipse.tcf.te.tcf.locator.nls.Messages"; //$NON-NLS-1$
+
+ /**
+ * Static constructor.
+ */
+ static {
+ // Load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ /**
+ * Returns if or if not this NLS manager contains a constant for
+ * the given externalized strings key.
+ *
+ * @param key The externalized strings key or <code>null</code>.
+ * @return <code>True</code> if a constant for the given key exists, <code>false</code> otherwise.
+ */
+ public static boolean hasString(String key) {
+ if (key != null) {
+ try {
+ Field field = Messages.class.getDeclaredField(key);
+ return field != null;
+ } catch (NoSuchFieldException e) { /* ignored on purpose */ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns the corresponding string for the given externalized strings
+ * key or <code>null</code> if the key does not exist.
+ *
+ * @param key The externalized strings key or <code>null</code>.
+ * @return The corresponding string or <code>null</code>.
+ */
+ public static String getString(String key) {
+ if (key != null) {
+ try {
+ Field field = Messages.class.getDeclaredField(key);
+ return (String)field.get(null);
+ } catch (Exception e) { /* ignored on purpose */ }
+ }
+
+ return null;
+ }
+
+ // **** Declare externalized string id's down here *****
+
+ public static String WaitForReadyStep_error_timeout;
+ public static String WaitForReadyStep_error_state;
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nls/Messages.properties
index 392288e5f..cc3b12cc6 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nls/Messages.properties
@@ -1,12 +1,12 @@
-###############################################################################
-# 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
-###############################################################################
-
-WaitForReadyStep_error_timeout=Timeout waiting for peer to become ready
+###############################################################################
+# 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
+###############################################################################
+
+WaitForReadyStep_error_timeout=Timeout waiting for peer to become ready
WaitForReadyStep_error_state=Illegal peer state \ 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/nodes/LocatorModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/LocatorModel.java
index b00388c53..61e1a4ff8 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/LocatorModel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/LocatorModel.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/nodes/PeerModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.java
index 8f262aeb0..aae484eec 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.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/services/LocatorModelLookupService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelLookupService.java
index 00dcde0d7..077867c8b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelLookupService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelLookupService.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/services/LocatorModelPeerNodeQueryService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelPeerNodeQueryService.java
index a0f168911..33377d642 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelPeerNodeQueryService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/LocatorModelPeerNodeQueryService.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.locator/src/org/eclipse/tcf/te/tcf/locator/steps/CheckServiceStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/CheckServiceStep.java
index c9ca9cfce..69b562ec4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/CheckServiceStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/CheckServiceStep.java
@@ -1,106 +1,106 @@
-/*******************************************************************************
- * 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.locator.steps;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicReference;
-
-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.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.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.locator.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
-
-/**
- * Check service step implementation.
- */
-public class CheckServiceStep extends AbstractPeerModelStep {
-
- public static final String PARAMETER_REMOTE_SERVICE = "remoteService"; //$NON-NLS-1$
- public static final String PARAMETER_LOCAL_SERVICE = "localService"; //$NON-NLS-1$
- public static final String PARAMETER_OFFLINE_SERVICE = "offlineService"; //$NON-NLS-1$
-
- /**
- * Constructor.
- */
- public CheckServiceStep() {
- }
-
- /* (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(final IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, final IProgressMonitor monitor) throws CoreException {
- if (Protocol.isDispatchThread()) {
- internalValidateExecute(context, data, fullQualifiedId, monitor);
- }
- else {
- final AtomicReference<CoreException> result = new AtomicReference<CoreException>();
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- try {
- internalValidateExecute(context, data, fullQualifiedId, monitor);
- }
- catch (CoreException e) {
- result.set(e);
- }
- }
- });
- if (result.get() != null) {
- throw result.get();
- }
- }
- }
-
- protected void internalValidateExecute(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, CoreBundleActivator.getUniqueIdentifier(), "missing or closed channel")); //$NON-NLS-1$
- }
-
- String remoteService = getParameters().get(PARAMETER_REMOTE_SERVICE);
- if (remoteService != null && channel.getRemoteService(remoteService) == null) {
- throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), "missing remote service '" + remoteService + "'")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- String localService = getParameters().get(PARAMETER_LOCAL_SERVICE);
- if (localService != null && channel.getLocalService(localService) == null) {
- throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), "missing local service '" + localService + "'")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- String offlineService = getParameters().get(PARAMETER_OFFLINE_SERVICE);
- String services = getActivePeerContext(context, data, fullQualifiedId).getAttributes().get(IPeerModelProperties.PROP_OFFLINE_SERVICES);
- List<String> list = services != null ? Arrays.asList(services.split(",\\s*")) : Collections.EMPTY_LIST; //$NON-NLS-1$
- if (offlineService != null && !list.contains(offlineService)) {
- throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), "missing offline service '" + offlineService + "'")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /* (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) {
- // nothing to do, check is done in validateExecute.
- 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.locator.steps;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicReference;
+
+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.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.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.locator.activator.CoreBundleActivator;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
+
+/**
+ * Check service step implementation.
+ */
+public class CheckServiceStep extends AbstractPeerModelStep {
+
+ public static final String PARAMETER_REMOTE_SERVICE = "remoteService"; //$NON-NLS-1$
+ public static final String PARAMETER_LOCAL_SERVICE = "localService"; //$NON-NLS-1$
+ public static final String PARAMETER_OFFLINE_SERVICE = "offlineService"; //$NON-NLS-1$
+
+ /**
+ * Constructor.
+ */
+ public CheckServiceStep() {
+ }
+
+ /* (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(final IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, final IProgressMonitor monitor) throws CoreException {
+ if (Protocol.isDispatchThread()) {
+ internalValidateExecute(context, data, fullQualifiedId, monitor);
+ }
+ else {
+ final AtomicReference<CoreException> result = new AtomicReference<CoreException>();
+ Protocol.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ internalValidateExecute(context, data, fullQualifiedId, monitor);
+ }
+ catch (CoreException e) {
+ result.set(e);
+ }
+ }
+ });
+ if (result.get() != null) {
+ throw result.get();
+ }
+ }
+ }
+
+ protected void internalValidateExecute(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, CoreBundleActivator.getUniqueIdentifier(), "missing or closed channel")); //$NON-NLS-1$
+ }
+
+ String remoteService = getParameters().get(PARAMETER_REMOTE_SERVICE);
+ if (remoteService != null && channel.getRemoteService(remoteService) == null) {
+ throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), "missing remote service '" + remoteService + "'")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ String localService = getParameters().get(PARAMETER_LOCAL_SERVICE);
+ if (localService != null && channel.getLocalService(localService) == null) {
+ throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), "missing local service '" + localService + "'")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ String offlineService = getParameters().get(PARAMETER_OFFLINE_SERVICE);
+ String services = getActivePeerContext(context, data, fullQualifiedId).getAttributes().get(IPeerModelProperties.PROP_OFFLINE_SERVICES);
+ List<String> list = services != null ? Arrays.asList(services.split(",\\s*")) : Collections.EMPTY_LIST; //$NON-NLS-1$
+ if (offlineService != null && !list.contains(offlineService)) {
+ throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), "missing offline service '" + offlineService + "'")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ /* (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) {
+ // nothing to do, check is done in validateExecute.
+ callback.done(this, Status.OK_STATUS);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.log.core/src/org/eclipse/tcf/te/tcf/log/core/internal/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.log.core/src/org/eclipse/tcf/te/tcf/log/core/internal/nls/Messages.java
index e86e70b21..dd96425da 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.log.core/src/org/eclipse/tcf/te/tcf/log/core/internal/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.log.core/src/org/eclipse/tcf/te/tcf/log/core/internal/nls/Messages.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.processes.core/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/plugin.properties
index 1cc8d1965..12d703b8a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/plugin.properties
@@ -1,15 +1,15 @@
-##################################################################################
-# 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 Processes Extensions Core
-providerName = Eclipse.org - Target Explorer
-
-LaunchProcessStep.name = Launch Process
-ResumeProcessStep.name=Resume Process
+##################################################################################
+# 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 Processes Extensions Core
+providerName = Eclipse.org - Target Explorer
+
+LaunchProcessStep.name = Launch Process
+ResumeProcessStep.name=Resume Process
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/launcher/IProcessLauncher.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/launcher/IProcessLauncher.java
index 9f1087051..bb9a0a433 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/launcher/IProcessLauncher.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/launcher/IProcessLauncher.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.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/steps/IProcessesStepAttributes.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/steps/IProcessesStepAttributes.java
index 4f75079df..268bf27c8 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/steps/IProcessesStepAttributes.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/steps/IProcessesStepAttributes.java
@@ -1,67 +1,67 @@
-/*******************************************************************************
- * 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.processes.core.interfaces.steps;
-
-
-/**
- * Defines the launch configuration attribute id's to access the launch step contexts.
- */
-public interface IProcessesStepAttributes {
-
- /**
- * Define the prefix used by all other attribute id's as prefix.
- */
- public static final String ATTR_PREFIX = "org.eclipse.tcf.te.tcf.processes.core"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute: The process image.
- */
- public static final String ATTR_PROCESS_IMAGE = ATTR_PREFIX + ".process_image"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute: The process arguments.
- */
- public static final String ATTR_PROCESS_ARGUMENTS = ATTR_PREFIX + ".process_arguments"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute: Flag if or if not to stop at process entry.
- */
- public static final String ATTR_STOP_AT_ENTRY = ATTR_PREFIX + ".process_stop_at_entry"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute: Flag if or if not to stop at main.
- */
- public static final String ATTR_STOP_AT_MAIN = ATTR_PREFIX + ".process_stop_at_main"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute: Flag if or if not to attach the process.
- */
- public static final String ATTR_ATTACH = ATTR_PREFIX + ".process_attach"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute: Flag if or if not to attach process children.
- */
- public static final String ATTR_ATTACH_CHILDREN = ATTR_PREFIX + ".process_attach_children"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute: Flag if or if not to redirect the output to the console.
- */
- public static final String ATTR_OUTPUT_CONSOLE = ATTR_PREFIX + ".process_output_console"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute: The file name to redirect the output.
- */
- public static final String ATTR_OUTPUT_FILE = ATTR_PREFIX + ".process_output_file"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute (internal use): The process context object.
- */
- public static final String ATTR_PROCESS_CONTEXT = ATTR_PREFIX + ".process_context"; //$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.processes.core.interfaces.steps;
+
+
+/**
+ * Defines the launch configuration attribute id's to access the launch step contexts.
+ */
+public interface IProcessesStepAttributes {
+
+ /**
+ * Define the prefix used by all other attribute id's as prefix.
+ */
+ public static final String ATTR_PREFIX = "org.eclipse.tcf.te.tcf.processes.core"; //$NON-NLS-1$
+
+ /**
+ * Launch configuration attribute: The process image.
+ */
+ public static final String ATTR_PROCESS_IMAGE = ATTR_PREFIX + ".process_image"; //$NON-NLS-1$
+
+ /**
+ * Launch configuration attribute: The process arguments.
+ */
+ public static final String ATTR_PROCESS_ARGUMENTS = ATTR_PREFIX + ".process_arguments"; //$NON-NLS-1$
+
+ /**
+ * Launch configuration attribute: Flag if or if not to stop at process entry.
+ */
+ public static final String ATTR_STOP_AT_ENTRY = ATTR_PREFIX + ".process_stop_at_entry"; //$NON-NLS-1$
+
+ /**
+ * Launch configuration attribute: Flag if or if not to stop at main.
+ */
+ public static final String ATTR_STOP_AT_MAIN = ATTR_PREFIX + ".process_stop_at_main"; //$NON-NLS-1$
+
+ /**
+ * Launch configuration attribute: Flag if or if not to attach the process.
+ */
+ public static final String ATTR_ATTACH = ATTR_PREFIX + ".process_attach"; //$NON-NLS-1$
+
+ /**
+ * Launch configuration attribute: Flag if or if not to attach process children.
+ */
+ public static final String ATTR_ATTACH_CHILDREN = ATTR_PREFIX + ".process_attach_children"; //$NON-NLS-1$
+
+ /**
+ * Launch configuration attribute: Flag if or if not to redirect the output to the console.
+ */
+ public static final String ATTR_OUTPUT_CONSOLE = ATTR_PREFIX + ".process_output_console"; //$NON-NLS-1$
+
+ /**
+ * Launch configuration attribute: The file name to redirect the output.
+ */
+ public static final String ATTR_OUTPUT_FILE = ATTR_PREFIX + ".process_output_file"; //$NON-NLS-1$
+
+ /**
+ * Launch configuration attribute (internal use): The process context object.
+ */
+ public static final String ATTR_PROCESS_CONTEXT = ATTR_PREFIX + ".process_context"; //$NON-NLS-1$
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/tracing/ITraceIds.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/tracing/ITraceIds.java
index 1de4d3c11..d92482be5 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/tracing/ITraceIds.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/interfaces/tracing/ITraceIds.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.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/interfaces/IProcessContextNodeProperties.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/interfaces/IProcessContextNodeProperties.java
index 6943f6ef0..95106fea6 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/interfaces/IProcessContextNodeProperties.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/interfaces/IProcessContextNodeProperties.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.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/RuntimeModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/RuntimeModel.java
index 5a63250dd..a387ad28c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/RuntimeModel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/RuntimeModel.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.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelChannelService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelChannelService.java
index 105fac4c5..7ed2fdf3d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelChannelService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelChannelService.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.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelLookupService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelLookupService.java
index b697388b6..0137d2349 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelLookupService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelLookupService.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.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelRefreshService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelRefreshService.java
index 84e693c95..2dee29f58 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelRefreshService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelRefreshService.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.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.java
index 1a108c449..87a97d7c0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.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.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/AttachStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/AttachStep.java
index a71a45a04..57b334213 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/AttachStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/steps/AttachStep.java
@@ -1,207 +1,207 @@
-/*******************************************************************************
- * 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.processes.core.model.steps;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.tcf.protocol.IChannel;
-import org.eclipse.tcf.protocol.IToken;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.services.IProcesses;
-import org.eclipse.tcf.services.IProcesses.ProcessContext;
-import org.eclipse.tcf.te.runtime.callback.Callback;
-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.properties.PropertiesContainer;
-import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.services.interfaces.IDebugService;
-import org.eclipse.tcf.te.runtime.statushandler.StatusHandlerManager;
-import org.eclipse.tcf.te.runtime.statushandler.interfaces.IStatusHandler;
-import org.eclipse.tcf.te.runtime.statushandler.interfaces.IStatusHandlerConstants;
-import org.eclipse.tcf.te.tcf.core.Tcf;
-import org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager;
-import org.eclipse.tcf.te.tcf.core.model.interfaces.IModel;
-import org.eclipse.tcf.te.tcf.core.model.interfaces.services.IModelRefreshService;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.processes.core.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.tcf.processes.core.interfaces.IContextHelpIds;
-import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode;
-import org.eclipse.tcf.te.tcf.processes.core.nls.Messages;
-
-/**
- * Process attach step implementation.
- */
-public class AttachStep {
-
- /**
- * Attach to the given process context.
- * <p>
- * <b>Note:</b> This method must be called from within the TCF dispatch thread.
- *
- * @param node The context. Must not be <code>null</code>.
- * @param callback The callback to invoke once the operation completed, or<code>null</code>.
- */
- public void executeAttach(final IProcessContextNode node, final ICallback callback) {
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- Assert.isNotNull(node);
-
- // If the context is already attached, there is nothing to do
- if (node.getProcessContext() != null && !node.getProcessContext().isAttached()) {
- IPeerModel peerNode = (IPeerModel)node.getAdapter(IPeerModel.class);
- if (peerNode != null) {
- // Determine the debug service to attach to the peer node
- IDebugService dbgService = ServiceManager.getInstance().getService(peerNode, IDebugService.class, false);
- if (dbgService != null) {
- // Attach to the peer node first
- dbgService.attach(peerNode, new PropertiesContainer(), null, new Callback() {
- @Override
- protected void internalDone(Object caller, IStatus status) {
- callback.setProperty("launch", getProperty("launch")); //$NON-NLS-1$ //$NON-NLS-2$
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- doAttach(node, callback);
- }
- };
- if (Protocol.isDispatchThread()) runnable.run();
- else Protocol.invokeLater(runnable);
- }
- });
- } else {
- doAttach(node, callback);
- }
- } else {
- onError(node, Messages.AttachStep_error_connect, null, callback);
- }
- } else {
- if (node.getProcessContext() == null) {
- onError(node, Messages.AttachStep_error_connect, null, callback);
- } else {
- onDone(callback);
- }
- }
- }
-
- /**
- * Opens a channel and perform the attach to the given context node.
- * <p>
- * <b>Note:</b> This method must be called from within the TCF dispatch thread.
- *
- * @param node The context node. Must not be <code>null</code>.
- * @param callback The callback to invoke once the operation completed, or<code>null</code>.
- */
- protected void doAttach(final IProcessContextNode node, final ICallback callback) {
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- Assert.isNotNull(node);
-
- // Determine the peer model node
- final IPeerModel peerNode = (IPeerModel)node.getAdapter(IPeerModel.class);
-
- // Open a channel
- Tcf.getChannelManager().openChannel(peerNode.getPeer(), null, new IChannelManager.DoneOpenChannel() {
- @Override
- public void doneOpenChannel(final Throwable error, final IChannel channel) {
- if (error == null) {
- final IProcesses service = channel.getRemoteService(IProcesses.class);
- if (service != null) {
- service.getContext(node.getStringProperty(IModelNode.PROPERTY_ID), new IProcesses.DoneGetContext() {
- @Override
- public void doneGetContext(IToken token, Exception error, ProcessContext context) {
- if (error == null && context != null) {
- context.attach(new IProcesses.DoneCommand() {
- @Override
- public void doneCommand(IToken token, Exception error) {
- if (error == null) {
- // We are attached now, trigger a refresh of the node
- IModel model = node.getParent(IModel.class);
- Assert.isNotNull(model);
- model.getService(IModelRefreshService.class).refresh(node, new Callback() {
- @Override
- protected void internalDone(Object caller, IStatus status) {
- onDone(callback);
- }
- });
- } else {
- onError(node, Messages.AttachStep_error_attach, error, callback);
- }
- }
- });
- } else {
- onError(node, Messages.AttachStep_error_getContext, error, callback);
- }
- }
- });
- } else {
- onError(node, Messages.AttachStep_error_connect, null, callback);
- }
- } else {
- onError(node, Messages.AttachStep_error_openChannel, error, callback);
- }
- }
- });
- }
-
- /**
- * Error handler. Called if a step failed.
- *
- * @param channel The channel or <code>null</code>.
- * @param context The status handler context. Must not be <code>null</code>:
- * @param message The message or <code>null</code>.
- * @param error The error or <code>null</code>.
- * @param callback The callback or <code>null</code>.
- */
- protected void onError(Object context, String message, Throwable error, ICallback callback) {
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
-
- String detailMessage = error != null ? error.getMessage() : null;
- if (detailMessage != null && detailMessage.contains("\n")) { //$NON-NLS-1$
- detailMessage = detailMessage.replaceAll("\n", ", "); //$NON-NLS-1$ //$NON-NLS-2$
- detailMessage = detailMessage.replaceAll(":, ", ": "); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- String fullMessage = message;
- if (fullMessage != null) fullMessage = NLS.bind(fullMessage, detailMessage != null ? detailMessage : ""); //$NON-NLS-1$
- else fullMessage = detailMessage;
-
- if (fullMessage != null) {
- IStatus status = new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), fullMessage, error);
-
- if (callback == null) {
- IStatusHandler[] handlers = StatusHandlerManager.getInstance().getHandler(context);
- if (handlers.length > 0) {
- IPropertiesContainer data = new PropertiesContainer();
- data.setProperty(IStatusHandlerConstants.PROPERTY_TITLE, Messages.AttachStep_error_title);
- data.setProperty(IStatusHandlerConstants.PROPERTY_CONTEXT_HELP_ID, IContextHelpIds.MESSAGE_ATTACH_FAILED);
- data.setProperty(IStatusHandlerConstants.PROPERTY_CALLER, this);
-
- handlers[0].handleStatus(status, data, null);
- } else {
- CoreBundleActivator.getDefault().getLog().log(status);
- }
- }
- else {
- callback.done(this, status);
- }
- }
- }
-
- /**
- * Done handler. Called if all necessary steps are completed.
- *
- * @param callback The callback to invoke or <code>null</code>
- */
- protected void onDone(ICallback callback) {
- Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- if (callback != null) 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.processes.core.model.steps;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.tcf.protocol.IChannel;
+import org.eclipse.tcf.protocol.IToken;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.services.IProcesses;
+import org.eclipse.tcf.services.IProcesses.ProcessContext;
+import org.eclipse.tcf.te.runtime.callback.Callback;
+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.properties.PropertiesContainer;
+import org.eclipse.tcf.te.runtime.services.ServiceManager;
+import org.eclipse.tcf.te.runtime.services.interfaces.IDebugService;
+import org.eclipse.tcf.te.runtime.statushandler.StatusHandlerManager;
+import org.eclipse.tcf.te.runtime.statushandler.interfaces.IStatusHandler;
+import org.eclipse.tcf.te.runtime.statushandler.interfaces.IStatusHandlerConstants;
+import org.eclipse.tcf.te.tcf.core.Tcf;
+import org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager;
+import org.eclipse.tcf.te.tcf.core.model.interfaces.IModel;
+import org.eclipse.tcf.te.tcf.core.model.interfaces.services.IModelRefreshService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.processes.core.activator.CoreBundleActivator;
+import org.eclipse.tcf.te.tcf.processes.core.interfaces.IContextHelpIds;
+import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode;
+import org.eclipse.tcf.te.tcf.processes.core.nls.Messages;
+
+/**
+ * Process attach step implementation.
+ */
+public class AttachStep {
+
+ /**
+ * Attach to the given process context.
+ * <p>
+ * <b>Note:</b> This method must be called from within the TCF dispatch thread.
+ *
+ * @param node The context. Must not be <code>null</code>.
+ * @param callback The callback to invoke once the operation completed, or<code>null</code>.
+ */
+ public void executeAttach(final IProcessContextNode node, final ICallback callback) {
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+ Assert.isNotNull(node);
+
+ // If the context is already attached, there is nothing to do
+ if (node.getProcessContext() != null && !node.getProcessContext().isAttached()) {
+ IPeerModel peerNode = (IPeerModel)node.getAdapter(IPeerModel.class);
+ if (peerNode != null) {
+ // Determine the debug service to attach to the peer node
+ IDebugService dbgService = ServiceManager.getInstance().getService(peerNode, IDebugService.class, false);
+ if (dbgService != null) {
+ // Attach to the peer node first
+ dbgService.attach(peerNode, new PropertiesContainer(), null, new Callback() {
+ @Override
+ protected void internalDone(Object caller, IStatus status) {
+ callback.setProperty("launch", getProperty("launch")); //$NON-NLS-1$ //$NON-NLS-2$
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ doAttach(node, callback);
+ }
+ };
+ if (Protocol.isDispatchThread()) runnable.run();
+ else Protocol.invokeLater(runnable);
+ }
+ });
+ } else {
+ doAttach(node, callback);
+ }
+ } else {
+ onError(node, Messages.AttachStep_error_connect, null, callback);
+ }
+ } else {
+ if (node.getProcessContext() == null) {
+ onError(node, Messages.AttachStep_error_connect, null, callback);
+ } else {
+ onDone(callback);
+ }
+ }
+ }
+
+ /**
+ * Opens a channel and perform the attach to the given context node.
+ * <p>
+ * <b>Note:</b> This method must be called from within the TCF dispatch thread.
+ *
+ * @param node The context node. Must not be <code>null</code>.
+ * @param callback The callback to invoke once the operation completed, or<code>null</code>.
+ */
+ protected void doAttach(final IProcessContextNode node, final ICallback callback) {
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+ Assert.isNotNull(node);
+
+ // Determine the peer model node
+ final IPeerModel peerNode = (IPeerModel)node.getAdapter(IPeerModel.class);
+
+ // Open a channel
+ Tcf.getChannelManager().openChannel(peerNode.getPeer(), null, new IChannelManager.DoneOpenChannel() {
+ @Override
+ public void doneOpenChannel(final Throwable error, final IChannel channel) {
+ if (error == null) {
+ final IProcesses service = channel.getRemoteService(IProcesses.class);
+ if (service != null) {
+ service.getContext(node.getStringProperty(IModelNode.PROPERTY_ID), new IProcesses.DoneGetContext() {
+ @Override
+ public void doneGetContext(IToken token, Exception error, ProcessContext context) {
+ if (error == null && context != null) {
+ context.attach(new IProcesses.DoneCommand() {
+ @Override
+ public void doneCommand(IToken token, Exception error) {
+ if (error == null) {
+ // We are attached now, trigger a refresh of the node
+ IModel model = node.getParent(IModel.class);
+ Assert.isNotNull(model);
+ model.getService(IModelRefreshService.class).refresh(node, new Callback() {
+ @Override
+ protected void internalDone(Object caller, IStatus status) {
+ onDone(callback);
+ }
+ });
+ } else {
+ onError(node, Messages.AttachStep_error_attach, error, callback);
+ }
+ }
+ });
+ } else {
+ onError(node, Messages.AttachStep_error_getContext, error, callback);
+ }
+ }
+ });
+ } else {
+ onError(node, Messages.AttachStep_error_connect, null, callback);
+ }
+ } else {
+ onError(node, Messages.AttachStep_error_openChannel, error, callback);
+ }
+ }
+ });
+ }
+
+ /**
+ * Error handler. Called if a step failed.
+ *
+ * @param channel The channel or <code>null</code>.
+ * @param context The status handler context. Must not be <code>null</code>:
+ * @param message The message or <code>null</code>.
+ * @param error The error or <code>null</code>.
+ * @param callback The callback or <code>null</code>.
+ */
+ protected void onError(Object context, String message, Throwable error, ICallback callback) {
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+
+ String detailMessage = error != null ? error.getMessage() : null;
+ if (detailMessage != null && detailMessage.contains("\n")) { //$NON-NLS-1$
+ detailMessage = detailMessage.replaceAll("\n", ", "); //$NON-NLS-1$ //$NON-NLS-2$
+ detailMessage = detailMessage.replaceAll(":, ", ": "); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ String fullMessage = message;
+ if (fullMessage != null) fullMessage = NLS.bind(fullMessage, detailMessage != null ? detailMessage : ""); //$NON-NLS-1$
+ else fullMessage = detailMessage;
+
+ if (fullMessage != null) {
+ IStatus status = new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), fullMessage, error);
+
+ if (callback == null) {
+ IStatusHandler[] handlers = StatusHandlerManager.getInstance().getHandler(context);
+ if (handlers.length > 0) {
+ IPropertiesContainer data = new PropertiesContainer();
+ data.setProperty(IStatusHandlerConstants.PROPERTY_TITLE, Messages.AttachStep_error_title);
+ data.setProperty(IStatusHandlerConstants.PROPERTY_CONTEXT_HELP_ID, IContextHelpIds.MESSAGE_ATTACH_FAILED);
+ data.setProperty(IStatusHandlerConstants.PROPERTY_CALLER, this);
+
+ handlers[0].handleStatus(status, data, null);
+ } else {
+ CoreBundleActivator.getDefault().getLog().log(status);
+ }
+ }
+ else {
+ callback.done(this, status);
+ }
+ }
+ }
+
+ /**
+ * Done handler. Called if all necessary steps are completed.
+ *
+ * @param callback The callback to invoke or <code>null</code>
+ */
+ protected void onDone(ICallback callback) {
+ Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+ if (callback != null) callback.done(this, Status.OK_STATUS);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/steps/LaunchProcessStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/steps/LaunchProcessStep.java
index e1dbf17fb..553d6564e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/steps/LaunchProcessStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/steps/LaunchProcessStep.java
@@ -1,177 +1,177 @@
-/*******************************************************************************
- * 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.processes.core.steps;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-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.Status;
-import org.eclipse.tcf.protocol.IChannel;
-import org.eclipse.tcf.protocol.IPeer;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.services.IProcesses;
-import org.eclipse.tcf.services.IProcessesV1;
-import org.eclipse.tcf.te.core.utils.text.StringUtil;
-import org.eclipse.tcf.te.runtime.callback.Callback;
-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.services.interfaces.constants.ILineSeparatorConstants;
-import org.eclipse.tcf.te.runtime.services.interfaces.constants.ITerminalsConnectorConstants;
-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.Host;
-import org.eclipse.tcf.te.runtime.utils.net.IPAddressUtil;
-import org.eclipse.tcf.te.tcf.core.interfaces.ITransportTypes;
-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.processes.core.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.tcf.processes.core.interfaces.launcher.IProcessLauncher;
-import org.eclipse.tcf.te.tcf.processes.core.interfaces.steps.IProcessesStepAttributes;
-import org.eclipse.tcf.te.tcf.processes.core.launcher.ProcessLauncher;
-
-/**
- * Launch process step implementation.
- */
-public class LaunchProcessStep extends AbstractPeerStep {
-
- /**
- * Constructor.
- */
- public LaunchProcessStep() {
- }
-
- /* (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 {
- String processImage = StepperAttributeUtil.getStringProperty(IProcessesStepAttributes.ATTR_PROCESS_IMAGE, fullQualifiedId, data);
- if (processImage != null && processImage.trim().length() > 0) {
- StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_PROCESS_IMAGE, fullQualifiedId, data, processImage);
- }
- else {
- throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), "missing process image name")); //$NON-NLS-1$
- }
-
- 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, CoreBundleActivator.getUniqueIdentifier(), "missing or closed channel")); //$NON-NLS-1$
- }
-
- String processArguments = StepperAttributeUtil.getStringProperty(IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, fullQualifiedId, data);
- StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, fullQualifiedId, data, processArguments);
- }
-
- /* (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) {
- final IChannel channel = (IChannel)StepperAttributeUtil.getProperty(ITcfStepAttributes.ATTR_CHANNEL, fullQualifiedId, data);
- Assert.isTrue(channel != null && channel.getState() == IChannel.STATE_OPEN, "channel is missing or closed"); //$NON-NLS-1$
-
- // Construct the launcher object
- final ProcessLauncher launcher = new ProcessLauncher();
-
- final Map<String, Object> launchAttributes = new HashMap<String, Object>();
-
- launchAttributes.put(IProcessLauncher.PROP_PROCESS_PATH, StepperAttributeUtil.getStringProperty(IProcessesStepAttributes.ATTR_PROCESS_IMAGE, fullQualifiedId, data));
-
- String arguments = StepperAttributeUtil.getStringProperty(IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, fullQualifiedId, data);
- String[] args = arguments != null && !"".equals(arguments.trim()) ? StringUtil.tokenize(arguments, 0, true) : null; //$NON-NLS-1$
- launchAttributes.put(IProcessLauncher.PROP_PROCESS_ARGS, args);
-
- launchAttributes.put(ITerminalsConnectorConstants.PROP_LOCAL_ECHO, Boolean.FALSE);
-
- boolean outputConsole = StepperAttributeUtil.getBooleanProperty(IProcessesStepAttributes.ATTR_OUTPUT_CONSOLE, fullQualifiedId, data);
- if (outputConsole) {
- launchAttributes.put(IProcessLauncher.PROP_PROCESS_ASSOCIATE_CONSOLE, Boolean.TRUE);
- }
- String outputFile = StepperAttributeUtil.getStringProperty(IProcessesStepAttributes.ATTR_OUTPUT_FILE, fullQualifiedId, data);
- if (outputFile != null) {
- launchAttributes.put(IProcessLauncher.PROP_PROCESS_OUTPUT_REDIRECT_TO_FILE, outputFile);
- }
-
- boolean attachProcess = StepperAttributeUtil.getBooleanProperty(IProcessesStepAttributes.ATTR_ATTACH, fullQualifiedId, data);
- if (attachProcess) {
- launchAttributes.put(IProcessLauncher.PROP_PROCESS_ATTACH, Boolean.TRUE);
-
- boolean stopAtEntry = StepperAttributeUtil.getBooleanProperty(IProcessesStepAttributes.ATTR_STOP_AT_ENTRY, fullQualifiedId, data);
- if (stopAtEntry) {
- launchAttributes.put(IProcessesV1.START_STOP_AT_ENTRY, Boolean.TRUE);
- }
-
- boolean stopAtMain = StepperAttributeUtil.getBooleanProperty(IProcessesStepAttributes.ATTR_STOP_AT_MAIN, fullQualifiedId, data);
- if (stopAtMain) {
- launchAttributes.put(IProcessesV1.START_STOP_AT_MAIN, Boolean.TRUE);
- }
-
- boolean attachChildren = StepperAttributeUtil.getBooleanProperty(IProcessesStepAttributes.ATTR_ATTACH_CHILDREN, fullQualifiedId, data);
- if (attachChildren) {
- launchAttributes.put(IProcessesV1.START_ATTACH_CHILDREN, Boolean.TRUE);
- }
- }
-
- // Determine the active peer
- final IPeer peer = getActivePeerContext(context, data, fullQualifiedId);
-
- // Fill in the launch attributes
- IPropertiesContainer container = new PropertiesContainer();
- container.setProperties(launchAttributes);
-
- // If the line separator setting is not set explicitly, try to determine it automatically (local host only).
- if (container.getProperty(ITerminalsConnectorConstants.PROP_LINE_SEPARATOR) == null) {
- // Determine if the launch is on local host. If yes, we can preset the
- // line ending character.
- final AtomicBoolean isLocalhost = new AtomicBoolean();
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- if (ITransportTypes.TRANSPORT_TYPE_TCP.equals(peer.getTransportName())
- || ITransportTypes.TRANSPORT_TYPE_SSL.equals(peer.getTransportName())) {
- isLocalhost.set(IPAddressUtil.getInstance().isLocalHost(peer.getAttributes().get(IPeer.ATTR_IP_HOST)));
- }
- }
- };
-
- if (Protocol.isDispatchThread()) runnable.run();
- else Protocol.invokeAndWait(runnable);
-
- if (isLocalhost.get()) {
- container.setProperty(ITerminalsConnectorConstants.PROP_LINE_SEPARATOR, Host.isWindowsHost() ? ILineSeparatorConstants.LINE_SEPARATOR_CRLF : ILineSeparatorConstants.LINE_SEPARATOR_LF);
- }
- }
-
- // Launch the process
- launcher.launch(peer, container, new Callback(callback) {
- @Override
- protected void internalDone(Object caller, IStatus status) {
- Object result = getResult();
- if (status.isOK()) {
- if (result instanceof IProcesses.ProcessContext) {
- StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_PROCESS_CONTEXT, fullQualifiedId.getParentId(), data, result);
- }
- StepperAttributeUtil.setProperty("services.processes.name", fullQualifiedId.getParentId(), data, //$NON-NLS-1$
- (launcher.getSvcProcesses() instanceof IProcessesV1 ? IProcessesV1.NAME : IProcesses.NAME));
- }
- Assert.isTrue(channel.getState() == IChannel.STATE_OPEN, "channel is closed"); //$NON-NLS-1$
- super.internalDone(caller, 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.processes.core.steps;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+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.Status;
+import org.eclipse.tcf.protocol.IChannel;
+import org.eclipse.tcf.protocol.IPeer;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.services.IProcesses;
+import org.eclipse.tcf.services.IProcessesV1;
+import org.eclipse.tcf.te.core.utils.text.StringUtil;
+import org.eclipse.tcf.te.runtime.callback.Callback;
+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.services.interfaces.constants.ILineSeparatorConstants;
+import org.eclipse.tcf.te.runtime.services.interfaces.constants.ITerminalsConnectorConstants;
+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.Host;
+import org.eclipse.tcf.te.runtime.utils.net.IPAddressUtil;
+import org.eclipse.tcf.te.tcf.core.interfaces.ITransportTypes;
+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.processes.core.activator.CoreBundleActivator;
+import org.eclipse.tcf.te.tcf.processes.core.interfaces.launcher.IProcessLauncher;
+import org.eclipse.tcf.te.tcf.processes.core.interfaces.steps.IProcessesStepAttributes;
+import org.eclipse.tcf.te.tcf.processes.core.launcher.ProcessLauncher;
+
+/**
+ * Launch process step implementation.
+ */
+public class LaunchProcessStep extends AbstractPeerStep {
+
+ /**
+ * Constructor.
+ */
+ public LaunchProcessStep() {
+ }
+
+ /* (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 {
+ String processImage = StepperAttributeUtil.getStringProperty(IProcessesStepAttributes.ATTR_PROCESS_IMAGE, fullQualifiedId, data);
+ if (processImage != null && processImage.trim().length() > 0) {
+ StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_PROCESS_IMAGE, fullQualifiedId, data, processImage);
+ }
+ else {
+ throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), "missing process image name")); //$NON-NLS-1$
+ }
+
+ 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, CoreBundleActivator.getUniqueIdentifier(), "missing or closed channel")); //$NON-NLS-1$
+ }
+
+ String processArguments = StepperAttributeUtil.getStringProperty(IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, fullQualifiedId, data);
+ StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, fullQualifiedId, data, processArguments);
+ }
+
+ /* (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) {
+ final IChannel channel = (IChannel)StepperAttributeUtil.getProperty(ITcfStepAttributes.ATTR_CHANNEL, fullQualifiedId, data);
+ Assert.isTrue(channel != null && channel.getState() == IChannel.STATE_OPEN, "channel is missing or closed"); //$NON-NLS-1$
+
+ // Construct the launcher object
+ final ProcessLauncher launcher = new ProcessLauncher();
+
+ final Map<String, Object> launchAttributes = new HashMap<String, Object>();
+
+ launchAttributes.put(IProcessLauncher.PROP_PROCESS_PATH, StepperAttributeUtil.getStringProperty(IProcessesStepAttributes.ATTR_PROCESS_IMAGE, fullQualifiedId, data));
+
+ String arguments = StepperAttributeUtil.getStringProperty(IProcessesStepAttributes.ATTR_PROCESS_ARGUMENTS, fullQualifiedId, data);
+ String[] args = arguments != null && !"".equals(arguments.trim()) ? StringUtil.tokenize(arguments, 0, true) : null; //$NON-NLS-1$
+ launchAttributes.put(IProcessLauncher.PROP_PROCESS_ARGS, args);
+
+ launchAttributes.put(ITerminalsConnectorConstants.PROP_LOCAL_ECHO, Boolean.FALSE);
+
+ boolean outputConsole = StepperAttributeUtil.getBooleanProperty(IProcessesStepAttributes.ATTR_OUTPUT_CONSOLE, fullQualifiedId, data);
+ if (outputConsole) {
+ launchAttributes.put(IProcessLauncher.PROP_PROCESS_ASSOCIATE_CONSOLE, Boolean.TRUE);
+ }
+ String outputFile = StepperAttributeUtil.getStringProperty(IProcessesStepAttributes.ATTR_OUTPUT_FILE, fullQualifiedId, data);
+ if (outputFile != null) {
+ launchAttributes.put(IProcessLauncher.PROP_PROCESS_OUTPUT_REDIRECT_TO_FILE, outputFile);
+ }
+
+ boolean attachProcess = StepperAttributeUtil.getBooleanProperty(IProcessesStepAttributes.ATTR_ATTACH, fullQualifiedId, data);
+ if (attachProcess) {
+ launchAttributes.put(IProcessLauncher.PROP_PROCESS_ATTACH, Boolean.TRUE);
+
+ boolean stopAtEntry = StepperAttributeUtil.getBooleanProperty(IProcessesStepAttributes.ATTR_STOP_AT_ENTRY, fullQualifiedId, data);
+ if (stopAtEntry) {
+ launchAttributes.put(IProcessesV1.START_STOP_AT_ENTRY, Boolean.TRUE);
+ }
+
+ boolean stopAtMain = StepperAttributeUtil.getBooleanProperty(IProcessesStepAttributes.ATTR_STOP_AT_MAIN, fullQualifiedId, data);
+ if (stopAtMain) {
+ launchAttributes.put(IProcessesV1.START_STOP_AT_MAIN, Boolean.TRUE);
+ }
+
+ boolean attachChildren = StepperAttributeUtil.getBooleanProperty(IProcessesStepAttributes.ATTR_ATTACH_CHILDREN, fullQualifiedId, data);
+ if (attachChildren) {
+ launchAttributes.put(IProcessesV1.START_ATTACH_CHILDREN, Boolean.TRUE);
+ }
+ }
+
+ // Determine the active peer
+ final IPeer peer = getActivePeerContext(context, data, fullQualifiedId);
+
+ // Fill in the launch attributes
+ IPropertiesContainer container = new PropertiesContainer();
+ container.setProperties(launchAttributes);
+
+ // If the line separator setting is not set explicitly, try to determine it automatically (local host only).
+ if (container.getProperty(ITerminalsConnectorConstants.PROP_LINE_SEPARATOR) == null) {
+ // Determine if the launch is on local host. If yes, we can preset the
+ // line ending character.
+ final AtomicBoolean isLocalhost = new AtomicBoolean();
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ if (ITransportTypes.TRANSPORT_TYPE_TCP.equals(peer.getTransportName())
+ || ITransportTypes.TRANSPORT_TYPE_SSL.equals(peer.getTransportName())) {
+ isLocalhost.set(IPAddressUtil.getInstance().isLocalHost(peer.getAttributes().get(IPeer.ATTR_IP_HOST)));
+ }
+ }
+ };
+
+ if (Protocol.isDispatchThread()) runnable.run();
+ else Protocol.invokeAndWait(runnable);
+
+ if (isLocalhost.get()) {
+ container.setProperty(ITerminalsConnectorConstants.PROP_LINE_SEPARATOR, Host.isWindowsHost() ? ILineSeparatorConstants.LINE_SEPARATOR_CRLF : ILineSeparatorConstants.LINE_SEPARATOR_LF);
+ }
+ }
+
+ // Launch the process
+ launcher.launch(peer, container, new Callback(callback) {
+ @Override
+ protected void internalDone(Object caller, IStatus status) {
+ Object result = getResult();
+ if (status.isOK()) {
+ if (result instanceof IProcesses.ProcessContext) {
+ StepperAttributeUtil.setProperty(IProcessesStepAttributes.ATTR_PROCESS_CONTEXT, fullQualifiedId.getParentId(), data, result);
+ }
+ StepperAttributeUtil.setProperty("services.processes.name", fullQualifiedId.getParentId(), data, //$NON-NLS-1$
+ (launcher.getSvcProcesses() instanceof IProcessesV1 ? IProcessesV1.NAME : IProcesses.NAME));
+ }
+ Assert.isTrue(channel.getState() == IChannel.STATE_OPEN, "channel is closed"); //$NON-NLS-1$
+ super.internalDone(caller, status);
+ }
+ });
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/steps/ResumeProcessStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/steps/ResumeProcessStep.java
index 89f55e1b6..6f40885a3 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/steps/ResumeProcessStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/steps/ResumeProcessStep.java
@@ -1,117 +1,117 @@
-/*******************************************************************************
- * 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.processes.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.protocol.IToken;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.services.IProcesses;
-import org.eclipse.tcf.services.IProcessesV1;
-import org.eclipse.tcf.services.IRunControl;
-import org.eclipse.tcf.services.IRunControl.RunControlContext;
-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.interfaces.steps.ITcfStepAttributes;
-import org.eclipse.tcf.te.tcf.core.steps.AbstractPeerStep;
-import org.eclipse.tcf.te.tcf.processes.core.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.tcf.processes.core.interfaces.steps.IProcessesStepAttributes;
-
-/**
- * Resume context step implementation.
- */
-public class ResumeProcessStep extends AbstractPeerStep {
-
- /**
- * Constructor.
- */
- public ResumeProcessStep() {
- }
-
- /* (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, CoreBundleActivator.getUniqueIdentifier(), "missing or closed channel")); //$NON-NLS-1$
- }
-
- IProcesses.ProcessContext processContext = (IProcesses.ProcessContext)StepperAttributeUtil.getProperty(IProcessesStepAttributes.ATTR_PROCESS_CONTEXT, fullQualifiedId, data);
- if (processContext == null) {
- throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), "missing process context")); //$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(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) {
- final IChannel channel = (IChannel)StepperAttributeUtil.getProperty(ITcfStepAttributes.ATTR_CHANNEL, fullQualifiedId, data);
- final IProcesses.ProcessContext processContext = (IProcesses.ProcessContext)StepperAttributeUtil.getProperty(IProcessesStepAttributes.ATTR_PROCESS_CONTEXT, fullQualifiedId, data);
- final IRunControl runControl = channel.getRemoteService(IRunControl.class);
- final String svcProcessesName = (String)StepperAttributeUtil.getProperty("services.processes.name", fullQualifiedId, data); //$NON-NLS-1$
-
- if (IProcessesV1.NAME.equals(svcProcessesName)) {
- // If the processes service used is IProcessesV1, there is nothing to do here
- callback.done(ResumeProcessStep.this, Status.OK_STATUS);
- } else if (runControl != null) {
- boolean stopAtEntry = StepperAttributeUtil.getBooleanProperty(IProcessesStepAttributes.ATTR_STOP_AT_ENTRY, fullQualifiedId, data);
-
- // In case "stop at entry" is not desired, we have to resume the context once to
- // "stop at main".
- if (!stopAtEntry) {
- runControl.getContext(processContext.getID(), new IRunControl.DoneGetContext() {
- @Override
- public void doneGetContext(IToken token, Exception error, RunControlContext context) {
- ProgressHelper.worked(monitor, 5);
- if (!ProgressHelper.isCancelOrError(ResumeProcessStep.this, StatusHelper.getStatus(error), monitor, callback)) {
- context.resume(IRunControl.RM_RESUME, 1, new IRunControl.DoneCommand() {
- @Override
- public void doneCommand(IToken token, Exception error) {
- callback.done(ResumeProcessStep.this, StatusHelper.getStatus(error));
- }
- });
- }
- }
- });
- } else {
- callback.done(ResumeProcessStep.this, Status.OK_STATUS);
- }
- }
- else {
- callback.done(this, new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), "missing run control service")); //$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.processes.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.protocol.IToken;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.services.IProcesses;
+import org.eclipse.tcf.services.IProcessesV1;
+import org.eclipse.tcf.services.IRunControl;
+import org.eclipse.tcf.services.IRunControl.RunControlContext;
+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.interfaces.steps.ITcfStepAttributes;
+import org.eclipse.tcf.te.tcf.core.steps.AbstractPeerStep;
+import org.eclipse.tcf.te.tcf.processes.core.activator.CoreBundleActivator;
+import org.eclipse.tcf.te.tcf.processes.core.interfaces.steps.IProcessesStepAttributes;
+
+/**
+ * Resume context step implementation.
+ */
+public class ResumeProcessStep extends AbstractPeerStep {
+
+ /**
+ * Constructor.
+ */
+ public ResumeProcessStep() {
+ }
+
+ /* (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, CoreBundleActivator.getUniqueIdentifier(), "missing or closed channel")); //$NON-NLS-1$
+ }
+
+ IProcesses.ProcessContext processContext = (IProcesses.ProcessContext)StepperAttributeUtil.getProperty(IProcessesStepAttributes.ATTR_PROCESS_CONTEXT, fullQualifiedId, data);
+ if (processContext == null) {
+ throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), "missing process context")); //$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(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) {
+ final IChannel channel = (IChannel)StepperAttributeUtil.getProperty(ITcfStepAttributes.ATTR_CHANNEL, fullQualifiedId, data);
+ final IProcesses.ProcessContext processContext = (IProcesses.ProcessContext)StepperAttributeUtil.getProperty(IProcessesStepAttributes.ATTR_PROCESS_CONTEXT, fullQualifiedId, data);
+ final IRunControl runControl = channel.getRemoteService(IRunControl.class);
+ final String svcProcessesName = (String)StepperAttributeUtil.getProperty("services.processes.name", fullQualifiedId, data); //$NON-NLS-1$
+
+ if (IProcessesV1.NAME.equals(svcProcessesName)) {
+ // If the processes service used is IProcessesV1, there is nothing to do here
+ callback.done(ResumeProcessStep.this, Status.OK_STATUS);
+ } else if (runControl != null) {
+ boolean stopAtEntry = StepperAttributeUtil.getBooleanProperty(IProcessesStepAttributes.ATTR_STOP_AT_ENTRY, fullQualifiedId, data);
+
+ // In case "stop at entry" is not desired, we have to resume the context once to
+ // "stop at main".
+ if (!stopAtEntry) {
+ runControl.getContext(processContext.getID(), new IRunControl.DoneGetContext() {
+ @Override
+ public void doneGetContext(IToken token, Exception error, RunControlContext context) {
+ ProgressHelper.worked(monitor, 5);
+ if (!ProgressHelper.isCancelOrError(ResumeProcessStep.this, StatusHelper.getStatus(error), monitor, callback)) {
+ context.resume(IRunControl.RM_RESUME, 1, new IRunControl.DoneCommand() {
+ @Override
+ public void doneCommand(IToken token, Exception error) {
+ callback.done(ResumeProcessStep.this, StatusHelper.getStatus(error));
+ }
+ });
+ }
+ }
+ });
+ } else {
+ callback.done(ResumeProcessStep.this, Status.OK_STATUS);
+ }
+ }
+ else {
+ callback.done(this, new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), "missing run control service")); //$NON-NLS-1$
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.properties
index 8b308205a..a0aece3e5 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.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.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/AttachHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/AttachHandler.java
index a5c364837..d36091918 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/AttachHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/AttachHandler.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.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/ConfigIntervalDynamicContribution.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/ConfigIntervalDynamicContribution.java
index ed81b971b..8392909a4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/ConfigIntervalDynamicContribution.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/ConfigIntervalDynamicContribution.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.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/EditorHandlerDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/EditorHandlerDelegate.java
index 65a1acc1f..efd9674b7 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/EditorHandlerDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/handler/EditorHandlerDelegate.java
@@ -2,7 +2,7 @@
* EditorHandlerDelegate.java
* Created on Jan 25, 2012
*
- * Copyright (c) 2012 Wind River Systems, Inc.
+ * 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
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/services/UIService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/services/UIService.java
index 5442e3f78..a96375ed1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/services/UIService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/services/UIService.java
@@ -2,7 +2,7 @@
* UIService.java
* Created on Nov 15, 2012
*
- * Copyright (c) 2012 Wind River Systems, Inc.
+ * 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
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsLauncherDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsLauncherDelegate.java
index 8c7c7e492..651cc2231 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsLauncherDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsLauncherDelegate.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.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/help/IContextHelpIds.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/help/IContextHelpIds.java
index 56c3082ec..0a47b6da9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/help/IContextHelpIds.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/help/IContextHelpIds.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.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/nls/Messages.java
index 8302b62b3..c983c9aaa 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/nls/Messages.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.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeerAction.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeerAction.java
index 89a007993..7c01be8f6 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeerAction.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeerAction.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.tcf.ui.views.scriptpad.actions;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.action.Action;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.ui.navigator.DelegatingLabelProvider;
-import org.eclipse.tcf.te.tcf.ui.views.scriptpad.ScriptPad;
-import org.eclipse.ui.IViewPart;
-
-/**
- * Peer toggle action implementation.
- */
-public class PeerAction extends Action {
- // Static reference to a label provider delegate providing the action label and image
- private final static DelegatingLabelProvider delegate = new DelegatingLabelProvider();
-
- // Reference to the peer model
- private IPeerModel peerModel;
- // Reference to the parent view part
- private IViewPart view;
-
- /**
- * Constructor.
- *
- * @param view The parent view part. Must not be <code>null</code>.
- * @param peerModel The peer model. Must not be <code>null</code>.
- */
- public PeerAction(IViewPart view, IPeerModel peerModel) {
- super("", AS_CHECK_BOX); //$NON-NLS-1$
-
- Assert.isNotNull(peerModel);
- this.peerModel = peerModel;
-
- String label = delegate.getText(peerModel);
- if (label != null) {
- setText(delegate.decorateText(label, peerModel));
- }
-
- Assert.isNotNull(view);
- this.view = view;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- @Override
- public void run() {
- setChecked(true);
-
- // Pass on the selected peer model to the parent view
- if (view instanceof ScriptPad) {
- ((ScriptPad)view).setPeerModel(peerModel);
- }
- }
-}
+/*******************************************************************************
+ * 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.ui.views.scriptpad.actions;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.action.Action;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.ui.navigator.DelegatingLabelProvider;
+import org.eclipse.tcf.te.tcf.ui.views.scriptpad.ScriptPad;
+import org.eclipse.ui.IViewPart;
+
+/**
+ * Peer toggle action implementation.
+ */
+public class PeerAction extends Action {
+ // Static reference to a label provider delegate providing the action label and image
+ private final static DelegatingLabelProvider delegate = new DelegatingLabelProvider();
+
+ // Reference to the peer model
+ private IPeerModel peerModel;
+ // Reference to the parent view part
+ private IViewPart view;
+
+ /**
+ * Constructor.
+ *
+ * @param view The parent view part. Must not be <code>null</code>.
+ * @param peerModel The peer model. Must not be <code>null</code>.
+ */
+ public PeerAction(IViewPart view, IPeerModel peerModel) {
+ super("", AS_CHECK_BOX); //$NON-NLS-1$
+
+ Assert.isNotNull(peerModel);
+ this.peerModel = peerModel;
+
+ String label = delegate.getText(peerModel);
+ if (label != null) {
+ setText(delegate.decorateText(label, peerModel));
+ }
+
+ Assert.isNotNull(view);
+ this.view = view;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ setChecked(true);
+
+ // Pass on the selected peer model to the parent view
+ if (view instanceof ScriptPad) {
+ ((ScriptPad)view).setPeerModel(peerModel);
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PlayAction.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PlayAction.java
index 19762debb..a4c4eabda 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PlayAction.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PlayAction.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.ui/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties
index 9d41e5e17..1f6b945cf 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties
@@ -1,75 +1,75 @@
-##################################################################################
-# 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 UI Plug-in
-providerName = Eclipse.org - Target Explorer
-
-# ***** Navigator Content *****
-
-navigatorContent.name = Dynamic Target Discovery
-
-# ***** Filter *****
-
-UnreachablePeersFilter.name=Unreachable targets
-RedirectPeersFilter.name=Redirected Targets (Root Level)
-PeersByCurrentUserFilter.name=Only show targets started by me
-
-# ***** Import/Export Wizards *****
-
-ImportWizards.Category.TCF=System Management
-ImportWizards.Peer=Configurations
-ImportWizards.PeerDescription=
-
-ExportWizards.Category.TCF=System Management
-ExportWizards.Peer=Configurations
-ExportWizards.PeerDescription=
-
-# ***** Decorators *****
-
-peerhost.decorator.label = Target Node Decorator
-
-# ***** Wizards *****
-
-NewWizards.category.name=Target Communication Framework
-
-NewTargetWizard.name=Target
-NewTargetWizard.description=Specify the attributes of the target to connect to.
-
-# ***** Editor Pages *****
-
-OverviewEditorPage.name=Overview
-
-# ***** Property Tabs *****
-
-propertyTab.general.label = General
-
-# ***** Preference and Property Pages *****
-
-preference.page.name = Logging
-
-# ***** Command Contributions *****
-
-command.delete.label=Delete
-command.delete.tooltip=Delete the selected target
-command.delete.mnemonic = D
-
-command.rename.label=Rename
-command.rename.tooltip=Rename the selected target
-command.rename.mnemonic = R
-
-command.refresh.label=Refresh
-command.refresh.tooltip=Refresh the selected target
-
-command.offline.label=Always Available Offline
-command.offline.tooltip=Creates an offline copy of the target attributes.
-command.offline.mnemonic = f
-
-command.debug.label=Debug
-command.debug.tooltip=Starts the 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 UI Plug-in
+providerName = Eclipse.org - Target Explorer
+
+# ***** Navigator Content *****
+
+navigatorContent.name = Dynamic Target Discovery
+
+# ***** Filter *****
+
+UnreachablePeersFilter.name=Unreachable targets
+RedirectPeersFilter.name=Redirected Targets (Root Level)
+PeersByCurrentUserFilter.name=Only show targets started by me
+
+# ***** Import/Export Wizards *****
+
+ImportWizards.Category.TCF=System Management
+ImportWizards.Peer=Configurations
+ImportWizards.PeerDescription=
+
+ExportWizards.Category.TCF=System Management
+ExportWizards.Peer=Configurations
+ExportWizards.PeerDescription=
+
+# ***** Decorators *****
+
+peerhost.decorator.label = Target Node Decorator
+
+# ***** Wizards *****
+
+NewWizards.category.name=Target Communication Framework
+
+NewTargetWizard.name=Target
+NewTargetWizard.description=Specify the attributes of the target to connect to.
+
+# ***** Editor Pages *****
+
+OverviewEditorPage.name=Overview
+
+# ***** Property Tabs *****
+
+propertyTab.general.label = General
+
+# ***** Preference and Property Pages *****
+
+preference.page.name = Logging
+
+# ***** Command Contributions *****
+
+command.delete.label=Delete
+command.delete.tooltip=Delete the selected target
+command.delete.mnemonic = D
+
+command.rename.label=Rename
+command.rename.tooltip=Rename the selected target
+command.rename.mnemonic = R
+
+command.refresh.label=Refresh
+command.refresh.tooltip=Refresh the selected target
+
+command.offline.label=Always Available Offline
+command.offline.tooltip=Creates an offline copy of the target attributes.
+command.offline.mnemonic = f
+
+command.debug.label=Debug
+command.debug.tooltip=Starts the debugger
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java
index f5826bbcb..1b316f3b4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java
@@ -1,280 +1,280 @@
-/*******************************************************************************
- * 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.ui.activator;
-
-import java.net.URL;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
-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.properties.PropertiesContainer;
-import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService;
-import org.eclipse.tcf.te.runtime.stepper.job.StepperJob;
-import org.eclipse.tcf.te.tcf.core.Tcf;
-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.model.Model;
-import org.eclipse.tcf.te.tcf.ui.internal.ImageConsts;
-import org.eclipse.tcf.te.ui.jface.images.AbstractImageDescriptor;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchListener;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class UIPlugin extends AbstractUIPlugin {
- // The shared instance
- private static UIPlugin plugin;
- // The workbench listener instance
- private IWorkbenchListener listener;
- // Reference to the workbench listener
- /* default */ final ListenerList listeners = new ListenerList();
-
- /**
- * Constructor.
- */
- public UIPlugin() {
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static UIPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Convenience method which returns the unique identifier of this plugin.
- */
- public static String getUniqueIdentifier() {
- if (getDefault() != null && getDefault().getBundle() != null) {
- return getDefault().getBundle().getSymbolicName();
- }
- return "org.eclipse.tcf.te.tcf.ui"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
-
- // Create and register the workbench listener instance
- listener = new IWorkbenchListener() {
-
- @Override
- public boolean preShutdown(IWorkbench workbench, boolean forced) {
- boolean proceedShutdown = true;
-
- // If there are workbench listener registered here, than
- // invoke them now before closing all the channels.
- Object[] candidates = listeners.getListeners();
- for (Object listener : candidates) {
- if (!(listener instanceof IWorkbenchListener)) continue;
- proceedShutdown &= ((IWorkbenchListener)listener).preShutdown(workbench, forced);
- if (!proceedShutdown && !forced) break;
- }
-
- if (proceedShutdown || forced) {
- // Terminate the scanner
- final ILocatorModel model = Model.getModel(true);
- if (model != null) model.getScanner().terminate();
-
- // Disconnect all connected connections via the stepper service
- if (model != null) {
- final AsyncCallbackCollector collector = new AsyncCallbackCollector();
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- // Get all peer model objects
- IPeerModel[] peers = model.getPeers();
- // Loop them and check if disconnect is available
- for (IPeerModel peerModel : peers) {
- IStepperService service = ServiceManager.getInstance().getService(peerModel, IStepperService.class);
- if (service != null) {
- String stepGroupId = service.getStepGroupId(peerModel, IStepperService.OPERATION_DISCONNECT);
- IStepContext stepContext = service.getStepContext(peerModel, IStepperService.OPERATION_DISCONNECT);
- String name = service.getStepGroupName(peerModel, IStepperService.OPERATION_DISCONNECT);
- boolean isEnabled = service.isEnabled(peerModel, IStepperService.OPERATION_DISCONNECT);
-
- if (isEnabled && stepGroupId != null && stepContext != null) {
- IPropertiesContainer data = new PropertiesContainer();
- StepperJob job = new StepperJob(name != null ? name : "", //$NON-NLS-1$
- stepContext,
- data,
- stepGroupId,
- IStepperService.OPERATION_DISCONNECT,
- false);
-
- ICallback callback = new AsyncCallbackCollector.SimpleCollectorCallback(collector);
- job.setJobCallback(callback);
-
- job.schedule();
- }
- }
- }
-
- collector.initDone();
- }
- };
-
- Assert.isTrue(!Protocol.isDispatchThread());
- Protocol.invokeAndWait(runnable);
-
- ExecutorsUtil.waitAndExecute(0, collector.getConditionTester());
- }
-
- // Close all channels now
- Tcf.getChannelManager().closeAll(!Protocol.isDispatchThread());
- }
-
- return proceedShutdown;
- }
-
- @Override
- public void postShutdown(IWorkbench workbench) {
- // If there are workbench listener registered here, than invoke them now.
- Object[] candidates = listeners.getListeners();
- for (Object listener : candidates) {
- if (!(listener instanceof IWorkbenchListener)) continue;
- ((IWorkbenchListener)listener).postShutdown(workbench);
- }
- }
- };
- PlatformUI.getWorkbench().addWorkbenchListener(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- if (listener != null) { PlatformUI.getWorkbench().removeWorkbenchListener(listener); listener = null; }
- super.stop(context);
- }
-
- /**
- * Adds the given workbench listener.
- * <p>
- * Has not effect if the same listener is already registered.
- *
- * @param listener The listener. Must not be <code>null</code>.
- */
- public void addListener(IWorkbenchListener listener) {
- Assert.isNotNull(listener);
- listeners.add(listener);
- }
-
- /**
- * Removes the given workbench listener.
- * <p>
- * Has no effect if the same listener was not already registered.
- *
- * @param listener The listener. Must not be <code>null</code>.
- */
- public void removeListener(IWorkbenchListener listener) {
- Assert.isNotNull(listener);
- listeners.remove(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
- */
- @Override
- protected void initializeImageRegistry(ImageRegistry registry) {
- URL url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OBJ + "peer.gif"); //$NON-NLS-1$
- registry.put(ImageConsts.PEER, ImageDescriptor.createFromURL(url));
- url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OBJ + "peer_discovered.gif"); //$NON-NLS-1$
- registry.put(ImageConsts.PEER_DISCOVERED, ImageDescriptor.createFromURL(url));
- url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OBJ + "discovery_root.gif"); //$NON-NLS-1$
- registry.put(ImageConsts.DISCOVERY_ROOT, ImageDescriptor.createFromURL(url));
-
- url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OVR + "gold_ovr.gif"); //$NON-NLS-1$
- registry.put(ImageConsts.GOLD_OVR, ImageDescriptor.createFromURL(url));
- url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OVR + "green_ovr.gif"); //$NON-NLS-1$
- registry.put(ImageConsts.GREEN_OVR, ImageDescriptor.createFromURL(url));
- url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OVR + "grey_ovr.gif"); //$NON-NLS-1$
- registry.put(ImageConsts.GREY_OVR, ImageDescriptor.createFromURL(url));
- url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OVR + "red_ovr.gif"); //$NON-NLS-1$
- registry.put(ImageConsts.RED_OVR, ImageDescriptor.createFromURL(url));
- url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OVR + "redX_ovr.gif"); //$NON-NLS-1$
- registry.put(ImageConsts.RED_X_OVR, ImageDescriptor.createFromURL(url));
- url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OVR + "link_ovr.gif"); //$NON-NLS-1$
- registry.put(ImageConsts.LINK_OVR, ImageDescriptor.createFromURL(url));
-
- url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_DTOOL + "run_exc.gif"); //$NON-NLS-1$
- registry.put(ImageConsts.RUN_DISABLED, ImageDescriptor.createFromURL(url));
- url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_ETOOL + "run_exc.gif"); //$NON-NLS-1$
- registry.put(ImageConsts.RUN_ENABLED, ImageDescriptor.createFromURL(url));
- }
-
- /**
- * Loads the image registered under the specified key from the image
- * registry and returns the <code>Image</code> object instance.
- *
- * @param key The key the image is registered with.
- * @return The <code>Image</code> object instance or <code>null</code>.
- */
- public static Image getImage(String key) {
- return getDefault().getImageRegistry().get(key);
- }
-
- /**
- * Loads the image registered under the specified key from the image
- * registry and returns the <code>ImageDescriptor</code> object instance.
- *
- * @param key The key the image is registered with.
- * @return The <code>ImageDescriptor</code> object instance or <code>null</code>.
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- return getDefault().getImageRegistry().getDescriptor(key);
- }
-
- /**
- * Loads the image given by the specified image descriptor from the image
- * registry. If the image has been loaded ones before already, the cached
- * <code>Image</code> object instance is returned. Otherwise, the <code>
- * Image</code> object instance will be created and cached before returned.
- *
- * @param descriptor The image descriptor.
- * @return The corresponding <code>Image</code> object instance or <code>null</code>.
- */
- public static Image getSharedImage(AbstractImageDescriptor descriptor) {
- ImageRegistry registry = getDefault().getImageRegistry();
-
- String imageKey = descriptor.getDecriptorKey();
- Image image = registry.get(imageKey);
- if (image == null) {
- registry.put(imageKey, descriptor);
- image = registry.get(imageKey);
- }
-
- return image;
- }
-}
+/*******************************************************************************
+ * 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.ui.activator;
+
+import java.net.URL;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
+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.properties.PropertiesContainer;
+import org.eclipse.tcf.te.runtime.services.ServiceManager;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService;
+import org.eclipse.tcf.te.runtime.stepper.job.StepperJob;
+import org.eclipse.tcf.te.tcf.core.Tcf;
+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.model.Model;
+import org.eclipse.tcf.te.tcf.ui.internal.ImageConsts;
+import org.eclipse.tcf.te.ui.jface.images.AbstractImageDescriptor;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchListener;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class UIPlugin extends AbstractUIPlugin {
+ // The shared instance
+ private static UIPlugin plugin;
+ // The workbench listener instance
+ private IWorkbenchListener listener;
+ // Reference to the workbench listener
+ /* default */ final ListenerList listeners = new ListenerList();
+
+ /**
+ * Constructor.
+ */
+ public UIPlugin() {
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static UIPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Convenience method which returns the unique identifier of this plugin.
+ */
+ public static String getUniqueIdentifier() {
+ if (getDefault() != null && getDefault().getBundle() != null) {
+ return getDefault().getBundle().getSymbolicName();
+ }
+ return "org.eclipse.tcf.te.tcf.ui"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+
+ // Create and register the workbench listener instance
+ listener = new IWorkbenchListener() {
+
+ @Override
+ public boolean preShutdown(IWorkbench workbench, boolean forced) {
+ boolean proceedShutdown = true;
+
+ // If there are workbench listener registered here, than
+ // invoke them now before closing all the channels.
+ Object[] candidates = listeners.getListeners();
+ for (Object listener : candidates) {
+ if (!(listener instanceof IWorkbenchListener)) continue;
+ proceedShutdown &= ((IWorkbenchListener)listener).preShutdown(workbench, forced);
+ if (!proceedShutdown && !forced) break;
+ }
+
+ if (proceedShutdown || forced) {
+ // Terminate the scanner
+ final ILocatorModel model = Model.getModel(true);
+ if (model != null) model.getScanner().terminate();
+
+ // Disconnect all connected connections via the stepper service
+ if (model != null) {
+ final AsyncCallbackCollector collector = new AsyncCallbackCollector();
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ // Get all peer model objects
+ IPeerModel[] peers = model.getPeers();
+ // Loop them and check if disconnect is available
+ for (IPeerModel peerModel : peers) {
+ IStepperService service = ServiceManager.getInstance().getService(peerModel, IStepperService.class);
+ if (service != null) {
+ String stepGroupId = service.getStepGroupId(peerModel, IStepperService.OPERATION_DISCONNECT);
+ IStepContext stepContext = service.getStepContext(peerModel, IStepperService.OPERATION_DISCONNECT);
+ String name = service.getStepGroupName(peerModel, IStepperService.OPERATION_DISCONNECT);
+ boolean isEnabled = service.isEnabled(peerModel, IStepperService.OPERATION_DISCONNECT);
+
+ if (isEnabled && stepGroupId != null && stepContext != null) {
+ IPropertiesContainer data = new PropertiesContainer();
+ StepperJob job = new StepperJob(name != null ? name : "", //$NON-NLS-1$
+ stepContext,
+ data,
+ stepGroupId,
+ IStepperService.OPERATION_DISCONNECT,
+ false);
+
+ ICallback callback = new AsyncCallbackCollector.SimpleCollectorCallback(collector);
+ job.setJobCallback(callback);
+
+ job.schedule();
+ }
+ }
+ }
+
+ collector.initDone();
+ }
+ };
+
+ Assert.isTrue(!Protocol.isDispatchThread());
+ Protocol.invokeAndWait(runnable);
+
+ ExecutorsUtil.waitAndExecute(0, collector.getConditionTester());
+ }
+
+ // Close all channels now
+ Tcf.getChannelManager().closeAll(!Protocol.isDispatchThread());
+ }
+
+ return proceedShutdown;
+ }
+
+ @Override
+ public void postShutdown(IWorkbench workbench) {
+ // If there are workbench listener registered here, than invoke them now.
+ Object[] candidates = listeners.getListeners();
+ for (Object listener : candidates) {
+ if (!(listener instanceof IWorkbenchListener)) continue;
+ ((IWorkbenchListener)listener).postShutdown(workbench);
+ }
+ }
+ };
+ PlatformUI.getWorkbench().addWorkbenchListener(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ if (listener != null) { PlatformUI.getWorkbench().removeWorkbenchListener(listener); listener = null; }
+ super.stop(context);
+ }
+
+ /**
+ * Adds the given workbench listener.
+ * <p>
+ * Has not effect if the same listener is already registered.
+ *
+ * @param listener The listener. Must not be <code>null</code>.
+ */
+ public void addListener(IWorkbenchListener listener) {
+ Assert.isNotNull(listener);
+ listeners.add(listener);
+ }
+
+ /**
+ * Removes the given workbench listener.
+ * <p>
+ * Has no effect if the same listener was not already registered.
+ *
+ * @param listener The listener. Must not be <code>null</code>.
+ */
+ public void removeListener(IWorkbenchListener listener) {
+ Assert.isNotNull(listener);
+ listeners.remove(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
+ */
+ @Override
+ protected void initializeImageRegistry(ImageRegistry registry) {
+ URL url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OBJ + "peer.gif"); //$NON-NLS-1$
+ registry.put(ImageConsts.PEER, ImageDescriptor.createFromURL(url));
+ url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OBJ + "peer_discovered.gif"); //$NON-NLS-1$
+ registry.put(ImageConsts.PEER_DISCOVERED, ImageDescriptor.createFromURL(url));
+ url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OBJ + "discovery_root.gif"); //$NON-NLS-1$
+ registry.put(ImageConsts.DISCOVERY_ROOT, ImageDescriptor.createFromURL(url));
+
+ url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OVR + "gold_ovr.gif"); //$NON-NLS-1$
+ registry.put(ImageConsts.GOLD_OVR, ImageDescriptor.createFromURL(url));
+ url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OVR + "green_ovr.gif"); //$NON-NLS-1$
+ registry.put(ImageConsts.GREEN_OVR, ImageDescriptor.createFromURL(url));
+ url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OVR + "grey_ovr.gif"); //$NON-NLS-1$
+ registry.put(ImageConsts.GREY_OVR, ImageDescriptor.createFromURL(url));
+ url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OVR + "red_ovr.gif"); //$NON-NLS-1$
+ registry.put(ImageConsts.RED_OVR, ImageDescriptor.createFromURL(url));
+ url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OVR + "redX_ovr.gif"); //$NON-NLS-1$
+ registry.put(ImageConsts.RED_X_OVR, ImageDescriptor.createFromURL(url));
+ url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OVR + "link_ovr.gif"); //$NON-NLS-1$
+ registry.put(ImageConsts.LINK_OVR, ImageDescriptor.createFromURL(url));
+
+ url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_DTOOL + "run_exc.gif"); //$NON-NLS-1$
+ registry.put(ImageConsts.RUN_DISABLED, ImageDescriptor.createFromURL(url));
+ url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_ETOOL + "run_exc.gif"); //$NON-NLS-1$
+ registry.put(ImageConsts.RUN_ENABLED, ImageDescriptor.createFromURL(url));
+ }
+
+ /**
+ * Loads the image registered under the specified key from the image
+ * registry and returns the <code>Image</code> object instance.
+ *
+ * @param key The key the image is registered with.
+ * @return The <code>Image</code> object instance or <code>null</code>.
+ */
+ public static Image getImage(String key) {
+ return getDefault().getImageRegistry().get(key);
+ }
+
+ /**
+ * Loads the image registered under the specified key from the image
+ * registry and returns the <code>ImageDescriptor</code> object instance.
+ *
+ * @param key The key the image is registered with.
+ * @return The <code>ImageDescriptor</code> object instance or <code>null</code>.
+ */
+ public static ImageDescriptor getImageDescriptor(String key) {
+ return getDefault().getImageRegistry().getDescriptor(key);
+ }
+
+ /**
+ * Loads the image given by the specified image descriptor from the image
+ * registry. If the image has been loaded ones before already, the cached
+ * <code>Image</code> object instance is returned. Otherwise, the <code>
+ * Image</code> object instance will be created and cached before returned.
+ *
+ * @param descriptor The image descriptor.
+ * @return The corresponding <code>Image</code> object instance or <code>null</code>.
+ */
+ public static Image getSharedImage(AbstractImageDescriptor descriptor) {
+ ImageRegistry registry = getDefault().getImageRegistry();
+
+ String imageKey = descriptor.getDecriptorKey();
+ Image image = registry.get(imageKey);
+ if (image == null) {
+ registry.put(imageKey, descriptor);
+ image = registry.get(imageKey);
+ }
+
+ return image;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/CustomTransportPanel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/CustomTransportPanel.java
index 9ae005928..54170464c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/CustomTransportPanel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/CustomTransportPanel.java
@@ -1,270 +1,270 @@
-/*******************************************************************************
- * 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.ui.controls;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.dialogs.IDialogPage;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.TypedEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.tcf.protocol.IPeer;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.tcf.ui.nls.Messages;
-import org.eclipse.tcf.te.ui.controls.BaseDialogPageControl;
-import org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl;
-import org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel;
-import org.eclipse.tcf.te.ui.controls.validator.RegexValidator;
-import org.eclipse.tcf.te.ui.controls.validator.Validator;
-import org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode3;
-import org.eclipse.tcf.te.ui.jface.interfaces.IValidatingContainer;
-import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-/**
- * Custom transport type panel implementation.
- */
-public class CustomTransportPanel extends AbstractWizardConfigurationPanel implements IDataExchangeNode3 {
-
- private CustomTransportNameControl customTransportNameControl;
-
- /**
- * Local custom transport name control implementation.
- */
- protected class CustomTransportNameControl extends BaseEditBrowseTextControl {
-
- /**
- * Constructor.
- *
- * @param parentPage The parent dialog page this control is embedded in.
- * Might be <code>null</code> if the control is not associated with a page.
- */
- public CustomTransportNameControl(IDialogPage parentPage) {
- super(parentPage);
- setIsGroup(false);
- setHasHistory(false);
- setHideBrowseButton(true);
- setEditFieldLabel(Messages.CustomTransportNameControl_label);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl#doCreateEditFieldValidator()
- */
- @Override
- protected Validator doCreateEditFieldValidator() {
- return new RegexValidator(Validator.ATTR_MANDATORY, ".*"); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl#configureEditFieldValidator(org.eclipse.tcf.te.ui.controls.validator.Validator)
- */
- @Override
- protected void configureEditFieldValidator(Validator validator) {
- if (validator instanceof RegexValidator) {
- validator.setMessageText(RegexValidator.INFO_MISSING_VALUE, Messages.CustomTransportNameControl_information_missingValue);
- validator.setMessageText(RegexValidator.ERROR_INVALID_VALUE, Messages.CustomTransportNameControl_error_invalidValue);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.BaseDialogPageControl#getValidatingContainer()
- */
- @Override
- public IValidatingContainer getValidatingContainer() {
- return CustomTransportPanel.this.getParentControl().getValidatingContainer();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- @Override
- public void modifyText(ModifyEvent e) {
- super.modifyText(e);
- if (CustomTransportPanel.this.getParentControl() instanceof ModifyListener) {
- ((ModifyListener)CustomTransportPanel.this.getParentControl()).modifyText(e);
- }
- }
- }
-
- /**
- * Constructor.
- *
- * @param parentPageControl The parent control. Must not be <code>null</code>!
- */
- public CustomTransportPanel(BaseDialogPageControl parentControl) {
- super(parentControl);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#dispose()
- */
- @Override
- public void dispose() {
- if (customTransportNameControl != null) { customTransportNameControl.dispose(); customTransportNameControl = null; }
- super.dispose();
- }
-
- /**
- * Returns if or if not to adjust the panels background color.
- *
- * @return <code>True</code> to adjust the panels background color, <code>false</code> if not.
- */
- protected boolean isAdjustBackgroundColor() {
- return getParentControl().getParentPage() != null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.interfaces.IWizardConfigurationPanel#setupPanel(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
- */
- @Override
- public void setupPanel(Composite parent, FormToolkit toolkit) {
- Assert.isNotNull(parent);
- Assert.isNotNull(toolkit);
-
- boolean adjustBackgroundColor = isAdjustBackgroundColor();
-
- Composite panel = toolkit.createComposite(parent);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0; layout.marginWidth = 0;
- panel.setLayout(layout);
- panel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- if (adjustBackgroundColor) panel.setBackground(parent.getBackground());
-
- setControl(panel);
-
- customTransportNameControl = doCreateCustomTransportNameControl(getParentControl().getParentPage());
- customTransportNameControl.setupPanel(panel);
- }
-
- /**
- * Creates the pipe name control instance.
- *
- * @param parentPage The parent dialog page or <code>null</code>.
- * @return The pipe name control instance.
- */
- protected CustomTransportNameControl doCreateCustomTransportNameControl(IDialogPage parentPage) {
- return new CustomTransportNameControl(parentPage);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#isValid()
- */
- @Override
- public boolean isValid() {
- boolean valid = super.isValid();
- if (!valid) return false;
-
- if (customTransportNameControl != null) {
- valid = customTransportNameControl.isValid();
- setMessage(customTransportNameControl.getMessage(), customTransportNameControl.getMessageType());
- }
-
- return valid;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.interfaces.IWizardConfigurationPanel#dataChanged(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.swt.events.TypedEvent)
- */
- @Override
- public boolean dataChanged(IPropertiesContainer data, TypedEvent e) {
- Assert.isNotNull(data);
-
- boolean isDirty = false;
-
- if (customTransportNameControl != null) {
- String CustomTransportName = customTransportNameControl.getEditFieldControlText();
- if (CustomTransportName != null) isDirty |= !CustomTransportName.equals(data.getStringProperty(IPeer.ATTR_TRANSPORT_NAME));
- }
-
- return isDirty;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.wizards.interfaces.ISharedDataExchangeNode#setupData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
- */
- @Override
- public void setupData(IPropertiesContainer data) {
- if (data == null) return;
-
- if (customTransportNameControl != null) {
- customTransportNameControl.setEditFieldControlText(data.getStringProperty(IPeer.ATTR_TRANSPORT_NAME));
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.wizards.interfaces.ISharedDataExchangeNode#extractData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
- */
- @Override
- public void extractData(IPropertiesContainer data) {
- if (data == null) return;
-
- if (customTransportNameControl != null) {
- data.setProperty(IPeer.ATTR_TRANSPORT_NAME, customTransportNameControl.getEditFieldControlText());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode2#initializeData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
- */
- @Override
- public void initializeData(IPropertiesContainer data) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode3#removeData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
- */
- @Override
- public void removeData(IPropertiesContainer data) {
- if (data == null) return;
- data.setProperty(IPeer.ATTR_TRANSPORT_NAME, null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode3#copyData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
- */
- @Override
- public void copyData(IPropertiesContainer src, IPropertiesContainer dst) {
- Assert.isNotNull(src);
- Assert.isNotNull(dst);
- dst.setProperty(IPeer.ATTR_TRANSPORT_NAME, src.getProperty(IPeer.ATTR_TRANSPORT_NAME));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#doSaveWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
- */
- @Override
- public void doSaveWidgetValues(IDialogSettings settings, String idPrefix) {
- super.doSaveWidgetValues(settings, idPrefix);
- if (customTransportNameControl != null) customTransportNameControl.doSaveWidgetValues(settings, idPrefix);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#doRestoreWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
- */
- @Override
- public void doRestoreWidgetValues(IDialogSettings settings, String idPrefix) {
- super.doRestoreWidgetValues(settings, idPrefix);
- if (customTransportNameControl != null) customTransportNameControl.doRestoreWidgetValues(settings, idPrefix);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#setEnabled(boolean)
- */
- @Override
- public void setEnabled(boolean enabled) {
- if (customTransportNameControl != null) {
- SWTControlUtil.setEnabled(customTransportNameControl.getEditFieldControl(), enabled);
- }
- }
-}
+/*******************************************************************************
+ * 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.ui.controls;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.dialogs.IDialogPage;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tcf.protocol.IPeer;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.tcf.ui.nls.Messages;
+import org.eclipse.tcf.te.ui.controls.BaseDialogPageControl;
+import org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl;
+import org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel;
+import org.eclipse.tcf.te.ui.controls.validator.RegexValidator;
+import org.eclipse.tcf.te.ui.controls.validator.Validator;
+import org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode3;
+import org.eclipse.tcf.te.ui.jface.interfaces.IValidatingContainer;
+import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * Custom transport type panel implementation.
+ */
+public class CustomTransportPanel extends AbstractWizardConfigurationPanel implements IDataExchangeNode3 {
+
+ private CustomTransportNameControl customTransportNameControl;
+
+ /**
+ * Local custom transport name control implementation.
+ */
+ protected class CustomTransportNameControl extends BaseEditBrowseTextControl {
+
+ /**
+ * Constructor.
+ *
+ * @param parentPage The parent dialog page this control is embedded in.
+ * Might be <code>null</code> if the control is not associated with a page.
+ */
+ public CustomTransportNameControl(IDialogPage parentPage) {
+ super(parentPage);
+ setIsGroup(false);
+ setHasHistory(false);
+ setHideBrowseButton(true);
+ setEditFieldLabel(Messages.CustomTransportNameControl_label);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl#doCreateEditFieldValidator()
+ */
+ @Override
+ protected Validator doCreateEditFieldValidator() {
+ return new RegexValidator(Validator.ATTR_MANDATORY, ".*"); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl#configureEditFieldValidator(org.eclipse.tcf.te.ui.controls.validator.Validator)
+ */
+ @Override
+ protected void configureEditFieldValidator(Validator validator) {
+ if (validator instanceof RegexValidator) {
+ validator.setMessageText(RegexValidator.INFO_MISSING_VALUE, Messages.CustomTransportNameControl_information_missingValue);
+ validator.setMessageText(RegexValidator.ERROR_INVALID_VALUE, Messages.CustomTransportNameControl_error_invalidValue);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.BaseDialogPageControl#getValidatingContainer()
+ */
+ @Override
+ public IValidatingContainer getValidatingContainer() {
+ return CustomTransportPanel.this.getParentControl().getValidatingContainer();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ @Override
+ public void modifyText(ModifyEvent e) {
+ super.modifyText(e);
+ if (CustomTransportPanel.this.getParentControl() instanceof ModifyListener) {
+ ((ModifyListener)CustomTransportPanel.this.getParentControl()).modifyText(e);
+ }
+ }
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param parentPageControl The parent control. Must not be <code>null</code>!
+ */
+ public CustomTransportPanel(BaseDialogPageControl parentControl) {
+ super(parentControl);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#dispose()
+ */
+ @Override
+ public void dispose() {
+ if (customTransportNameControl != null) { customTransportNameControl.dispose(); customTransportNameControl = null; }
+ super.dispose();
+ }
+
+ /**
+ * Returns if or if not to adjust the panels background color.
+ *
+ * @return <code>True</code> to adjust the panels background color, <code>false</code> if not.
+ */
+ protected boolean isAdjustBackgroundColor() {
+ return getParentControl().getParentPage() != null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.interfaces.IWizardConfigurationPanel#setupPanel(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
+ */
+ @Override
+ public void setupPanel(Composite parent, FormToolkit toolkit) {
+ Assert.isNotNull(parent);
+ Assert.isNotNull(toolkit);
+
+ boolean adjustBackgroundColor = isAdjustBackgroundColor();
+
+ Composite panel = toolkit.createComposite(parent);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 0; layout.marginWidth = 0;
+ panel.setLayout(layout);
+ panel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ if (adjustBackgroundColor) panel.setBackground(parent.getBackground());
+
+ setControl(panel);
+
+ customTransportNameControl = doCreateCustomTransportNameControl(getParentControl().getParentPage());
+ customTransportNameControl.setupPanel(panel);
+ }
+
+ /**
+ * Creates the pipe name control instance.
+ *
+ * @param parentPage The parent dialog page or <code>null</code>.
+ * @return The pipe name control instance.
+ */
+ protected CustomTransportNameControl doCreateCustomTransportNameControl(IDialogPage parentPage) {
+ return new CustomTransportNameControl(parentPage);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#isValid()
+ */
+ @Override
+ public boolean isValid() {
+ boolean valid = super.isValid();
+ if (!valid) return false;
+
+ if (customTransportNameControl != null) {
+ valid = customTransportNameControl.isValid();
+ setMessage(customTransportNameControl.getMessage(), customTransportNameControl.getMessageType());
+ }
+
+ return valid;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.interfaces.IWizardConfigurationPanel#dataChanged(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.swt.events.TypedEvent)
+ */
+ @Override
+ public boolean dataChanged(IPropertiesContainer data, TypedEvent e) {
+ Assert.isNotNull(data);
+
+ boolean isDirty = false;
+
+ if (customTransportNameControl != null) {
+ String CustomTransportName = customTransportNameControl.getEditFieldControlText();
+ if (CustomTransportName != null) isDirty |= !CustomTransportName.equals(data.getStringProperty(IPeer.ATTR_TRANSPORT_NAME));
+ }
+
+ return isDirty;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.wizards.interfaces.ISharedDataExchangeNode#setupData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
+ */
+ @Override
+ public void setupData(IPropertiesContainer data) {
+ if (data == null) return;
+
+ if (customTransportNameControl != null) {
+ customTransportNameControl.setEditFieldControlText(data.getStringProperty(IPeer.ATTR_TRANSPORT_NAME));
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.wizards.interfaces.ISharedDataExchangeNode#extractData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
+ */
+ @Override
+ public void extractData(IPropertiesContainer data) {
+ if (data == null) return;
+
+ if (customTransportNameControl != null) {
+ data.setProperty(IPeer.ATTR_TRANSPORT_NAME, customTransportNameControl.getEditFieldControlText());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode2#initializeData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
+ */
+ @Override
+ public void initializeData(IPropertiesContainer data) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode3#removeData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
+ */
+ @Override
+ public void removeData(IPropertiesContainer data) {
+ if (data == null) return;
+ data.setProperty(IPeer.ATTR_TRANSPORT_NAME, null);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode3#copyData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
+ */
+ @Override
+ public void copyData(IPropertiesContainer src, IPropertiesContainer dst) {
+ Assert.isNotNull(src);
+ Assert.isNotNull(dst);
+ dst.setProperty(IPeer.ATTR_TRANSPORT_NAME, src.getProperty(IPeer.ATTR_TRANSPORT_NAME));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#doSaveWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
+ */
+ @Override
+ public void doSaveWidgetValues(IDialogSettings settings, String idPrefix) {
+ super.doSaveWidgetValues(settings, idPrefix);
+ if (customTransportNameControl != null) customTransportNameControl.doSaveWidgetValues(settings, idPrefix);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#doRestoreWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
+ */
+ @Override
+ public void doRestoreWidgetValues(IDialogSettings settings, String idPrefix) {
+ super.doRestoreWidgetValues(settings, idPrefix);
+ if (customTransportNameControl != null) customTransportNameControl.doRestoreWidgetValues(settings, idPrefix);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#setEnabled(boolean)
+ */
+ @Override
+ public void setEnabled(boolean enabled) {
+ if (customTransportNameControl != null) {
+ SWTControlUtil.setEnabled(customTransportNameControl.getEditFieldControl(), enabled);
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/PeerNameControl.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/PeerNameControl.java
index 401a697f2..a4a95a9f0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/PeerNameControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/PeerNameControl.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.ui/src/org/eclipse/tcf/te/tcf/ui/controls/PipeTransportPanel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/PipeTransportPanel.java
index 1306eac89..a418c5438 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/PipeTransportPanel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/PipeTransportPanel.java
@@ -1,270 +1,270 @@
-/*******************************************************************************
- * 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.ui.controls;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.dialogs.IDialogPage;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.TypedEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.tcf.ui.nls.Messages;
-import org.eclipse.tcf.te.ui.controls.BaseDialogPageControl;
-import org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl;
-import org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel;
-import org.eclipse.tcf.te.ui.controls.validator.RegexValidator;
-import org.eclipse.tcf.te.ui.controls.validator.Validator;
-import org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode3;
-import org.eclipse.tcf.te.ui.jface.interfaces.IValidatingContainer;
-import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-/**
- * Pipe transport type panel implementation.
- */
-public class PipeTransportPanel extends AbstractWizardConfigurationPanel implements IDataExchangeNode3 {
-
- private PipeNameControl pipeNameControl;
-
- /**
- * Local pipe name control implementation.
- */
- protected class PipeNameControl extends BaseEditBrowseTextControl {
-
- /**
- * Constructor.
- *
- * @param parentPage The parent dialog page this control is embedded in.
- * Might be <code>null</code> if the control is not associated with a page.
- */
- public PipeNameControl(IDialogPage parentPage) {
- super(parentPage);
- setIsGroup(false);
- setHasHistory(false);
- setHideBrowseButton(true);
- setEditFieldLabel(Messages.PipeNameControl_label);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl#doCreateEditFieldValidator()
- */
- @Override
- protected Validator doCreateEditFieldValidator() {
- return new RegexValidator(Validator.ATTR_MANDATORY, ".*"); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl#configureEditFieldValidator(org.eclipse.tcf.te.ui.controls.validator.Validator)
- */
- @Override
- protected void configureEditFieldValidator(Validator validator) {
- if (validator instanceof RegexValidator) {
- validator.setMessageText(RegexValidator.INFO_MISSING_VALUE, Messages.PipeNameControl_information_missingValue);
- validator.setMessageText(RegexValidator.ERROR_INVALID_VALUE, Messages.PipeNameControl_error_invalidValue);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.BaseDialogPageControl#getValidatingContainer()
- */
- @Override
- public IValidatingContainer getValidatingContainer() {
- return PipeTransportPanel.this.getParentControl().getValidatingContainer();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- @Override
- public void modifyText(ModifyEvent e) {
- super.modifyText(e);
- if (PipeTransportPanel.this.getParentControl() instanceof ModifyListener) {
- ((ModifyListener)PipeTransportPanel.this.getParentControl()).modifyText(e);
- }
- }
- }
-
- /**
- * Constructor.
- *
- * @param parentPageControl The parent control. Must not be <code>null</code>!
- */
- public PipeTransportPanel(BaseDialogPageControl parentControl) {
- super(parentControl);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#dispose()
- */
- @Override
- public void dispose() {
- if (pipeNameControl != null) { pipeNameControl.dispose(); pipeNameControl = null; }
- super.dispose();
- }
-
- /**
- * Returns if or if not to adjust the panels background color.
- *
- * @return <code>True</code> to adjust the panels background color, <code>false</code> if not.
- */
- protected boolean isAdjustBackgroundColor() {
- return getParentControl().getParentPage() != null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.interfaces.IWizardConfigurationPanel#setupPanel(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
- */
- @Override
- public void setupPanel(Composite parent, FormToolkit toolkit) {
- Assert.isNotNull(parent);
- Assert.isNotNull(toolkit);
-
- boolean adjustBackgroundColor = isAdjustBackgroundColor();
-
- Composite panel = toolkit.createComposite(parent);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0; layout.marginWidth = 0;
- panel.setLayout(layout);
- panel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- if (adjustBackgroundColor) panel.setBackground(parent.getBackground());
-
- setControl(panel);
-
- pipeNameControl = doCreatePipeNameControl(getParentControl().getParentPage());
- pipeNameControl.setupPanel(panel);
- }
-
- /**
- * Creates the pipe name control instance.
- *
- * @param parentPage The parent dialog page or <code>null</code>.
- * @return The pipe name control instance.
- */
- protected PipeNameControl doCreatePipeNameControl(IDialogPage parentPage) {
- return new PipeNameControl(parentPage);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#isValid()
- */
- @Override
- public boolean isValid() {
- boolean valid = super.isValid();
- if (!valid) return false;
-
- if (pipeNameControl != null) {
- valid = pipeNameControl.isValid();
- setMessage(pipeNameControl.getMessage(), pipeNameControl.getMessageType());
- }
-
- return valid;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.interfaces.IWizardConfigurationPanel#dataChanged(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.swt.events.TypedEvent)
- */
- @Override
- public boolean dataChanged(IPropertiesContainer data, TypedEvent e) {
- Assert.isNotNull(data);
-
- boolean isDirty = false;
-
- if (pipeNameControl != null) {
- String pipeName = pipeNameControl.getEditFieldControlText();
- if (pipeName != null) isDirty |= !pipeName.equals(data.getStringProperty("PipeName")); //$NON-NLS-1$
- }
-
- return isDirty;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.wizards.interfaces.ISharedDataExchangeNode#setupData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
- */
- @Override
- public void setupData(IPropertiesContainer data) {
- if (data == null) return;
-
- if (pipeNameControl != null) {
- pipeNameControl.setEditFieldControlText(data.getStringProperty("PipeName")); //$NON-NLS-1$
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.wizards.interfaces.ISharedDataExchangeNode#extractData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
- */
- @Override
- public void extractData(IPropertiesContainer data) {
- if (data == null) return;
-
- if (pipeNameControl != null) {
- String pipeName = pipeNameControl.getEditFieldControlText();
- data.setProperty("PipeName", !"".equals(pipeName) ? pipeName : null); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode2#initializeData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
- */
- @Override
- public void initializeData(IPropertiesContainer data) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode3#removeData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
- */
- @Override
- public void removeData(IPropertiesContainer data) {
- if (data == null) return;
- data.setProperty("PipeName", null); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode3#copyData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
- */
- @Override
- public void copyData(IPropertiesContainer src, IPropertiesContainer dst) {
- Assert.isNotNull(src);
- Assert.isNotNull(dst);
- dst.setProperty("PipeName", src.getProperty("PipeName")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#doSaveWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
- */
- @Override
- public void doSaveWidgetValues(IDialogSettings settings, String idPrefix) {
- super.doSaveWidgetValues(settings, idPrefix);
- if (pipeNameControl != null) pipeNameControl.doSaveWidgetValues(settings, idPrefix);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#doRestoreWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
- */
- @Override
- public void doRestoreWidgetValues(IDialogSettings settings, String idPrefix) {
- super.doRestoreWidgetValues(settings, idPrefix);
- if (pipeNameControl != null) pipeNameControl.doRestoreWidgetValues(settings, idPrefix);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#setEnabled(boolean)
- */
- @Override
- public void setEnabled(boolean enabled) {
- if (pipeNameControl != null) {
- SWTControlUtil.setEnabled(pipeNameControl.getEditFieldControl(), enabled);
- }
- }
-}
+/*******************************************************************************
+ * 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.ui.controls;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.dialogs.IDialogPage;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.tcf.ui.nls.Messages;
+import org.eclipse.tcf.te.ui.controls.BaseDialogPageControl;
+import org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl;
+import org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel;
+import org.eclipse.tcf.te.ui.controls.validator.RegexValidator;
+import org.eclipse.tcf.te.ui.controls.validator.Validator;
+import org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode3;
+import org.eclipse.tcf.te.ui.jface.interfaces.IValidatingContainer;
+import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * Pipe transport type panel implementation.
+ */
+public class PipeTransportPanel extends AbstractWizardConfigurationPanel implements IDataExchangeNode3 {
+
+ private PipeNameControl pipeNameControl;
+
+ /**
+ * Local pipe name control implementation.
+ */
+ protected class PipeNameControl extends BaseEditBrowseTextControl {
+
+ /**
+ * Constructor.
+ *
+ * @param parentPage The parent dialog page this control is embedded in.
+ * Might be <code>null</code> if the control is not associated with a page.
+ */
+ public PipeNameControl(IDialogPage parentPage) {
+ super(parentPage);
+ setIsGroup(false);
+ setHasHistory(false);
+ setHideBrowseButton(true);
+ setEditFieldLabel(Messages.PipeNameControl_label);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl#doCreateEditFieldValidator()
+ */
+ @Override
+ protected Validator doCreateEditFieldValidator() {
+ return new RegexValidator(Validator.ATTR_MANDATORY, ".*"); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl#configureEditFieldValidator(org.eclipse.tcf.te.ui.controls.validator.Validator)
+ */
+ @Override
+ protected void configureEditFieldValidator(Validator validator) {
+ if (validator instanceof RegexValidator) {
+ validator.setMessageText(RegexValidator.INFO_MISSING_VALUE, Messages.PipeNameControl_information_missingValue);
+ validator.setMessageText(RegexValidator.ERROR_INVALID_VALUE, Messages.PipeNameControl_error_invalidValue);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.BaseDialogPageControl#getValidatingContainer()
+ */
+ @Override
+ public IValidatingContainer getValidatingContainer() {
+ return PipeTransportPanel.this.getParentControl().getValidatingContainer();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ @Override
+ public void modifyText(ModifyEvent e) {
+ super.modifyText(e);
+ if (PipeTransportPanel.this.getParentControl() instanceof ModifyListener) {
+ ((ModifyListener)PipeTransportPanel.this.getParentControl()).modifyText(e);
+ }
+ }
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param parentPageControl The parent control. Must not be <code>null</code>!
+ */
+ public PipeTransportPanel(BaseDialogPageControl parentControl) {
+ super(parentControl);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#dispose()
+ */
+ @Override
+ public void dispose() {
+ if (pipeNameControl != null) { pipeNameControl.dispose(); pipeNameControl = null; }
+ super.dispose();
+ }
+
+ /**
+ * Returns if or if not to adjust the panels background color.
+ *
+ * @return <code>True</code> to adjust the panels background color, <code>false</code> if not.
+ */
+ protected boolean isAdjustBackgroundColor() {
+ return getParentControl().getParentPage() != null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.interfaces.IWizardConfigurationPanel#setupPanel(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
+ */
+ @Override
+ public void setupPanel(Composite parent, FormToolkit toolkit) {
+ Assert.isNotNull(parent);
+ Assert.isNotNull(toolkit);
+
+ boolean adjustBackgroundColor = isAdjustBackgroundColor();
+
+ Composite panel = toolkit.createComposite(parent);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 0; layout.marginWidth = 0;
+ panel.setLayout(layout);
+ panel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ if (adjustBackgroundColor) panel.setBackground(parent.getBackground());
+
+ setControl(panel);
+
+ pipeNameControl = doCreatePipeNameControl(getParentControl().getParentPage());
+ pipeNameControl.setupPanel(panel);
+ }
+
+ /**
+ * Creates the pipe name control instance.
+ *
+ * @param parentPage The parent dialog page or <code>null</code>.
+ * @return The pipe name control instance.
+ */
+ protected PipeNameControl doCreatePipeNameControl(IDialogPage parentPage) {
+ return new PipeNameControl(parentPage);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#isValid()
+ */
+ @Override
+ public boolean isValid() {
+ boolean valid = super.isValid();
+ if (!valid) return false;
+
+ if (pipeNameControl != null) {
+ valid = pipeNameControl.isValid();
+ setMessage(pipeNameControl.getMessage(), pipeNameControl.getMessageType());
+ }
+
+ return valid;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.interfaces.IWizardConfigurationPanel#dataChanged(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.swt.events.TypedEvent)
+ */
+ @Override
+ public boolean dataChanged(IPropertiesContainer data, TypedEvent e) {
+ Assert.isNotNull(data);
+
+ boolean isDirty = false;
+
+ if (pipeNameControl != null) {
+ String pipeName = pipeNameControl.getEditFieldControlText();
+ if (pipeName != null) isDirty |= !pipeName.equals(data.getStringProperty("PipeName")); //$NON-NLS-1$
+ }
+
+ return isDirty;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.wizards.interfaces.ISharedDataExchangeNode#setupData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
+ */
+ @Override
+ public void setupData(IPropertiesContainer data) {
+ if (data == null) return;
+
+ if (pipeNameControl != null) {
+ pipeNameControl.setEditFieldControlText(data.getStringProperty("PipeName")); //$NON-NLS-1$
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.wizards.interfaces.ISharedDataExchangeNode#extractData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
+ */
+ @Override
+ public void extractData(IPropertiesContainer data) {
+ if (data == null) return;
+
+ if (pipeNameControl != null) {
+ String pipeName = pipeNameControl.getEditFieldControlText();
+ data.setProperty("PipeName", !"".equals(pipeName) ? pipeName : null); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode2#initializeData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
+ */
+ @Override
+ public void initializeData(IPropertiesContainer data) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode3#removeData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
+ */
+ @Override
+ public void removeData(IPropertiesContainer data) {
+ if (data == null) return;
+ data.setProperty("PipeName", null); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode3#copyData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
+ */
+ @Override
+ public void copyData(IPropertiesContainer src, IPropertiesContainer dst) {
+ Assert.isNotNull(src);
+ Assert.isNotNull(dst);
+ dst.setProperty("PipeName", src.getProperty("PipeName")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#doSaveWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
+ */
+ @Override
+ public void doSaveWidgetValues(IDialogSettings settings, String idPrefix) {
+ super.doSaveWidgetValues(settings, idPrefix);
+ if (pipeNameControl != null) pipeNameControl.doSaveWidgetValues(settings, idPrefix);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#doRestoreWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
+ */
+ @Override
+ public void doRestoreWidgetValues(IDialogSettings settings, String idPrefix) {
+ super.doRestoreWidgetValues(settings, idPrefix);
+ if (pipeNameControl != null) pipeNameControl.doRestoreWidgetValues(settings, idPrefix);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel#setEnabled(boolean)
+ */
+ @Override
+ public void setEnabled(boolean enabled) {
+ if (pipeNameControl != null) {
+ SWTControlUtil.setEnabled(pipeNameControl.getEditFieldControl(), enabled);
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/TcpTransportPanel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/TcpTransportPanel.java
index 3cc2c6a61..d6e99405c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/TcpTransportPanel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/TcpTransportPanel.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.ui/src/org/eclipse/tcf/te/tcf/ui/controls/TransportTypeControl.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/TransportTypeControl.java
index fee94cedc..9999fa5e0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/TransportTypeControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/TransportTypeControl.java
@@ -1,144 +1,144 @@
-/*******************************************************************************
- * 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.ui.controls;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.dialogs.IDialogPage;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.tcf.te.tcf.core.interfaces.ITransportTypes;
-import org.eclipse.tcf.te.tcf.ui.nls.Messages;
-import org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl;
-import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
-
-/**
- * Transport type control implementation.
- */
-public class TransportTypeControl extends BaseEditBrowseTextControl {
-
- private final static List<String> TRANSPORT_TYPES = Arrays.asList(new String[] {
- ITransportTypes.TRANSPORT_TYPE_TCP,
- ITransportTypes.TRANSPORT_TYPE_SSL,
- ITransportTypes.TRANSPORT_TYPE_PIPE,
- ITransportTypes.TRANSPORT_TYPE_CUSTOM
- });
-
- /**
- * Constructor.
- *
- * @param parentPage The parent dialog page this control is embedded in.
- * Might be <code>null</code> if the control is not associated with a page.
- */
- public TransportTypeControl(IDialogPage parentPage) {
- super(parentPage);
- setIsGroup(false);
- setReadOnly(true);
- setHideBrowseButton(true);
- setEditFieldLabel(Messages.TransportTypeControl_label);
- }
-
- /**
- * Returns the list of transport types supported by this control.
- *
- * @return The list of supported transport types.
- */
- public String[] getTransportTypes() {
- return TRANSPORT_TYPES.toArray(new String[TRANSPORT_TYPES.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl#setupPanel(org.eclipse.swt.widgets.Composite)
- */
- @Override
- public void setupPanel(Composite parent) {
- super.setupPanel(parent);
-
- List<String> transportTypeLabels = new ArrayList<String>();
- for (String transportType : getTransportTypes()) {
- String label = getTransportTypeLabel(transportType);
- if (label != null) transportTypeLabels.add(label);
- }
-
- setEditFieldControlHistory(transportTypeLabels.toArray(new String[transportTypeLabels.size()]));
- SWTControlUtil.select(getEditFieldControl(), 0);
- SWTControlUtil.setEnabled(getEditFieldControl(), transportTypeLabels.size() > 1);
- }
-
- /**
- * Returns the label of the given transport type.
- *
- * @param transportType The transport type. Must not be <code>null</code>.
- * @return The corresponding label or <code>null</code> if the transport type is unknown.
- */
- protected String getTransportTypeLabel(String transportType) {
- Assert.isNotNull(transportType);
-
- if (ITransportTypes.TRANSPORT_TYPE_TCP.equals(transportType)) return Messages.TransportTypeControl_tcpType_label;
- else if (ITransportTypes.TRANSPORT_TYPE_SSL.equals(transportType)) return Messages.TransportTypeControl_sslType_label;
- else if (ITransportTypes.TRANSPORT_TYPE_PIPE.equals(transportType)) return Messages.TransportTypeControl_pipeType_label;
- else if (ITransportTypes.TRANSPORT_TYPE_CUSTOM.equals(transportType)) return Messages.TransportTypeControl_customType_label;
-
- return null;
- }
-
- /**
- * Returns the currently selected transport type.
- *
- * @return The currently selected transport type.
- */
- public String getSelectedTransportType() {
- String type = getEditFieldControlText();
-
- if (Messages.TransportTypeControl_tcpType_label.equals(type)) type = ITransportTypes.TRANSPORT_TYPE_TCP;
- else if (Messages.TransportTypeControl_sslType_label.equals(type)) type = ITransportTypes.TRANSPORT_TYPE_SSL;
- else if (Messages.TransportTypeControl_pipeType_label.equals(type)) type = ITransportTypes.TRANSPORT_TYPE_PIPE;
- else if (Messages.TransportTypeControl_customType_label.equals(type)) type = ITransportTypes.TRANSPORT_TYPE_CUSTOM;
-
- return type;
- }
-
- /**
- * Sets the selected transport type to the specified one.
- *
- * @param transportType The transport type. Must not be <code>null</code>.
- */
- public void setSelectedTransportType(String transportType) {
- Assert.isNotNull(transportType);
-
- // Get the transport type label for given transport type
- String label = getTransportTypeLabel(transportType);
- int index = SWTControlUtil.indexOf(getEditFieldControl(), label);
- if (index != -1) SWTControlUtil.select(getEditFieldControl(), index);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl#doRestoreWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
- */
- @Override
- public void doRestoreWidgetValues(IDialogSettings settings, String idPrefix) {
- // The widget is not user editable and the history is used
- // for presenting the available transport types. Neither save
- // or restore the history actively.
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl#doSaveWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
- */
- @Override
- public void doSaveWidgetValues(IDialogSettings settings, String idPrefix) {
- // The widget is not user editable and the history is used
- // for presenting the available transport types. Neither save
- // or restore the history actively.
- }
-}
+/*******************************************************************************
+ * 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.ui.controls;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.dialogs.IDialogPage;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tcf.te.tcf.core.interfaces.ITransportTypes;
+import org.eclipse.tcf.te.tcf.ui.nls.Messages;
+import org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl;
+import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
+
+/**
+ * Transport type control implementation.
+ */
+public class TransportTypeControl extends BaseEditBrowseTextControl {
+
+ private final static List<String> TRANSPORT_TYPES = Arrays.asList(new String[] {
+ ITransportTypes.TRANSPORT_TYPE_TCP,
+ ITransportTypes.TRANSPORT_TYPE_SSL,
+ ITransportTypes.TRANSPORT_TYPE_PIPE,
+ ITransportTypes.TRANSPORT_TYPE_CUSTOM
+ });
+
+ /**
+ * Constructor.
+ *
+ * @param parentPage The parent dialog page this control is embedded in.
+ * Might be <code>null</code> if the control is not associated with a page.
+ */
+ public TransportTypeControl(IDialogPage parentPage) {
+ super(parentPage);
+ setIsGroup(false);
+ setReadOnly(true);
+ setHideBrowseButton(true);
+ setEditFieldLabel(Messages.TransportTypeControl_label);
+ }
+
+ /**
+ * Returns the list of transport types supported by this control.
+ *
+ * @return The list of supported transport types.
+ */
+ public String[] getTransportTypes() {
+ return TRANSPORT_TYPES.toArray(new String[TRANSPORT_TYPES.size()]);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl#setupPanel(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void setupPanel(Composite parent) {
+ super.setupPanel(parent);
+
+ List<String> transportTypeLabels = new ArrayList<String>();
+ for (String transportType : getTransportTypes()) {
+ String label = getTransportTypeLabel(transportType);
+ if (label != null) transportTypeLabels.add(label);
+ }
+
+ setEditFieldControlHistory(transportTypeLabels.toArray(new String[transportTypeLabels.size()]));
+ SWTControlUtil.select(getEditFieldControl(), 0);
+ SWTControlUtil.setEnabled(getEditFieldControl(), transportTypeLabels.size() > 1);
+ }
+
+ /**
+ * Returns the label of the given transport type.
+ *
+ * @param transportType The transport type. Must not be <code>null</code>.
+ * @return The corresponding label or <code>null</code> if the transport type is unknown.
+ */
+ protected String getTransportTypeLabel(String transportType) {
+ Assert.isNotNull(transportType);
+
+ if (ITransportTypes.TRANSPORT_TYPE_TCP.equals(transportType)) return Messages.TransportTypeControl_tcpType_label;
+ else if (ITransportTypes.TRANSPORT_TYPE_SSL.equals(transportType)) return Messages.TransportTypeControl_sslType_label;
+ else if (ITransportTypes.TRANSPORT_TYPE_PIPE.equals(transportType)) return Messages.TransportTypeControl_pipeType_label;
+ else if (ITransportTypes.TRANSPORT_TYPE_CUSTOM.equals(transportType)) return Messages.TransportTypeControl_customType_label;
+
+ return null;
+ }
+
+ /**
+ * Returns the currently selected transport type.
+ *
+ * @return The currently selected transport type.
+ */
+ public String getSelectedTransportType() {
+ String type = getEditFieldControlText();
+
+ if (Messages.TransportTypeControl_tcpType_label.equals(type)) type = ITransportTypes.TRANSPORT_TYPE_TCP;
+ else if (Messages.TransportTypeControl_sslType_label.equals(type)) type = ITransportTypes.TRANSPORT_TYPE_SSL;
+ else if (Messages.TransportTypeControl_pipeType_label.equals(type)) type = ITransportTypes.TRANSPORT_TYPE_PIPE;
+ else if (Messages.TransportTypeControl_customType_label.equals(type)) type = ITransportTypes.TRANSPORT_TYPE_CUSTOM;
+
+ return type;
+ }
+
+ /**
+ * Sets the selected transport type to the specified one.
+ *
+ * @param transportType The transport type. Must not be <code>null</code>.
+ */
+ public void setSelectedTransportType(String transportType) {
+ Assert.isNotNull(transportType);
+
+ // Get the transport type label for given transport type
+ String label = getTransportTypeLabel(transportType);
+ int index = SWTControlUtil.indexOf(getEditFieldControl(), label);
+ if (index != -1) SWTControlUtil.select(getEditFieldControl(), index);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl#doRestoreWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
+ */
+ @Override
+ public void doRestoreWidgetValues(IDialogSettings settings, String idPrefix) {
+ // The widget is not user editable and the history is used
+ // for presenting the available transport types. Neither save
+ // or restore the history actively.
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl#doSaveWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
+ */
+ @Override
+ public void doSaveWidgetValues(IDialogSettings settings, String idPrefix) {
+ // The widget is not user editable and the history is used
+ // for presenting the available transport types. Neither save
+ // or restore the history actively.
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/OverviewEditorPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/OverviewEditorPage.java
index a43441f9d..0580ff2e2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/OverviewEditorPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/OverviewEditorPage.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.ui.editor;
-
-import java.io.IOException;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.persistence.interfaces.IURIPersistenceService;
-import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.statushandler.StatusHandlerUtil;
-import org.eclipse.tcf.te.runtime.utils.StatusHelper;
-import org.eclipse.tcf.te.tcf.locator.ScannerRunnable;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.ui.activator.UIPlugin;
-import org.eclipse.tcf.te.tcf.ui.editor.sections.AttributesSection;
-import org.eclipse.tcf.te.tcf.ui.editor.sections.GeneralInformationSection;
-import org.eclipse.tcf.te.tcf.ui.editor.sections.ServicesSection;
-import org.eclipse.tcf.te.tcf.ui.editor.sections.TransportSection;
-import org.eclipse.tcf.te.tcf.ui.help.IContextHelpIds;
-import org.eclipse.tcf.te.tcf.ui.internal.ImageConsts;
-import org.eclipse.tcf.te.tcf.ui.nls.Messages;
-import org.eclipse.tcf.te.ui.forms.CustomFormToolkit;
-import org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.forms.widgets.TableWrapData;
-import org.eclipse.ui.forms.widgets.TableWrapLayout;
-
-/**
- * Peer overview page implementation.
- */
-public class OverviewEditorPage extends AbstractCustomFormToolkitEditorPage {
- // References to the page sub sections
- private GeneralInformationSection infoSection;
- private TransportSection transportSection;
- private ServicesSection servicesSection;
- private AttributesSection attributesSection;
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#dispose()
- */
- @Override
- public void dispose() {
- if (infoSection != null) { infoSection.dispose(); infoSection = null; }
- if (transportSection != null) { transportSection.dispose(); transportSection = null; }
- if (servicesSection != null) { servicesSection.dispose(); servicesSection = null; }
- if (attributesSection != null) { attributesSection.dispose(); attributesSection = null; }
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#getContextHelpId()
- */
- @Override
- protected String getContextHelpId() {
- return IContextHelpIds.OVERVIEW_EDITOR_PAGE;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#getFormTitle()
- */
- @Override
- protected String getFormTitle() {
- return Messages.OverviewEditorPage_title;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#getFormImage()
- */
- @Override
- protected Image getFormImage() {
- return UIPlugin.getImage(ImageConsts.PEER);
- }
-
- /* (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);
-
- // Setup the main panel (using the table wrap layout)
- Composite panel = toolkit.getFormToolkit().createComposite(parent);
- TableWrapLayout layout = new TableWrapLayout();
- layout.makeColumnsEqualWidth = true;
- layout.numColumns = 2;
- panel.setLayout(layout);
- panel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- infoSection = new GeneralInformationSection(getManagedForm(), panel);
- infoSection.getSection().setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP));
- getManagedForm().addPart(infoSection);
-
- transportSection = new TransportSection(getManagedForm(), (Composite)infoSection.getSection().getClient());
- ((GridData)transportSection.getSection().getLayoutData()).horizontalSpan = 2;
- getManagedForm().addPart(transportSection);
-
- servicesSection = new ServicesSection(getManagedForm(), panel);
- TableWrapData layoutData = new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP);
- servicesSection.getSection().setLayoutData(layoutData);
- getManagedForm().addPart(servicesSection);
-
- attributesSection = new AttributesSection(getManagedForm(), panel);
- layoutData = new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.FILL_GRAB);
- layoutData.colspan = 2;
- attributesSection.getSection().setLayoutData(layoutData);
- getManagedForm().addPart(attributesSection);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.forms.editor.FormPage#setActive(boolean)
- */
- @Override
- public void setActive(boolean active) {
- super.setActive(active);
- if (infoSection != null) infoSection.setActive(active);
- if (transportSection != null) transportSection.setActive(active);
- if (servicesSection != null) servicesSection.setActive(active);
- if (attributesSection != null) attributesSection.setActive(active);
- validate();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractEditorPage#doValidate()
- */
- @Override
- protected ValidationResult doValidate() {
- ValidationResult result = super.doValidate();
-
- if (infoSection != null) {
- infoSection.isValid();
- result.setResult(infoSection);
- }
-
- if (transportSection != null) {
- transportSection.isValid();
- result.setResult(transportSection);
- }
-
- if (servicesSection != null) {
- servicesSection.isValid();
- result.setResult(servicesSection);
- }
-
- if (attributesSection != null) {
- attributesSection.isValid();
- result.setResult(attributesSection);
- }
-
- return result;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractEditorPage#setInput(org.eclipse.ui.IEditorInput)
- */
- @Override
- protected void setInput(IEditorInput input) {
- super.setInput(input);
- if (getEditorInputNode() instanceof IPeerModel) {
- ScannerRunnable runnable = new ScannerRunnable(null, ((IPeerModel)getEditorInputNode()));
- Protocol.invokeLater(runnable);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractEditorPage#setInputWithNotify(org.eclipse.ui.IEditorInput)
- */
- @Override
- protected void setInputWithNotify(IEditorInput input) {
- super.setInputWithNotify(input);
- if (getEditorInputNode() instanceof IPeerModel) {
- ScannerRunnable runnable = new ScannerRunnable(null, ((IPeerModel)getEditorInputNode()));
- Protocol.invokeLater(runnable);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractEditorPage#postDoSave(org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void postDoSave(IProgressMonitor monitor) {
- // If necessary, write the changed peer attributes
- final Object input = getEditorInputNode();
- if (input instanceof IPeerModel) {
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- try {
- boolean isStatic = ((IPeerModel)input).isStatic();
- if (isStatic) {
- // Get the persistence service
- IURIPersistenceService uRIPersistenceService = ServiceManager.getInstance().getService(IURIPersistenceService.class);
- if (uRIPersistenceService == null) {
- throw new IOException("Persistence service instance unavailable."); //$NON-NLS-1$
- }
- // Save the peer node to the new persistence storage
- uRIPersistenceService.write(((IPeerModel)input).getPeer(), null);
- }
- } catch (IOException e) {
- // Build up the message template
- String template = NLS.bind(Messages.OverviewEditorPage_error_save, ((IPeerModel)input).getName(), Messages.PossibleCause);
- // Handle the status
- StatusHandlerUtil.handleStatus(StatusHelper.getStatus(e), input, template, null, IContextHelpIds.MESSAGE_SAVE_FAILED, OverviewEditorPage.this, null);
- }
- }
- };
- Assert.isTrue(!Protocol.isDispatchThread());
- Protocol.invokeAndWait(runnable);
-
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- // Trigger a change event for the original data node
- ((IPeerModel)input).fireChangeEvent("properties", null, ((IPeerModel)input).getProperties()); //$NON-NLS-1$
- }
- });
-
- // Force a scan of the peer
- ScannerRunnable runnable2 = new ScannerRunnable(null, ((IPeerModel)input));
- Protocol.invokeLater(runnable2);
- }
- }
-}
+/*******************************************************************************
+ * 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.ui.editor;
+
+import java.io.IOException;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.runtime.persistence.interfaces.IURIPersistenceService;
+import org.eclipse.tcf.te.runtime.services.ServiceManager;
+import org.eclipse.tcf.te.runtime.statushandler.StatusHandlerUtil;
+import org.eclipse.tcf.te.runtime.utils.StatusHelper;
+import org.eclipse.tcf.te.tcf.locator.ScannerRunnable;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.ui.activator.UIPlugin;
+import org.eclipse.tcf.te.tcf.ui.editor.sections.AttributesSection;
+import org.eclipse.tcf.te.tcf.ui.editor.sections.GeneralInformationSection;
+import org.eclipse.tcf.te.tcf.ui.editor.sections.ServicesSection;
+import org.eclipse.tcf.te.tcf.ui.editor.sections.TransportSection;
+import org.eclipse.tcf.te.tcf.ui.help.IContextHelpIds;
+import org.eclipse.tcf.te.tcf.ui.internal.ImageConsts;
+import org.eclipse.tcf.te.tcf.ui.nls.Messages;
+import org.eclipse.tcf.te.ui.forms.CustomFormToolkit;
+import org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+/**
+ * Peer overview page implementation.
+ */
+public class OverviewEditorPage extends AbstractCustomFormToolkitEditorPage {
+ // References to the page sub sections
+ private GeneralInformationSection infoSection;
+ private TransportSection transportSection;
+ private ServicesSection servicesSection;
+ private AttributesSection attributesSection;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#dispose()
+ */
+ @Override
+ public void dispose() {
+ if (infoSection != null) { infoSection.dispose(); infoSection = null; }
+ if (transportSection != null) { transportSection.dispose(); transportSection = null; }
+ if (servicesSection != null) { servicesSection.dispose(); servicesSection = null; }
+ if (attributesSection != null) { attributesSection.dispose(); attributesSection = null; }
+ super.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#getContextHelpId()
+ */
+ @Override
+ protected String getContextHelpId() {
+ return IContextHelpIds.OVERVIEW_EDITOR_PAGE;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#getFormTitle()
+ */
+ @Override
+ protected String getFormTitle() {
+ return Messages.OverviewEditorPage_title;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#getFormImage()
+ */
+ @Override
+ protected Image getFormImage() {
+ return UIPlugin.getImage(ImageConsts.PEER);
+ }
+
+ /* (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);
+
+ // Setup the main panel (using the table wrap layout)
+ Composite panel = toolkit.getFormToolkit().createComposite(parent);
+ TableWrapLayout layout = new TableWrapLayout();
+ layout.makeColumnsEqualWidth = true;
+ layout.numColumns = 2;
+ panel.setLayout(layout);
+ panel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ infoSection = new GeneralInformationSection(getManagedForm(), panel);
+ infoSection.getSection().setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP));
+ getManagedForm().addPart(infoSection);
+
+ transportSection = new TransportSection(getManagedForm(), (Composite)infoSection.getSection().getClient());
+ ((GridData)transportSection.getSection().getLayoutData()).horizontalSpan = 2;
+ getManagedForm().addPart(transportSection);
+
+ servicesSection = new ServicesSection(getManagedForm(), panel);
+ TableWrapData layoutData = new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP);
+ servicesSection.getSection().setLayoutData(layoutData);
+ getManagedForm().addPart(servicesSection);
+
+ attributesSection = new AttributesSection(getManagedForm(), panel);
+ layoutData = new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.FILL_GRAB);
+ layoutData.colspan = 2;
+ attributesSection.getSection().setLayoutData(layoutData);
+ getManagedForm().addPart(attributesSection);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.editor.FormPage#setActive(boolean)
+ */
+ @Override
+ public void setActive(boolean active) {
+ super.setActive(active);
+ if (infoSection != null) infoSection.setActive(active);
+ if (transportSection != null) transportSection.setActive(active);
+ if (servicesSection != null) servicesSection.setActive(active);
+ if (attributesSection != null) attributesSection.setActive(active);
+ validate();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractEditorPage#doValidate()
+ */
+ @Override
+ protected ValidationResult doValidate() {
+ ValidationResult result = super.doValidate();
+
+ if (infoSection != null) {
+ infoSection.isValid();
+ result.setResult(infoSection);
+ }
+
+ if (transportSection != null) {
+ transportSection.isValid();
+ result.setResult(transportSection);
+ }
+
+ if (servicesSection != null) {
+ servicesSection.isValid();
+ result.setResult(servicesSection);
+ }
+
+ if (attributesSection != null) {
+ attributesSection.isValid();
+ result.setResult(attributesSection);
+ }
+
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractEditorPage#setInput(org.eclipse.ui.IEditorInput)
+ */
+ @Override
+ protected void setInput(IEditorInput input) {
+ super.setInput(input);
+ if (getEditorInputNode() instanceof IPeerModel) {
+ ScannerRunnable runnable = new ScannerRunnable(null, ((IPeerModel)getEditorInputNode()));
+ Protocol.invokeLater(runnable);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractEditorPage#setInputWithNotify(org.eclipse.ui.IEditorInput)
+ */
+ @Override
+ protected void setInputWithNotify(IEditorInput input) {
+ super.setInputWithNotify(input);
+ if (getEditorInputNode() instanceof IPeerModel) {
+ ScannerRunnable runnable = new ScannerRunnable(null, ((IPeerModel)getEditorInputNode()));
+ Protocol.invokeLater(runnable);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractEditorPage#postDoSave(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void postDoSave(IProgressMonitor monitor) {
+ // If necessary, write the changed peer attributes
+ final Object input = getEditorInputNode();
+ if (input instanceof IPeerModel) {
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ try {
+ boolean isStatic = ((IPeerModel)input).isStatic();
+ if (isStatic) {
+ // Get the persistence service
+ IURIPersistenceService uRIPersistenceService = ServiceManager.getInstance().getService(IURIPersistenceService.class);
+ if (uRIPersistenceService == null) {
+ throw new IOException("Persistence service instance unavailable."); //$NON-NLS-1$
+ }
+ // Save the peer node to the new persistence storage
+ uRIPersistenceService.write(((IPeerModel)input).getPeer(), null);
+ }
+ } catch (IOException e) {
+ // Build up the message template
+ String template = NLS.bind(Messages.OverviewEditorPage_error_save, ((IPeerModel)input).getName(), Messages.PossibleCause);
+ // Handle the status
+ StatusHandlerUtil.handleStatus(StatusHelper.getStatus(e), input, template, null, IContextHelpIds.MESSAGE_SAVE_FAILED, OverviewEditorPage.this, null);
+ }
+ }
+ };
+ Assert.isTrue(!Protocol.isDispatchThread());
+ Protocol.invokeAndWait(runnable);
+
+ Protocol.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ // Trigger a change event for the original data node
+ ((IPeerModel)input).fireChangeEvent("properties", null, ((IPeerModel)input).getProperties()); //$NON-NLS-1$
+ }
+ });
+
+ // Force a scan of the peer
+ ScannerRunnable runnable2 = new ScannerRunnable(null, ((IPeerModel)input));
+ Protocol.invokeLater(runnable2);
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/controls/InfoSectionPeerNameControl.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/controls/InfoSectionPeerNameControl.java
index 39b60aade..3540aa746 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/controls/InfoSectionPeerNameControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/controls/InfoSectionPeerNameControl.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.ui/src/org/eclipse/tcf/te/tcf/ui/editor/controls/TransportSectionTypeControl.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/controls/TransportSectionTypeControl.java
index 8555c7d13..ec234600c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/controls/TransportSectionTypeControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/controls/TransportSectionTypeControl.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.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/GeneralInformationSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/GeneralInformationSection.java
index 9f41d1561..d36d42cdc 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/GeneralInformationSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/GeneralInformationSection.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.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TransportSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TransportSection.java
index ba41070da..c79084b7e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TransportSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TransportSection.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.ui/src/org/eclipse/tcf/te/tcf/ui/handler/AbstractPeerModelEditorHandlerDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/AbstractPeerModelEditorHandlerDelegate.java
index 9a02f5a00..25b329d69 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/AbstractPeerModelEditorHandlerDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/AbstractPeerModelEditorHandlerDelegate.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.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RefreshHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RefreshHandler.java
index e626c2d34..fb4a11b77 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RefreshHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RefreshHandler.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.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java
index c6e1e3fb5..3be1f4fd7 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/StartDebugCommandHandler.java
@@ -1,106 +1,106 @@
-/**
- * StartDebugCommandHandler.java
- * Created on Jun 29, 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.ui.handler;
-
-import java.util.Iterator;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
-import org.eclipse.tcf.te.runtime.callback.Callback;
-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.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.services.interfaces.IDebugService;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.ui.async.UICallbackInvocationDelegate;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.part.EditorPart;
-
-/**
- * Start debugger command handler implementation.
- */
-public class StartDebugCommandHandler extends AbstractHandler {
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- // Get the active part
- IWorkbenchPart part = HandlerUtil.getActivePart(event);
- // Get the current selection
- ISelection selection = HandlerUtil.getCurrentSelection(event);
-
- // If the handler is invoked from an editor part, ignore the selection and
- // construct an artificial selection from the active editor input.
- if (part instanceof EditorPart) {
- IEditorInput input = ((EditorPart)part).getEditorInput();
- Object element = input != null ? input.getAdapter(Object.class) : null;
- if (element != null) {
- selection = new StructuredSelection(element);
- }
- }
-
- // If the selection is not empty, iterate over the selection and execute
- // the operation for each peer model node in the selection.
- if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
- // Create the collector keeping track of the callbacks for each peer model
- // node within the selection
- final AsyncCallbackCollector collector = new AsyncCallbackCollector(new Callback() {
- @Override
- protected void internalDone(Object caller, IStatus status) {
- // Signal that all operations completed
- }
- }, new UICallbackInvocationDelegate());
-
- Iterator<?> iterator = ((IStructuredSelection)selection).iterator();
- while (iterator.hasNext()) {
- final Object element = iterator.next();
- if (element instanceof IPeerModel) {
- startDebugger((IPeerModel)element, new AsyncCallbackCollector.SimpleCollectorCallback(collector));
- }
- }
-
- // Mark the collector initialization done
- collector.initDone();
- }
-
- return null;
- }
-
- /**
- * Starts the debugger for the given peer model node.
- *
- * @param peerModel The peer model node. Must not be <code>null</code>.
- * @param callback The callback. Must not be <code>null</code>.
- */
- public void startDebugger(final IPeerModel peerModel, final ICallback callback) {
- Assert.isNotNull(peerModel);
- Assert.isNotNull(callback);
-
- IDebugService dbgService = ServiceManager.getInstance().getService(peerModel, IDebugService.class, false);
- if (dbgService != null) {
- // Attach the debugger and all cores (OCDDevices)
- IPropertiesContainer props = new PropertiesContainer();
- dbgService.attach(peerModel, props, null, callback);
- }
- }
-}
+/**
+ * StartDebugCommandHandler.java
+ * Created on Jun 29, 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.ui.handler;
+
+import java.util.Iterator;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
+import org.eclipse.tcf.te.runtime.callback.Callback;
+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.services.ServiceManager;
+import org.eclipse.tcf.te.runtime.services.interfaces.IDebugService;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.ui.async.UICallbackInvocationDelegate;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.part.EditorPart;
+
+/**
+ * Start debugger command handler implementation.
+ */
+public class StartDebugCommandHandler extends AbstractHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ // Get the active part
+ IWorkbenchPart part = HandlerUtil.getActivePart(event);
+ // Get the current selection
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+
+ // If the handler is invoked from an editor part, ignore the selection and
+ // construct an artificial selection from the active editor input.
+ if (part instanceof EditorPart) {
+ IEditorInput input = ((EditorPart)part).getEditorInput();
+ Object element = input != null ? input.getAdapter(Object.class) : null;
+ if (element != null) {
+ selection = new StructuredSelection(element);
+ }
+ }
+
+ // If the selection is not empty, iterate over the selection and execute
+ // the operation for each peer model node in the selection.
+ if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
+ // Create the collector keeping track of the callbacks for each peer model
+ // node within the selection
+ final AsyncCallbackCollector collector = new AsyncCallbackCollector(new Callback() {
+ @Override
+ protected void internalDone(Object caller, IStatus status) {
+ // Signal that all operations completed
+ }
+ }, new UICallbackInvocationDelegate());
+
+ Iterator<?> iterator = ((IStructuredSelection)selection).iterator();
+ while (iterator.hasNext()) {
+ final Object element = iterator.next();
+ if (element instanceof IPeerModel) {
+ startDebugger((IPeerModel)element, new AsyncCallbackCollector.SimpleCollectorCallback(collector));
+ }
+ }
+
+ // Mark the collector initialization done
+ collector.initDone();
+ }
+
+ return null;
+ }
+
+ /**
+ * Starts the debugger for the given peer model node.
+ *
+ * @param peerModel The peer model node. Must not be <code>null</code>.
+ * @param callback The callback. Must not be <code>null</code>.
+ */
+ public void startDebugger(final IPeerModel peerModel, final ICallback callback) {
+ Assert.isNotNull(peerModel);
+ Assert.isNotNull(callback);
+
+ IDebugService dbgService = ServiceManager.getInstance().getService(peerModel, IDebugService.class, false);
+ if (dbgService != null) {
+ // Attach the debugger and all cores (OCDDevices)
+ IPropertiesContainer props = new PropertiesContainer();
+ dbgService.attach(peerModel, props, null, callback);
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/PropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/PropertyTester.java
index f64dc482d..627c79560 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/PropertyTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/PropertyTester.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.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/PeerModelFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/PeerModelFactory.java
index 8a2954d26..64b3b90f3 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/PeerModelFactory.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/PeerModelFactory.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.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/IPreferenceKeys.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/IPreferenceKeys.java
index f25cb8561..ea12e0c95 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/IPreferenceKeys.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/IPreferenceKeys.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.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/PreferencesInitializer.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/PreferencesInitializer.java
index 68c90220f..a14357ec3 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/PreferencesInitializer.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/preferences/PreferencesInitializer.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.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerGeneralSectionContentProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerGeneralSectionContentProvider.java
index f0e856917..ce24112e8 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerGeneralSectionContentProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerGeneralSectionContentProvider.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.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/DelegatingLabelProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/DelegatingLabelProvider.java
index 052a9e7c6..d70571d3f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/DelegatingLabelProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/DelegatingLabelProvider.java
@@ -1,288 +1,288 @@
-/*******************************************************************************
- * 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.ui.navigator;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.tcf.protocol.IPeer;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.utils.net.IPAddressUtil;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
-import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
-import org.eclipse.tcf.te.tcf.locator.model.Model;
-import org.eclipse.tcf.te.tcf.ui.activator.UIPlugin;
-import org.eclipse.tcf.te.tcf.ui.internal.ImageConsts;
-import org.eclipse.tcf.te.tcf.ui.navigator.images.PeerImageDescriptor;
-import org.eclipse.tcf.te.tcf.ui.navigator.nodes.PeerRedirectorGroupNode;
-import org.eclipse.tcf.te.tcf.ui.nls.Messages;
-import org.eclipse.tcf.te.ui.jface.images.AbstractImageDescriptor;
-import org.eclipse.tcf.te.ui.views.extensions.LabelProviderDelegateExtensionPointManager;
-
-
-/**
- * Label provider implementation.
- */
-public class DelegatingLabelProvider extends LabelProvider implements ILabelDecorator {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
- */
- @Override
- public String getText(final Object element) {
- ILabelProvider[] delegates = LabelProviderDelegateExtensionPointManager.getInstance().getDelegates(element, false);
-
- if (delegates != null && delegates.length > 0) {
- String text = delegates[0].getText(element);
- if (text != null) {
- return text;
- }
- }
-
- if (element instanceof IPeerModel || element instanceof IPeer) {
- StringBuilder builder = new StringBuilder();
-
- // Copy the peer node and peer attributes
- final Map<String, Object> attrs = new HashMap<String, Object>();
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- if (element instanceof IPeerModel) {
- attrs.putAll(((IPeerModel)element).getProperties());
- attrs.putAll(((IPeerModel)element).getPeer().getAttributes());
- }
- else if (element instanceof IPeer) {
- attrs.putAll(((IPeer)element).getAttributes());
- }
- }
- };
-
- if (Protocol.isDispatchThread()) {
- runnable.run();
- }
- else {
- Protocol.invokeAndWait(runnable);
- }
-
- // Build up the base label from the peer name
- builder.append((String)attrs.get(IPeer.ATTR_NAME));
-
- // If the label is "TCF Agent" or "TCF Proxy", than append IP/dns.name
- // (if not localhost) and port to the label
- if (isAppendAddressText(builder.toString())) {
- String dnsName = (String)attrs.get("dns.name.transient"); //$NON-NLS-1$
- String ip = (String)attrs.get(IPeer.ATTR_IP_HOST);
- String port = (String)attrs.get(IPeer.ATTR_IP_PORT);
-
- if (ip != null && !"".equals(ip.trim())) { //$NON-NLS-1$
- builder.append(" "); //$NON-NLS-1$
- if (!IPAddressUtil.getInstance().isLocalHost(ip)) {
- builder.append(dnsName != null && !"".equals(dnsName.trim()) ? dnsName.trim() : ip.trim()); //$NON-NLS-1$
- }
-
- if (port != null && !"".equals(port.trim()) && !"1534".equals(port.trim())) { //$NON-NLS-1$ //$NON-NLS-2$
- builder.append(":"); //$NON-NLS-1$
- builder.append(port.trim());
- }
- }
- }
-
- String label = builder.toString();
- if (!"".equals(label.trim())) { //$NON-NLS-1$
- return label;
- }
- } else if (element instanceof PeerRedirectorGroupNode) {
- return Messages.RemotePeerDiscoveryRootNode_label;
- }
-
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Determines if the IP-address and port needs to be appended
- * to the given label.
- * <p>
- * The default implementation returns <code>true</code> if the label is either
- * &quot;TCF Agent&quot; or &quot;TCF Proxy&quot;.
- *
- * @param label The label. Must not be <code>null</code>.
- * @return <code>True</code> if the address shall be appended, <code>false</code> otherwise.
- */
- protected boolean isAppendAddressText(final String label) {
- Assert.isNotNull(label);
-
- boolean append = "TCF Agent".equals(label) || "TCF Proxy".equals(label); //$NON-NLS-1$ //$NON-NLS-2$
-
- if (!append) {
- final AtomicInteger count = new AtomicInteger();
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- count.set(Model.getModel().getService(ILocatorModelLookupService.class).lkupPeerModelByName(label).length);
- }
- };
-
- if (Protocol.isDispatchThread()) runnable.run();
- else Protocol.invokeAndWait(runnable);
-
- append = count.get() > 1;
- }
-
- return append;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
- */
- @Override
- public Image getImage(final Object element) {
- ILabelProvider[] delegates = LabelProviderDelegateExtensionPointManager.getInstance().getDelegates(element, false);
-
- if (delegates != null && delegates.length > 0) {
- Image image = delegates[0].getImage(element);
- if (image != null) {
- return image;
- }
- }
-
- if (element instanceof IPeerModel || element instanceof IPeer) {
- final AtomicBoolean isStatic = new AtomicBoolean();
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- if (element instanceof IPeerModel) {
- isStatic.set(((IPeerModel)element).isStatic());
- }
- else if (element instanceof IPeer) {
- String value = ((IPeer)element).getAttributes().get("static.transient"); //$NON-NLS-1$
- isStatic.set(value != null && Boolean.parseBoolean(value.trim()));
- }
- }
- };
-
- if (Protocol.isDispatchThread()) {
- runnable.run();
- }
- else {
- Protocol.invokeAndWait(runnable);
- }
-
- return isStatic.get() ? UIPlugin.getImage(ImageConsts.PEER) : UIPlugin.getImage(ImageConsts.PEER_DISCOVERED);
- }
- if (element instanceof PeerRedirectorGroupNode) {
- return UIPlugin.getImage(ImageConsts.DISCOVERY_ROOT);
- }
-
- return super.getImage(element);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelDecorator#decorateImage(org.eclipse.swt.graphics.Image, java.lang.Object)
- */
- @Override
- public Image decorateImage(Image image, Object element) {
- Image decoratedImage = null;
-
- if (image != null && element instanceof IPeerModel) {
- ILabelProvider[] delegates = LabelProviderDelegateExtensionPointManager.getInstance().getDelegates(element, false);
- if (delegates != null && delegates.length > 0) {
- if (delegates[0] instanceof ILabelDecorator) {
- Image candidate = ((ILabelDecorator)delegates[0]).decorateImage(image, element);
- if (candidate != null) image = candidate;
- }
- }
-
- boolean isStatic = ((IPeerModel)element).isStatic();
- if (!isStatic) {
- AbstractImageDescriptor descriptor = new PeerImageDescriptor(UIPlugin.getDefault().getImageRegistry(),
- image,
- (IPeerModel)element);
- decoratedImage = UIPlugin.getSharedImage(descriptor);
- }
- }
-
- return decoratedImage;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelDecorator#decorateText(java.lang.String, java.lang.Object)
- */
- @Override
- public String decorateText(final String text, final Object element) {
- String label = text;
-
- ILabelProvider[] delegates = LabelProviderDelegateExtensionPointManager.getInstance().getDelegates(element, false);
- if (delegates != null && delegates.length > 0) {
- if (delegates[0] instanceof ILabelDecorator) {
- String candidate = ((ILabelDecorator)delegates[0]).decorateText(label, element);
- if (candidate != null) label = candidate;
- }
- }
-
- if (element instanceof IPeerModel) {
- final StringBuilder builder = new StringBuilder(label != null && !"".equals(label.trim()) ? label.trim() : "<noname>"); //$NON-NLS-1$ //$NON-NLS-2$
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- doDecorateText(builder, (IPeerModel)element);
- }
- };
-
- if (Protocol.isDispatchThread()) runnable.run();
- else Protocol.invokeAndWait(runnable);
-
- label = builder.toString();
-
- if (!"".equals(label.trim()) && !"<noname>".equals(label.trim())) { //$NON-NLS-1$ //$NON-NLS-2$
- return label;
- }
- }
- return null;
- }
-
- /**
- * Decorate the text with some peer attributes.
- * <p>
- * <b>Note:</b> Must be called with the TCF event dispatch thread.
- *
- * @param builder The string builder to decorate. Must not be <code>null</code>.
- * @param peerModel The peer model node. Must not be <code>null</code>.
- */
- /* default */ void doDecorateText(StringBuilder builder, IPeerModel peerModel) {
- Assert.isNotNull(builder);
- Assert.isNotNull(peerModel);
- Assert.isTrue(Protocol.isDispatchThread());
-
- boolean isStatic = peerModel.isStatic();
-
- int state = peerModel.getIntProperty(IPeerModelProperties.PROP_STATE);
- if (state > IPeerModelProperties.STATE_UNKNOWN
- && (!isStatic
- || state == IPeerModelProperties.STATE_REACHABLE
- || state == IPeerModelProperties.STATE_CONNECTED
- || state == IPeerModelProperties.STATE_WAITING_FOR_READY)) {
- builder.append(" ["); //$NON-NLS-1$
- builder.append(Messages.getString("LabelProviderDelegate_state_" + state)); //$NON-NLS-1$
- builder.append("]"); //$NON-NLS-1$
- }
- }
-}
+/*******************************************************************************
+ * 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.ui.navigator;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.viewers.ILabelDecorator;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.tcf.protocol.IPeer;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.runtime.utils.net.IPAddressUtil;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService;
+import org.eclipse.tcf.te.tcf.locator.model.Model;
+import org.eclipse.tcf.te.tcf.ui.activator.UIPlugin;
+import org.eclipse.tcf.te.tcf.ui.internal.ImageConsts;
+import org.eclipse.tcf.te.tcf.ui.navigator.images.PeerImageDescriptor;
+import org.eclipse.tcf.te.tcf.ui.navigator.nodes.PeerRedirectorGroupNode;
+import org.eclipse.tcf.te.tcf.ui.nls.Messages;
+import org.eclipse.tcf.te.ui.jface.images.AbstractImageDescriptor;
+import org.eclipse.tcf.te.ui.views.extensions.LabelProviderDelegateExtensionPointManager;
+
+
+/**
+ * Label provider implementation.
+ */
+public class DelegatingLabelProvider extends LabelProvider implements ILabelDecorator {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
+ */
+ @Override
+ public String getText(final Object element) {
+ ILabelProvider[] delegates = LabelProviderDelegateExtensionPointManager.getInstance().getDelegates(element, false);
+
+ if (delegates != null && delegates.length > 0) {
+ String text = delegates[0].getText(element);
+ if (text != null) {
+ return text;
+ }
+ }
+
+ if (element instanceof IPeerModel || element instanceof IPeer) {
+ StringBuilder builder = new StringBuilder();
+
+ // Copy the peer node and peer attributes
+ final Map<String, Object> attrs = new HashMap<String, Object>();
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ if (element instanceof IPeerModel) {
+ attrs.putAll(((IPeerModel)element).getProperties());
+ attrs.putAll(((IPeerModel)element).getPeer().getAttributes());
+ }
+ else if (element instanceof IPeer) {
+ attrs.putAll(((IPeer)element).getAttributes());
+ }
+ }
+ };
+
+ if (Protocol.isDispatchThread()) {
+ runnable.run();
+ }
+ else {
+ Protocol.invokeAndWait(runnable);
+ }
+
+ // Build up the base label from the peer name
+ builder.append((String)attrs.get(IPeer.ATTR_NAME));
+
+ // If the label is "TCF Agent" or "TCF Proxy", than append IP/dns.name
+ // (if not localhost) and port to the label
+ if (isAppendAddressText(builder.toString())) {
+ String dnsName = (String)attrs.get("dns.name.transient"); //$NON-NLS-1$
+ String ip = (String)attrs.get(IPeer.ATTR_IP_HOST);
+ String port = (String)attrs.get(IPeer.ATTR_IP_PORT);
+
+ if (ip != null && !"".equals(ip.trim())) { //$NON-NLS-1$
+ builder.append(" "); //$NON-NLS-1$
+ if (!IPAddressUtil.getInstance().isLocalHost(ip)) {
+ builder.append(dnsName != null && !"".equals(dnsName.trim()) ? dnsName.trim() : ip.trim()); //$NON-NLS-1$
+ }
+
+ if (port != null && !"".equals(port.trim()) && !"1534".equals(port.trim())) { //$NON-NLS-1$ //$NON-NLS-2$
+ builder.append(":"); //$NON-NLS-1$
+ builder.append(port.trim());
+ }
+ }
+ }
+
+ String label = builder.toString();
+ if (!"".equals(label.trim())) { //$NON-NLS-1$
+ return label;
+ }
+ } else if (element instanceof PeerRedirectorGroupNode) {
+ return Messages.RemotePeerDiscoveryRootNode_label;
+ }
+
+ return ""; //$NON-NLS-1$
+ }
+
+ /**
+ * Determines if the IP-address and port needs to be appended
+ * to the given label.
+ * <p>
+ * The default implementation returns <code>true</code> if the label is either
+ * &quot;TCF Agent&quot; or &quot;TCF Proxy&quot;.
+ *
+ * @param label The label. Must not be <code>null</code>.
+ * @return <code>True</code> if the address shall be appended, <code>false</code> otherwise.
+ */
+ protected boolean isAppendAddressText(final String label) {
+ Assert.isNotNull(label);
+
+ boolean append = "TCF Agent".equals(label) || "TCF Proxy".equals(label); //$NON-NLS-1$ //$NON-NLS-2$
+
+ if (!append) {
+ final AtomicInteger count = new AtomicInteger();
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ count.set(Model.getModel().getService(ILocatorModelLookupService.class).lkupPeerModelByName(label).length);
+ }
+ };
+
+ if (Protocol.isDispatchThread()) runnable.run();
+ else Protocol.invokeAndWait(runnable);
+
+ append = count.get() > 1;
+ }
+
+ return append;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
+ */
+ @Override
+ public Image getImage(final Object element) {
+ ILabelProvider[] delegates = LabelProviderDelegateExtensionPointManager.getInstance().getDelegates(element, false);
+
+ if (delegates != null && delegates.length > 0) {
+ Image image = delegates[0].getImage(element);
+ if (image != null) {
+ return image;
+ }
+ }
+
+ if (element instanceof IPeerModel || element instanceof IPeer) {
+ final AtomicBoolean isStatic = new AtomicBoolean();
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ if (element instanceof IPeerModel) {
+ isStatic.set(((IPeerModel)element).isStatic());
+ }
+ else if (element instanceof IPeer) {
+ String value = ((IPeer)element).getAttributes().get("static.transient"); //$NON-NLS-1$
+ isStatic.set(value != null && Boolean.parseBoolean(value.trim()));
+ }
+ }
+ };
+
+ if (Protocol.isDispatchThread()) {
+ runnable.run();
+ }
+ else {
+ Protocol.invokeAndWait(runnable);
+ }
+
+ return isStatic.get() ? UIPlugin.getImage(ImageConsts.PEER) : UIPlugin.getImage(ImageConsts.PEER_DISCOVERED);
+ }
+ if (element instanceof PeerRedirectorGroupNode) {
+ return UIPlugin.getImage(ImageConsts.DISCOVERY_ROOT);
+ }
+
+ return super.getImage(element);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ILabelDecorator#decorateImage(org.eclipse.swt.graphics.Image, java.lang.Object)
+ */
+ @Override
+ public Image decorateImage(Image image, Object element) {
+ Image decoratedImage = null;
+
+ if (image != null && element instanceof IPeerModel) {
+ ILabelProvider[] delegates = LabelProviderDelegateExtensionPointManager.getInstance().getDelegates(element, false);
+ if (delegates != null && delegates.length > 0) {
+ if (delegates[0] instanceof ILabelDecorator) {
+ Image candidate = ((ILabelDecorator)delegates[0]).decorateImage(image, element);
+ if (candidate != null) image = candidate;
+ }
+ }
+
+ boolean isStatic = ((IPeerModel)element).isStatic();
+ if (!isStatic) {
+ AbstractImageDescriptor descriptor = new PeerImageDescriptor(UIPlugin.getDefault().getImageRegistry(),
+ image,
+ (IPeerModel)element);
+ decoratedImage = UIPlugin.getSharedImage(descriptor);
+ }
+ }
+
+ return decoratedImage;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ILabelDecorator#decorateText(java.lang.String, java.lang.Object)
+ */
+ @Override
+ public String decorateText(final String text, final Object element) {
+ String label = text;
+
+ ILabelProvider[] delegates = LabelProviderDelegateExtensionPointManager.getInstance().getDelegates(element, false);
+ if (delegates != null && delegates.length > 0) {
+ if (delegates[0] instanceof ILabelDecorator) {
+ String candidate = ((ILabelDecorator)delegates[0]).decorateText(label, element);
+ if (candidate != null) label = candidate;
+ }
+ }
+
+ if (element instanceof IPeerModel) {
+ final StringBuilder builder = new StringBuilder(label != null && !"".equals(label.trim()) ? label.trim() : "<noname>"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ doDecorateText(builder, (IPeerModel)element);
+ }
+ };
+
+ if (Protocol.isDispatchThread()) runnable.run();
+ else Protocol.invokeAndWait(runnable);
+
+ label = builder.toString();
+
+ if (!"".equals(label.trim()) && !"<noname>".equals(label.trim())) { //$NON-NLS-1$ //$NON-NLS-2$
+ return label;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Decorate the text with some peer attributes.
+ * <p>
+ * <b>Note:</b> Must be called with the TCF event dispatch thread.
+ *
+ * @param builder The string builder to decorate. Must not be <code>null</code>.
+ * @param peerModel The peer model node. Must not be <code>null</code>.
+ */
+ /* default */ void doDecorateText(StringBuilder builder, IPeerModel peerModel) {
+ Assert.isNotNull(builder);
+ Assert.isNotNull(peerModel);
+ Assert.isTrue(Protocol.isDispatchThread());
+
+ boolean isStatic = peerModel.isStatic();
+
+ int state = peerModel.getIntProperty(IPeerModelProperties.PROP_STATE);
+ if (state > IPeerModelProperties.STATE_UNKNOWN
+ && (!isStatic
+ || state == IPeerModelProperties.STATE_REACHABLE
+ || state == IPeerModelProperties.STATE_CONNECTED
+ || state == IPeerModelProperties.STATE_WAITING_FOR_READY)) {
+ builder.append(" ["); //$NON-NLS-1$
+ builder.append(Messages.getString("LabelProviderDelegate_state_" + state)); //$NON-NLS-1$
+ builder.append("]"); //$NON-NLS-1$
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ModelListener.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ModelListener.java
index 5af6cf57c..a6ee0b8ec 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ModelListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ModelListener.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.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.java
index 7ee73acc8..232a4ddd5 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/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.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.java
index 5dd691903..376701571 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.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.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java
index ba5ad613b..67bf46944 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.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.tests/src/org/eclipse/tcf/te/tests/concurrent/ConcurrentTestCase.java b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/concurrent/ConcurrentTestCase.java
index 71eae0eff..c9dd495ab 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/concurrent/ConcurrentTestCase.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/concurrent/ConcurrentTestCase.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.tests/src/org/eclipse/tcf/te/tests/stepper/StepperTests.java b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/stepper/StepperTests.java
index 13ac6b91d..81572a4b2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/stepper/StepperTests.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/stepper/StepperTests.java
@@ -1,296 +1,296 @@
-/*******************************************************************************
- * 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.tests.stepper;
-
-import java.util.Map;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
-import org.eclipse.tcf.te.runtime.stepper.StepperManager;
-import org.eclipse.tcf.te.runtime.stepper.context.AbstractStepContext;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStep;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroup;
-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.stepper.Stepper;
-import org.eclipse.tcf.te.tests.CoreTestCase;
-import org.eclipse.tcf.te.tests.stepper.steps.ParameterizedTestStep;
-import org.eclipse.tcf.te.tests.stepper.steps.TestStep;
-
-/**
- * Stepper engine test cases.
- */
-public class StepperTests extends CoreTestCase {
-
- protected static class TestStepContext extends AbstractStepContext {
-
- /**
- * Constructor.
- */
- public TestStepContext(Object contextObject) {
- super(contextObject);
- }
-
- @Override
- public String getId() {
- return "org.eclipse.tcf.te.tests.stepper.TestStepContext"; //$NON-NLS-1$
- }
-
- @Override
- public String getName() {
- return "TestStepContext"; //$NON-NLS-1$
- }
- }
-
- /**
- * Provides a test suite to the caller which combines all single
- * test bundled within this category.
- *
- * @return Test suite containing all test for this test category.
- */
- public static Test getTestSuite() {
- TestSuite testSuite = new TestSuite("Test stepper engine"); //$NON-NLS-1$
-
- // add ourself to the test suite
- testSuite.addTestSuite(StepperTests.class);
-
- return testSuite;
- }
-
- /**
- * Test the stepper extension point mechanism.
- */
- public void testStepperContributions() {
- assertNotNull("Unexpected return value 'null'.", StepperManager.getInstance()); //$NON-NLS-1$
- }
-
- /**
- * Test the steps extension point mechanism.
- */
- public void testStepContributions() {
- assertNotNull("Unexpected return value 'null'.", StepperManager.getInstance()); //$NON-NLS-1$
- assertNotNull("Unexpected return value 'null'.", StepperManager.getInstance().getStepExtManager()); //$NON-NLS-1$
-
- IStep[] steps = StepperManager.getInstance().getStepExtManager().getSteps(false);
- int testStepCount = 0;
-
- for (IStep step : steps) {
- if (step.getId().startsWith("org.eclipse.tcf.te.tests.stepper.step")) { //$NON-NLS-1$
- testStepCount++;
- } else {
- continue;
- }
-
- if (step.getId().endsWith(".step1")) { //$NON-NLS-1$
- assertEquals("Unexpected step label found.", "Test Step 1", step.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Unexpected step description found.", "", step.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("Unexpected step class type found.", step instanceof TestStep); //$NON-NLS-1$
- assertEquals("Unexpected number of dependencies found.", 0, step.getDependencies().length); //$NON-NLS-1$
- }
-
- if (step.getId().endsWith(".step2")) { //$NON-NLS-1$
- assertEquals("Unexpected step label found.", "Test Step 2", step.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Unexpected step description found.", "", step.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("Unexpected step class type found.", step instanceof ParameterizedTestStep); //$NON-NLS-1$
-
- Map<?,?> params = ((ParameterizedTestStep)step).params;
- assertNotNull("Unexpected value 'null'.", params); //$NON-NLS-1$
- assertEquals("Unexpected number of parameter found.", 1, params.keySet().size()); //$NON-NLS-1$
- assertTrue("Missing expected key 'param1'.", params.containsKey("param1")); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("Missing expected value 'value1'.", params.containsValue("value1")); //$NON-NLS-1$ //$NON-NLS-2$
-
- assertEquals("Unexpected number of dependencies found.", 0, step.getDependencies().length); //$NON-NLS-1$
- }
-
- if (step.getId().endsWith(".step3")) { //$NON-NLS-1$
- assertEquals("Unexpected step label found.", "Test Step 3", step.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Unexpected step description found.", "Just another test step", step.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("Unexpected step class type found.", step instanceof TestStep); //$NON-NLS-1$
- assertEquals("Unexpected number of dependencies found.", 0, step.getDependencies().length); //$NON-NLS-1$
- }
-
- if (step.getId().endsWith(".step4")) { //$NON-NLS-1$
- assertEquals("Unexpected step label found.", "Test Step 4", step.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Unexpected step description found.", "", step.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("Unexpected step class type found.", step instanceof TestStep); //$NON-NLS-1$
- assertEquals("Unexpected number of dependencies found.", 1, step.getDependencies().length); //$NON-NLS-1$
- }
-
- if (step.getId().endsWith(".step5")) { //$NON-NLS-1$
- assertEquals("Unexpected step label found.", "Test Step 5", step.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Unexpected step description found.", "", step.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("Unexpected step class type found.", step instanceof TestStep); //$NON-NLS-1$
- assertEquals("Unexpected number of dependencies found.", 0, step.getDependencies().length); //$NON-NLS-1$
- }
- }
-
- assertEquals("Unexpected number of test steps found.", 5, testStepCount); //$NON-NLS-1$
- }
-
- /**
- * Test the step group extension point mechanism.
- */
- public void testStepGroupContributions() {
- assertNotNull("Unexpected return value 'null'.", StepperManager.getInstance()); //$NON-NLS-1$
- assertNotNull("Unexpected return value 'null'.", StepperManager.getInstance().getStepGroupExtManager()); //$NON-NLS-1$
-
- IStepGroup[] stepGroups = StepperManager.getInstance().getStepGroupExtManager().getStepGroups(false);
- int testStepGroupCount = 0;
-
- for (IStepGroup stepGroup : stepGroups) {
- if (stepGroup.getId().startsWith("org.eclipse.tcf.te.tests.stepper.stepGroup")) { //$NON-NLS-1$
- testStepGroupCount++;
- } else {
- continue;
- }
-
- Throwable error = null;
- String message = null;
- IStepGroupable[] steps = null;
-
- if (stepGroup.getId().endsWith(".stepGroup1")) { //$NON-NLS-1$
- assertEquals("Unexpected step group label found.", "Test Step Group 1", stepGroup.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Unexpected step description found.", "", stepGroup.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$
- assertFalse("Step group is locked but should not.", stepGroup.isLocked()); //$NON-NLS-1$
- assertNull("Unexpected non-null value.", stepGroup.getStepGroupIterator()); //$NON-NLS-1$
-
- try {
- steps = stepGroup.getSteps(new TestStepContext(this));
- } catch (CoreException e) {
- error = e;
- message = e.getLocalizedMessage();
- }
- assertNull("Failed to determine steps from step group. Possible cause: " + message, error); //$NON-NLS-1$
- assertNotNull("Unexpected return value 'null'.", steps); //$NON-NLS-1$
- assertEquals("Unexpected number of steps returned.", 0, steps.length); //$NON-NLS-1$
- }
-
- if (stepGroup.getId().endsWith(".stepGroup2")) { //$NON-NLS-1$
- assertEquals("Unexpected step group label found.", "Test Step Group 2", stepGroup.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Unexpected step description found.", "Just a step group description", stepGroup.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$
- assertTrue("Step group is not locked but should.", stepGroup.isLocked()); //$NON-NLS-1$
- assertNull("Unexpected non-null value.", stepGroup.getStepGroupIterator()); //$NON-NLS-1$
-
- error = null; message = null; steps = null;
- try {
- steps = stepGroup.getSteps(new TestStepContext(this));
- } catch (CoreException e) {
- error = e;
- message = e.getLocalizedMessage();
- }
- assertNull("Failed to determine steps from step group. Possible cause: " + message, error); //$NON-NLS-1$
- assertNotNull("Unexpected return value 'null'.", steps); //$NON-NLS-1$
- assertEquals("Unexpected number of steps returned.", 0, steps.length); //$NON-NLS-1$
- }
-
- if (stepGroup.getId().endsWith(".stepGroup3")) { //$NON-NLS-1$
- assertEquals("Unexpected step group label found.", "Test Step Group 3", stepGroup.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Unexpected step description found.", "", stepGroup.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$
- assertFalse("Step group is locked but should not.", stepGroup.isLocked()); //$NON-NLS-1$
- assertNull("Unexpected non-null value.", stepGroup.getStepGroupIterator()); //$NON-NLS-1$
-
- error = null; message = null; steps = null;
- try {
- steps = stepGroup.getSteps(new TestStepContext(this));
- } catch (CoreException e) {
- error = e;
- message = e.getLocalizedMessage();
- }
- assertNull("Failed to determine steps from step group. Possible cause: " + message, error); //$NON-NLS-1$
- assertNotNull("Unexpected return value 'null'.", steps); //$NON-NLS-1$
- assertEquals("Unexpected number of steps returned.", 4, steps.length); //$NON-NLS-1$
-
- assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step1", steps[0].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step2", steps[1].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step3", steps[2].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step4", steps[3].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-
- if (stepGroup.getId().endsWith(".stepGroup4")) { //$NON-NLS-1$
- assertEquals("Unexpected step group label found.", "Test Step Group 4", stepGroup.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Unexpected step description found.", "", stepGroup.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$
- assertFalse("Step group is locked but should not.", stepGroup.isLocked()); //$NON-NLS-1$
- assertNull("Unexpected non-null value.", stepGroup.getStepGroupIterator()); //$NON-NLS-1$
-
- error = null; message = null; steps = null;
- try {
- steps = stepGroup.getSteps(new TestStepContext(this));
- } catch (CoreException e) {
- error = e;
- message = e.getLocalizedMessage();
- }
- assertNull("Failed to determine steps from step group. Possible cause: " + message, error); //$NON-NLS-1$
- assertNotNull("Unexpected return value 'null'.", steps); //$NON-NLS-1$
- assertEquals("Unexpected number of steps returned.", 5, steps.length); //$NON-NLS-1$
-
- assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step1", steps[0].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step2", steps[1].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step3", steps[2].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step4", steps[3].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
-
- error = null; message = null; steps = null;
- try {
- steps = stepGroup.getSteps(new TestStepContext(this));
- } catch (CoreException e) {
- error = e;
- message = e.getLocalizedMessage();
- }
- assertNull("Failed to determine steps from step group. Possible cause: " + message, error); //$NON-NLS-1$
- assertNotNull("Unexpected return value 'null'.", steps); //$NON-NLS-1$
- assertEquals("Unexpected number of steps returned.", 5, steps.length); //$NON-NLS-1$
-
- assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step1", steps[0].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step2", steps[1].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step3", steps[2].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step4", steps[3].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
- assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step5", steps[4].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- assertEquals("Unexpected number of test step groups found.", 4, testStepGroupCount); //$NON-NLS-1$
- }
-
- public void testExecuteStepGroup() {
- final IStepper stepper = new Stepper("testExecuteStepGroup"); //$NON-NLS-1$
-
- IPropertiesContainer properties = new PropertiesContainer();
-
- // Initialize the stepper
- stepper.initialize(new TestStepContext(this), "org.eclipse.tcf.te.tests.stepper.stepGroup4", properties, null); //$NON-NLS-1$
-
- ExecutorsUtil.execute(new Runnable() {
- @Override
- public void run() {
- // Execute
- try {
- stepper.execute();
- }
- catch (Exception e) {
- assertNull("Unexpected exception when executing step group", e); //$NON-NLS-1$
- }
- }
- });
-
- // Wait for the stepper to be finished
- assertFalse("Timeout executing step group", ExecutorsUtil.waitAndExecute(10000, new IStepper.ExecutionFinishedConditionTester(stepper))); //$NON-NLS-1$
-
- assertNotNull("Missing executed step 1", properties.getProperty("org.eclipse.tcf.te.tests.stepper.step1")); //$NON-NLS-1$ //$NON-NLS-2$
- assertNotNull("Missing executed step 2", properties.getProperty("org.eclipse.tcf.te.tests.stepper.step2")); //$NON-NLS-1$ //$NON-NLS-2$
- assertNotNull("Missing executed step 3", properties.getProperty("org.eclipse.tcf.te.tests.stepper.step3")); //$NON-NLS-1$ //$NON-NLS-2$
- assertNotNull("Missing executed step 4", properties.getProperty("org.eclipse.tcf.te.tests.stepper.step4")); //$NON-NLS-1$ //$NON-NLS-2$
- assertNotNull("Missing executed step 5", properties.getProperty("org.eclipse.tcf.te.tests.stepper.step5")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-}
+/*******************************************************************************
+ * 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.tests.stepper;
+
+import java.util.Map;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.tcf.te.runtime.concurrent.util.ExecutorsUtil;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
+import org.eclipse.tcf.te.runtime.stepper.StepperManager;
+import org.eclipse.tcf.te.runtime.stepper.context.AbstractStepContext;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStep;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepGroup;
+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.stepper.Stepper;
+import org.eclipse.tcf.te.tests.CoreTestCase;
+import org.eclipse.tcf.te.tests.stepper.steps.ParameterizedTestStep;
+import org.eclipse.tcf.te.tests.stepper.steps.TestStep;
+
+/**
+ * Stepper engine test cases.
+ */
+public class StepperTests extends CoreTestCase {
+
+ protected static class TestStepContext extends AbstractStepContext {
+
+ /**
+ * Constructor.
+ */
+ public TestStepContext(Object contextObject) {
+ super(contextObject);
+ }
+
+ @Override
+ public String getId() {
+ return "org.eclipse.tcf.te.tests.stepper.TestStepContext"; //$NON-NLS-1$
+ }
+
+ @Override
+ public String getName() {
+ return "TestStepContext"; //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Provides a test suite to the caller which combines all single
+ * test bundled within this category.
+ *
+ * @return Test suite containing all test for this test category.
+ */
+ public static Test getTestSuite() {
+ TestSuite testSuite = new TestSuite("Test stepper engine"); //$NON-NLS-1$
+
+ // add ourself to the test suite
+ testSuite.addTestSuite(StepperTests.class);
+
+ return testSuite;
+ }
+
+ /**
+ * Test the stepper extension point mechanism.
+ */
+ public void testStepperContributions() {
+ assertNotNull("Unexpected return value 'null'.", StepperManager.getInstance()); //$NON-NLS-1$
+ }
+
+ /**
+ * Test the steps extension point mechanism.
+ */
+ public void testStepContributions() {
+ assertNotNull("Unexpected return value 'null'.", StepperManager.getInstance()); //$NON-NLS-1$
+ assertNotNull("Unexpected return value 'null'.", StepperManager.getInstance().getStepExtManager()); //$NON-NLS-1$
+
+ IStep[] steps = StepperManager.getInstance().getStepExtManager().getSteps(false);
+ int testStepCount = 0;
+
+ for (IStep step : steps) {
+ if (step.getId().startsWith("org.eclipse.tcf.te.tests.stepper.step")) { //$NON-NLS-1$
+ testStepCount++;
+ } else {
+ continue;
+ }
+
+ if (step.getId().endsWith(".step1")) { //$NON-NLS-1$
+ assertEquals("Unexpected step label found.", "Test Step 1", step.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Unexpected step description found.", "", step.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Unexpected step class type found.", step instanceof TestStep); //$NON-NLS-1$
+ assertEquals("Unexpected number of dependencies found.", 0, step.getDependencies().length); //$NON-NLS-1$
+ }
+
+ if (step.getId().endsWith(".step2")) { //$NON-NLS-1$
+ assertEquals("Unexpected step label found.", "Test Step 2", step.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Unexpected step description found.", "", step.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Unexpected step class type found.", step instanceof ParameterizedTestStep); //$NON-NLS-1$
+
+ Map<?,?> params = ((ParameterizedTestStep)step).params;
+ assertNotNull("Unexpected value 'null'.", params); //$NON-NLS-1$
+ assertEquals("Unexpected number of parameter found.", 1, params.keySet().size()); //$NON-NLS-1$
+ assertTrue("Missing expected key 'param1'.", params.containsKey("param1")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Missing expected value 'value1'.", params.containsValue("value1")); //$NON-NLS-1$ //$NON-NLS-2$
+
+ assertEquals("Unexpected number of dependencies found.", 0, step.getDependencies().length); //$NON-NLS-1$
+ }
+
+ if (step.getId().endsWith(".step3")) { //$NON-NLS-1$
+ assertEquals("Unexpected step label found.", "Test Step 3", step.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Unexpected step description found.", "Just another test step", step.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Unexpected step class type found.", step instanceof TestStep); //$NON-NLS-1$
+ assertEquals("Unexpected number of dependencies found.", 0, step.getDependencies().length); //$NON-NLS-1$
+ }
+
+ if (step.getId().endsWith(".step4")) { //$NON-NLS-1$
+ assertEquals("Unexpected step label found.", "Test Step 4", step.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Unexpected step description found.", "", step.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Unexpected step class type found.", step instanceof TestStep); //$NON-NLS-1$
+ assertEquals("Unexpected number of dependencies found.", 1, step.getDependencies().length); //$NON-NLS-1$
+ }
+
+ if (step.getId().endsWith(".step5")) { //$NON-NLS-1$
+ assertEquals("Unexpected step label found.", "Test Step 5", step.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Unexpected step description found.", "", step.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Unexpected step class type found.", step instanceof TestStep); //$NON-NLS-1$
+ assertEquals("Unexpected number of dependencies found.", 0, step.getDependencies().length); //$NON-NLS-1$
+ }
+ }
+
+ assertEquals("Unexpected number of test steps found.", 5, testStepCount); //$NON-NLS-1$
+ }
+
+ /**
+ * Test the step group extension point mechanism.
+ */
+ public void testStepGroupContributions() {
+ assertNotNull("Unexpected return value 'null'.", StepperManager.getInstance()); //$NON-NLS-1$
+ assertNotNull("Unexpected return value 'null'.", StepperManager.getInstance().getStepGroupExtManager()); //$NON-NLS-1$
+
+ IStepGroup[] stepGroups = StepperManager.getInstance().getStepGroupExtManager().getStepGroups(false);
+ int testStepGroupCount = 0;
+
+ for (IStepGroup stepGroup : stepGroups) {
+ if (stepGroup.getId().startsWith("org.eclipse.tcf.te.tests.stepper.stepGroup")) { //$NON-NLS-1$
+ testStepGroupCount++;
+ } else {
+ continue;
+ }
+
+ Throwable error = null;
+ String message = null;
+ IStepGroupable[] steps = null;
+
+ if (stepGroup.getId().endsWith(".stepGroup1")) { //$NON-NLS-1$
+ assertEquals("Unexpected step group label found.", "Test Step Group 1", stepGroup.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Unexpected step description found.", "", stepGroup.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertFalse("Step group is locked but should not.", stepGroup.isLocked()); //$NON-NLS-1$
+ assertNull("Unexpected non-null value.", stepGroup.getStepGroupIterator()); //$NON-NLS-1$
+
+ try {
+ steps = stepGroup.getSteps(new TestStepContext(this));
+ } catch (CoreException e) {
+ error = e;
+ message = e.getLocalizedMessage();
+ }
+ assertNull("Failed to determine steps from step group. Possible cause: " + message, error); //$NON-NLS-1$
+ assertNotNull("Unexpected return value 'null'.", steps); //$NON-NLS-1$
+ assertEquals("Unexpected number of steps returned.", 0, steps.length); //$NON-NLS-1$
+ }
+
+ if (stepGroup.getId().endsWith(".stepGroup2")) { //$NON-NLS-1$
+ assertEquals("Unexpected step group label found.", "Test Step Group 2", stepGroup.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Unexpected step description found.", "Just a step group description", stepGroup.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Step group is not locked but should.", stepGroup.isLocked()); //$NON-NLS-1$
+ assertNull("Unexpected non-null value.", stepGroup.getStepGroupIterator()); //$NON-NLS-1$
+
+ error = null; message = null; steps = null;
+ try {
+ steps = stepGroup.getSteps(new TestStepContext(this));
+ } catch (CoreException e) {
+ error = e;
+ message = e.getLocalizedMessage();
+ }
+ assertNull("Failed to determine steps from step group. Possible cause: " + message, error); //$NON-NLS-1$
+ assertNotNull("Unexpected return value 'null'.", steps); //$NON-NLS-1$
+ assertEquals("Unexpected number of steps returned.", 0, steps.length); //$NON-NLS-1$
+ }
+
+ if (stepGroup.getId().endsWith(".stepGroup3")) { //$NON-NLS-1$
+ assertEquals("Unexpected step group label found.", "Test Step Group 3", stepGroup.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Unexpected step description found.", "", stepGroup.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertFalse("Step group is locked but should not.", stepGroup.isLocked()); //$NON-NLS-1$
+ assertNull("Unexpected non-null value.", stepGroup.getStepGroupIterator()); //$NON-NLS-1$
+
+ error = null; message = null; steps = null;
+ try {
+ steps = stepGroup.getSteps(new TestStepContext(this));
+ } catch (CoreException e) {
+ error = e;
+ message = e.getLocalizedMessage();
+ }
+ assertNull("Failed to determine steps from step group. Possible cause: " + message, error); //$NON-NLS-1$
+ assertNotNull("Unexpected return value 'null'.", steps); //$NON-NLS-1$
+ assertEquals("Unexpected number of steps returned.", 4, steps.length); //$NON-NLS-1$
+
+ assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step1", steps[0].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step2", steps[1].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step3", steps[2].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step4", steps[3].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+
+ if (stepGroup.getId().endsWith(".stepGroup4")) { //$NON-NLS-1$
+ assertEquals("Unexpected step group label found.", "Test Step Group 4", stepGroup.getLabel()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Unexpected step description found.", "", stepGroup.getDescription()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertFalse("Step group is locked but should not.", stepGroup.isLocked()); //$NON-NLS-1$
+ assertNull("Unexpected non-null value.", stepGroup.getStepGroupIterator()); //$NON-NLS-1$
+
+ error = null; message = null; steps = null;
+ try {
+ steps = stepGroup.getSteps(new TestStepContext(this));
+ } catch (CoreException e) {
+ error = e;
+ message = e.getLocalizedMessage();
+ }
+ assertNull("Failed to determine steps from step group. Possible cause: " + message, error); //$NON-NLS-1$
+ assertNotNull("Unexpected return value 'null'.", steps); //$NON-NLS-1$
+ assertEquals("Unexpected number of steps returned.", 5, steps.length); //$NON-NLS-1$
+
+ assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step1", steps[0].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step2", steps[1].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step3", steps[2].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step4", steps[3].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
+
+ error = null; message = null; steps = null;
+ try {
+ steps = stepGroup.getSteps(new TestStepContext(this));
+ } catch (CoreException e) {
+ error = e;
+ message = e.getLocalizedMessage();
+ }
+ assertNull("Failed to determine steps from step group. Possible cause: " + message, error); //$NON-NLS-1$
+ assertNotNull("Unexpected return value 'null'.", steps); //$NON-NLS-1$
+ assertEquals("Unexpected number of steps returned.", 5, steps.length); //$NON-NLS-1$
+
+ assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step1", steps[0].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step2", steps[1].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step3", steps[2].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step4", steps[3].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Unexpected step order.", "org.eclipse.tcf.te.tests.stepper.step5", steps[4].getExtension().getId()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ assertEquals("Unexpected number of test step groups found.", 4, testStepGroupCount); //$NON-NLS-1$
+ }
+
+ public void testExecuteStepGroup() {
+ final IStepper stepper = new Stepper("testExecuteStepGroup"); //$NON-NLS-1$
+
+ IPropertiesContainer properties = new PropertiesContainer();
+
+ // Initialize the stepper
+ stepper.initialize(new TestStepContext(this), "org.eclipse.tcf.te.tests.stepper.stepGroup4", properties, null); //$NON-NLS-1$
+
+ ExecutorsUtil.execute(new Runnable() {
+ @Override
+ public void run() {
+ // Execute
+ try {
+ stepper.execute();
+ }
+ catch (Exception e) {
+ assertNull("Unexpected exception when executing step group", e); //$NON-NLS-1$
+ }
+ }
+ });
+
+ // Wait for the stepper to be finished
+ assertFalse("Timeout executing step group", ExecutorsUtil.waitAndExecute(10000, new IStepper.ExecutionFinishedConditionTester(stepper))); //$NON-NLS-1$
+
+ assertNotNull("Missing executed step 1", properties.getProperty("org.eclipse.tcf.te.tests.stepper.step1")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertNotNull("Missing executed step 2", properties.getProperty("org.eclipse.tcf.te.tests.stepper.step2")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertNotNull("Missing executed step 3", properties.getProperty("org.eclipse.tcf.te.tests.stepper.step3")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertNotNull("Missing executed step 4", properties.getProperty("org.eclipse.tcf.te.tests.stepper.step4")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertNotNull("Missing executed step 5", properties.getProperty("org.eclipse.tcf.te.tests.stepper.step5")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/stepper/steps/ParameterizedTestStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/stepper/steps/ParameterizedTestStep.java
index 050b78a72..5558db5d5 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/stepper/steps/ParameterizedTestStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/stepper/steps/ParameterizedTestStep.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.tests/src/org/eclipse/tcf/te/tests/stepper/steps/TestStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/stepper/steps/TestStep.java
index 9deeedb14..cb0832612 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/stepper/steps/TestStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/stepper/steps/TestStep.java
@@ -1,41 +1,41 @@
-/*******************************************************************************
- * 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.tests.stepper.steps;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Status;
-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.stepper.steps.AbstractStep;
-
-/**
- * Empty test step contribution.
- */
-public class TestStep 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 {
- }
-
- /* (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) {
- data.setProperty(getId(), fullQualifiedId.toString());
- callback.done(this, Status.OK_STATUS);
- }
-}
+/*******************************************************************************
+ * 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.tests.stepper.steps;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Status;
+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.stepper.steps.AbstractStep;
+
+/**
+ * Empty test step contribution.
+ */
+public class TestStep 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 {
+ }
+
+ /* (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) {
+ data.setProperty(getId(), fullQualifiedId.toString());
+ callback.done(this, Status.OK_STATUS);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/suites/AllTests.java b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/suites/AllTests.java
index 6fb7bf70b..ebaea1608 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/suites/AllTests.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/suites/AllTests.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.tests/src/org/eclipse/tcf/te/tests/tcf/TcfTestCase.java b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/TcfTestCase.java
index 0b6bb7434..ba8b90af6 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/TcfTestCase.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/TcfTestCase.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.tests/src/org/eclipse/tcf/te/tests/tcf/launch/TcfLaunchTests.java b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/launch/TcfLaunchTests.java
index 24e4067ba..a08e9c631 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/launch/TcfLaunchTests.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/launch/TcfLaunchTests.java
@@ -1,143 +1,143 @@
-/*******************************************************************************
- * 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.tests.tcf.launch;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-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.debug.core.ILaunchManager;
-import org.eclipse.tcf.te.launch.core.lm.LaunchManager;
-import org.eclipse.tcf.te.launch.core.lm.LaunchSpecification;
-import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification;
-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.runtime.model.interfaces.IModelNode;
-import org.eclipse.tcf.te.runtime.services.filetransfer.FileTransferItem;
-import org.eclipse.tcf.te.runtime.services.interfaces.filetransfer.IFileTransferItem;
-import org.eclipse.tcf.te.runtime.utils.Host;
-import org.eclipse.tcf.te.tcf.launch.core.interfaces.ILaunchTypes;
-import org.eclipse.tcf.te.tcf.processes.core.interfaces.steps.IProcessesStepAttributes;
-import org.eclipse.tcf.te.tests.tcf.TcfTestCase;
-
-/**
- * TCF Launch tests.
- */
-public class TcfLaunchTests extends TcfTestCase {
-
- /**
- * Provides a test suite to the caller which combines all single
- * test bundled within this category.
- *
- * @return Test suite containing all test for this test category.
- */
- public static Test getTestSuite() {
- TestSuite testSuite = new TestSuite("TCF Launch tests"); //$NON-NLS-1$
-
- // add ourself to the test suite
- testSuite.addTestSuite(TcfLaunchTests.class);
-
- return testSuite;
- }
-
-
- public void testRemoteAppLaunch() {
- final ILaunchSpecification spec = new LaunchSpecification(ILaunchTypes.REMOTE_APPLICATION, ILaunchManager.RUN_MODE);
- LaunchContextsPersistenceDelegate.setLaunchContexts(spec, new IModelNode[]{peerModel});
-
- IPath helloWorldLocation = getHelloWorldLocation();
- assertTrue("Missing hello world example for current OS and Arch:" + Platform.getOS() + "/" + Platform.getOSArch(), //$NON-NLS-1$ //$NON-NLS-2$
- helloWorldLocation != null &&
- helloWorldLocation.toFile().exists() &&
- helloWorldLocation.toFile().canRead());
-
- String temp = System.getProperty("java.io.tmpdir"); //$NON-NLS-1$
- IPath tempDir = temp != null ? new Path(temp) : null;
- assertNotNull("Missing java temp directory", tempDir); //$NON-NLS-1$
-
- // If the temporary directory is not writable for whatever reason to us,
- // fallback to the users home directory
- if (!tempDir.toFile().canWrite()) {
- temp = System.getProperty("user.home"); //$NON-NLS-1$
- tempDir = temp != null ? new Path(temp) : null;
- assertNotNull("Missing user home directory", tempDir); //$NON-NLS-1$
- }
-
- tempDir = tempDir.append(TcfLaunchTests.class.getSimpleName());
- assertNotNull("Cannot append test case specific temp directory", tempDir); //$NON-NLS-1$
- if (!tempDir.toFile().exists()) {
- assertTrue("Failed to create path " + tempDir.toString(), tempDir.toFile().mkdirs()); //$NON-NLS-1$
- }
- assertTrue("Temporary file location is not writable (" + tempDir.toOSString() + ")", tempDir.toFile().canWrite()); //$NON-NLS-1$ //$NON-NLS-2$
-
- IPath tempHelloWorld = tempDir.append(helloWorldLocation.lastSegment());
- if (tempHelloWorld.toFile().exists()) {
- tempHelloWorld.toFile().setWritable(true, false);
- tempHelloWorld.toFile().delete();
- }
- assertFalse("Cannot delete process image " + tempHelloWorld.toOSString(), tempHelloWorld.toFile().exists()); //$NON-NLS-1$
-
- IPath outFile = tempDir.append("/HelloWorld.out"); //$NON-NLS-1$
- if (outFile.toFile().exists()) {
- outFile.toFile().delete();
- }
- assertFalse("Cannot delete console output file " + outFile.toOSString(), outFile.toFile().exists()); //$NON-NLS-1$
-
- FileTransfersPersistenceDelegate.setFileTransfers(spec, new IFileTransferItem[]{new FileTransferItem(helloWorldLocation, tempDir)});
- spec.addAttribute(IProcessesStepAttributes.ATTR_PROCESS_IMAGE, tempHelloWorld.toOSString());
-
- ILaunchConfiguration config = null;
- try {
- config = LaunchManager.getInstance().getLaunchConfiguration(spec, true);
- ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
- wc.setAttribute("org.eclipse.debug.ui.ATTR_CONSOLE_OUTPUT_ON", false); //$NON-NLS-1$
- wc.setAttribute("org.eclipse.debug.ui.ATTR_CAPTURE_IN_FILE", outFile.toOSString()); //$NON-NLS-1$
- config = wc.doSave();
- }
- catch (Exception e) {
- assertNull("Unexpected exception when creating launch: " + e, e); //$NON-NLS-1$
- }
-
- try {
- LaunchManager.getInstance().launch(config, ILaunchManager.RUN_MODE, false, new NullProgressMonitor());
- }
- catch (Exception e) {
- assertNull("Unexpected exception when launching hello world: " + e, e); //$NON-NLS-1$
- }
-
- int counter = 20;
- boolean exist = outFile.toFile().exists() && outFile.toFile().length() > 0;
- while (!exist && counter > 0) {
- try {
- Thread.sleep(200);
- } catch (InterruptedException e) { /* ignored on purpose */ }
- exist = outFile.toFile().exists() && outFile.toFile().length() > 0;
- counter--;
- }
- assertTrue("Missing console output file (" + outFile.toOSString() + ")", exist); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- private IPath getHelloWorldLocation() {
- IPath path = getDataLocation("helloWorld", true, true); //$NON-NLS-1$
- if (path != null) {
- path = path.append("HelloWorld"); //$NON-NLS-1$
- if (Host.isWindowsHost()) {
- path = path.addFileExtension("exe"); //$NON-NLS-1$
- }
- }
-
- return path;
- }
-}
+/*******************************************************************************
+ * 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.tests.tcf.launch;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+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.debug.core.ILaunchManager;
+import org.eclipse.tcf.te.launch.core.lm.LaunchManager;
+import org.eclipse.tcf.te.launch.core.lm.LaunchSpecification;
+import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification;
+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.runtime.model.interfaces.IModelNode;
+import org.eclipse.tcf.te.runtime.services.filetransfer.FileTransferItem;
+import org.eclipse.tcf.te.runtime.services.interfaces.filetransfer.IFileTransferItem;
+import org.eclipse.tcf.te.runtime.utils.Host;
+import org.eclipse.tcf.te.tcf.launch.core.interfaces.ILaunchTypes;
+import org.eclipse.tcf.te.tcf.processes.core.interfaces.steps.IProcessesStepAttributes;
+import org.eclipse.tcf.te.tests.tcf.TcfTestCase;
+
+/**
+ * TCF Launch tests.
+ */
+public class TcfLaunchTests extends TcfTestCase {
+
+ /**
+ * Provides a test suite to the caller which combines all single
+ * test bundled within this category.
+ *
+ * @return Test suite containing all test for this test category.
+ */
+ public static Test getTestSuite() {
+ TestSuite testSuite = new TestSuite("TCF Launch tests"); //$NON-NLS-1$
+
+ // add ourself to the test suite
+ testSuite.addTestSuite(TcfLaunchTests.class);
+
+ return testSuite;
+ }
+
+
+ public void testRemoteAppLaunch() {
+ final ILaunchSpecification spec = new LaunchSpecification(ILaunchTypes.REMOTE_APPLICATION, ILaunchManager.RUN_MODE);
+ LaunchContextsPersistenceDelegate.setLaunchContexts(spec, new IModelNode[]{peerModel});
+
+ IPath helloWorldLocation = getHelloWorldLocation();
+ assertTrue("Missing hello world example for current OS and Arch:" + Platform.getOS() + "/" + Platform.getOSArch(), //$NON-NLS-1$ //$NON-NLS-2$
+ helloWorldLocation != null &&
+ helloWorldLocation.toFile().exists() &&
+ helloWorldLocation.toFile().canRead());
+
+ String temp = System.getProperty("java.io.tmpdir"); //$NON-NLS-1$
+ IPath tempDir = temp != null ? new Path(temp) : null;
+ assertNotNull("Missing java temp directory", tempDir); //$NON-NLS-1$
+
+ // If the temporary directory is not writable for whatever reason to us,
+ // fallback to the users home directory
+ if (!tempDir.toFile().canWrite()) {
+ temp = System.getProperty("user.home"); //$NON-NLS-1$
+ tempDir = temp != null ? new Path(temp) : null;
+ assertNotNull("Missing user home directory", tempDir); //$NON-NLS-1$
+ }
+
+ tempDir = tempDir.append(TcfLaunchTests.class.getSimpleName());
+ assertNotNull("Cannot append test case specific temp directory", tempDir); //$NON-NLS-1$
+ if (!tempDir.toFile().exists()) {
+ assertTrue("Failed to create path " + tempDir.toString(), tempDir.toFile().mkdirs()); //$NON-NLS-1$
+ }
+ assertTrue("Temporary file location is not writable (" + tempDir.toOSString() + ")", tempDir.toFile().canWrite()); //$NON-NLS-1$ //$NON-NLS-2$
+
+ IPath tempHelloWorld = tempDir.append(helloWorldLocation.lastSegment());
+ if (tempHelloWorld.toFile().exists()) {
+ tempHelloWorld.toFile().setWritable(true, false);
+ tempHelloWorld.toFile().delete();
+ }
+ assertFalse("Cannot delete process image " + tempHelloWorld.toOSString(), tempHelloWorld.toFile().exists()); //$NON-NLS-1$
+
+ IPath outFile = tempDir.append("/HelloWorld.out"); //$NON-NLS-1$
+ if (outFile.toFile().exists()) {
+ outFile.toFile().delete();
+ }
+ assertFalse("Cannot delete console output file " + outFile.toOSString(), outFile.toFile().exists()); //$NON-NLS-1$
+
+ FileTransfersPersistenceDelegate.setFileTransfers(spec, new IFileTransferItem[]{new FileTransferItem(helloWorldLocation, tempDir)});
+ spec.addAttribute(IProcessesStepAttributes.ATTR_PROCESS_IMAGE, tempHelloWorld.toOSString());
+
+ ILaunchConfiguration config = null;
+ try {
+ config = LaunchManager.getInstance().getLaunchConfiguration(spec, true);
+ ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+ wc.setAttribute("org.eclipse.debug.ui.ATTR_CONSOLE_OUTPUT_ON", false); //$NON-NLS-1$
+ wc.setAttribute("org.eclipse.debug.ui.ATTR_CAPTURE_IN_FILE", outFile.toOSString()); //$NON-NLS-1$
+ config = wc.doSave();
+ }
+ catch (Exception e) {
+ assertNull("Unexpected exception when creating launch: " + e, e); //$NON-NLS-1$
+ }
+
+ try {
+ LaunchManager.getInstance().launch(config, ILaunchManager.RUN_MODE, false, new NullProgressMonitor());
+ }
+ catch (Exception e) {
+ assertNull("Unexpected exception when launching hello world: " + e, e); //$NON-NLS-1$
+ }
+
+ int counter = 20;
+ boolean exist = outFile.toFile().exists() && outFile.toFile().length() > 0;
+ while (!exist && counter > 0) {
+ try {
+ Thread.sleep(200);
+ } catch (InterruptedException e) { /* ignored on purpose */ }
+ exist = outFile.toFile().exists() && outFile.toFile().length() > 0;
+ counter--;
+ }
+ assertTrue("Missing console output file (" + outFile.toOSString() + ")", exist); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ private IPath getHelloWorldLocation() {
+ IPath path = getDataLocation("helloWorld", true, true); //$NON-NLS-1$
+ if (path != null) {
+ path = path.append("HelloWorld"); //$NON-NLS-1$
+ if (Host.isWindowsHost()) {
+ path = path.addFileExtension("exe"); //$NON-NLS-1$
+ }
+ }
+
+ return path;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseControl.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseControl.java
index 054cc9585..be8997760 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseControl.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.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseEditBrowseTextControl.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseEditBrowseTextControl.java
index 67622de0b..93cd7383d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseEditBrowseTextControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseEditBrowseTextControl.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.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseWizardConfigurationPanelControl.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseWizardConfigurationPanelControl.java
index 943db816a..f0c27be7f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseWizardConfigurationPanelControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseWizardConfigurationPanelControl.java
@@ -1,253 +1,253 @@
-/*******************************************************************************
- * 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.ui.controls;
-
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.dialogs.IDialogPage;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.tcf.te.ui.controls.interfaces.IWizardConfigurationPanel;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-/**
- * Base control to deal with wizard or property page controls
- * which should share the same UI space.
- */
-public class BaseWizardConfigurationPanelControl extends BaseDialogPageControl {
- private final Map<String, IWizardConfigurationPanel> configurationPanels = new Hashtable<String, IWizardConfigurationPanel>();
-
- private boolean isGroup;
-
- private Composite panel;
- private StackLayout panelLayout;
-
- private String activeConfigurationPanelKey = null;
- private IWizardConfigurationPanel activeConfigurationPanel = null;
-
- /**
- * Constructor.
- *
- * @param parentPage The parent dialog page this control is embedded in.
- * Might be <code>null</code> if the control is not associated with a page.
- */
- public BaseWizardConfigurationPanelControl(IDialogPage parentPage) {
- super(parentPage);
- clear();
- setPanelIsGroup(false);
- }
-
- /**
- * Sets if or if not the controls panel is a <code>Group</code>.
- *
- * @param isGroup <code>True</code> if the controls panel is a group, <code>false</code> otherwise.
- */
- public void setPanelIsGroup(boolean isGroup) {
- this.isGroup = isGroup;
- }
-
- /**
- * Returns if or if not the controls panel is a <code>Group</code>.
- *
- * @return <code>True</code> if the controls panel is a group, <code>false</code> otherwise.
- */
- public boolean isPanelIsGroup() {
- return isGroup;
- }
-
- /**
- * Returns the controls panel.
- *
- * @return The controls panel or <code>null</code>.
- */
- public Composite getPanel() {
- return panel;
- }
-
- /**
- * Returns the label text to set for the group (if the panel is a group).
- *
- * @return The label text to apply or <code>null</code>.
- */
- public String getGroupLabel() {
- return null;
- }
-
- /**
- * To be called from the embedding control to setup the controls UI elements.
- *
- * @param parent The parent control. Must not be <code>null</code>!
- * @param toolkit The form toolkit. Must not be <code>null</code>.
- */
- public void setupPanel(Composite parent, String[] configurationPanelKeys, FormToolkit toolkit) {
- Assert.isNotNull(parent);
- Assert.isNotNull(toolkit);
-
- setFormToolkit(toolkit);
-
- if (isPanelIsGroup()) {
- panel = new Group(parent, SWT.NONE);
- if (getGroupLabel() != null) ((Group)panel).setText(getGroupLabel());
- } else {
- panel = new Composite(parent, SWT.NONE);
- }
- Assert.isNotNull(panel);
- panel.setFont(parent.getFont());
- panel.setBackground(parent.getBackground());
-
- panelLayout = new StackLayout();
- panel.setLayout(panelLayout);
-
- setupConfigurationPanels(panel, configurationPanelKeys, toolkit);
- }
-
- /**
- * Removes all configuration panels.
- */
- public void clear() {
- configurationPanels.clear();
- }
-
- /**
- * Returns a unsorted list of all registered wizard configuration
- * panel id's.
- *
- * @return A list of registered wizard configuration panel id's.
- */
- public String[] getConfigurationPanelIds() {
- return configurationPanels.keySet().toArray(new String[configurationPanels.keySet().size()]);
- }
-
- /**
- * Returns the wizard configuration panel instance registered for the given configuration panel key.
- *
- * @param key The key to get the wizard configuration panel for. Must not be <code>null</code>!
- * @return The wizard configuration panel instance or <code>null</code> if the key is unknown.
- */
- public IWizardConfigurationPanel getConfigurationPanel(String key) {
- if (key == null) return null;
- return configurationPanels.get(key);
- }
-
- /**
- * Adds the given wizard configuration panel under the given configuration panel key to the
- * list of known panels. If the given configuration panel is <code>null</code>, any configuration
- * panel stored under the given key is removed from the list of known panels.
- *
- * @param key The key to get the wizard configuration panel for. Must not be <code>null</code>!
- * @param panel The wizard configuration panel instance or <code>null</code>.
- */
- public void addConfigurationPanel(String key, IWizardConfigurationPanel panel) {
- if (key == null) return;
- if (panel != null) {
- configurationPanels.put(key, panel);
- } else {
- configurationPanels.remove(key);
- }
- }
-
- /**
- * Setup the wizard configuration panels for being presented to the user. This method is called by the
- * controls <code>doSetupPanel(...)</code> and initialize all possible wizard configuration panels to show.
- * The default implementation iterates over the given list of configuration panel keys and calls
- * <code>setupPanel(...)</code> for each of them.
- *
- * @param parent The parent composite to use for the wizard configuration panels. Must not be <code>null</code>!
- * @param configurationPanelKeys The list of configuration panels to initialize. Might be <code>null</code> or empty!
- * @param toolkit The form toolkit. Must not be <code>null</code>.
- */
- public void setupConfigurationPanels(Composite parent, String[] configurationPanelKeys, FormToolkit toolkit) {
- Assert.isNotNull(parent);
- Assert.isNotNull(toolkit);
-
- if (configurationPanelKeys != null) {
- for (int i = 0; i < configurationPanelKeys.length; i++) {
- IWizardConfigurationPanel configPanel = getConfigurationPanel(configurationPanelKeys[i]);
- if (configPanel != null) configPanel.setupPanel(parent, toolkit);
- }
- }
- }
-
- /**
- * Make the wizard configuration panel registered under the given configuration panel key the
- * most top configuration panel. If no configuration panel is registered under the given key,
- * nothing will happen.
- *
- * @param key The key to get the wizard configuration panel for. Must not be <code>null</code>!
- */
- public void showConfigurationPanel(String key) {
- if (key == null) return;
-
- IWizardConfigurationPanel configPanel = getConfigurationPanel(key);
- if (configPanel != null && configPanel.getControl() != null) {
- activeConfigurationPanel = configPanel;
- activeConfigurationPanelKey = key;
- panelLayout.topControl = configPanel.getControl();
- panel.layout();
- }
- }
-
- /**
- * Returns the currently active configuration panel.
- *
- * @return The active configuration panel or <code>null</code>.
- */
- public IWizardConfigurationPanel getActiveConfigurationPanel() {
- return activeConfigurationPanel;
- }
-
- /**
- * Returns the currently active configuration panel key.
- *
- * @return The active configuration panel key or <code>null</code>.
- */
- public String getActiveConfigurationPanelKey() {
- return activeConfigurationPanelKey;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.BaseControl#doSaveWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
- */
- @Override
- public void doSaveWidgetValues(IDialogSettings settings, String idPrefix) {
- super.doSaveWidgetValues(settings, idPrefix);
- if (settings != null) {
- IWizardConfigurationPanel configPanel = getActiveConfigurationPanel();
- if (configPanel != null) {
- IDialogSettings configPanelSettings = settings.getSection(activeConfigurationPanelKey);
- if (configPanelSettings == null) configPanelSettings = settings.addNewSection(activeConfigurationPanelKey);
- configPanel.doSaveWidgetValues(configPanelSettings, idPrefix);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.BaseControl#doRestoreWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
- */
- @Override
- public void doRestoreWidgetValues(IDialogSettings settings, String idPrefix) {
- super.doRestoreWidgetValues(settings, idPrefix);
- if (settings != null) {
- for (String key : configurationPanels.keySet()) {
- IWizardConfigurationPanel configPanel = getConfigurationPanel(key);
- if (configPanel != null) {
- IDialogSettings configPanelSettings = settings.getSection(key);
- if (configPanelSettings == null) configPanelSettings = settings.addNewSection(key);
- configPanel.doRestoreWidgetValues(configPanelSettings, idPrefix);
- }
- }
- }
- }
-}
+/*******************************************************************************
+ * 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.ui.controls;
+
+import java.util.Hashtable;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.dialogs.IDialogPage;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StackLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.tcf.te.ui.controls.interfaces.IWizardConfigurationPanel;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * Base control to deal with wizard or property page controls
+ * which should share the same UI space.
+ */
+public class BaseWizardConfigurationPanelControl extends BaseDialogPageControl {
+ private final Map<String, IWizardConfigurationPanel> configurationPanels = new Hashtable<String, IWizardConfigurationPanel>();
+
+ private boolean isGroup;
+
+ private Composite panel;
+ private StackLayout panelLayout;
+
+ private String activeConfigurationPanelKey = null;
+ private IWizardConfigurationPanel activeConfigurationPanel = null;
+
+ /**
+ * Constructor.
+ *
+ * @param parentPage The parent dialog page this control is embedded in.
+ * Might be <code>null</code> if the control is not associated with a page.
+ */
+ public BaseWizardConfigurationPanelControl(IDialogPage parentPage) {
+ super(parentPage);
+ clear();
+ setPanelIsGroup(false);
+ }
+
+ /**
+ * Sets if or if not the controls panel is a <code>Group</code>.
+ *
+ * @param isGroup <code>True</code> if the controls panel is a group, <code>false</code> otherwise.
+ */
+ public void setPanelIsGroup(boolean isGroup) {
+ this.isGroup = isGroup;
+ }
+
+ /**
+ * Returns if or if not the controls panel is a <code>Group</code>.
+ *
+ * @return <code>True</code> if the controls panel is a group, <code>false</code> otherwise.
+ */
+ public boolean isPanelIsGroup() {
+ return isGroup;
+ }
+
+ /**
+ * Returns the controls panel.
+ *
+ * @return The controls panel or <code>null</code>.
+ */
+ public Composite getPanel() {
+ return panel;
+ }
+
+ /**
+ * Returns the label text to set for the group (if the panel is a group).
+ *
+ * @return The label text to apply or <code>null</code>.
+ */
+ public String getGroupLabel() {
+ return null;
+ }
+
+ /**
+ * To be called from the embedding control to setup the controls UI elements.
+ *
+ * @param parent The parent control. Must not be <code>null</code>!
+ * @param toolkit The form toolkit. Must not be <code>null</code>.
+ */
+ public void setupPanel(Composite parent, String[] configurationPanelKeys, FormToolkit toolkit) {
+ Assert.isNotNull(parent);
+ Assert.isNotNull(toolkit);
+
+ setFormToolkit(toolkit);
+
+ if (isPanelIsGroup()) {
+ panel = new Group(parent, SWT.NONE);
+ if (getGroupLabel() != null) ((Group)panel).setText(getGroupLabel());
+ } else {
+ panel = new Composite(parent, SWT.NONE);
+ }
+ Assert.isNotNull(panel);
+ panel.setFont(parent.getFont());
+ panel.setBackground(parent.getBackground());
+
+ panelLayout = new StackLayout();
+ panel.setLayout(panelLayout);
+
+ setupConfigurationPanels(panel, configurationPanelKeys, toolkit);
+ }
+
+ /**
+ * Removes all configuration panels.
+ */
+ public void clear() {
+ configurationPanels.clear();
+ }
+
+ /**
+ * Returns a unsorted list of all registered wizard configuration
+ * panel id's.
+ *
+ * @return A list of registered wizard configuration panel id's.
+ */
+ public String[] getConfigurationPanelIds() {
+ return configurationPanels.keySet().toArray(new String[configurationPanels.keySet().size()]);
+ }
+
+ /**
+ * Returns the wizard configuration panel instance registered for the given configuration panel key.
+ *
+ * @param key The key to get the wizard configuration panel for. Must not be <code>null</code>!
+ * @return The wizard configuration panel instance or <code>null</code> if the key is unknown.
+ */
+ public IWizardConfigurationPanel getConfigurationPanel(String key) {
+ if (key == null) return null;
+ return configurationPanels.get(key);
+ }
+
+ /**
+ * Adds the given wizard configuration panel under the given configuration panel key to the
+ * list of known panels. If the given configuration panel is <code>null</code>, any configuration
+ * panel stored under the given key is removed from the list of known panels.
+ *
+ * @param key The key to get the wizard configuration panel for. Must not be <code>null</code>!
+ * @param panel The wizard configuration panel instance or <code>null</code>.
+ */
+ public void addConfigurationPanel(String key, IWizardConfigurationPanel panel) {
+ if (key == null) return;
+ if (panel != null) {
+ configurationPanels.put(key, panel);
+ } else {
+ configurationPanels.remove(key);
+ }
+ }
+
+ /**
+ * Setup the wizard configuration panels for being presented to the user. This method is called by the
+ * controls <code>doSetupPanel(...)</code> and initialize all possible wizard configuration panels to show.
+ * The default implementation iterates over the given list of configuration panel keys and calls
+ * <code>setupPanel(...)</code> for each of them.
+ *
+ * @param parent The parent composite to use for the wizard configuration panels. Must not be <code>null</code>!
+ * @param configurationPanelKeys The list of configuration panels to initialize. Might be <code>null</code> or empty!
+ * @param toolkit The form toolkit. Must not be <code>null</code>.
+ */
+ public void setupConfigurationPanels(Composite parent, String[] configurationPanelKeys, FormToolkit toolkit) {
+ Assert.isNotNull(parent);
+ Assert.isNotNull(toolkit);
+
+ if (configurationPanelKeys != null) {
+ for (int i = 0; i < configurationPanelKeys.length; i++) {
+ IWizardConfigurationPanel configPanel = getConfigurationPanel(configurationPanelKeys[i]);
+ if (configPanel != null) configPanel.setupPanel(parent, toolkit);
+ }
+ }
+ }
+
+ /**
+ * Make the wizard configuration panel registered under the given configuration panel key the
+ * most top configuration panel. If no configuration panel is registered under the given key,
+ * nothing will happen.
+ *
+ * @param key The key to get the wizard configuration panel for. Must not be <code>null</code>!
+ */
+ public void showConfigurationPanel(String key) {
+ if (key == null) return;
+
+ IWizardConfigurationPanel configPanel = getConfigurationPanel(key);
+ if (configPanel != null && configPanel.getControl() != null) {
+ activeConfigurationPanel = configPanel;
+ activeConfigurationPanelKey = key;
+ panelLayout.topControl = configPanel.getControl();
+ panel.layout();
+ }
+ }
+
+ /**
+ * Returns the currently active configuration panel.
+ *
+ * @return The active configuration panel or <code>null</code>.
+ */
+ public IWizardConfigurationPanel getActiveConfigurationPanel() {
+ return activeConfigurationPanel;
+ }
+
+ /**
+ * Returns the currently active configuration panel key.
+ *
+ * @return The active configuration panel key or <code>null</code>.
+ */
+ public String getActiveConfigurationPanelKey() {
+ return activeConfigurationPanelKey;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.BaseControl#doSaveWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
+ */
+ @Override
+ public void doSaveWidgetValues(IDialogSettings settings, String idPrefix) {
+ super.doSaveWidgetValues(settings, idPrefix);
+ if (settings != null) {
+ IWizardConfigurationPanel configPanel = getActiveConfigurationPanel();
+ if (configPanel != null) {
+ IDialogSettings configPanelSettings = settings.getSection(activeConfigurationPanelKey);
+ if (configPanelSettings == null) configPanelSettings = settings.addNewSection(activeConfigurationPanelKey);
+ configPanel.doSaveWidgetValues(configPanelSettings, idPrefix);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.BaseControl#doRestoreWidgetValues(org.eclipse.jface.dialogs.IDialogSettings, java.lang.String)
+ */
+ @Override
+ public void doRestoreWidgetValues(IDialogSettings settings, String idPrefix) {
+ super.doRestoreWidgetValues(settings, idPrefix);
+ if (settings != null) {
+ for (String key : configurationPanels.keySet()) {
+ IWizardConfigurationPanel configPanel = getConfigurationPanel(key);
+ if (configPanel != null) {
+ IDialogSettings configPanelSettings = settings.getSection(key);
+ if (configPanelSettings == null) configPanelSettings = settings.addNewSection(key);
+ configPanel.doRestoreWidgetValues(configPanelSettings, idPrefix);
+ }
+ }
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/file/FileSelectionControl.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/file/FileSelectionControl.java
index b42c21c16..040f92f5c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/file/FileSelectionControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/file/FileSelectionControl.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.ui.controls/src/org/eclipse/tcf/te/ui/controls/net/RemoteHostPortControl.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/net/RemoteHostPortControl.java
index 9969fa8cf..ab0170697 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/net/RemoteHostPortControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/net/RemoteHostPortControl.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.ui.controls/src/org/eclipse/tcf/te/ui/controls/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/nls/Messages.java
index ae3bb54f9..625662db4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/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.ui.controls/src/org/eclipse/tcf/te/ui/controls/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/nls/Messages.properties
index 6ded25988..4e87af3eb 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/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.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/HexValidator.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/HexValidator.java
index b1fc5f7b7..062c8b83b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/HexValidator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/HexValidator.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.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/NameOrIPValidator.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/NameOrIPValidator.java
index e11751953..f4862af56 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/NameOrIPValidator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/NameOrIPValidator.java
@@ -1,146 +1,146 @@
-/*******************************************************************************
- * 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.ui.controls.validator;
-
-
-/**
- * Input validator for hostnames id IP addresses.
- */
-public class NameOrIPValidator extends Validator {
-
- // regular expressions for validator
- private static final String IP_CHARACTERS_REGEX = "[0-9\\.]+"; //$NON-NLS-1$
- public static final String IP_REGEX = NameOrIPVerifyListener.IP_FRAGMENT_REGEX + "(\\." + //$NON-NLS-1$
- NameOrIPVerifyListener.IP_FRAGMENT_REGEX + "){3}[ ]*"; //$NON-NLS-1$
-
- // RFC 1034 - ftp://ftp.rfc-editor.org/in-notes/std/std13.txt
- private static final String NAME_CHARACTERS_REGEX = "[0-9a-zA-Z\\-_\\.]+"; //$NON-NLS-1$
- public static final String NAME_REGEX = NameOrIPVerifyListener.NAME_FRAGMENT_REGEX + "(\\." + //$NON-NLS-1$
- NameOrIPVerifyListener.NAME_FRAGMENT_REGEX + ")*[ ]*"; //$NON-NLS-1$
-
- // keys for info messages
- public static final String INFO_MISSING_NAME_OR_IP = "NameOrIPValidator_Information_MissingNameOrIP"; //$NON-NLS-1$
- public static final String INFO_MISSING_NAME = "NameOrIPValidator_Information_MissingName"; //$NON-NLS-1$
- public static final String INFO_MISSING_IP = "NameOrIPValidator_Information_MissingIP"; //$NON-NLS-1$
- public static final String INFO_CHECK_NAME = "NameOrIPValidator_Information_CheckName"; //$NON-NLS-1$
-
- // keys for error messages
- public static final String ERROR_INVALID_NAME_OR_IP = "NameOrIPValidator_Error.InvalidNameOrIP"; //$NON-NLS-1$
- public static final String ERROR_INVALID_IP = "NameOrIPValidator_Error_InvalidIP"; //$NON-NLS-1$
- public static final String ERROR_INVALID_NAME = "NameOrIPValidator_Error_InvalidName"; //$NON-NLS-1$
-
- // arguments
- public static final int ATTR_NAME = 2;
- public static final int ATTR_IP = 4;
- public static final int ATTR_CHECK_AVAILABLE = 8;
- // next attribute should start with 2^4
-
-
- // value attributes
- private boolean isIP;
- private boolean isName;
-
- /**
- * Constructor
- * @attributes attributes The validator attributes.
- */
- public NameOrIPValidator(int attributes) {
- super(attributes);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.validator.Validator#init()
- */
- @Override
- protected void init() {
- super.init();
- isIP = false;
- isName = false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.validator.Validator#isValid(java.lang.String)
- */
- @Override
- public boolean isValid(String ipOrHostName) {
- init();
-
- // info message when value is empty
- if (ipOrHostName == null || ipOrHostName.trim().length() == 0) {
- if (isAttribute(ATTR_MANDATORY)) {
- if (isAttribute(ATTR_IP) && !isAttribute(ATTR_NAME)) {
- setMessage(getMessageText(INFO_MISSING_IP), getMessageTextType(INFO_MISSING_IP, INFORMATION));
- }
- else if (isAttribute(ATTR_NAME) && !isAttribute(ATTR_IP)) {
- setMessage(getMessageText(INFO_MISSING_NAME), getMessageTextType(INFO_MISSING_NAME, INFORMATION));
- }
- else {
- setMessage(getMessageText(INFO_MISSING_NAME_OR_IP), getMessageTextType(INFO_MISSING_NAME_OR_IP, INFORMATION));
- }
- return false;
- }
- return true;
- }
- ipOrHostName = ipOrHostName.trim();
- // check IP address when only numeric values and '.' are entered
- if (ipOrHostName.matches(IP_CHARACTERS_REGEX)) {
- isIP = true;
- // error message when IP not correct
- if (!isAttribute(ATTR_IP) && isAttribute(ATTR_NAME)) {
- setMessage(getMessageText(ERROR_INVALID_NAME), getMessageTextType(ERROR_INVALID_NAME, ERROR));
- }
- else if (!ipOrHostName.matches(IP_REGEX)) {
- setMessage(getMessageText(ERROR_INVALID_IP), getMessageTextType(ERROR_INVALID_IP, ERROR));
- }
- }
- else if (ipOrHostName.matches(NAME_CHARACTERS_REGEX)) {
- isName = true;
- if (!isAttribute(ATTR_NAME) && isAttribute(ATTR_IP)) {
- setMessage(getMessageText(ERROR_INVALID_IP), getMessageTextType(ERROR_INVALID_IP, ERROR));
- }
- else if (!ipOrHostName.matches(NAME_REGEX)) {
- setMessage(getMessageText(ERROR_INVALID_NAME), getMessageTextType(ERROR_INVALID_NAME, ERROR));
- }
- else if (isAttribute(ATTR_CHECK_AVAILABLE) && !"localhost".equals(ipOrHostName.trim())){ //$NON-NLS-1$
- // info message when name was entered to check
- setMessage(getMessageText(INFO_CHECK_NAME), getMessageTextType(INFO_CHECK_NAME, INFORMATION));
- }
- }
- else {
- if (isAttribute(ATTR_IP) && !isAttribute(ATTR_NAME)) {
- setMessage(getMessageText(ERROR_INVALID_IP), getMessageTextType(ERROR_INVALID_IP, ERROR));
- }
- else if (isAttribute(ATTR_NAME) && !isAttribute(ATTR_IP)) {
- setMessage(getMessageText(ERROR_INVALID_NAME), getMessageTextType(ERROR_INVALID_NAME, ERROR));
- }
- else {
- setMessage(getMessageText(ERROR_INVALID_NAME_OR_IP), getMessageTextType(ERROR_INVALID_NAME_OR_IP, ERROR));
- }
- }
-
- return getMessageType() != ERROR;
- }
-
- /**
- * Validated value is IP address.
- * @return
- */
- public boolean isIP() {
- return isIP;
- }
-
- /**
- * Validated value is alphanumeric host name.
- * @return
- */
- public boolean isName() {
- return isName;
- }
-}
+/*******************************************************************************
+ * 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.ui.controls.validator;
+
+
+/**
+ * Input validator for hostnames id IP addresses.
+ */
+public class NameOrIPValidator extends Validator {
+
+ // regular expressions for validator
+ private static final String IP_CHARACTERS_REGEX = "[0-9\\.]+"; //$NON-NLS-1$
+ public static final String IP_REGEX = NameOrIPVerifyListener.IP_FRAGMENT_REGEX + "(\\." + //$NON-NLS-1$
+ NameOrIPVerifyListener.IP_FRAGMENT_REGEX + "){3}[ ]*"; //$NON-NLS-1$
+
+ // RFC 1034 - ftp://ftp.rfc-editor.org/in-notes/std/std13.txt
+ private static final String NAME_CHARACTERS_REGEX = "[0-9a-zA-Z\\-_\\.]+"; //$NON-NLS-1$
+ public static final String NAME_REGEX = NameOrIPVerifyListener.NAME_FRAGMENT_REGEX + "(\\." + //$NON-NLS-1$
+ NameOrIPVerifyListener.NAME_FRAGMENT_REGEX + ")*[ ]*"; //$NON-NLS-1$
+
+ // keys for info messages
+ public static final String INFO_MISSING_NAME_OR_IP = "NameOrIPValidator_Information_MissingNameOrIP"; //$NON-NLS-1$
+ public static final String INFO_MISSING_NAME = "NameOrIPValidator_Information_MissingName"; //$NON-NLS-1$
+ public static final String INFO_MISSING_IP = "NameOrIPValidator_Information_MissingIP"; //$NON-NLS-1$
+ public static final String INFO_CHECK_NAME = "NameOrIPValidator_Information_CheckName"; //$NON-NLS-1$
+
+ // keys for error messages
+ public static final String ERROR_INVALID_NAME_OR_IP = "NameOrIPValidator_Error.InvalidNameOrIP"; //$NON-NLS-1$
+ public static final String ERROR_INVALID_IP = "NameOrIPValidator_Error_InvalidIP"; //$NON-NLS-1$
+ public static final String ERROR_INVALID_NAME = "NameOrIPValidator_Error_InvalidName"; //$NON-NLS-1$
+
+ // arguments
+ public static final int ATTR_NAME = 2;
+ public static final int ATTR_IP = 4;
+ public static final int ATTR_CHECK_AVAILABLE = 8;
+ // next attribute should start with 2^4
+
+
+ // value attributes
+ private boolean isIP;
+ private boolean isName;
+
+ /**
+ * Constructor
+ * @attributes attributes The validator attributes.
+ */
+ public NameOrIPValidator(int attributes) {
+ super(attributes);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.validator.Validator#init()
+ */
+ @Override
+ protected void init() {
+ super.init();
+ isIP = false;
+ isName = false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.validator.Validator#isValid(java.lang.String)
+ */
+ @Override
+ public boolean isValid(String ipOrHostName) {
+ init();
+
+ // info message when value is empty
+ if (ipOrHostName == null || ipOrHostName.trim().length() == 0) {
+ if (isAttribute(ATTR_MANDATORY)) {
+ if (isAttribute(ATTR_IP) && !isAttribute(ATTR_NAME)) {
+ setMessage(getMessageText(INFO_MISSING_IP), getMessageTextType(INFO_MISSING_IP, INFORMATION));
+ }
+ else if (isAttribute(ATTR_NAME) && !isAttribute(ATTR_IP)) {
+ setMessage(getMessageText(INFO_MISSING_NAME), getMessageTextType(INFO_MISSING_NAME, INFORMATION));
+ }
+ else {
+ setMessage(getMessageText(INFO_MISSING_NAME_OR_IP), getMessageTextType(INFO_MISSING_NAME_OR_IP, INFORMATION));
+ }
+ return false;
+ }
+ return true;
+ }
+ ipOrHostName = ipOrHostName.trim();
+ // check IP address when only numeric values and '.' are entered
+ if (ipOrHostName.matches(IP_CHARACTERS_REGEX)) {
+ isIP = true;
+ // error message when IP not correct
+ if (!isAttribute(ATTR_IP) && isAttribute(ATTR_NAME)) {
+ setMessage(getMessageText(ERROR_INVALID_NAME), getMessageTextType(ERROR_INVALID_NAME, ERROR));
+ }
+ else if (!ipOrHostName.matches(IP_REGEX)) {
+ setMessage(getMessageText(ERROR_INVALID_IP), getMessageTextType(ERROR_INVALID_IP, ERROR));
+ }
+ }
+ else if (ipOrHostName.matches(NAME_CHARACTERS_REGEX)) {
+ isName = true;
+ if (!isAttribute(ATTR_NAME) && isAttribute(ATTR_IP)) {
+ setMessage(getMessageText(ERROR_INVALID_IP), getMessageTextType(ERROR_INVALID_IP, ERROR));
+ }
+ else if (!ipOrHostName.matches(NAME_REGEX)) {
+ setMessage(getMessageText(ERROR_INVALID_NAME), getMessageTextType(ERROR_INVALID_NAME, ERROR));
+ }
+ else if (isAttribute(ATTR_CHECK_AVAILABLE) && !"localhost".equals(ipOrHostName.trim())){ //$NON-NLS-1$
+ // info message when name was entered to check
+ setMessage(getMessageText(INFO_CHECK_NAME), getMessageTextType(INFO_CHECK_NAME, INFORMATION));
+ }
+ }
+ else {
+ if (isAttribute(ATTR_IP) && !isAttribute(ATTR_NAME)) {
+ setMessage(getMessageText(ERROR_INVALID_IP), getMessageTextType(ERROR_INVALID_IP, ERROR));
+ }
+ else if (isAttribute(ATTR_NAME) && !isAttribute(ATTR_IP)) {
+ setMessage(getMessageText(ERROR_INVALID_NAME), getMessageTextType(ERROR_INVALID_NAME, ERROR));
+ }
+ else {
+ setMessage(getMessageText(ERROR_INVALID_NAME_OR_IP), getMessageTextType(ERROR_INVALID_NAME_OR_IP, ERROR));
+ }
+ }
+
+ return getMessageType() != ERROR;
+ }
+
+ /**
+ * Validated value is IP address.
+ * @return
+ */
+ public boolean isIP() {
+ return isIP;
+ }
+
+ /**
+ * Validated value is alphanumeric host name.
+ * @return
+ */
+ public boolean isName() {
+ return isName;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/NameOrIPVerifyListener.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/NameOrIPVerifyListener.java
index 6e6ad4f8d..8762b56a4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/NameOrIPVerifyListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/NameOrIPVerifyListener.java
@@ -1,73 +1,73 @@
-/*******************************************************************************
- * 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.ui.controls.validator;
-
-/**
- * Verify listener for text widgets to receive host names or IP addresses.
- */
-public class NameOrIPVerifyListener extends RegexVerifyListener {
-
- // regular expressions
- // characters that can be set at the beginning
- private static final String NAME_START_REGEX = "[a-zA-Z]"; //$NON-NLS-1$
- // characters that can be set after the starting character
- private static final String NAME_FOLLOW_REGEX = "[a-zA-Z0-9]"; //$NON-NLS-1$
- // allowed separators in fragments
- private static final String NAME_SEPERATOR_REGEX = "(\\-|_)"; //$NON-NLS-1$
- // complete name fragment
- public static final String NAME_FRAGMENT_REGEX =
- "(" + NAME_START_REGEX + NAME_FOLLOW_REGEX + "*" + //$NON-NLS-1$ //$NON-NLS-2$
- "(" + NAME_SEPERATOR_REGEX + NAME_FOLLOW_REGEX + "+)*)"; //$NON-NLS-1$ //$NON-NLS-2$
- // open name fragment during typing
- private static final String OPEN_NAME_FRAGMENT_REGEX =
- "(" + NAME_FRAGMENT_REGEX + NAME_SEPERATOR_REGEX + "?)"; //$NON-NLS-1$ //$NON-NLS-2$
- // multiple
- public static final String OPEN_NAME_REGEX =
- "((" + NAME_FRAGMENT_REGEX + "\\.)*" + OPEN_NAME_FRAGMENT_REGEX + "?)?[ ]*"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- public static final String IP_FRAGMENT_REGEX = "([0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])"; //$NON-NLS-1$
- public static final String OPEN_IP_REGEX = "((" + IP_FRAGMENT_REGEX + "?\\.){0,3}" + IP_FRAGMENT_REGEX + "?)?[ ]*"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- public static final String OPEN_TIPC_REGEX = "((" + IP_FRAGMENT_REGEX + "?\\.){0,2}" + IP_FRAGMENT_REGEX + "?)?[ ]*"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- // arguments
- public static final int ATTR_NAME = 1;
- public static final int ATTR_IP = 2;
- public static final int ATTR_TIPC = 4;
-
- /**
- * Constructor
- * @param decimal true if decimal value is allowed
- * @param hex true if hex value (0x####) is allowed
- */
- public NameOrIPVerifyListener(int attributes) {
- super(attributes, getRegEx(attributes));
- }
-
- /*
- * Static method to generate regular expression for constructor super call.
- */
- private static String getRegEx(int attributes) {
- String regex = null;
-
- if (isAttribute(ATTR_TIPC, attributes)) {
- regex = OPEN_TIPC_REGEX;
- }
- else {
- if (isAttribute(ATTR_NAME, attributes) || !isAttribute(ATTR_IP, attributes)) {
- regex = OPEN_NAME_REGEX;
- }
- if (isAttribute(ATTR_IP, attributes) || !isAttribute(ATTR_NAME, attributes)) {
- regex = (regex != null) ? (regex + "|" + OPEN_IP_REGEX) : OPEN_IP_REGEX; //$NON-NLS-1$
- }
- }
-
- return regex;
- }
-}
+/*******************************************************************************
+ * 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.ui.controls.validator;
+
+/**
+ * Verify listener for text widgets to receive host names or IP addresses.
+ */
+public class NameOrIPVerifyListener extends RegexVerifyListener {
+
+ // regular expressions
+ // characters that can be set at the beginning
+ private static final String NAME_START_REGEX = "[a-zA-Z]"; //$NON-NLS-1$
+ // characters that can be set after the starting character
+ private static final String NAME_FOLLOW_REGEX = "[a-zA-Z0-9]"; //$NON-NLS-1$
+ // allowed separators in fragments
+ private static final String NAME_SEPERATOR_REGEX = "(\\-|_)"; //$NON-NLS-1$
+ // complete name fragment
+ public static final String NAME_FRAGMENT_REGEX =
+ "(" + NAME_START_REGEX + NAME_FOLLOW_REGEX + "*" + //$NON-NLS-1$ //$NON-NLS-2$
+ "(" + NAME_SEPERATOR_REGEX + NAME_FOLLOW_REGEX + "+)*)"; //$NON-NLS-1$ //$NON-NLS-2$
+ // open name fragment during typing
+ private static final String OPEN_NAME_FRAGMENT_REGEX =
+ "(" + NAME_FRAGMENT_REGEX + NAME_SEPERATOR_REGEX + "?)"; //$NON-NLS-1$ //$NON-NLS-2$
+ // multiple
+ public static final String OPEN_NAME_REGEX =
+ "((" + NAME_FRAGMENT_REGEX + "\\.)*" + OPEN_NAME_FRAGMENT_REGEX + "?)?[ ]*"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ public static final String IP_FRAGMENT_REGEX = "([0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])"; //$NON-NLS-1$
+ public static final String OPEN_IP_REGEX = "((" + IP_FRAGMENT_REGEX + "?\\.){0,3}" + IP_FRAGMENT_REGEX + "?)?[ ]*"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ public static final String OPEN_TIPC_REGEX = "((" + IP_FRAGMENT_REGEX + "?\\.){0,2}" + IP_FRAGMENT_REGEX + "?)?[ ]*"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ // arguments
+ public static final int ATTR_NAME = 1;
+ public static final int ATTR_IP = 2;
+ public static final int ATTR_TIPC = 4;
+
+ /**
+ * Constructor
+ * @param decimal true if decimal value is allowed
+ * @param hex true if hex value (0x####) is allowed
+ */
+ public NameOrIPVerifyListener(int attributes) {
+ super(attributes, getRegEx(attributes));
+ }
+
+ /*
+ * Static method to generate regular expression for constructor super call.
+ */
+ private static String getRegEx(int attributes) {
+ String regex = null;
+
+ if (isAttribute(ATTR_TIPC, attributes)) {
+ regex = OPEN_TIPC_REGEX;
+ }
+ else {
+ if (isAttribute(ATTR_NAME, attributes) || !isAttribute(ATTR_IP, attributes)) {
+ regex = OPEN_NAME_REGEX;
+ }
+ if (isAttribute(ATTR_IP, attributes) || !isAttribute(ATTR_NAME, attributes)) {
+ regex = (regex != null) ? (regex + "|" + OPEN_IP_REGEX) : OPEN_IP_REGEX; //$NON-NLS-1$
+ }
+ }
+
+ return regex;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/NumberValidator.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/NumberValidator.java
index 929039e63..ce1559fdd 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/NumberValidator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/NumberValidator.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.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/PortNumberValidator.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/PortNumberValidator.java
index ecf120392..b60593105 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/PortNumberValidator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/PortNumberValidator.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.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/RegexValidator.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/RegexValidator.java
index 68981542e..1cd95d154 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/RegexValidator.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/validator/RegexValidator.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.ui.controls/src/org/eclipse/tcf/te/ui/controls/wire/network/NetworkAddressControl.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/wire/network/NetworkAddressControl.java
index 2c88fce44..bdbff4552 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/wire/network/NetworkAddressControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/wire/network/NetworkAddressControl.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.ui.controls/src/org/eclipse/tcf/te/ui/controls/wire/network/NetworkCablePanel.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/wire/network/NetworkCablePanel.java
index 00bf3ce25..af431ceb1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/wire/network/NetworkCablePanel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/wire/network/NetworkCablePanel.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.ui.controls/src/org/eclipse/tcf/te/ui/controls/wire/serial/SerialPortAddressDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/wire/serial/SerialPortAddressDialog.java
index 0f4ff4311..738577fac 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/wire/serial/SerialPortAddressDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/wire/serial/SerialPortAddressDialog.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.ui.forms/src/org/eclipse/tcf/te/ui/forms/CustomFormToolkit.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/CustomFormToolkit.java
index 7c222583c..f3886f22f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/CustomFormToolkit.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/CustomFormToolkit.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.ui.forms/src/org/eclipse/tcf/te/ui/forms/interfaces/tracing/ITraceIds.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/interfaces/tracing/ITraceIds.java
index abe521b6d..e396d5d7e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/interfaces/tracing/ITraceIds.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/interfaces/tracing/ITraceIds.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.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractSection.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractSection.java
index c6af74178..03c55bc9b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractSection.java
@@ -1,429 +1,429 @@
-/*******************************************************************************
- * 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.ui.forms.parts;
-
-import java.lang.reflect.Field;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.tcf.te.ui.forms.FormLayoutFactory;
-import org.eclipse.tcf.te.ui.forms.activator.UIPlugin;
-import org.eclipse.tcf.te.ui.forms.interfaces.tracing.ITraceIds;
-import org.eclipse.tcf.te.ui.jface.interfaces.IValidatable;
-import org.eclipse.tcf.te.ui.jface.interfaces.IValidatingContainer;
-import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
-import org.eclipse.ui.forms.AbstractFormPart;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.SectionPart;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * Abstract section implementation.
- */
-public abstract class AbstractSection extends SectionPart implements IAdaptable, IValidatable {
- // The message text
- private String message = null;
- // The message type. See IMessageProvider
- private int messageType = NONE;
-
- // Flag to mark if the controls of the sections are currently updated.
- // While the control are updated, validation and similar logic should
- // not be processed.
- // <p>
- // <b>Note:</b> This flag default to <code>true</code> on instantiation.
- private boolean updating = true;
-
- // Flag to remember the read-only state
- /* default */ boolean readOnly = false;
-
- /**
- * Constructor.
- *
- * @param form The parent managed form. Must not be <code>null</code>.
- * @param parent The parent composite. Must not be <code>null</code>.
- * @param style The section style.
- */
- public AbstractSection(IManagedForm form, Composite parent, int style) {
- this(form, parent, style, true);
- }
-
- /**
- * Constructor.
- *
- * @param form The parent managed form. Must not be <code>null</code>.
- * @param parent The parent composite. Must not be <code>null</code>.
- * @param style The section style.
- * @param titleBar If <code>true</code>, the title bar style bit is added to <code>style</code>.
- */
- public AbstractSection(IManagedForm form, Composite parent, int style, boolean titleBar) {
- super(parent, form.getToolkit(), titleBar ? (ExpandableComposite.TITLE_BAR | style) : style);
- initialize(form);
- configureSection(getSection());
- }
-
- /**
- * Get the validation container.
- * @return The validation container.
- */
- protected IValidatingContainer getValidatingContainer() {
- Object container = getManagedForm().getContainer();
- return container instanceof IValidatingContainer ? (IValidatingContainer)container : null;
- }
-
- /**
- * Configure the section.
- *
- * @param section The section. Must not be <code>null</code>.
- */
- protected void configureSection(Section section) {
- Assert.isNotNull(section);
-
- section.clientVerticalSpacing = FormLayoutFactory.SECTION_HEADER_VERTICAL_SPACING;
- section.setData("part", this); //$NON-NLS-1$
-
- // Adjust the background
- Color bg = section.getParent().getBackground();
- if (bg != null && !bg.equals(section.getBackground())) {
- section.setBackground(bg);
- }
- }
-
- /**
- * Creates the section client.
- *
- * @param section The parent section. Must not be <code>null</code>.
- * @param toolkit The form toolkit. Must not be <code>null</code>.
- */
- protected abstract void createClient(Section section, FormToolkit toolkit);
-
- /**
- * Creates the client container composite.
- *
- * @param parent The parent composite. Must not be <code>null</code>.
- * @param numColumns The number of columns.
- * @param toolkit The form toolkit or <code>null</code>.
- *
- * @return The client container composite.
- */
- protected Composite createClientContainer(Composite parent, int numColumns, FormToolkit toolkit) {
- Composite container = toolkit != null ? toolkit.createComposite(parent) : new Composite(parent, SWT.NONE);
- container.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, numColumns));
-
- // Adjust the background
- Color bg = parent.getBackground();
- if (bg != null && !bg.equals(container.getBackground())) {
- container.setBackground(bg);
- }
-
- return container;
- }
-
- /**
- * Convenience method to create a "invisible" label for creating an
- * empty space between controls.
- *
- * @param parent The parent composite. Must not be <code>null</code>.
- * @param span The horizontal span.
- * @param toolkit The form toolkit or <code>null</code>.
- *
- * @return
- */
- protected Label createEmptySpace(Composite parent, int span, FormToolkit toolkit) {
- Assert.isNotNull(parent);
-
- Label emptySpace = toolkit != null ? toolkit.createLabel(parent, null) : new Label(parent, SWT.NONE);
-
- GridData layoutData = new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false);
- layoutData.horizontalSpan = span;
- layoutData.widthHint = 0; layoutData.heightHint = SWTControlUtil.convertHeightInCharsToPixels(emptySpace, 1) / 2;
-
- emptySpace.setLayoutData(layoutData);
-
- return emptySpace;
- }
-
- /**
- * Convenience method to create a section toolbar.
- *
- * @param section The section. Must not be <code>null</code>.
- * @param toolkit The form toolkit or <code>null</code>.
- */
- protected void createSectionToolbar(Section section, FormToolkit toolkit) {
- Assert.isNotNull(section);
-
- // Create the toolbar manager and the toolbar control
- ToolBarManager tlbMgr = new ToolBarManager(SWT.FLAT);
- ToolBar tlb = tlbMgr.createControl(section);
-
- // If the user moves over the toolbar area, change the cursor to become a hand
- final Cursor cursor = new Cursor(Display.getCurrent(), SWT.CURSOR_HAND);
- tlb.setCursor(cursor);
-
- // Cursor needs to be explicitly disposed
- tlb.addDisposeListener(new DisposeListener() {
- @Override
- public void widgetDisposed(DisposeEvent e) {
- if (cursor.isDisposed() == false) {
- cursor.dispose();
- }
- }
- });
-
- // Create the toolbar items
- createSectionToolbarItems(section, toolkit, tlbMgr);
-
- // Update the toolbar manager
- tlbMgr.update(true);
- // Associate the toolbar control with the section
- section.setTextClient(tlb);
- }
-
- /**
- * Convenience method to create section toolbar items.
- * <p>
- * This method is called from {@link #createSectionToolbar(Section, FormToolkit)}.
- *
- * @param section The section. Must not be <code>null</code>.
- * @param toolkit The form toolkit or <code>null</code>.
- * @param tlbMgr The toolbar manager. Must not be <code>null</code>.
- */
- protected void createSectionToolbarItems(Section section, FormToolkit toolkit, ToolBarManager tlbMgr) {
- Assert.isNotNull(section);
- Assert.isNotNull(tlbMgr);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- @Override
- public Object getAdapter(Class adapter) {
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-
- /**
- * Marks the section dirty or reset the dirty state.
- *
- * @param dirty <code>True</code> to mark the section dirty, <code>false</code> otherwise.
- */
- public final void markDirty(boolean dirty) {
- if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_SECTIONS_DIRTY_STATE)) {
- UIPlugin.getTraceHandler().trace("markDirty: Set dirty state to " + dirty, //$NON-NLS-1$
- ITraceIds.TRACE_SECTIONS_DIRTY_STATE, this);
- }
-
- if (dirty) markDirty();
- else {
- // For now, there is no direct way to reset the dirty state,
- // and the refresh() method is setting back both flags (stale and dirty).
- // Plus, refresh() might be overwritten to refresh the widget content
- // from the data itself, what will trigger an stack overflow after all.
- try {
- final Field f = AbstractFormPart.class.getDeclaredField("dirty"); //$NON-NLS-1$
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- @Override
- public Object run() {
- f.setAccessible(true);
- return null;
- }
- });
- f.setBoolean(this, dirty);
- if (getManagedForm() != null) getManagedForm().dirtyStateChanged();
- } catch (Exception e) { /* ignored on purpose */ }
- }
- }
-
- /**
- * Marks the section stale or reset the stale state.
- *
- * @param stale <code>True</code> to mark the section stale, <code>false</code> otherwise.
- */
- public final void markStale(boolean stale) {
- if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_SECTIONS_STALE_STATE)) {
- UIPlugin.getTraceHandler().trace("markStale: Set stale state to " + stale, //$NON-NLS-1$
- ITraceIds.TRACE_SECTIONS_STALE_STATE, this);
- }
-
- if (stale) markStale();
- else {
- // For now, there is no direct way to reset the stale state,
- // and the refresh() method is setting back both flags (stale and dirty).
- // Plus, refresh() might be overwritten to refresh the widget content
- // from the data itself, what will trigger an stack overflow after all.
- try {
- final Field f = AbstractFormPart.class.getDeclaredField("stale"); //$NON-NLS-1$
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- @Override
- public Object run() {
- f.setAccessible(true);
- return null;
- }
- });
- f.setBoolean(this, stale);
- if (getManagedForm() != null) getManagedForm().staleStateChanged();
- } catch (Exception e) { /* ignored on purpose */ }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.forms.AbstractFormPart#commit(boolean)
- */
- @Override
- public void commit(boolean onSave) {
- // commit is reseting the dirty state
- boolean hasBeenDirty = isDirty();
- // Execute the commit
- super.commit(onSave);
- // signal the dirty state change to the manager form if
- // it really has changed
- if (hasBeenDirty) {
- if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_SECTIONS_DIRTY_STATE)) {
- UIPlugin.getTraceHandler().trace("Commit(" + onSave + ") reseted the dirty state to false.", //$NON-NLS-1$ //$NON-NLS-2$
- ITraceIds.TRACE_SECTIONS_DIRTY_STATE, this);
- }
- if (onSave)
- getManagedForm().dirtyStateChanged();
- else
- markDirty();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.forms.AbstractFormPart#refresh()
- */
- @Override
- public void refresh() {
- // refresh is reseting both the stale and the dirty state
- boolean hasBeenStale = isStale();
- boolean hasBeenDirty = isDirty();
-
- super.refresh();
-
- if (hasBeenStale) {
- if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_SECTIONS_STALE_STATE)) {
- UIPlugin.getTraceHandler().trace("refresh() reseted the stale state to false.", //$NON-NLS-1$
- ITraceIds.TRACE_SECTIONS_STALE_STATE, this);
- }
-
- getManagedForm().staleStateChanged();
- }
-
- if (hasBeenDirty) {
- if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_SECTIONS_DIRTY_STATE)) {
- UIPlugin.getTraceHandler().trace("refresh() reseted the dirty state to false.", //$NON-NLS-1$
- ITraceIds.TRACE_SECTIONS_DIRTY_STATE, this);
- }
-
- getManagedForm().dirtyStateChanged();
- }
- }
-
- /**
- * Set the sections read only state.
- * @param readOnly <code>true</code> if the sections controls should be read only.
- */
- public void setReadOnly(boolean readOnly) {
- this.readOnly = readOnly;
- }
-
- /**
- * Get the read only state of this section.
- * @return The read onyly state.
- */
- public boolean isReadOnly() {
- return readOnly;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.jface.interfaces.IValidatable#isValid()
- */
- @Override
- public boolean isValid() {
- setMessage(null, IMessageProvider.NONE);
- return true;
- }
-
- /**
- * Sets the message text and type.
- *
- * @param message The message or <code>null</code>.
- * @param messageType The message type. See {@link IMessageProvider}.
- */
- protected final void setMessage(String message, int messageType) {
- this.message = message;
- this.messageType = messageType;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IMessageProvider#getMessage()
- */
- @Override
- public final String getMessage() {
- return message;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IMessageProvider#getMessageType()
- */
- @Override
- public final int getMessageType() {
- return messageType;
- }
-
- /**
- * Marks if or if not the controls of the section are currently updated.
- */
- protected final void setIsUpdating(boolean updating) {
- this.updating = updating;
- }
-
- /**
- * Returns if or if not the controls of the section are currently updated.
- *
- * @return <code>True</code> if the controls are currently updated, <code>false</code> otherwise.
- */
- protected final boolean isUpdating() {
- return updating;
- }
-
- /**
- * Saves the widget history of all UI elements of the section.
- *
- * @param settings The dialog settings or <code>null</code>.
- */
- public void saveWidgetValues(IDialogSettings settings) {
- }
-
- /**
- * Restores the widget history of all UI elements of the section.
- *
- * @param settings The dialog settings or <code>null</code>.
- */
- public void restoreWidgetValues(IDialogSettings settings) {
- }
-
-}
+/*******************************************************************************
+ * 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.ui.forms.parts;
+
+import java.lang.reflect.Field;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.tcf.te.ui.forms.FormLayoutFactory;
+import org.eclipse.tcf.te.ui.forms.activator.UIPlugin;
+import org.eclipse.tcf.te.ui.forms.interfaces.tracing.ITraceIds;
+import org.eclipse.tcf.te.ui.jface.interfaces.IValidatable;
+import org.eclipse.tcf.te.ui.jface.interfaces.IValidatingContainer;
+import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
+import org.eclipse.ui.forms.AbstractFormPart;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.SectionPart;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * Abstract section implementation.
+ */
+public abstract class AbstractSection extends SectionPart implements IAdaptable, IValidatable {
+ // The message text
+ private String message = null;
+ // The message type. See IMessageProvider
+ private int messageType = NONE;
+
+ // Flag to mark if the controls of the sections are currently updated.
+ // While the control are updated, validation and similar logic should
+ // not be processed.
+ // <p>
+ // <b>Note:</b> This flag default to <code>true</code> on instantiation.
+ private boolean updating = true;
+
+ // Flag to remember the read-only state
+ /* default */ boolean readOnly = false;
+
+ /**
+ * Constructor.
+ *
+ * @param form The parent managed form. Must not be <code>null</code>.
+ * @param parent The parent composite. Must not be <code>null</code>.
+ * @param style The section style.
+ */
+ public AbstractSection(IManagedForm form, Composite parent, int style) {
+ this(form, parent, style, true);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param form The parent managed form. Must not be <code>null</code>.
+ * @param parent The parent composite. Must not be <code>null</code>.
+ * @param style The section style.
+ * @param titleBar If <code>true</code>, the title bar style bit is added to <code>style</code>.
+ */
+ public AbstractSection(IManagedForm form, Composite parent, int style, boolean titleBar) {
+ super(parent, form.getToolkit(), titleBar ? (ExpandableComposite.TITLE_BAR | style) : style);
+ initialize(form);
+ configureSection(getSection());
+ }
+
+ /**
+ * Get the validation container.
+ * @return The validation container.
+ */
+ protected IValidatingContainer getValidatingContainer() {
+ Object container = getManagedForm().getContainer();
+ return container instanceof IValidatingContainer ? (IValidatingContainer)container : null;
+ }
+
+ /**
+ * Configure the section.
+ *
+ * @param section The section. Must not be <code>null</code>.
+ */
+ protected void configureSection(Section section) {
+ Assert.isNotNull(section);
+
+ section.clientVerticalSpacing = FormLayoutFactory.SECTION_HEADER_VERTICAL_SPACING;
+ section.setData("part", this); //$NON-NLS-1$
+
+ // Adjust the background
+ Color bg = section.getParent().getBackground();
+ if (bg != null && !bg.equals(section.getBackground())) {
+ section.setBackground(bg);
+ }
+ }
+
+ /**
+ * Creates the section client.
+ *
+ * @param section The parent section. Must not be <code>null</code>.
+ * @param toolkit The form toolkit. Must not be <code>null</code>.
+ */
+ protected abstract void createClient(Section section, FormToolkit toolkit);
+
+ /**
+ * Creates the client container composite.
+ *
+ * @param parent The parent composite. Must not be <code>null</code>.
+ * @param numColumns The number of columns.
+ * @param toolkit The form toolkit or <code>null</code>.
+ *
+ * @return The client container composite.
+ */
+ protected Composite createClientContainer(Composite parent, int numColumns, FormToolkit toolkit) {
+ Composite container = toolkit != null ? toolkit.createComposite(parent) : new Composite(parent, SWT.NONE);
+ container.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, numColumns));
+
+ // Adjust the background
+ Color bg = parent.getBackground();
+ if (bg != null && !bg.equals(container.getBackground())) {
+ container.setBackground(bg);
+ }
+
+ return container;
+ }
+
+ /**
+ * Convenience method to create a "invisible" label for creating an
+ * empty space between controls.
+ *
+ * @param parent The parent composite. Must not be <code>null</code>.
+ * @param span The horizontal span.
+ * @param toolkit The form toolkit or <code>null</code>.
+ *
+ * @return
+ */
+ protected Label createEmptySpace(Composite parent, int span, FormToolkit toolkit) {
+ Assert.isNotNull(parent);
+
+ Label emptySpace = toolkit != null ? toolkit.createLabel(parent, null) : new Label(parent, SWT.NONE);
+
+ GridData layoutData = new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false);
+ layoutData.horizontalSpan = span;
+ layoutData.widthHint = 0; layoutData.heightHint = SWTControlUtil.convertHeightInCharsToPixels(emptySpace, 1) / 2;
+
+ emptySpace.setLayoutData(layoutData);
+
+ return emptySpace;
+ }
+
+ /**
+ * Convenience method to create a section toolbar.
+ *
+ * @param section The section. Must not be <code>null</code>.
+ * @param toolkit The form toolkit or <code>null</code>.
+ */
+ protected void createSectionToolbar(Section section, FormToolkit toolkit) {
+ Assert.isNotNull(section);
+
+ // Create the toolbar manager and the toolbar control
+ ToolBarManager tlbMgr = new ToolBarManager(SWT.FLAT);
+ ToolBar tlb = tlbMgr.createControl(section);
+
+ // If the user moves over the toolbar area, change the cursor to become a hand
+ final Cursor cursor = new Cursor(Display.getCurrent(), SWT.CURSOR_HAND);
+ tlb.setCursor(cursor);
+
+ // Cursor needs to be explicitly disposed
+ tlb.addDisposeListener(new DisposeListener() {
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ if (cursor.isDisposed() == false) {
+ cursor.dispose();
+ }
+ }
+ });
+
+ // Create the toolbar items
+ createSectionToolbarItems(section, toolkit, tlbMgr);
+
+ // Update the toolbar manager
+ tlbMgr.update(true);
+ // Associate the toolbar control with the section
+ section.setTextClient(tlb);
+ }
+
+ /**
+ * Convenience method to create section toolbar items.
+ * <p>
+ * This method is called from {@link #createSectionToolbar(Section, FormToolkit)}.
+ *
+ * @param section The section. Must not be <code>null</code>.
+ * @param toolkit The form toolkit or <code>null</code>.
+ * @param tlbMgr The toolbar manager. Must not be <code>null</code>.
+ */
+ protected void createSectionToolbarItems(Section section, FormToolkit toolkit, ToolBarManager tlbMgr) {
+ Assert.isNotNull(section);
+ Assert.isNotNull(tlbMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(Class adapter) {
+ return Platform.getAdapterManager().getAdapter(this, adapter);
+ }
+
+ /**
+ * Marks the section dirty or reset the dirty state.
+ *
+ * @param dirty <code>True</code> to mark the section dirty, <code>false</code> otherwise.
+ */
+ public final void markDirty(boolean dirty) {
+ if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_SECTIONS_DIRTY_STATE)) {
+ UIPlugin.getTraceHandler().trace("markDirty: Set dirty state to " + dirty, //$NON-NLS-1$
+ ITraceIds.TRACE_SECTIONS_DIRTY_STATE, this);
+ }
+
+ if (dirty) markDirty();
+ else {
+ // For now, there is no direct way to reset the dirty state,
+ // and the refresh() method is setting back both flags (stale and dirty).
+ // Plus, refresh() might be overwritten to refresh the widget content
+ // from the data itself, what will trigger an stack overflow after all.
+ try {
+ final Field f = AbstractFormPart.class.getDeclaredField("dirty"); //$NON-NLS-1$
+ AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ @Override
+ public Object run() {
+ f.setAccessible(true);
+ return null;
+ }
+ });
+ f.setBoolean(this, dirty);
+ if (getManagedForm() != null) getManagedForm().dirtyStateChanged();
+ } catch (Exception e) { /* ignored on purpose */ }
+ }
+ }
+
+ /**
+ * Marks the section stale or reset the stale state.
+ *
+ * @param stale <code>True</code> to mark the section stale, <code>false</code> otherwise.
+ */
+ public final void markStale(boolean stale) {
+ if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_SECTIONS_STALE_STATE)) {
+ UIPlugin.getTraceHandler().trace("markStale: Set stale state to " + stale, //$NON-NLS-1$
+ ITraceIds.TRACE_SECTIONS_STALE_STATE, this);
+ }
+
+ if (stale) markStale();
+ else {
+ // For now, there is no direct way to reset the stale state,
+ // and the refresh() method is setting back both flags (stale and dirty).
+ // Plus, refresh() might be overwritten to refresh the widget content
+ // from the data itself, what will trigger an stack overflow after all.
+ try {
+ final Field f = AbstractFormPart.class.getDeclaredField("stale"); //$NON-NLS-1$
+ AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ @Override
+ public Object run() {
+ f.setAccessible(true);
+ return null;
+ }
+ });
+ f.setBoolean(this, stale);
+ if (getManagedForm() != null) getManagedForm().staleStateChanged();
+ } catch (Exception e) { /* ignored on purpose */ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.AbstractFormPart#commit(boolean)
+ */
+ @Override
+ public void commit(boolean onSave) {
+ // commit is reseting the dirty state
+ boolean hasBeenDirty = isDirty();
+ // Execute the commit
+ super.commit(onSave);
+ // signal the dirty state change to the manager form if
+ // it really has changed
+ if (hasBeenDirty) {
+ if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_SECTIONS_DIRTY_STATE)) {
+ UIPlugin.getTraceHandler().trace("Commit(" + onSave + ") reseted the dirty state to false.", //$NON-NLS-1$ //$NON-NLS-2$
+ ITraceIds.TRACE_SECTIONS_DIRTY_STATE, this);
+ }
+ if (onSave)
+ getManagedForm().dirtyStateChanged();
+ else
+ markDirty();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.AbstractFormPart#refresh()
+ */
+ @Override
+ public void refresh() {
+ // refresh is reseting both the stale and the dirty state
+ boolean hasBeenStale = isStale();
+ boolean hasBeenDirty = isDirty();
+
+ super.refresh();
+
+ if (hasBeenStale) {
+ if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_SECTIONS_STALE_STATE)) {
+ UIPlugin.getTraceHandler().trace("refresh() reseted the stale state to false.", //$NON-NLS-1$
+ ITraceIds.TRACE_SECTIONS_STALE_STATE, this);
+ }
+
+ getManagedForm().staleStateChanged();
+ }
+
+ if (hasBeenDirty) {
+ if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_SECTIONS_DIRTY_STATE)) {
+ UIPlugin.getTraceHandler().trace("refresh() reseted the dirty state to false.", //$NON-NLS-1$
+ ITraceIds.TRACE_SECTIONS_DIRTY_STATE, this);
+ }
+
+ getManagedForm().dirtyStateChanged();
+ }
+ }
+
+ /**
+ * Set the sections read only state.
+ * @param readOnly <code>true</code> if the sections controls should be read only.
+ */
+ public void setReadOnly(boolean readOnly) {
+ this.readOnly = readOnly;
+ }
+
+ /**
+ * Get the read only state of this section.
+ * @return The read onyly state.
+ */
+ public boolean isReadOnly() {
+ return readOnly;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.jface.interfaces.IValidatable#isValid()
+ */
+ @Override
+ public boolean isValid() {
+ setMessage(null, IMessageProvider.NONE);
+ return true;
+ }
+
+ /**
+ * Sets the message text and type.
+ *
+ * @param message The message or <code>null</code>.
+ * @param messageType The message type. See {@link IMessageProvider}.
+ */
+ protected final void setMessage(String message, int messageType) {
+ this.message = message;
+ this.messageType = messageType;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IMessageProvider#getMessage()
+ */
+ @Override
+ public final String getMessage() {
+ return message;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IMessageProvider#getMessageType()
+ */
+ @Override
+ public final int getMessageType() {
+ return messageType;
+ }
+
+ /**
+ * Marks if or if not the controls of the section are currently updated.
+ */
+ protected final void setIsUpdating(boolean updating) {
+ this.updating = updating;
+ }
+
+ /**
+ * Returns if or if not the controls of the section are currently updated.
+ *
+ * @return <code>True</code> if the controls are currently updated, <code>false</code> otherwise.
+ */
+ protected final boolean isUpdating() {
+ return updating;
+ }
+
+ /**
+ * Saves the widget history of all UI elements of the section.
+ *
+ * @param settings The dialog settings or <code>null</code>.
+ */
+ public void saveWidgetValues(IDialogSettings settings) {
+ }
+
+ /**
+ * Restores the widget history of all UI elements of the section.
+ *
+ * @param settings The dialog settings or <code>null</code>.
+ */
+ public void restoreWidgetValues(IDialogSettings settings) {
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractTableSection.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractTableSection.java
index a43213610..6e8a72a12 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractTableSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractTableSection.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.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractTreeSection.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractTreeSection.java
index b86e0eb5f..c4082f555 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractTreeSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractTreeSection.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.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/TablePart.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/TablePart.java
index 1548be9a4..55ea32ff4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/TablePart.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/TablePart.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.ui.swt/src/org/eclipse/tcf/te/ui/jface/dialogs/CustomTrayDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/jface/dialogs/CustomTrayDialog.java
index 72f110e99..2af016e59 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/jface/dialogs/CustomTrayDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/jface/dialogs/CustomTrayDialog.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.ui.swt/src/org/eclipse/tcf/te/ui/jface/images/AbstractImageDescriptor.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/jface/images/AbstractImageDescriptor.java
index 5f810d17e..e93021246 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/jface/images/AbstractImageDescriptor.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/jface/images/AbstractImageDescriptor.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.ui.swt/src/org/eclipse/tcf/te/ui/jface/interfaces/IValidatingContainer.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/jface/interfaces/IValidatingContainer.java
index fcda762ed..21d5636b5 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/jface/interfaces/IValidatingContainer.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/jface/interfaces/IValidatingContainer.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.ui.swt/src/org/eclipse/tcf/te/ui/swt/SWTControlUtil.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/swt/SWTControlUtil.java
index f9f292fdf..bde8ef511 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/swt/SWTControlUtil.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.swt/src/org/eclipse/tcf/te/ui/swt/SWTControlUtil.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.ui.terminals.process/src/org/eclipse/tcf/te/ui/terminals/process/ProcessConnectorType.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.process/src/org/eclipse/tcf/te/ui/terminals/process/ProcessConnectorType.java
index c787fc26c..7d0d667b3 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.process/src/org/eclipse/tcf/te/ui/terminals/process/ProcessConnectorType.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.process/src/org/eclipse/tcf/te/ui/terminals/process/ProcessConnectorType.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.ui.terminals.process/src/org/eclipse/tcf/te/ui/terminals/process/ProcessSettings.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.process/src/org/eclipse/tcf/te/ui/terminals/process/ProcessSettings.java
index 6433592b1..558e13edb 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.process/src/org/eclipse/tcf/te/ui/terminals/process/ProcessSettings.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.process/src/org/eclipse/tcf/te/ui/terminals/process/ProcessSettings.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.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/actions/AbstractAction.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/actions/AbstractAction.java
index 3dab1b1d6..3ab4f8cef 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/actions/AbstractAction.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/actions/AbstractAction.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.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/activator/UIPlugin.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/activator/UIPlugin.java
index 44100d632..7bd89ed7d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/activator/UIPlugin.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/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.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/help/IContextHelpIds.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/help/IContextHelpIds.java
index ed3000b1b..63a31668c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/help/IContextHelpIds.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/help/IContextHelpIds.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.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/ILauncherDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/ILauncherDelegate.java
index 84c0fec96..25df054fa 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/ILauncherDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/ILauncherDelegate.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.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/ImageConsts.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/ImageConsts.java
index 1a4ee78a5..ec47afc86 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/ImageConsts.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/ImageConsts.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.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/tracing/ITraceIds.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/tracing/ITraceIds.java
index c98d81404..1ed32c06c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/tracing/ITraceIds.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/tracing/ITraceIds.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.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/EncodingSelectionDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/EncodingSelectionDialog.java
index cead2df92..219044944 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/EncodingSelectionDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/EncodingSelectionDialog.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.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/handler/LaunchTerminalCommandHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/handler/LaunchTerminalCommandHandler.java
index af3083457..c6eaa4d37 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/handler/LaunchTerminalCommandHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/handler/LaunchTerminalCommandHandler.java
@@ -1,158 +1,158 @@
-/*******************************************************************************
- * 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.ui.terminals.internal.handler;
-
-import java.text.DateFormat;
-import java.util.Date;
-import java.util.Map;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
-import org.eclipse.tcf.te.runtime.services.ServiceManager;
-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.constants.ITerminalsConnectorConstants;
-import org.eclipse.tcf.te.ui.terminals.activator.UIPlugin;
-import org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate;
-import org.eclipse.tcf.te.ui.terminals.interfaces.tracing.ITraceIds;
-import org.eclipse.tcf.te.ui.terminals.internal.dialogs.LaunchTerminalSettingsDialog;
-import org.eclipse.tcf.te.ui.terminals.launcher.LauncherDelegateManager;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Launch terminal command handler implementation.
- */
-public class LaunchTerminalCommandHandler extends AbstractHandler {
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- String commandId = event.getCommand().getId();
- // "org.eclipse.tcf.te.ui.terminals.command.launchToolbar"
- // "org.eclipse.tcf.te.ui.terminals.command.launch"
-
- long start = System.currentTimeMillis();
-
- if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER)) {
- DateFormat format = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
- String date = format.format(new Date(start));
-
- UIPlugin.getTraceHandler().trace("Started at " + date + " (" + start + ")", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER, LaunchTerminalCommandHandler.this);
- }
-
- // Get the active shell
- Shell shell = HandlerUtil.getActiveShell(event);
- // Get the current selection
- ISelection selection = HandlerUtil.getCurrentSelection(event);
-
- if (commandId.equals("org.eclipse.tcf.te.ui.terminals.command.launchToolbar")) { //$NON-NLS-1$
- if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER)) {
- UIPlugin.getTraceHandler().trace("(a) Attempt to open launch terminal settings dialog after " + (System.currentTimeMillis() - start) + " ms.", //$NON-NLS-1$ //$NON-NLS-2$
- ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER, LaunchTerminalCommandHandler.this);
- }
-
- LaunchTerminalSettingsDialog dialog = new LaunchTerminalSettingsDialog(shell, start);
-
- if(isValidSelection(selection)){
- dialog.setSelection(selection);
- }
- if (dialog.open() == Window.OK) {
- // Get the terminal settings from the dialog
- IPropertiesContainer properties = dialog.getSettings();
- if (properties != null) {
- String delegateId = properties.getStringProperty(ITerminalsConnectorConstants.PROP_DELEGATE_ID);
- Assert.isNotNull(delegateId);
- ILauncherDelegate delegate = LauncherDelegateManager.getInstance().getLauncherDelegate(delegateId, false);
- Assert.isNotNull(delegateId);
- delegate.execute(properties, null);
- }
- }
- }
- else {
- if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER)) {
- UIPlugin.getTraceHandler().trace("Getting applicable launcher delegates after " + (System.currentTimeMillis() - start) + " ms.", //$NON-NLS-1$ //$NON-NLS-2$
- ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER, LaunchTerminalCommandHandler.this);
- }
-
- // Check if the dialog needs to be shown at all
- ILauncherDelegate[] delegates = LauncherDelegateManager.getInstance().getApplicableLauncherDelegates(selection);
-
- if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER)) {
- UIPlugin.getTraceHandler().trace("Got applicable launcher delegates after " + (System.currentTimeMillis() - start) + " ms.", //$NON-NLS-1$ //$NON-NLS-2$
- ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER, LaunchTerminalCommandHandler.this);
- }
-
- if (delegates.length > 1 || (delegates.length == 1 && delegates[0].needsUserConfiguration())) {
- if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER)) {
- UIPlugin.getTraceHandler().trace("(b) Attempt to open launch terminal settings dialog after " + (System.currentTimeMillis() - start) + " ms.", //$NON-NLS-1$ //$NON-NLS-2$
- ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER, LaunchTerminalCommandHandler.this);
- }
-
- // Create the launch terminal settings dialog
- LaunchTerminalSettingsDialog dialog = new LaunchTerminalSettingsDialog(shell, start);
- if(isValidSelection(selection)){
- dialog.setSelection(selection);
- }
- if (dialog.open() == Window.OK) {
- // Get the terminal settings from the dialog
- IPropertiesContainer properties = dialog.getSettings();
- if (properties != null) {
- String delegateId = properties.getStringProperty(ITerminalsConnectorConstants.PROP_DELEGATE_ID);
- Assert.isNotNull(delegateId);
- ILauncherDelegate delegate = LauncherDelegateManager.getInstance().getLauncherDelegate(delegateId, false);
- Assert.isNotNull(delegateId);
- delegate.execute(properties, null);
- }
- }
- }
- else if (delegates.length == 1) {
- ILauncherDelegate delegate = delegates[0];
- IPropertiesContainer properties = new PropertiesContainer();
-
- // Store the id of the selected delegate
- properties.setProperty(ITerminalsConnectorConstants.PROP_DELEGATE_ID, delegate.getId());
- // Store the selection
- properties.setProperty(ITerminalsConnectorConstants.PROP_SELECTION, selection);
-
- // Execute
- delegate.execute(properties, null);
- }
- }
-
- return null;
- }
-
- private boolean isValidSelection(ISelection selection) {
- if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
- Object element = ((IStructuredSelection) selection).getFirstElement();
- IPropertiesAccessService service = ServiceManager.getInstance().getService(element, IPropertiesAccessService.class);
- if (service != null) {
- Map<String, String> props = service.getTargetAddress(element);
- if (props != null && props.containsKey(IPropertiesAccessServiceConstants.PROP_ADDRESS)) {
- return true;
- }
- }
- }
-
- 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.ui.terminals.internal.handler;
+
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.Map;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
+import org.eclipse.tcf.te.runtime.services.ServiceManager;
+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.constants.ITerminalsConnectorConstants;
+import org.eclipse.tcf.te.ui.terminals.activator.UIPlugin;
+import org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate;
+import org.eclipse.tcf.te.ui.terminals.interfaces.tracing.ITraceIds;
+import org.eclipse.tcf.te.ui.terminals.internal.dialogs.LaunchTerminalSettingsDialog;
+import org.eclipse.tcf.te.ui.terminals.launcher.LauncherDelegateManager;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Launch terminal command handler implementation.
+ */
+public class LaunchTerminalCommandHandler extends AbstractHandler {
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ String commandId = event.getCommand().getId();
+ // "org.eclipse.tcf.te.ui.terminals.command.launchToolbar"
+ // "org.eclipse.tcf.te.ui.terminals.command.launch"
+
+ long start = System.currentTimeMillis();
+
+ if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER)) {
+ DateFormat format = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
+ String date = format.format(new Date(start));
+
+ UIPlugin.getTraceHandler().trace("Started at " + date + " (" + start + ")", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER, LaunchTerminalCommandHandler.this);
+ }
+
+ // Get the active shell
+ Shell shell = HandlerUtil.getActiveShell(event);
+ // Get the current selection
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+
+ if (commandId.equals("org.eclipse.tcf.te.ui.terminals.command.launchToolbar")) { //$NON-NLS-1$
+ if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER)) {
+ UIPlugin.getTraceHandler().trace("(a) Attempt to open launch terminal settings dialog after " + (System.currentTimeMillis() - start) + " ms.", //$NON-NLS-1$ //$NON-NLS-2$
+ ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER, LaunchTerminalCommandHandler.this);
+ }
+
+ LaunchTerminalSettingsDialog dialog = new LaunchTerminalSettingsDialog(shell, start);
+
+ if(isValidSelection(selection)){
+ dialog.setSelection(selection);
+ }
+ if (dialog.open() == Window.OK) {
+ // Get the terminal settings from the dialog
+ IPropertiesContainer properties = dialog.getSettings();
+ if (properties != null) {
+ String delegateId = properties.getStringProperty(ITerminalsConnectorConstants.PROP_DELEGATE_ID);
+ Assert.isNotNull(delegateId);
+ ILauncherDelegate delegate = LauncherDelegateManager.getInstance().getLauncherDelegate(delegateId, false);
+ Assert.isNotNull(delegateId);
+ delegate.execute(properties, null);
+ }
+ }
+ }
+ else {
+ if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER)) {
+ UIPlugin.getTraceHandler().trace("Getting applicable launcher delegates after " + (System.currentTimeMillis() - start) + " ms.", //$NON-NLS-1$ //$NON-NLS-2$
+ ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER, LaunchTerminalCommandHandler.this);
+ }
+
+ // Check if the dialog needs to be shown at all
+ ILauncherDelegate[] delegates = LauncherDelegateManager.getInstance().getApplicableLauncherDelegates(selection);
+
+ if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER)) {
+ UIPlugin.getTraceHandler().trace("Got applicable launcher delegates after " + (System.currentTimeMillis() - start) + " ms.", //$NON-NLS-1$ //$NON-NLS-2$
+ ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER, LaunchTerminalCommandHandler.this);
+ }
+
+ if (delegates.length > 1 || (delegates.length == 1 && delegates[0].needsUserConfiguration())) {
+ if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER)) {
+ UIPlugin.getTraceHandler().trace("(b) Attempt to open launch terminal settings dialog after " + (System.currentTimeMillis() - start) + " ms.", //$NON-NLS-1$ //$NON-NLS-2$
+ ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER, LaunchTerminalCommandHandler.this);
+ }
+
+ // Create the launch terminal settings dialog
+ LaunchTerminalSettingsDialog dialog = new LaunchTerminalSettingsDialog(shell, start);
+ if(isValidSelection(selection)){
+ dialog.setSelection(selection);
+ }
+ if (dialog.open() == Window.OK) {
+ // Get the terminal settings from the dialog
+ IPropertiesContainer properties = dialog.getSettings();
+ if (properties != null) {
+ String delegateId = properties.getStringProperty(ITerminalsConnectorConstants.PROP_DELEGATE_ID);
+ Assert.isNotNull(delegateId);
+ ILauncherDelegate delegate = LauncherDelegateManager.getInstance().getLauncherDelegate(delegateId, false);
+ Assert.isNotNull(delegateId);
+ delegate.execute(properties, null);
+ }
+ }
+ }
+ else if (delegates.length == 1) {
+ ILauncherDelegate delegate = delegates[0];
+ IPropertiesContainer properties = new PropertiesContainer();
+
+ // Store the id of the selected delegate
+ properties.setProperty(ITerminalsConnectorConstants.PROP_DELEGATE_ID, delegate.getId());
+ // Store the selection
+ properties.setProperty(ITerminalsConnectorConstants.PROP_SELECTION, selection);
+
+ // Execute
+ delegate.execute(properties, null);
+ }
+ }
+
+ return null;
+ }
+
+ private boolean isValidSelection(ISelection selection) {
+ if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
+ Object element = ((IStructuredSelection) selection).getFirstElement();
+ IPropertiesAccessService service = ServiceManager.getInstance().getService(element, IPropertiesAccessService.class);
+ if (service != null) {
+ Map<String, String> props = service.getTargetAddress(element);
+ if (props != null && props.containsKey(IPropertiesAccessServiceConstants.PROP_ADDRESS)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/launcher/LauncherDelegateManager.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/launcher/LauncherDelegateManager.java
index b1fa04db3..d4cf480bc 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/launcher/LauncherDelegateManager.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/launcher/LauncherDelegateManager.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.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/streams/AbstractStreamsConnector.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/streams/AbstractStreamsConnector.java
index bedbc7ef7..54290d3f7 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/streams/AbstractStreamsConnector.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/streams/AbstractStreamsConnector.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.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/streams/OutputStreamMonitor.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/streams/OutputStreamMonitor.java
index 7107e31a5..b729f903c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/streams/OutputStreamMonitor.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/streams/OutputStreamMonitor.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.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/streams/StreamsConnector.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/streams/StreamsConnector.java
index 805686977..6d8ccb0a7 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/streams/StreamsConnector.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/streams/StreamsConnector.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.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/tabs/TabFolderMenuHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/tabs/TabFolderMenuHandler.java
index c3fa53524..794b1754f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/tabs/TabFolderMenuHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/tabs/TabFolderMenuHandler.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.ui.views/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/plugin.properties
index 469302286..8f05de740 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/plugin.properties
@@ -1,89 +1,89 @@
-##################################################################################
-# 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, Common Views
-providerName = Eclipse.org - Target Explorer
-
-# ***** Extension Points *****
-
-ExtensionPoint.editorPages.name=Properties Editor Pages Extension Point
-ExtensionPoint.editorPageBindings.name=Properties Editor Page Bindings Extension Point
-ExtensionPoint.categories.name=Categories Extension Point
-ExtensionPoint.labelProviderDelegates.name=Label Provider Delegates Extension Point
-# ***** Perspective *****
-
-Perspective.name=Target Explorer
-
-# ***** Views *****
-
-View.name=System Management
-
-# ***** Editor *****
-
-Editor.name=Properties Editor
-
-# ***** Common Navigator *****
-
-navigatorContent.name = Categories
-
-# ***** Categories *****
-
-category.favorites.name=Favorites
-category.mytargets.name=My Targets
-category.neighborhood.name=Neighborhood
-
-# ***** Command and menu contributions *****
-command.open.name=Open
-
-command.open.label=Open
-command.open.mnemonic=O
-command.open.tooltip=Open the selection
-
-menu.showIn.label = Show In
-menu.properties.label = Properties
-
-command.showInProperties.label = Show In Properties
-
-command.refresh.label=Refresh
-command.refresh.description=Refresh the selected node
-
-command.filters.label = Filters...
-command.content.label = Content...
-command.filters.name = Filters
-command.content.name = Content
-
-menu.categories.addto.label=Add To
-menu.categories.removefrom.label=Remove From
-
-command.showin.name = Show In Group
-
-menu.find.label = Find...
-menu.find.mnemonic = f
-
-menu.filter.label = Filter...
-menu.filter.mnemonic = t
-
-menu.reset.label = Reset
-menu.reset.mnemonic = r
-
-command.find.name = Find...
-command.find.description = Find elements in a tree viewer
-
-command.filter.name = Quick Filter
-command.filter.description = Filter elements in a tree viewer
-
-command.reset.name = Reset Quick Filter
-command.reset.description = Reset quick filter in a tree viewer
-
-command.showInSM.name=Show In System Management
-command.showInSM.description=Show In System Management View
-
-command.apply.name=Apply
-command.apply.description=Apply changes
+##################################################################################
+# 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, Common Views
+providerName = Eclipse.org - Target Explorer
+
+# ***** Extension Points *****
+
+ExtensionPoint.editorPages.name=Properties Editor Pages Extension Point
+ExtensionPoint.editorPageBindings.name=Properties Editor Page Bindings Extension Point
+ExtensionPoint.categories.name=Categories Extension Point
+ExtensionPoint.labelProviderDelegates.name=Label Provider Delegates Extension Point
+# ***** Perspective *****
+
+Perspective.name=Target Explorer
+
+# ***** Views *****
+
+View.name=System Management
+
+# ***** Editor *****
+
+Editor.name=Properties Editor
+
+# ***** Common Navigator *****
+
+navigatorContent.name = Categories
+
+# ***** Categories *****
+
+category.favorites.name=Favorites
+category.mytargets.name=My Targets
+category.neighborhood.name=Neighborhood
+
+# ***** Command and menu contributions *****
+command.open.name=Open
+
+command.open.label=Open
+command.open.mnemonic=O
+command.open.tooltip=Open the selection
+
+menu.showIn.label = Show In
+menu.properties.label = Properties
+
+command.showInProperties.label = Show In Properties
+
+command.refresh.label=Refresh
+command.refresh.description=Refresh the selected node
+
+command.filters.label = Filters...
+command.content.label = Content...
+command.filters.name = Filters
+command.content.name = Content
+
+menu.categories.addto.label=Add To
+menu.categories.removefrom.label=Remove From
+
+command.showin.name = Show In Group
+
+menu.find.label = Find...
+menu.find.mnemonic = f
+
+menu.filter.label = Filter...
+menu.filter.mnemonic = t
+
+menu.reset.label = Reset
+menu.reset.mnemonic = r
+
+command.find.name = Find...
+command.find.description = Find elements in a tree viewer
+
+command.filter.name = Quick Filter
+command.filter.description = Filter elements in a tree viewer
+
+command.reset.name = Reset Quick Filter
+command.reset.description = Reset quick filter in a tree viewer
+
+command.showInSM.name=Show In System Management
+command.showInSM.description=Show In System Management View
+
+command.apply.name=Apply
+command.apply.description=Apply changes
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/actions/NewActionProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/actions/NewActionProvider.java
index d39068801..526961cb0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/actions/NewActionProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/actions/NewActionProvider.java
@@ -1,159 +1,159 @@
-/*******************************************************************************
- * 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
- * Tobias Schwarz (Wind River) - [368243] [UI] Allow dynamic new wizard contributions
- *******************************************************************************/
-package org.eclipse.tcf.te.ui.views.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.tcf.te.ui.help.IContextHelpIds;
-import org.eclipse.tcf.te.ui.interfaces.ImageConsts;
-import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
-import org.eclipse.tcf.te.ui.views.nls.Messages;
-import org.eclipse.tcf.te.ui.wizards.newWizard.NewWizardRegistry;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.internal.actions.CommandAction;
-import org.eclipse.ui.internal.navigator.wizards.WizardShortcutAction;
-import org.eclipse.ui.navigator.CommonActionProvider;
-import org.eclipse.ui.navigator.ICommonActionExtensionSite;
-import org.eclipse.ui.navigator.ICommonMenuConstants;
-import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
-import org.eclipse.ui.navigator.WizardActionGroup;
-import org.eclipse.ui.wizards.IWizardDescriptor;
-
-/**
- * Action provider implementation providing the "New >" content menu
- * content.
- */
-@SuppressWarnings("restriction")
-public class NewActionProvider extends CommonActionProvider {
- // Reference to the action showing the "Other..." dialog (context menu)
- private CommandAction newWizardCommandAction = null;
- // Reference to the action showing the "Other..." dialog (toolbar)
- private CommandAction newWizardCommandActionToolbar = null;
- // Reference to the action group managing the context sensitive new wizards
- private WizardActionGroup newWizardActionGroup = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.CommonActionProvider#init(org.eclipse.ui.navigator.ICommonActionExtensionSite)
- */
- @Override
- public void init(ICommonActionExtensionSite site) {
- super.init(site);
-
- if (site.getViewSite() instanceof ICommonViewerWorkbenchSite) {
- // To initialize the actions, the workbench window instance is required
- IWorkbenchWindow window = ((ICommonViewerWorkbenchSite)site.getViewSite()).getWorkbenchWindow();
- // Initialize the actions
- newWizardCommandAction = new CommandAction(window, "org.eclipse.tcf.te.ui.command.newWizards"); //$NON-NLS-1$
- newWizardCommandAction.setImageDescriptor(null);
- newWizardCommandAction.setDisabledImageDescriptor(null);
- newWizardCommandAction.setText(Messages.NewActionProvider_NewWizardCommandAction_label);
- newWizardCommandAction.setToolTipText(Messages.NewActionProvider_NewWizardCommandAction_tooltip);
- window.getWorkbench().getHelpSystem().setHelp(newWizardCommandAction, IContextHelpIds.NEW_TARGET_WIZARD);
-
- newWizardCommandActionToolbar = new CommandAction(window, "org.eclipse.tcf.te.ui.command.newWizards"); //$NON-NLS-1$
- newWizardCommandActionToolbar.setImageDescriptor(org.eclipse.tcf.te.ui.activator.UIPlugin.getImageDescriptor(ImageConsts.NEW_TARGET_WIZARD_ENABLED));
- newWizardCommandActionToolbar.setDisabledImageDescriptor(org.eclipse.tcf.te.ui.activator.UIPlugin.getImageDescriptor(ImageConsts.NEW_TARGET_WIZARD_DISABLED));
- newWizardCommandActionToolbar.setText(Messages.NewActionProvider_NewWizardCommandAction_label);
- newWizardCommandActionToolbar.setToolTipText(Messages.NewActionProvider_NewWizardCommandAction_tooltip);
- window.getWorkbench().getHelpSystem().setHelp(newWizardCommandActionToolbar, IContextHelpIds.NEW_TARGET_WIZARD);
-
- newWizardActionGroup = new WizardActionGroup(window,
- NewWizardRegistry.getInstance(),
- WizardActionGroup.TYPE_NEW,
- site.getContentService());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.ActionGroup#dispose()
- */
- @Override
- public void dispose() {
- if (newWizardCommandAction != null) {
- newWizardCommandAction.dispose();
- newWizardCommandAction = null;
- }
- if (newWizardActionGroup != null) {
- newWizardActionGroup.dispose();
- newWizardActionGroup = null;
- }
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
- @Override
- public void fillContextMenu(IMenuManager menu) {
- // If none of the actions got created, there is nothing to do here
- if (newWizardCommandAction == null && newWizardActionGroup == null) {
- return;
- }
-
- // Create the new sub menu
- IMenuManager newMenu = new MenuManager(Messages.NewActionProvider_NewMenu_label,
- org.eclipse.tcf.te.ui.activator.UIPlugin.getImageDescriptor(ImageConsts.NEW_TARGET_WIZARD_ENABLED),
- IUIConstants.ID_EXPLORER + ".menu.new"); //$NON-NLS-1$
-
- // Add the context sensitive wizards (commonWizard element)
- if (newWizardActionGroup != null) {
- newWizardActionGroup.setContext(getContext());
- newWizardActionGroup.fillContextMenu(newMenu);
- }
-
-
- IWorkbenchWindow window = ((ICommonViewerWorkbenchSite)getActionSite().getViewSite()).getWorkbenchWindow();
- for (IWizardDescriptor wizard : NewWizardRegistry.getInstance().getCommonWizards(getContext().getSelection())) {
- IAction action = new WizardShortcutAction(window, wizard);
- newMenu.add(action);
- }
-
- // Add the standard additions marker
- newMenu.add(new Separator(ICommonMenuConstants.GROUP_ADDITIONS));
-
- // Add the "Other..." dialog action
- if (newWizardCommandAction != null) {
- newMenu.add(new Separator());
- newMenu.add(newWizardCommandAction);
- }
-
- // The menu will be appended after the GROUP_NEW group.
- menu.insertAfter(ICommonMenuConstants.GROUP_NEW, newMenu);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.ActionGroup#fillActionBars(org.eclipse.ui.IActionBars)
- */
- @Override
- public void fillActionBars(IActionBars actionBars) {
- // If none of the actions got created, there is nothing to do here
- if (newWizardCommandActionToolbar == null) {
- return;
- }
-
- // Get the toolbar manager
- IToolBarManager toolbar = actionBars.getToolBarManager();
-
- // Check for the newWizard action in the toolbar. If found,
- // drop out immediately to avoid adding the items to the toolbar
- // again and again
- if (toolbar.find("org.eclipse.tcf.te.ui.command.newWizards") != null) { //$NON-NLS-1$
- return;
- }
-
- // Add the items to the toolbar
- toolbar.insertAfter(ICommonMenuConstants.GROUP_NEW, newWizardCommandActionToolbar);
- }
-}
+/*******************************************************************************
+ * 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
+ * Tobias Schwarz (Wind River) - [368243] [UI] Allow dynamic new wizard contributions
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.views.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.tcf.te.ui.help.IContextHelpIds;
+import org.eclipse.tcf.te.ui.interfaces.ImageConsts;
+import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
+import org.eclipse.tcf.te.ui.views.nls.Messages;
+import org.eclipse.tcf.te.ui.wizards.newWizard.NewWizardRegistry;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.internal.actions.CommandAction;
+import org.eclipse.ui.internal.navigator.wizards.WizardShortcutAction;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.ICommonMenuConstants;
+import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
+import org.eclipse.ui.navigator.WizardActionGroup;
+import org.eclipse.ui.wizards.IWizardDescriptor;
+
+/**
+ * Action provider implementation providing the "New >" content menu
+ * content.
+ */
+@SuppressWarnings("restriction")
+public class NewActionProvider extends CommonActionProvider {
+ // Reference to the action showing the "Other..." dialog (context menu)
+ private CommandAction newWizardCommandAction = null;
+ // Reference to the action showing the "Other..." dialog (toolbar)
+ private CommandAction newWizardCommandActionToolbar = null;
+ // Reference to the action group managing the context sensitive new wizards
+ private WizardActionGroup newWizardActionGroup = null;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.navigator.CommonActionProvider#init(org.eclipse.ui.navigator.ICommonActionExtensionSite)
+ */
+ @Override
+ public void init(ICommonActionExtensionSite site) {
+ super.init(site);
+
+ if (site.getViewSite() instanceof ICommonViewerWorkbenchSite) {
+ // To initialize the actions, the workbench window instance is required
+ IWorkbenchWindow window = ((ICommonViewerWorkbenchSite)site.getViewSite()).getWorkbenchWindow();
+ // Initialize the actions
+ newWizardCommandAction = new CommandAction(window, "org.eclipse.tcf.te.ui.command.newWizards"); //$NON-NLS-1$
+ newWizardCommandAction.setImageDescriptor(null);
+ newWizardCommandAction.setDisabledImageDescriptor(null);
+ newWizardCommandAction.setText(Messages.NewActionProvider_NewWizardCommandAction_label);
+ newWizardCommandAction.setToolTipText(Messages.NewActionProvider_NewWizardCommandAction_tooltip);
+ window.getWorkbench().getHelpSystem().setHelp(newWizardCommandAction, IContextHelpIds.NEW_TARGET_WIZARD);
+
+ newWizardCommandActionToolbar = new CommandAction(window, "org.eclipse.tcf.te.ui.command.newWizards"); //$NON-NLS-1$
+ newWizardCommandActionToolbar.setImageDescriptor(org.eclipse.tcf.te.ui.activator.UIPlugin.getImageDescriptor(ImageConsts.NEW_TARGET_WIZARD_ENABLED));
+ newWizardCommandActionToolbar.setDisabledImageDescriptor(org.eclipse.tcf.te.ui.activator.UIPlugin.getImageDescriptor(ImageConsts.NEW_TARGET_WIZARD_DISABLED));
+ newWizardCommandActionToolbar.setText(Messages.NewActionProvider_NewWizardCommandAction_label);
+ newWizardCommandActionToolbar.setToolTipText(Messages.NewActionProvider_NewWizardCommandAction_tooltip);
+ window.getWorkbench().getHelpSystem().setHelp(newWizardCommandActionToolbar, IContextHelpIds.NEW_TARGET_WIZARD);
+
+ newWizardActionGroup = new WizardActionGroup(window,
+ NewWizardRegistry.getInstance(),
+ WizardActionGroup.TYPE_NEW,
+ site.getContentService());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.actions.ActionGroup#dispose()
+ */
+ @Override
+ public void dispose() {
+ if (newWizardCommandAction != null) {
+ newWizardCommandAction.dispose();
+ newWizardCommandAction = null;
+ }
+ if (newWizardActionGroup != null) {
+ newWizardActionGroup.dispose();
+ newWizardActionGroup = null;
+ }
+ super.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
+ */
+ @Override
+ public void fillContextMenu(IMenuManager menu) {
+ // If none of the actions got created, there is nothing to do here
+ if (newWizardCommandAction == null && newWizardActionGroup == null) {
+ return;
+ }
+
+ // Create the new sub menu
+ IMenuManager newMenu = new MenuManager(Messages.NewActionProvider_NewMenu_label,
+ org.eclipse.tcf.te.ui.activator.UIPlugin.getImageDescriptor(ImageConsts.NEW_TARGET_WIZARD_ENABLED),
+ IUIConstants.ID_EXPLORER + ".menu.new"); //$NON-NLS-1$
+
+ // Add the context sensitive wizards (commonWizard element)
+ if (newWizardActionGroup != null) {
+ newWizardActionGroup.setContext(getContext());
+ newWizardActionGroup.fillContextMenu(newMenu);
+ }
+
+
+ IWorkbenchWindow window = ((ICommonViewerWorkbenchSite)getActionSite().getViewSite()).getWorkbenchWindow();
+ for (IWizardDescriptor wizard : NewWizardRegistry.getInstance().getCommonWizards(getContext().getSelection())) {
+ IAction action = new WizardShortcutAction(window, wizard);
+ newMenu.add(action);
+ }
+
+ // Add the standard additions marker
+ newMenu.add(new Separator(ICommonMenuConstants.GROUP_ADDITIONS));
+
+ // Add the "Other..." dialog action
+ if (newWizardCommandAction != null) {
+ newMenu.add(new Separator());
+ newMenu.add(newWizardCommandAction);
+ }
+
+ // The menu will be appended after the GROUP_NEW group.
+ menu.insertAfter(ICommonMenuConstants.GROUP_NEW, newMenu);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.actions.ActionGroup#fillActionBars(org.eclipse.ui.IActionBars)
+ */
+ @Override
+ public void fillActionBars(IActionBars actionBars) {
+ // If none of the actions got created, there is nothing to do here
+ if (newWizardCommandActionToolbar == null) {
+ return;
+ }
+
+ // Get the toolbar manager
+ IToolBarManager toolbar = actionBars.getToolBarManager();
+
+ // Check for the newWizard action in the toolbar. If found,
+ // drop out immediately to avoid adding the items to the toolbar
+ // again and again
+ if (toolbar.find("org.eclipse.tcf.te.ui.command.newWizards") != null) { //$NON-NLS-1$
+ return;
+ }
+
+ // Add the items to the toolbar
+ toolbar.insertAfter(ICommonMenuConstants.GROUP_NEW, newWizardCommandActionToolbar);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/activator/UIPlugin.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/activator/UIPlugin.java
index f04a85f86..533665e09 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/activator/UIPlugin.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/activator/UIPlugin.java
@@ -1,176 +1,176 @@
-/*******************************************************************************
- * 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.ui.views.activator;
-
-import java.net.URL;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.tcf.te.runtime.preferences.ScopedEclipsePreferences;
-import org.eclipse.tcf.te.runtime.tracing.TraceHandler;
-import org.eclipse.tcf.te.ui.views.Managers;
-import org.eclipse.tcf.te.ui.views.interfaces.ImageConsts;
-import org.eclipse.tcf.te.ui.views.listeners.WorkbenchWindowListener;
-import org.eclipse.ui.IWindowListener;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class UIPlugin extends AbstractUIPlugin {
- // The shared instance
- private static UIPlugin plugin;
- // The scoped preferences instance
- private static volatile ScopedEclipsePreferences scopedPreferences;
- // The trace handler instance
- private static volatile TraceHandler traceHandler;
-
- // The global window listener instance
- private IWindowListener windowListener;
-
- /**
- * The constructor
- */
- public UIPlugin() {
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static UIPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Convenience method which returns the unique identifier of this plugin.
- */
- public static String getUniqueIdentifier() {
- if (getDefault() != null && getDefault().getBundle() != null) {
- return getDefault().getBundle().getSymbolicName();
- }
- return "org.eclipse.tcf.te.ui.views"; //$NON-NLS-1$
- }
-
- /**
- * Return the scoped preferences for this plugin.
- */
- public static ScopedEclipsePreferences getScopedPreferences() {
- if (scopedPreferences == null) {
- scopedPreferences = new ScopedEclipsePreferences(getUniqueIdentifier());
- }
- return scopedPreferences;
- }
-
- /**
- * Returns the bundles trace handler.
- *
- * @return The bundles trace handler.
- */
- public static TraceHandler getTraceHandler() {
- if (traceHandler == null) {
- traceHandler = new TraceHandler(getUniqueIdentifier());
- }
- return traceHandler;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
-
- if (windowListener == null && PlatformUI.getWorkbench() != null) {
- windowListener = new WorkbenchWindowListener();
- PlatformUI.getWorkbench().addWindowListener(windowListener);
- activateContexts();
- }
- }
-
- void activateContexts() {
- if (Display.getCurrent() != null) {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window != null && windowListener != null) windowListener.windowOpened(window);
- }
- else {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable(){
- @Override
- public void run() {
- activateContexts();
- }});
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- if (windowListener != null && PlatformUI.getWorkbench() != null) {
- PlatformUI.getWorkbench().removeWindowListener(windowListener);
- windowListener = null;
- }
-
- Managers.dispose();
-
- plugin = null;
- scopedPreferences = null;
- traceHandler = null;
- super.stop(context);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
- */
- @Override
- protected void initializeImageRegistry(ImageRegistry registry) {
- URL url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_EVIEW + "prop_ps.gif"); //$NON-NLS-1$
- registry.put(ImageConsts.EDITOR, ImageDescriptor.createFromURL(url));
- url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_EVIEW + "targets_view.gif"); //$NON-NLS-1$
- registry.put(ImageConsts.VIEW, ImageDescriptor.createFromURL(url));
-
- url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_ETOOL + "help.gif"); //$NON-NLS-1$
- registry.put(ImageConsts.HELP, ImageDescriptor.createFromURL(url));
-
- url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OBJ + "favorites.gif"); //$NON-NLS-1$
- registry.put(ImageConsts.FAVORITES, ImageDescriptor.createFromURL(url));
- }
-
- /**
- * Loads the image registered under the specified key from the image
- * registry and returns the <code>Image</code> object instance.
- *
- * @param key The key the image is registered with.
- * @return The <code>Image</code> object instance or <code>null</code>.
- */
- public static Image getImage(String key) {
- return getDefault().getImageRegistry().get(key);
- }
-
- /**
- * Loads the image registered under the specified key from the image
- * registry and returns the <code>ImageDescriptor</code> object instance.
- *
- * @param key The key the image is registered with.
- * @return The <code>ImageDescriptor</code> object instance or <code>null</code>.
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- return getDefault().getImageRegistry().getDescriptor(key);
- }
-}
+/*******************************************************************************
+ * 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.ui.views.activator;
+
+import java.net.URL;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.tcf.te.runtime.preferences.ScopedEclipsePreferences;
+import org.eclipse.tcf.te.runtime.tracing.TraceHandler;
+import org.eclipse.tcf.te.ui.views.Managers;
+import org.eclipse.tcf.te.ui.views.interfaces.ImageConsts;
+import org.eclipse.tcf.te.ui.views.listeners.WorkbenchWindowListener;
+import org.eclipse.ui.IWindowListener;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class UIPlugin extends AbstractUIPlugin {
+ // The shared instance
+ private static UIPlugin plugin;
+ // The scoped preferences instance
+ private static volatile ScopedEclipsePreferences scopedPreferences;
+ // The trace handler instance
+ private static volatile TraceHandler traceHandler;
+
+ // The global window listener instance
+ private IWindowListener windowListener;
+
+ /**
+ * The constructor
+ */
+ public UIPlugin() {
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static UIPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Convenience method which returns the unique identifier of this plugin.
+ */
+ public static String getUniqueIdentifier() {
+ if (getDefault() != null && getDefault().getBundle() != null) {
+ return getDefault().getBundle().getSymbolicName();
+ }
+ return "org.eclipse.tcf.te.ui.views"; //$NON-NLS-1$
+ }
+
+ /**
+ * Return the scoped preferences for this plugin.
+ */
+ public static ScopedEclipsePreferences getScopedPreferences() {
+ if (scopedPreferences == null) {
+ scopedPreferences = new ScopedEclipsePreferences(getUniqueIdentifier());
+ }
+ return scopedPreferences;
+ }
+
+ /**
+ * Returns the bundles trace handler.
+ *
+ * @return The bundles trace handler.
+ */
+ public static TraceHandler getTraceHandler() {
+ if (traceHandler == null) {
+ traceHandler = new TraceHandler(getUniqueIdentifier());
+ }
+ return traceHandler;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+
+ if (windowListener == null && PlatformUI.getWorkbench() != null) {
+ windowListener = new WorkbenchWindowListener();
+ PlatformUI.getWorkbench().addWindowListener(windowListener);
+ activateContexts();
+ }
+ }
+
+ void activateContexts() {
+ if (Display.getCurrent() != null) {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (window != null && windowListener != null) windowListener.windowOpened(window);
+ }
+ else {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable(){
+ @Override
+ public void run() {
+ activateContexts();
+ }});
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ if (windowListener != null && PlatformUI.getWorkbench() != null) {
+ PlatformUI.getWorkbench().removeWindowListener(windowListener);
+ windowListener = null;
+ }
+
+ Managers.dispose();
+
+ plugin = null;
+ scopedPreferences = null;
+ traceHandler = null;
+ super.stop(context);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
+ */
+ @Override
+ protected void initializeImageRegistry(ImageRegistry registry) {
+ URL url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_EVIEW + "prop_ps.gif"); //$NON-NLS-1$
+ registry.put(ImageConsts.EDITOR, ImageDescriptor.createFromURL(url));
+ url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_EVIEW + "targets_view.gif"); //$NON-NLS-1$
+ registry.put(ImageConsts.VIEW, ImageDescriptor.createFromURL(url));
+
+ url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_ETOOL + "help.gif"); //$NON-NLS-1$
+ registry.put(ImageConsts.HELP, ImageDescriptor.createFromURL(url));
+
+ url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OBJ + "favorites.gif"); //$NON-NLS-1$
+ registry.put(ImageConsts.FAVORITES, ImageDescriptor.createFromURL(url));
+ }
+
+ /**
+ * Loads the image registered under the specified key from the image
+ * registry and returns the <code>Image</code> object instance.
+ *
+ * @param key The key the image is registered with.
+ * @return The <code>Image</code> object instance or <code>null</code>.
+ */
+ public static Image getImage(String key) {
+ return getDefault().getImageRegistry().get(key);
+ }
+
+ /**
+ * Loads the image registered under the specified key from the image
+ * registry and returns the <code>ImageDescriptor</code> object instance.
+ *
+ * @param key The key the image is registered with.
+ * @return The <code>ImageDescriptor</code> object instance or <code>null</code>.
+ */
+ public static ImageDescriptor getImageDescriptor(String key) {
+ return getDefault().getImageRegistry().getDescriptor(key);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/categories/Category.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/categories/Category.java
index 4961e5da1..740b50410 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/categories/Category.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/categories/Category.java
@@ -1,209 +1,209 @@
-/*******************************************************************************
- * 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.ui.views.categories;
-
-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.expressions.IEvaluationContext;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-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.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.tcf.te.runtime.extensions.ExecutableExtension;
-import org.eclipse.tcf.te.runtime.interfaces.IDisposable;
-import org.eclipse.tcf.te.ui.views.Managers;
-import org.eclipse.tcf.te.ui.views.activator.UIPlugin;
-import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
-import org.eclipse.tcf.te.ui.views.interfaces.categories.ICategorizable;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.handlers.IHandlerService;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-/**
- * Default category implementation.
- */
-public class Category extends ExecutableExtension implements ICategory, IDisposable, IPersistableElement {
- // The category image / image descriptor
- private ImageDescriptor descriptor = null;
- private Image image = null;
- // The sorting rank
- private int rank = -1;
- // The converted expression
- private Expression expression;
-
- /* (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 {
- super.setInitializationData(config, propertyName, data);
-
- // Read the icon attribute and create the image
- String attrIcon = config.getAttribute("icon");//$NON-NLS-1$
- if (attrIcon != null) {
- descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(config.getNamespaceIdentifier(), attrIcon);
- if (descriptor != null) {
- image = JFaceResources.getResources().createImageWithDefault(descriptor);
- }
- }
-
- // Read the rank attribute
- String attrRank = config.getAttribute("rank"); //$NON-NLS-1$
- if (attrRank != null) {
- try {
- rank = Integer.valueOf(attrRank).intValue();
- } catch (NumberFormatException e) { /* ignored on purpose */ }
- }
-
- // Read the "enablement" sub element of the extension
- IConfigurationElement[] children = config.getChildren("enablement"); //$NON-NLS-1$
- // Only one "enablement" element is expected
- if (children != null && children.length > 0) {
- expression = ExpressionConverter.getDefault().perform(children[0]);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
- */
- @Override
- public Object getAdapter(Class adapter) {
- if(adapter == IPersistableElement.class) {
- return this;
- }
- return super.getAdapter(adapter);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
- */
- @Override
- public void saveState(IMemento memento) {
- memento.putString("id", this.getId()); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.IPersistableElement#getFactoryId()
- */
- @Override
- public String getFactoryId() {
- return "org.eclipse.tcf.te.ui.views.categoryFactory"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.IDisposable#dispose()
- */
- @Override
- public void dispose() {
- if (descriptor != null) {
- JFaceResources.getResources().destroyImage(descriptor);
- descriptor = null;
- }
- image = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.interfaces.ICategory#getImage()
- */
- @Override
- public Image getImage() {
- return image;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.interfaces.ICategory#getChildren()
- */
- @Override
- public Object[] getChildren() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.interfaces.ICategory#getRank()
- */
- @Override
- public int getRank() {
- return rank;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.interfaces.ICategory#belongsTo(java.lang.Object)
- */
- @Override
- public boolean belongsTo(Object element) {
- ICategorizable categorizable = null;
- if (element instanceof IAdaptable) {
- categorizable = (ICategorizable)((IAdaptable)element).getAdapter(ICategorizable.class);
- }
- if (categorizable == null) {
- categorizable = (ICategorizable)Platform.getAdapterManager().getAdapter(element, ICategorizable.class);
- }
- return categorizable != null ? Managers.getCategoryManager().belongsTo(getId(), categorizable.getId()) : false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.interfaces.ICategory#isEnabled()
- */
- @Override
- public boolean isEnabled() {
- // The category is enabled if no "enablement" expression is found
- boolean enabled = true;
-
- if (expression != null) {
- // Get the handler service
- IHandlerService handlerSvc = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
- Assert.isNotNull(handlerSvc);
-
- // Get the current state
- IEvaluationContext currentState = handlerSvc.getCurrentState();
-
- // Construct the evaluation context to pass to the expression
- // The expressions default variable is the category itself.
- IEvaluationContext ctx = new EvaluationContext(currentState, this);
- try {
- enabled = expression.evaluate(ctx).equals(EvaluationResult.TRUE);
- } catch (CoreException e) {
- IStatus status = new Status(IStatus.ERROR, UIPlugin.getUniqueIdentifier(), e.getLocalizedMessage(), e);
- UIPlugin.getDefault().getLog().log(status);
- }
- }
-
- return enabled;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- StringBuffer buffer = new StringBuffer(getLabel());
- buffer.append(" ["); //$NON-NLS-1$
- buffer.append(getId());
- buffer.append("] {rank="); //$NON-NLS-1$
- buffer.append(getRank());
- buffer.append(", enabled="); //$NON-NLS-1$
- buffer.append(isEnabled());
- buffer.append("}"); //$NON-NLS-1$
- return buffer.toString();
- }
-}
+/*******************************************************************************
+ * 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.ui.views.categories;
+
+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.expressions.IEvaluationContext;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+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.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.tcf.te.runtime.extensions.ExecutableExtension;
+import org.eclipse.tcf.te.runtime.interfaces.IDisposable;
+import org.eclipse.tcf.te.ui.views.Managers;
+import org.eclipse.tcf.te.ui.views.activator.UIPlugin;
+import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
+import org.eclipse.tcf.te.ui.views.interfaces.categories.ICategorizable;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+/**
+ * Default category implementation.
+ */
+public class Category extends ExecutableExtension implements ICategory, IDisposable, IPersistableElement {
+ // The category image / image descriptor
+ private ImageDescriptor descriptor = null;
+ private Image image = null;
+ // The sorting rank
+ private int rank = -1;
+ // The converted expression
+ private Expression expression;
+
+ /* (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 {
+ super.setInitializationData(config, propertyName, data);
+
+ // Read the icon attribute and create the image
+ String attrIcon = config.getAttribute("icon");//$NON-NLS-1$
+ if (attrIcon != null) {
+ descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(config.getNamespaceIdentifier(), attrIcon);
+ if (descriptor != null) {
+ image = JFaceResources.getResources().createImageWithDefault(descriptor);
+ }
+ }
+
+ // Read the rank attribute
+ String attrRank = config.getAttribute("rank"); //$NON-NLS-1$
+ if (attrRank != null) {
+ try {
+ rank = Integer.valueOf(attrRank).intValue();
+ } catch (NumberFormatException e) { /* ignored on purpose */ }
+ }
+
+ // Read the "enablement" sub element of the extension
+ IConfigurationElement[] children = config.getChildren("enablement"); //$NON-NLS-1$
+ // Only one "enablement" element is expected
+ if (children != null && children.length > 0) {
+ expression = ExpressionConverter.getDefault().perform(children[0]);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(Class adapter) {
+ if(adapter == IPersistableElement.class) {
+ return this;
+ }
+ return super.getAdapter(adapter);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
+ */
+ @Override
+ public void saveState(IMemento memento) {
+ memento.putString("id", this.getId()); //$NON-NLS-1$
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IPersistableElement#getFactoryId()
+ */
+ @Override
+ public String getFactoryId() {
+ return "org.eclipse.tcf.te.ui.views.categoryFactory"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.interfaces.IDisposable#dispose()
+ */
+ @Override
+ public void dispose() {
+ if (descriptor != null) {
+ JFaceResources.getResources().destroyImage(descriptor);
+ descriptor = null;
+ }
+ image = null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.interfaces.ICategory#getImage()
+ */
+ @Override
+ public Image getImage() {
+ return image;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.interfaces.ICategory#getChildren()
+ */
+ @Override
+ public Object[] getChildren() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.interfaces.ICategory#getRank()
+ */
+ @Override
+ public int getRank() {
+ return rank;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.interfaces.ICategory#belongsTo(java.lang.Object)
+ */
+ @Override
+ public boolean belongsTo(Object element) {
+ ICategorizable categorizable = null;
+ if (element instanceof IAdaptable) {
+ categorizable = (ICategorizable)((IAdaptable)element).getAdapter(ICategorizable.class);
+ }
+ if (categorizable == null) {
+ categorizable = (ICategorizable)Platform.getAdapterManager().getAdapter(element, ICategorizable.class);
+ }
+ return categorizable != null ? Managers.getCategoryManager().belongsTo(getId(), categorizable.getId()) : false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.interfaces.ICategory#isEnabled()
+ */
+ @Override
+ public boolean isEnabled() {
+ // The category is enabled if no "enablement" expression is found
+ boolean enabled = true;
+
+ if (expression != null) {
+ // Get the handler service
+ IHandlerService handlerSvc = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
+ Assert.isNotNull(handlerSvc);
+
+ // Get the current state
+ IEvaluationContext currentState = handlerSvc.getCurrentState();
+
+ // Construct the evaluation context to pass to the expression
+ // The expressions default variable is the category itself.
+ IEvaluationContext ctx = new EvaluationContext(currentState, this);
+ try {
+ enabled = expression.evaluate(ctx).equals(EvaluationResult.TRUE);
+ } catch (CoreException e) {
+ IStatus status = new Status(IStatus.ERROR, UIPlugin.getUniqueIdentifier(), e.getLocalizedMessage(), e);
+ UIPlugin.getDefault().getLog().log(status);
+ }
+ }
+
+ return enabled;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ StringBuffer buffer = new StringBuffer(getLabel());
+ buffer.append(" ["); //$NON-NLS-1$
+ buffer.append(getId());
+ buffer.append("] {rank="); //$NON-NLS-1$
+ buffer.append(getRank());
+ buffer.append(", enabled="); //$NON-NLS-1$
+ buffer.append(isEnabled());
+ buffer.append("}"); //$NON-NLS-1$
+ return buffer.toString();
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/Editor.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/Editor.java
index d86ab77cd..1c7922127 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/Editor.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/Editor.java
@@ -1,530 +1,530 @@
-/*******************************************************************************
- * 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.ui.views.editor;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.tcf.te.ui.views.editor.pages.AbstractEditorPage;
-import org.eclipse.tcf.te.ui.views.extensions.EditorPageBinding;
-import org.eclipse.tcf.te.ui.views.extensions.EditorPageBindingExtensionPointManager;
-import org.eclipse.tcf.te.ui.views.extensions.EditorPageExtensionPointManager;
-import org.eclipse.tcf.te.ui.views.interfaces.IEditorPage;
-import org.eclipse.tcf.te.ui.views.interfaces.IEditorSaveAsAdapter;
-import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IPersistable;
-import org.eclipse.ui.IPersistableEditor;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.XMLMemento;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.IFormPage;
-import org.eclipse.ui.internal.part.NullEditorInput;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-
-
-/**
- * Editor implementation.
- */
-@SuppressWarnings("restriction")
-public final class Editor extends FormEditor implements IPersistableEditor, ITabbedPropertySheetPageContributor {
-
- // The reference to an memento to restore once the editor got activated
- private IMemento mementoToRestore;
-
- // The editor event listener instance
- private EditorEventListener listener;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.forms.editor.FormEditor#addPages()
- */
- @Override
- protected void addPages() {
- // Read extension point and add the contributed pages.
- IEditorInput input = getEditorInput();
- // Get all applicable editor page bindings
- EditorPageBinding[] bindings = EditorPageBindingExtensionPointManager.getInstance().getApplicableEditorPageBindings(input);
- for (EditorPageBinding binding : bindings) {
- processPageBinding(binding);
- }
-
- if (mementoToRestore != null) {
- // Loop over all registered pages and pass on the editor specific memento
- // to the pages which implements IPersistableEditor as well
- for (Object page : pages) {
- if (page instanceof IPersistableEditor) {
- ((IPersistableEditor)page).restoreState(mementoToRestore);
- }
- }
- mementoToRestore = null;
- }
- }
-
- /**
- * Override this method to delegate the setFocus to
- * the active form page.
- */
- @Override
- public void setFocus() {
- IFormPage fpage = getActivePageInstance();
- if(fpage != null) {
- fpage.setFocus();
- }
- else {
- super.setFocus();
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.forms.editor.FormEditor#getActivePageInstance()
- */
- @Override
- public IFormPage getActivePageInstance() {
- int index = getActivePage();
- if (index != -1) {
- return getPage(index);
- }
- return super.getActivePageInstance();
- }
-
- /**
- * Returns the page which has the specified index.
- *
- * @param index The page's index.
- * @return The page object or null if it does not exists.
- */
- private IFormPage getPage(int index) {
- for (int i = 0; i < pages.size(); i++) {
- Object page = pages.get(i);
- if (page instanceof IFormPage) {
- IFormPage fpage = (IFormPage) page;
- if (fpage.getIndex() == index) {
- return fpage;
- }
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.forms.editor.FormEditor#setActivePage(int)
- */
- @Override
- public void setActivePage(int pageIndex) {
- if (getPage(pageIndex) != null) {
- super.setActivePage(pageIndex);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.MultiPageEditorPart#getEditor(int)
- */
- @Override
- protected IEditorPart getEditor(int pageIndex) {
- return getPage(pageIndex) != null ? super.getEditor(pageIndex) : null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.forms.editor.FormEditor#createPageContainer(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Composite createPageContainer(Composite parent) {
- // Create page container is the first method called by the final
- // MultiPageEditorPart#createPartControl. Use it as hook to close
- // editors with a NullEditorInput.
- if (getEditorInput() instanceof NullEditorInput) {
-// DisplayUtil.safeAsyncExec(new Runnable() {
-// @Override
-// public void run() {
-// close(false);
-// }
-// });
- close(false);
- }
-
- return super.createPageContainer(parent);
- }
-
- /**
- * Update the editor page list. Pages which are not longer valid
- * will be removed and pages now being valid gets added.
- */
- public void updatePageList() {
- // Remember the currently active page
- String activePageId = getActivePageInstance() != null ? getActivePageInstance().getId() : null;
- String activePageTitle = getActivePageInstance() != null ? getActivePageInstance().getTitle() : null;
- // Get the editor input object
- IEditorInput input = getEditorInput();
- // Get all applicable editor page bindings
- List<EditorPageBinding> bindings = new ArrayList<EditorPageBinding>(Arrays.asList(EditorPageBindingExtensionPointManager.getInstance().getApplicableEditorPageBindings(input)));
- // Get a copy of the currently added pages
- List<Object> oldPages = pages != null ? new ArrayList<Object>(Arrays.asList(pages.toArray())) : new ArrayList<Object>();
- // Loop through the old pages and determine if the page is still applicable
- Iterator<Object> iterator = oldPages.iterator();
- while (iterator.hasNext()) {
- Object element = iterator.next();
- // Skip over pages not being a form page.
- if (!(element instanceof IFormPage)) {
- continue;
- }
- IFormPage page = (IFormPage)element;
- // Find the corresponding page binding
- EditorPageBinding binding = null;
- for (EditorPageBinding candidate : bindings) {
- if (candidate.getPageId().equals(page.getId())) {
- binding = candidate;
- break;
- }
- }
- if (binding != null) {
- // Found binding -> page is still applicable
- bindings.remove(binding);
- } else {
- // No binding found -> page is not longer applicable
- removePage(pages.indexOf(page));
- }
- }
- // If the are remaining bindings left, this are new pages.
- // --> Process them now
- for (EditorPageBinding binding : bindings) {
- processPageBinding(binding);
- }
- // If possible, restore the active page
- if (activePageId != null) {
- int index = getIndexOf(activePageId);
- if (index == -1 && activePageTitle != null) {
- index = getIndexOfByTitle(activePageTitle);
- }
- if (index != -1) setActivePage(index);
- }
- }
-
- /**
- * Process the given editor page binding.
- *
- * @param binding The editor page binding. Must not be <code>null</code>.
- */
- protected void processPageBinding(EditorPageBinding binding) {
- Assert.isNotNull(binding);
-
- String pageId = binding.getPageId();
- if (pageId != null) {
- // Get the corresponding editor page instance
- IEditorPage page = EditorPageExtensionPointManager.getInstance().getEditorPage(pageId, true);
- if (page != null) {
- try {
- // Associate this editor with the page instance.
- // This is typically done in the constructor, but we are
- // utilizing a default constructor to instantiate the page.
- page.initialize(this);
-
- // Read in the "insertBefore" and "insertAfter" properties of the binding
- String insertBefore = binding.getInsertBefore().trim();
- String insertAfter = binding.getInsertAfter().trim();
-
- boolean pageAdded = false;
-
- // insertBefore will be processed before insertAfter.
- if (!"".equals(insertBefore)) { //$NON-NLS-1$
- String[] pageIds = insertBefore.split(","); //$NON-NLS-1$
- for (String insertBeforePageId : pageIds) {
- // If it is "first", we insert the page at index 0
- if ("first".equalsIgnoreCase(insertBeforePageId)) { //$NON-NLS-1$
- if (getIndexOf(page.getId()) == -1) {
- addPage(0, page);
- }
- pageAdded = true;
- break;
- }
-
- // Find the index of the page we shall insert this page before
- int index = getIndexOf(insertBeforePageId);
- if (index != -1) {
- if (getIndexOf(page.getId()) == -1) {
- addPage(index, page);
- }
- pageAdded = true;
- break;
- }
- }
- }
-
- // If the page hasn't been added till now, process insertAfter
- if (!pageAdded && !"".equals(insertAfter)) { //$NON-NLS-1$
- String[] pageIds = insertAfter.split(","); //$NON-NLS-1$
- for (String insertAfterPageId : pageIds) {
- // If it is "last", we insert the page at the end
- if ("last".equalsIgnoreCase(insertAfterPageId)) { //$NON-NLS-1$
- if (getIndexOf(page.getId()) == -1) {
- addPage(page);
- }
- pageAdded = true;
- break;
- }
-
- // Find the index of the page we shall insert this page after
- int index = getIndexOf(insertAfterPageId);
- if (index != -1 && index + 1 < pages.size()) {
- if (getIndexOf(page.getId()) == -1) {
- addPage(index + 1, page);
- }
- pageAdded = true;
- break;
- }
- }
- }
-
- // Add the page to the end if not added otherwise
- if (!pageAdded && getIndexOf(page.getId()) == -1) {
- addPage(page);
- }
-
- } catch (PartInitException e) { /* ignored on purpose */ }
- }
- }
- }
-
- /**
- * Returns the index of the page with the given id.
- *
- * @param pageId The page id. Must not be <code>null</code>.
- * @return The page index or <code>-1</code> if not found.
- */
- private int getIndexOf(String pageId) {
- Assert.isNotNull(pageId);
- for (int i = 0; i < pages.size(); i++) {
- Object page = pages.get(i);
- if (page instanceof IFormPage) {
- IFormPage fpage = (IFormPage)page;
- if (fpage.getId().equals(pageId)) {
- return i;
- }
- }
- }
- return -1;
- }
-
- /**
- * Returns the index of the page with the given title.
- *
- * @param pageTitle The page title. Must not be <code>null</code>.
- * @return The page index or <code>-1</code> if not found.
- */
- private int getIndexOfByTitle(String pageTitle) {
- Assert.isNotNull(pageTitle);
- for (int i = 0; i < pages.size(); i++) {
- Object page = pages.get(i);
- if (page instanceof IFormPage) {
- IFormPage fpage = (IFormPage)page;
- if (fpage.getTitle().equals(pageTitle)) {
- return i;
- }
- }
- }
- return -1;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.forms.editor.FormPage#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
- */
- @Override
- public void init(IEditorSite site, IEditorInput input) throws PartInitException {
- super.init(site, input);
-
- // Update the part name
- if (!"".equals(input.getName())) { //$NON-NLS-1$
- setPartName(input.getName());
- }
-
- // Dispose an existing event listener instance
- if (listener != null) { listener.dispose(); listener = null; }
- // Create the event listener. The event listener does register itself.
- listener = new EditorEventListener(this);
- }
-
- /**
- * Update the editor part name based on the current editor input.
- */
- public void updatePartName() {
- IEditorInput input = getEditorInput();
- String oldPartName = getPartName();
-
- if (input instanceof EditorInput) {
- // Reset the editor input name to trigger recalculation
- ((EditorInput)input).name = null;
- // If the name changed, apply the new name
- if (!oldPartName.equals(input.getName())) {
- setPartName(input.getName());
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.forms.editor.FormEditor#dispose()
- */
- @Override
- public void dispose() {
- // Dispose an existing event listener instance
- if (listener != null) { listener.dispose(); listener = null; }
-
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void doSave(IProgressMonitor monitor) {
- // The pages may require some save pre processing
- for (Object page : pages) {
- if (page instanceof AbstractEditorPage) {
- ((AbstractEditorPage)page).preDoSave(monitor);
- }
- }
- // Commit the page changes
- commitPages(true);
- // The pages may require some save post processing
- for (Object page : pages) {
- if (page instanceof AbstractEditorPage) {
- ((AbstractEditorPage)page).postDoSave(monitor);
- }
- }
- editorDirtyStateChanged();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#doSaveAs()
- */
- @Override
- public void doSaveAs() {
- IEditorSaveAsAdapter adapter = getEditorInput() != null ? (IEditorSaveAsAdapter)Platform.getAdapterManager().getAdapter(getEditorInput(), IEditorSaveAsAdapter.class) : null;
- if (adapter != null) {
- Object newNode = adapter.doSaveAs(getEditorInput());
- if (newNode != null) {
- setInput(new EditorInput(newNode));
- updatePartName();
- updatePageList();
- for (Object page : pages) {
- if (page instanceof AbstractEditorPage) {
- ((AbstractEditorPage) page).init(getEditorSite(), getEditorInput());
- }
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
- */
- @Override
- public boolean isSaveAsAllowed() {
- IEditorSaveAsAdapter adapter = getEditorInput() != null ? (IEditorSaveAsAdapter)Platform.getAdapterManager().getAdapter(getEditorInput(), IEditorSaveAsAdapter.class) : null;
- if (adapter != null) {
- return adapter.isSaveAsAllowed(getEditorInput());
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPersistableEditor#restoreState(org.eclipse.ui.IMemento)
- */
- @Override
- public void restoreState(IMemento memento) {
- // Get the editor specific memento
- mementoToRestore = internalGetMemento(memento);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
- */
- @Override
- public void saveState(IMemento memento) {
- // Get the editor specific memento
- memento = internalGetMemento(memento);
- // Loop over all registered pages and pass on the editor specific memento
- // to the pages which implements IPersistable as well
- for (Object page : pages) {
- if (page instanceof IPersistable) {
- ((IPersistable)page).saveState(memento);
- }
- }
- }
-
- /**
- * Internal helper method accessing our editor local child memento
- * from the given parent memento.
- */
- private IMemento internalGetMemento(IMemento memento) {
- // Assume the editor memento to be the same as the parent memento
- IMemento editorMemento = memento;
-
- // If the parent memento is not null, create a child within the parent
- if (memento != null) {
- editorMemento = memento.getChild(Editor.class.getName());
- if (editorMemento == null) {
- editorMemento = memento.createChild(Editor.class.getName());
- }
- } else {
- // The parent memento is null. Create a new internal instance
- // of a XMLMemento. This case is happening if the user switches
- // to another perspective an the view becomes visible by this switch.
- editorMemento = XMLMemento.createWriteRoot(Editor.class.getName());
- }
-
- return editorMemento;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.MultiPageEditorPart#getAdapter(java.lang.Class)
- */
- @Override
- public Object getAdapter(Class adapter) {
- if (adapter == IPropertySheetPage.class) {
- return new TabbedPropertySheetPage(this);
- }
- // We pass on the adapt request to the currently active page
- Object adapterInstance = getActivePageInstance() != null ? getActivePageInstance().getAdapter(adapter) : null;
- if (adapterInstance == null) {
- // If failed to adapt via the currently active page, pass on to the super implementation
- adapterInstance = super.getAdapter(adapter);
- }
- return adapterInstance;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor#getContributorId()
- */
- @Override
- public String getContributorId() {
- return IUIConstants.TABBED_PROPERTIES_CONTRIBUTOR_ID;
- }
-
- /**
- * Fires a property changed event.
- *
- * @param propertyId the id of the property that changed
- */
- @Override
- public final void firePropertyChange(final int propertyId) {
- super.firePropertyChange(propertyId);
- }
-}
+/*******************************************************************************
+ * 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.ui.views.editor;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tcf.te.ui.views.editor.pages.AbstractEditorPage;
+import org.eclipse.tcf.te.ui.views.extensions.EditorPageBinding;
+import org.eclipse.tcf.te.ui.views.extensions.EditorPageBindingExtensionPointManager;
+import org.eclipse.tcf.te.ui.views.extensions.EditorPageExtensionPointManager;
+import org.eclipse.tcf.te.ui.views.interfaces.IEditorPage;
+import org.eclipse.tcf.te.ui.views.interfaces.IEditorSaveAsAdapter;
+import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IPersistable;
+import org.eclipse.ui.IPersistableEditor;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.XMLMemento;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.IFormPage;
+import org.eclipse.ui.internal.part.NullEditorInput;
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+
+
+/**
+ * Editor implementation.
+ */
+@SuppressWarnings("restriction")
+public final class Editor extends FormEditor implements IPersistableEditor, ITabbedPropertySheetPageContributor {
+
+ // The reference to an memento to restore once the editor got activated
+ private IMemento mementoToRestore;
+
+ // The editor event listener instance
+ private EditorEventListener listener;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.editor.FormEditor#addPages()
+ */
+ @Override
+ protected void addPages() {
+ // Read extension point and add the contributed pages.
+ IEditorInput input = getEditorInput();
+ // Get all applicable editor page bindings
+ EditorPageBinding[] bindings = EditorPageBindingExtensionPointManager.getInstance().getApplicableEditorPageBindings(input);
+ for (EditorPageBinding binding : bindings) {
+ processPageBinding(binding);
+ }
+
+ if (mementoToRestore != null) {
+ // Loop over all registered pages and pass on the editor specific memento
+ // to the pages which implements IPersistableEditor as well
+ for (Object page : pages) {
+ if (page instanceof IPersistableEditor) {
+ ((IPersistableEditor)page).restoreState(mementoToRestore);
+ }
+ }
+ mementoToRestore = null;
+ }
+ }
+
+ /**
+ * Override this method to delegate the setFocus to
+ * the active form page.
+ */
+ @Override
+ public void setFocus() {
+ IFormPage fpage = getActivePageInstance();
+ if(fpage != null) {
+ fpage.setFocus();
+ }
+ else {
+ super.setFocus();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.forms.editor.FormEditor#getActivePageInstance()
+ */
+ @Override
+ public IFormPage getActivePageInstance() {
+ int index = getActivePage();
+ if (index != -1) {
+ return getPage(index);
+ }
+ return super.getActivePageInstance();
+ }
+
+ /**
+ * Returns the page which has the specified index.
+ *
+ * @param index The page's index.
+ * @return The page object or null if it does not exists.
+ */
+ private IFormPage getPage(int index) {
+ for (int i = 0; i < pages.size(); i++) {
+ Object page = pages.get(i);
+ if (page instanceof IFormPage) {
+ IFormPage fpage = (IFormPage) page;
+ if (fpage.getIndex() == index) {
+ return fpage;
+ }
+ }
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.editor.FormEditor#setActivePage(int)
+ */
+ @Override
+ public void setActivePage(int pageIndex) {
+ if (getPage(pageIndex) != null) {
+ super.setActivePage(pageIndex);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.MultiPageEditorPart#getEditor(int)
+ */
+ @Override
+ protected IEditorPart getEditor(int pageIndex) {
+ return getPage(pageIndex) != null ? super.getEditor(pageIndex) : null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.editor.FormEditor#createPageContainer(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Composite createPageContainer(Composite parent) {
+ // Create page container is the first method called by the final
+ // MultiPageEditorPart#createPartControl. Use it as hook to close
+ // editors with a NullEditorInput.
+ if (getEditorInput() instanceof NullEditorInput) {
+// DisplayUtil.safeAsyncExec(new Runnable() {
+// @Override
+// public void run() {
+// close(false);
+// }
+// });
+ close(false);
+ }
+
+ return super.createPageContainer(parent);
+ }
+
+ /**
+ * Update the editor page list. Pages which are not longer valid
+ * will be removed and pages now being valid gets added.
+ */
+ public void updatePageList() {
+ // Remember the currently active page
+ String activePageId = getActivePageInstance() != null ? getActivePageInstance().getId() : null;
+ String activePageTitle = getActivePageInstance() != null ? getActivePageInstance().getTitle() : null;
+ // Get the editor input object
+ IEditorInput input = getEditorInput();
+ // Get all applicable editor page bindings
+ List<EditorPageBinding> bindings = new ArrayList<EditorPageBinding>(Arrays.asList(EditorPageBindingExtensionPointManager.getInstance().getApplicableEditorPageBindings(input)));
+ // Get a copy of the currently added pages
+ List<Object> oldPages = pages != null ? new ArrayList<Object>(Arrays.asList(pages.toArray())) : new ArrayList<Object>();
+ // Loop through the old pages and determine if the page is still applicable
+ Iterator<Object> iterator = oldPages.iterator();
+ while (iterator.hasNext()) {
+ Object element = iterator.next();
+ // Skip over pages not being a form page.
+ if (!(element instanceof IFormPage)) {
+ continue;
+ }
+ IFormPage page = (IFormPage)element;
+ // Find the corresponding page binding
+ EditorPageBinding binding = null;
+ for (EditorPageBinding candidate : bindings) {
+ if (candidate.getPageId().equals(page.getId())) {
+ binding = candidate;
+ break;
+ }
+ }
+ if (binding != null) {
+ // Found binding -> page is still applicable
+ bindings.remove(binding);
+ } else {
+ // No binding found -> page is not longer applicable
+ removePage(pages.indexOf(page));
+ }
+ }
+ // If the are remaining bindings left, this are new pages.
+ // --> Process them now
+ for (EditorPageBinding binding : bindings) {
+ processPageBinding(binding);
+ }
+ // If possible, restore the active page
+ if (activePageId != null) {
+ int index = getIndexOf(activePageId);
+ if (index == -1 && activePageTitle != null) {
+ index = getIndexOfByTitle(activePageTitle);
+ }
+ if (index != -1) setActivePage(index);
+ }
+ }
+
+ /**
+ * Process the given editor page binding.
+ *
+ * @param binding The editor page binding. Must not be <code>null</code>.
+ */
+ protected void processPageBinding(EditorPageBinding binding) {
+ Assert.isNotNull(binding);
+
+ String pageId = binding.getPageId();
+ if (pageId != null) {
+ // Get the corresponding editor page instance
+ IEditorPage page = EditorPageExtensionPointManager.getInstance().getEditorPage(pageId, true);
+ if (page != null) {
+ try {
+ // Associate this editor with the page instance.
+ // This is typically done in the constructor, but we are
+ // utilizing a default constructor to instantiate the page.
+ page.initialize(this);
+
+ // Read in the "insertBefore" and "insertAfter" properties of the binding
+ String insertBefore = binding.getInsertBefore().trim();
+ String insertAfter = binding.getInsertAfter().trim();
+
+ boolean pageAdded = false;
+
+ // insertBefore will be processed before insertAfter.
+ if (!"".equals(insertBefore)) { //$NON-NLS-1$
+ String[] pageIds = insertBefore.split(","); //$NON-NLS-1$
+ for (String insertBeforePageId : pageIds) {
+ // If it is "first", we insert the page at index 0
+ if ("first".equalsIgnoreCase(insertBeforePageId)) { //$NON-NLS-1$
+ if (getIndexOf(page.getId()) == -1) {
+ addPage(0, page);
+ }
+ pageAdded = true;
+ break;
+ }
+
+ // Find the index of the page we shall insert this page before
+ int index = getIndexOf(insertBeforePageId);
+ if (index != -1) {
+ if (getIndexOf(page.getId()) == -1) {
+ addPage(index, page);
+ }
+ pageAdded = true;
+ break;
+ }
+ }
+ }
+
+ // If the page hasn't been added till now, process insertAfter
+ if (!pageAdded && !"".equals(insertAfter)) { //$NON-NLS-1$
+ String[] pageIds = insertAfter.split(","); //$NON-NLS-1$
+ for (String insertAfterPageId : pageIds) {
+ // If it is "last", we insert the page at the end
+ if ("last".equalsIgnoreCase(insertAfterPageId)) { //$NON-NLS-1$
+ if (getIndexOf(page.getId()) == -1) {
+ addPage(page);
+ }
+ pageAdded = true;
+ break;
+ }
+
+ // Find the index of the page we shall insert this page after
+ int index = getIndexOf(insertAfterPageId);
+ if (index != -1 && index + 1 < pages.size()) {
+ if (getIndexOf(page.getId()) == -1) {
+ addPage(index + 1, page);
+ }
+ pageAdded = true;
+ break;
+ }
+ }
+ }
+
+ // Add the page to the end if not added otherwise
+ if (!pageAdded && getIndexOf(page.getId()) == -1) {
+ addPage(page);
+ }
+
+ } catch (PartInitException e) { /* ignored on purpose */ }
+ }
+ }
+ }
+
+ /**
+ * Returns the index of the page with the given id.
+ *
+ * @param pageId The page id. Must not be <code>null</code>.
+ * @return The page index or <code>-1</code> if not found.
+ */
+ private int getIndexOf(String pageId) {
+ Assert.isNotNull(pageId);
+ for (int i = 0; i < pages.size(); i++) {
+ Object page = pages.get(i);
+ if (page instanceof IFormPage) {
+ IFormPage fpage = (IFormPage)page;
+ if (fpage.getId().equals(pageId)) {
+ return i;
+ }
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * Returns the index of the page with the given title.
+ *
+ * @param pageTitle The page title. Must not be <code>null</code>.
+ * @return The page index or <code>-1</code> if not found.
+ */
+ private int getIndexOfByTitle(String pageTitle) {
+ Assert.isNotNull(pageTitle);
+ for (int i = 0; i < pages.size(); i++) {
+ Object page = pages.get(i);
+ if (page instanceof IFormPage) {
+ IFormPage fpage = (IFormPage)page;
+ if (fpage.getTitle().equals(pageTitle)) {
+ return i;
+ }
+ }
+ }
+ return -1;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.editor.FormPage#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
+ */
+ @Override
+ public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+ super.init(site, input);
+
+ // Update the part name
+ if (!"".equals(input.getName())) { //$NON-NLS-1$
+ setPartName(input.getName());
+ }
+
+ // Dispose an existing event listener instance
+ if (listener != null) { listener.dispose(); listener = null; }
+ // Create the event listener. The event listener does register itself.
+ listener = new EditorEventListener(this);
+ }
+
+ /**
+ * Update the editor part name based on the current editor input.
+ */
+ public void updatePartName() {
+ IEditorInput input = getEditorInput();
+ String oldPartName = getPartName();
+
+ if (input instanceof EditorInput) {
+ // Reset the editor input name to trigger recalculation
+ ((EditorInput)input).name = null;
+ // If the name changed, apply the new name
+ if (!oldPartName.equals(input.getName())) {
+ setPartName(input.getName());
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.editor.FormEditor#dispose()
+ */
+ @Override
+ public void dispose() {
+ // Dispose an existing event listener instance
+ if (listener != null) { listener.dispose(); listener = null; }
+
+ super.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ // The pages may require some save pre processing
+ for (Object page : pages) {
+ if (page instanceof AbstractEditorPage) {
+ ((AbstractEditorPage)page).preDoSave(monitor);
+ }
+ }
+ // Commit the page changes
+ commitPages(true);
+ // The pages may require some save post processing
+ for (Object page : pages) {
+ if (page instanceof AbstractEditorPage) {
+ ((AbstractEditorPage)page).postDoSave(monitor);
+ }
+ }
+ editorDirtyStateChanged();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.EditorPart#doSaveAs()
+ */
+ @Override
+ public void doSaveAs() {
+ IEditorSaveAsAdapter adapter = getEditorInput() != null ? (IEditorSaveAsAdapter)Platform.getAdapterManager().getAdapter(getEditorInput(), IEditorSaveAsAdapter.class) : null;
+ if (adapter != null) {
+ Object newNode = adapter.doSaveAs(getEditorInput());
+ if (newNode != null) {
+ setInput(new EditorInput(newNode));
+ updatePartName();
+ updatePageList();
+ for (Object page : pages) {
+ if (page instanceof AbstractEditorPage) {
+ ((AbstractEditorPage) page).init(getEditorSite(), getEditorInput());
+ }
+ }
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
+ */
+ @Override
+ public boolean isSaveAsAllowed() {
+ IEditorSaveAsAdapter adapter = getEditorInput() != null ? (IEditorSaveAsAdapter)Platform.getAdapterManager().getAdapter(getEditorInput(), IEditorSaveAsAdapter.class) : null;
+ if (adapter != null) {
+ return adapter.isSaveAsAllowed(getEditorInput());
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IPersistableEditor#restoreState(org.eclipse.ui.IMemento)
+ */
+ @Override
+ public void restoreState(IMemento memento) {
+ // Get the editor specific memento
+ mementoToRestore = internalGetMemento(memento);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
+ */
+ @Override
+ public void saveState(IMemento memento) {
+ // Get the editor specific memento
+ memento = internalGetMemento(memento);
+ // Loop over all registered pages and pass on the editor specific memento
+ // to the pages which implements IPersistable as well
+ for (Object page : pages) {
+ if (page instanceof IPersistable) {
+ ((IPersistable)page).saveState(memento);
+ }
+ }
+ }
+
+ /**
+ * Internal helper method accessing our editor local child memento
+ * from the given parent memento.
+ */
+ private IMemento internalGetMemento(IMemento memento) {
+ // Assume the editor memento to be the same as the parent memento
+ IMemento editorMemento = memento;
+
+ // If the parent memento is not null, create a child within the parent
+ if (memento != null) {
+ editorMemento = memento.getChild(Editor.class.getName());
+ if (editorMemento == null) {
+ editorMemento = memento.createChild(Editor.class.getName());
+ }
+ } else {
+ // The parent memento is null. Create a new internal instance
+ // of a XMLMemento. This case is happening if the user switches
+ // to another perspective an the view becomes visible by this switch.
+ editorMemento = XMLMemento.createWriteRoot(Editor.class.getName());
+ }
+
+ return editorMemento;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.MultiPageEditorPart#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(Class adapter) {
+ if (adapter == IPropertySheetPage.class) {
+ return new TabbedPropertySheetPage(this);
+ }
+ // We pass on the adapt request to the currently active page
+ Object adapterInstance = getActivePageInstance() != null ? getActivePageInstance().getAdapter(adapter) : null;
+ if (adapterInstance == null) {
+ // If failed to adapt via the currently active page, pass on to the super implementation
+ adapterInstance = super.getAdapter(adapter);
+ }
+ return adapterInstance;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor#getContributorId()
+ */
+ @Override
+ public String getContributorId() {
+ return IUIConstants.TABBED_PROPERTIES_CONTRIBUTOR_ID;
+ }
+
+ /**
+ * Fires a property changed event.
+ *
+ * @param propertyId the id of the property that changed
+ */
+ @Override
+ public final void firePropertyChange(final int propertyId) {
+ super.firePropertyChange(propertyId);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/EditorEventListener.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/EditorEventListener.java
index 2ab7f98b9..8efa40eb2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/EditorEventListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/EditorEventListener.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.ui.views/src/org/eclipse/tcf/te/ui/views/editor/EditorInput.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/EditorInput.java
index dc4e0a1de..fd7e2eb72 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/EditorInput.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/EditorInput.java
@@ -1,194 +1,194 @@
-/*******************************************************************************
- * 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.ui.views.editor;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.tcf.te.runtime.preferences.ScopedEclipsePreferences;
-import org.eclipse.tcf.te.ui.interfaces.IPreferenceKeys;
-import org.eclipse.tcf.te.ui.views.activator.UIPlugin;
-import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
-import org.eclipse.tcf.te.ui.views.interfaces.ImageConsts;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.navigator.CommonNavigator;
-import org.eclipse.ui.navigator.CommonViewer;
-
-
-/**
- * Editor input implementation.
- */
-public final class EditorInput implements IEditorInput, IPersistableElement {
- // The parent editor id
- private final String id;
- // The editor input name, once determined
- /* default */ String name;
- // The node (selection) the editor is showing
- private final Object node;
-
- /**
- * Constructor.
- *
- * @param node The node (selection) the editor is showing. Must not be <code>null</code>.
- */
- public EditorInput(Object node) {
- this(node, IUIConstants.ID_EDITOR);
- }
-
- /**
- * Constructor.
- *
- * @param node The node (selection) the editor is showing. Must not be <code>null</code>.
- * @param id The parent editor id or <code>null</code>
- */
- public EditorInput(Object node, String id) {
- super();
- this.id = id;
- Assert.isNotNull(node);
- this.node = node;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (node != null && obj instanceof EditorInput) {
- return node.equals(((EditorInput)obj).node)
- && (id != null ? id.equals(((EditorInput)obj).id) : ((EditorInput)obj).id == null);
- }
- return super.equals(obj);
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return node != null ? node.hashCode() << 16 + (id != null ? id.hashCode() : 0) : super.hashCode();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#exists()
- */
- @Override
- public boolean exists() {
- return node != null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
- */
- @Override
- public ImageDescriptor getImageDescriptor() {
- return UIPlugin.getImageDescriptor(ImageConsts.EDITOR);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#getName()
- */
- @Override
- public String getName() {
- if (name == null && node != null) {
- ILabelProvider provider = node instanceof IAdaptable ? (ILabelProvider)((IAdaptable)node).getAdapter(ILabelProvider.class) : null;
- if (provider == null) {
- provider = (ILabelProvider)Platform.getAdapterManager().getAdapter(node, ILabelProvider.class);
- }
- name = provider != null ? provider.getText(node) : node.toString();
- }
-
- return name != null ? name : ""; //$NON-NLS-1$
- }
-
- /**
- * Get the common viewer used by the main view instance.
- *
- * @return The common viewer or <code>null</code>
- */
- protected CommonViewer getViewer() {
- if (PlatformUI.getWorkbench() != null && PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null
- && PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() != null) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IViewPart part = page.findView(IUIConstants.ID_EXPLORER);
- if (part instanceof CommonNavigator) {
- return ((CommonNavigator)part).getCommonViewer();
- }
- }
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#getPersistable()
- */
- @Override
- public IPersistableElement getPersistable() {
- ScopedEclipsePreferences store = org.eclipse.tcf.te.ui.activator.UIPlugin.getScopedPreferences();
- if (getFactoryId() != null && store != null && store.getBoolean(IPreferenceKeys.PREF_PERSIST_EDITORS)) {
- return this;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPersistableElement#getFactoryId()
- */
- @Override
- public String getFactoryId() {
- IPersistableElement adapter = (IPersistableElement)Platform.getAdapterManager().getAdapter(node, IPersistableElement.class);
- if (adapter != null) {
- return adapter.getFactoryId();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
- */
- @Override
- public void saveState(IMemento memento) {
- IPersistableElement adapter = (IPersistableElement)Platform.getAdapterManager().getAdapter(node, IPersistableElement.class);
- if (adapter != null) {
- adapter.saveState(memento);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#getToolTipText()
- */
- @Override
- public String getToolTipText() {
- return getName();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- @Override
- public Object getAdapter(Class adapter) {
- if (IPersistableElement.class.isAssignableFrom(adapter)) {
- return getPersistable();
- }
-
- // If the adapter can be applied to the node instance, return the adapted node
- Object adapted = Platform.getAdapterManager().getAdapter(node, adapter);
- if (adapted != null) return adapted;
-
- return 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.ui.views.editor;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.tcf.te.runtime.preferences.ScopedEclipsePreferences;
+import org.eclipse.tcf.te.ui.interfaces.IPreferenceKeys;
+import org.eclipse.tcf.te.ui.views.activator.UIPlugin;
+import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
+import org.eclipse.tcf.te.ui.views.interfaces.ImageConsts;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.navigator.CommonNavigator;
+import org.eclipse.ui.navigator.CommonViewer;
+
+
+/**
+ * Editor input implementation.
+ */
+public final class EditorInput implements IEditorInput, IPersistableElement {
+ // The parent editor id
+ private final String id;
+ // The editor input name, once determined
+ /* default */ String name;
+ // The node (selection) the editor is showing
+ private final Object node;
+
+ /**
+ * Constructor.
+ *
+ * @param node The node (selection) the editor is showing. Must not be <code>null</code>.
+ */
+ public EditorInput(Object node) {
+ this(node, IUIConstants.ID_EDITOR);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param node The node (selection) the editor is showing. Must not be <code>null</code>.
+ * @param id The parent editor id or <code>null</code>
+ */
+ public EditorInput(Object node, String id) {
+ super();
+ this.id = id;
+ Assert.isNotNull(node);
+ this.node = node;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (node != null && obj instanceof EditorInput) {
+ return node.equals(((EditorInput)obj).node)
+ && (id != null ? id.equals(((EditorInput)obj).id) : ((EditorInput)obj).id == null);
+ }
+ return super.equals(obj);
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return node != null ? node.hashCode() << 16 + (id != null ? id.hashCode() : 0) : super.hashCode();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#exists()
+ */
+ @Override
+ public boolean exists() {
+ return node != null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+ */
+ @Override
+ public ImageDescriptor getImageDescriptor() {
+ return UIPlugin.getImageDescriptor(ImageConsts.EDITOR);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getName()
+ */
+ @Override
+ public String getName() {
+ if (name == null && node != null) {
+ ILabelProvider provider = node instanceof IAdaptable ? (ILabelProvider)((IAdaptable)node).getAdapter(ILabelProvider.class) : null;
+ if (provider == null) {
+ provider = (ILabelProvider)Platform.getAdapterManager().getAdapter(node, ILabelProvider.class);
+ }
+ name = provider != null ? provider.getText(node) : node.toString();
+ }
+
+ return name != null ? name : ""; //$NON-NLS-1$
+ }
+
+ /**
+ * Get the common viewer used by the main view instance.
+ *
+ * @return The common viewer or <code>null</code>
+ */
+ protected CommonViewer getViewer() {
+ if (PlatformUI.getWorkbench() != null && PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null
+ && PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() != null) {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IViewPart part = page.findView(IUIConstants.ID_EXPLORER);
+ if (part instanceof CommonNavigator) {
+ return ((CommonNavigator)part).getCommonViewer();
+ }
+ }
+
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getPersistable()
+ */
+ @Override
+ public IPersistableElement getPersistable() {
+ ScopedEclipsePreferences store = org.eclipse.tcf.te.ui.activator.UIPlugin.getScopedPreferences();
+ if (getFactoryId() != null && store != null && store.getBoolean(IPreferenceKeys.PREF_PERSIST_EDITORS)) {
+ return this;
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IPersistableElement#getFactoryId()
+ */
+ @Override
+ public String getFactoryId() {
+ IPersistableElement adapter = (IPersistableElement)Platform.getAdapterManager().getAdapter(node, IPersistableElement.class);
+ if (adapter != null) {
+ return adapter.getFactoryId();
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
+ */
+ @Override
+ public void saveState(IMemento memento) {
+ IPersistableElement adapter = (IPersistableElement)Platform.getAdapterManager().getAdapter(node, IPersistableElement.class);
+ if (adapter != null) {
+ adapter.saveState(memento);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getToolTipText()
+ */
+ @Override
+ public String getToolTipText() {
+ return getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(Class adapter) {
+ if (IPersistableElement.class.isAssignableFrom(adapter)) {
+ return getPersistable();
+ }
+
+ // If the adapter can be applied to the node instance, return the adapted node
+ Object adapted = Platform.getAdapterManager().getAdapter(node, adapter);
+ if (adapted != null) return adapted;
+
+ return null;
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/controls/ButtonPanelControl.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/controls/ButtonPanelControl.java
index 430183dab..74d73563a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/controls/ButtonPanelControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/controls/ButtonPanelControl.java
@@ -1,199 +1,199 @@
-/*******************************************************************************
- * 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.ui.views.editor.controls;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.tcf.te.ui.controls.BaseControl;
-import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
-import org.eclipse.tcf.te.ui.views.nls.Messages;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-
-/**
- * A panel control holding a set of buttons.
- * <p>
- * The panel control is associated with a managed form. If the managed form is the
- * embedded within a form editor or a form page, <code>getEditor()</code> will return
- * the parent form editor instance.
- * <p>
- * If the panel control has the default "Apply" button, the apply button will be
- * enabled once the parent form editor is marked dirty. If the "Apply" button is
- * clicked the form editor will be saved.
- */
-public class ButtonPanelControl extends BaseControl {
- // Reference to the parent managed form
- private final IManagedForm form;
-
- // The control sub-control
- private Composite panel;
- /* default */ Button applyButton;
-
- // Reference to the dirty state listener
- private IPropertyListener dirtyListener = null;
-
- /**
- * Constructor
- *
- * @param form The parent managed form. Must not be <code>null</code>.
- */
- public ButtonPanelControl(IManagedForm form) {
- super();
-
- Assert.isNotNull(form);
- this.form = form;
- }
-
- /**
- * Returns the parent managed form instance.
- *
- * @return The parent managed form instance.
- */
- protected final IManagedForm getManagedForm() {
- return form;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.forms.AbstractFormPart#dispose()
- */
- @Override
- public void dispose() {
- // Dispose the dirty state listener
- if (dirtyListener != null && getEditor() != null) {
- getEditor().removePropertyListener(dirtyListener);
- dirtyListener = null;
- }
-
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.controls.BaseControl#setupPanel(org.eclipse.swt.widgets.Composite)
- */
- @Override
- public void setupPanel(Composite parent) {
- super.setupPanel(parent);
-
- // Create the buttons panel
- panel = doCreatePanel(parent);
- Assert.isNotNull(panel);
-
- // Create the buttons within the buttons panel
- doCreateButtons(panel);
- }
-
- /**
- * Create the panel that holds the buttons.
- *
- * @param parent The parent composite. Must not be <code>null</code>.
- * @return The panel.
- */
- protected Composite doCreatePanel(Composite parent) {
- Assert.isNotNull(parent);
-
- Composite panel = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0; layout.marginWidth = 0;
- panel.setLayout(layout);
- GridData layoutData = new GridData(SWT.TRAIL, SWT.BEGINNING, true, false);
- if (parent.getLayout() instanceof GridLayout) layoutData.horizontalSpan = ((GridLayout)parent.getLayout()).numColumns;
- panel.setLayoutData(layoutData);
- panel.setBackground(parent.getBackground());
-
- return panel;
- }
-
- /**
- * Returns if or of not the control has an apply button added to the buttons
- * panel by default.
- * <p>
- * <b>Note:</b> The default return by this method is <code>true</code>.
- *
- * @return <code>true</code> if there should be an apply button.
- */
- protected boolean hasApplyButton() {
- return true;
- }
-
- /**
- * Creates the buttons within the given parent composite.
- *
- * @param parent The parent composite. Must not be <code>null</code>.
- */
- protected void doCreateButtons(Composite parent) {
- Assert.isNotNull(parent);
-
- // Create a "Apply" button if requested
- if (hasApplyButton() && getEditor() != null) {
- applyButton = new Button(parent, SWT.PUSH);
- applyButton.setText(Messages.ButtonPanelControl_applyButton_label);
- applyButton.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_ETOOL_SAVE_EDIT));
- applyButton.setBackground(parent.getBackground());
-
- GridData layoutData = new GridData(SWT.TRAIL, SWT.CENTER, false, false);
- layoutData.widthHint = SWTControlUtil.convertWidthInCharsToPixels(applyButton, 15);
- applyButton.setLayoutData(layoutData);
-
- applyButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- FormEditor editor = getEditor();
- Assert.isNotNull(editor);
- if (editor.isDirty()) {
- editor.doSave(new NullProgressMonitor());
- }
- }
- });
-
- dirtyListener = new IPropertyListener() {
- @Override
- public void propertyChanged(Object source, int propId) {
- if (propId == IEditorPart.PROP_DIRTY) {
- boolean dirty = getEditor().isDirty();
- applyButton.setEnabled(dirty);
- }
- }
- };
- getEditor().addPropertyListener(dirtyListener);
- applyButton.setEnabled(getEditor().isDirty());
- }
- }
-
- /**
- * Returns the parent form editor if the managed form is embedded
- * in such an editor.
- *
- * @return The parent form editor or <code>null</code>.
- */
- protected final FormEditor getEditor() {
- FormEditor editor = null;
-
- Object container = getManagedForm() != null ? getManagedForm().getContainer() : null;
- if (container instanceof FormEditor) {
- editor = (FormEditor)container;
- } else if (container instanceof FormPage) {
- editor = ((FormPage)container).getEditor();
- }
-
- return editor;
- }
-}
+/*******************************************************************************
+ * 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.ui.views.editor.controls;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tcf.te.ui.controls.BaseControl;
+import org.eclipse.tcf.te.ui.swt.SWTControlUtil;
+import org.eclipse.tcf.te.ui.views.nls.Messages;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IPropertyListener;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+
+/**
+ * A panel control holding a set of buttons.
+ * <p>
+ * The panel control is associated with a managed form. If the managed form is the
+ * embedded within a form editor or a form page, <code>getEditor()</code> will return
+ * the parent form editor instance.
+ * <p>
+ * If the panel control has the default "Apply" button, the apply button will be
+ * enabled once the parent form editor is marked dirty. If the "Apply" button is
+ * clicked the form editor will be saved.
+ */
+public class ButtonPanelControl extends BaseControl {
+ // Reference to the parent managed form
+ private final IManagedForm form;
+
+ // The control sub-control
+ private Composite panel;
+ /* default */ Button applyButton;
+
+ // Reference to the dirty state listener
+ private IPropertyListener dirtyListener = null;
+
+ /**
+ * Constructor
+ *
+ * @param form The parent managed form. Must not be <code>null</code>.
+ */
+ public ButtonPanelControl(IManagedForm form) {
+ super();
+
+ Assert.isNotNull(form);
+ this.form = form;
+ }
+
+ /**
+ * Returns the parent managed form instance.
+ *
+ * @return The parent managed form instance.
+ */
+ protected final IManagedForm getManagedForm() {
+ return form;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.AbstractFormPart#dispose()
+ */
+ @Override
+ public void dispose() {
+ // Dispose the dirty state listener
+ if (dirtyListener != null && getEditor() != null) {
+ getEditor().removePropertyListener(dirtyListener);
+ dirtyListener = null;
+ }
+
+ super.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.BaseControl#setupPanel(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void setupPanel(Composite parent) {
+ super.setupPanel(parent);
+
+ // Create the buttons panel
+ panel = doCreatePanel(parent);
+ Assert.isNotNull(panel);
+
+ // Create the buttons within the buttons panel
+ doCreateButtons(panel);
+ }
+
+ /**
+ * Create the panel that holds the buttons.
+ *
+ * @param parent The parent composite. Must not be <code>null</code>.
+ * @return The panel.
+ */
+ protected Composite doCreatePanel(Composite parent) {
+ Assert.isNotNull(parent);
+
+ Composite panel = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 0; layout.marginWidth = 0;
+ panel.setLayout(layout);
+ GridData layoutData = new GridData(SWT.TRAIL, SWT.BEGINNING, true, false);
+ if (parent.getLayout() instanceof GridLayout) layoutData.horizontalSpan = ((GridLayout)parent.getLayout()).numColumns;
+ panel.setLayoutData(layoutData);
+ panel.setBackground(parent.getBackground());
+
+ return panel;
+ }
+
+ /**
+ * Returns if or of not the control has an apply button added to the buttons
+ * panel by default.
+ * <p>
+ * <b>Note:</b> The default return by this method is <code>true</code>.
+ *
+ * @return <code>true</code> if there should be an apply button.
+ */
+ protected boolean hasApplyButton() {
+ return true;
+ }
+
+ /**
+ * Creates the buttons within the given parent composite.
+ *
+ * @param parent The parent composite. Must not be <code>null</code>.
+ */
+ protected void doCreateButtons(Composite parent) {
+ Assert.isNotNull(parent);
+
+ // Create a "Apply" button if requested
+ if (hasApplyButton() && getEditor() != null) {
+ applyButton = new Button(parent, SWT.PUSH);
+ applyButton.setText(Messages.ButtonPanelControl_applyButton_label);
+ applyButton.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_ETOOL_SAVE_EDIT));
+ applyButton.setBackground(parent.getBackground());
+
+ GridData layoutData = new GridData(SWT.TRAIL, SWT.CENTER, false, false);
+ layoutData.widthHint = SWTControlUtil.convertWidthInCharsToPixels(applyButton, 15);
+ applyButton.setLayoutData(layoutData);
+
+ applyButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ FormEditor editor = getEditor();
+ Assert.isNotNull(editor);
+ if (editor.isDirty()) {
+ editor.doSave(new NullProgressMonitor());
+ }
+ }
+ });
+
+ dirtyListener = new IPropertyListener() {
+ @Override
+ public void propertyChanged(Object source, int propId) {
+ if (propId == IEditorPart.PROP_DIRTY) {
+ boolean dirty = getEditor().isDirty();
+ applyButton.setEnabled(dirty);
+ }
+ }
+ };
+ getEditor().addPropertyListener(dirtyListener);
+ applyButton.setEnabled(getEditor().isDirty());
+ }
+ }
+
+ /**
+ * Returns the parent form editor if the managed form is embedded
+ * in such an editor.
+ *
+ * @return The parent form editor or <code>null</code>.
+ */
+ protected final FormEditor getEditor() {
+ FormEditor editor = null;
+
+ Object container = getManagedForm() != null ? getManagedForm().getContainer() : null;
+ if (container instanceof FormEditor) {
+ editor = (FormEditor)container;
+ } else if (container instanceof FormPage) {
+ editor = ((FormPage)container).getEditor();
+ }
+
+ return editor;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/pages/AbstractCustomFormToolkitEditorPage.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/pages/AbstractCustomFormToolkitEditorPage.java
index 678c234dc..70eb2529f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/pages/AbstractCustomFormToolkitEditorPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/pages/AbstractCustomFormToolkitEditorPage.java
@@ -1,341 +1,341 @@
-/*******************************************************************************
- * 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.ui.views.editor.pages;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ContributionManager;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.tcf.te.runtime.interfaces.IDisposable;
-import org.eclipse.tcf.te.ui.forms.CustomFormToolkit;
-import org.eclipse.tcf.te.ui.forms.FormLayoutFactory;
-import org.eclipse.tcf.te.ui.views.activator.UIPlugin;
-import org.eclipse.tcf.te.ui.views.interfaces.ImageConsts;
-import org.eclipse.tcf.te.ui.views.nls.Messages;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.menus.CommandContributionItem;
-import org.eclipse.ui.menus.CommandContributionItemParameter;
-import org.eclipse.ui.menus.IMenuService;
-
-/**
- * Abstract details editor page implementation managing
- * an custom form toolkit instance.
- */
-public abstract class AbstractCustomFormToolkitEditorPage extends AbstractEditorPage {
- // Reference to the form toolkit instance
- private CustomFormToolkit toolkit = null;
- // Reference to the toolbar manager to release menu contributions for
- private IToolBarManager manager = null;
-
- // The default help action class definition
- static protected class HelpAction extends Action {
- /* default */ final String helpID;
-
- /**
- * Constructor.
- *
- * @param helpID The context help id. Must not be <code>null</code>.
- */
- public HelpAction(String helpID) {
- super(Messages.AbstractCustomFormToolkitEditorPage_HelpAction_label, IAction.AS_PUSH_BUTTON);
- Assert.isNotNull(helpID);
- this.helpID = helpID;
- setToolTipText(Messages.AbstractCustomFormToolkitEditorPage_HelpAction_tooltip);
- setImageDescriptor(UIPlugin.getImageDescriptor(ImageConsts.HELP));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- @Override
- public void run() {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- @Override
- public void run() {
- PlatformUI.getWorkbench().getHelpSystem().displayHelp(helpID);
- }
- });
- }
- }
-
- // The default apply changes action class definition
- static protected class ApplyAction extends Action implements IPropertyListener, IDisposable {
- private final IEditorPart part;
-
- /**
- * Constructor
- */
- public ApplyAction(IEditorPart part) {
- super(Messages.AbstractCustomFormToolkitEditorPage_ApplyAction_label, IAction.AS_PUSH_BUTTON);
- Assert.isNotNull(part);
- this.part = part;
- setToolTipText(Messages.AbstractCustomFormToolkitEditorPage_ApplyAction_tooltip);
- setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ETOOL_SAVE_EDIT));
- setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ETOOL_SAVE_EDIT_DISABLED));
-
- part.addPropertyListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.interfaces.IDisposable#dispose()
- */
- @Override
- public void dispose() {
- if (part != null) part.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- @Override
- public void run() {
- if (part != null && part.isDirty()) {
- part.doSave(new NullProgressMonitor());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPropertyListener#propertyChanged(java.lang.Object, int)
- */
- @Override
- public void propertyChanged(Object source, int propId) {
- if (propId == IEditorPart.PROP_DIRTY) {
- boolean dirty = part != null && part.isDirty();
- setEnabled(dirty);
- }
- }
- }
-
- /**
- * Returns the custom form toolkit instance.
- *
- * @return The custom form toolkit instance or <code>null</code>.
- */
- protected final CustomFormToolkit getFormToolkit() {
- return toolkit;
- }
-
- /**
- * Sets the custom form toolkit instance.
- *
- * @param toolkit The custom form toolkit instance or <code>null</code>.
- */
- protected final void setFormToolkit(CustomFormToolkit toolkit) {
- this.toolkit = toolkit;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.forms.editor.FormPage#dispose()
- */
- @Override
- public void dispose() {
- // Get the menu service and release the toolbar manager
- if (manager instanceof ContributionManager) {
- IMenuService service = (IMenuService) getSite().getService(IMenuService.class);
- if (service != null) {
- service.releaseContributions((ContributionManager)manager);
- }
- }
- // Dispose the custom form toolkit
- if (toolkit != null) { toolkit.dispose(); toolkit = null; }
- // Dispose all the rest
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
- */
- @Override
- protected void createFormContent(IManagedForm managedForm) {
- super.createFormContent(managedForm);
-
- Assert.isNotNull(managedForm);
-
- // Create the toolkit instance
- toolkit = new CustomFormToolkit(managedForm.getToolkit());
-
- // Configure the managed form
- configureManagedForm(managedForm);
-
- // Do create the content of the form now
- doCreateFormContent(managedForm.getForm().getBody(), getFormToolkit());
-
- // Re-arrange the controls
- managedForm.reflow(true);
- }
-
- /**
- * Configure the managed form to be ready for usage.
- *
- * @param managedForm The managed form. Must not be <code>null</code>.
- */
- protected void configureManagedForm(IManagedForm managedForm) {
- Assert.isNotNull(managedForm);
-
- // Configure main layout
- Composite body = managedForm.getForm().getBody();
- body.setLayout(FormLayoutFactory.createFormGridLayout(false, 1));
-
- // Set context help id
- if (getContextHelpId() != null) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(managedForm.getForm(), getContextHelpId());
- }
-
- // Decorate the form header
- getFormToolkit().getFormToolkit().decorateFormHeading(managedForm.getForm().getForm());
- // And set the header text and image
- if (getFormTitle() != null) managedForm.getForm().getForm().setText(getFormTitle());
- managedForm.getForm().getForm().setImage(getFormImage());
-
- // Add the toolbar items which will appear in the form header
- manager = managedForm.getForm().getForm().getToolBarManager();
- // Add the default "additions" separator
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- // Create fixed toolbar contribution items
- createToolbarContributionItems(manager);
- // Get the menu service and populate contributed toolbar actions
- IMenuService service = (IMenuService) getSite().getService(IMenuService.class);
- if (service != null && manager instanceof ContributionManager) {
- service.populateContributionManager((ContributionManager)manager, "toolbar:" + getId()); //$NON-NLS-1$
- }
- // Trigger an update of the toolbar widget
- manager.update(true);
- }
-
- /**
- * Returns the context help id to associate with the page form.
- *
- * @return The context help id.
- */
- protected String getContextHelpId() {
- return null;
- }
-
- /**
- * Returns the form title to set to the top form header.
- *
- * @return The form title.
- */
- protected String getFormTitle() {
- return null;
- }
-
- /**
- * Returns the image to be set to the top form header.
- *
- * @return The image or <code>null</code> to use no image.
- */
- protected Image getFormImage() {
- return null;
- }
-
- /**
- * Create the toolbar contribution items.
- *
- * @param manager The toolbar manager. Must not be <code>null</code>.
- */
- protected void createToolbarContributionItems(IToolBarManager manager) {
- Assert.isNotNull(manager);
-
- manager.add(new Separator("group.connect")); //$NON-NLS-1$
- manager.add(new Separator("group.launch")); //$NON-NLS-1$
- manager.add(new GroupMarker("group.launch.rundebug")); //$NON-NLS-1$
- manager.add(new GroupMarker("group.launch.modes")); //$NON-NLS-1$
- manager.add(new GroupMarker("group.launch.additions")); //$NON-NLS-1$
-
- manager.add(new Separator("group.showIn")); //$NON-NLS-1$
- if (hasShowInSystemManagementAction()) {
- manager.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(),
- "org.eclipse.tcf.te.ui.views.command.showIn.systemManagement", //$NON-NLS-1$
- "org.eclipse.tcf.te.ui.command.showIn.systemManagement", //$NON-NLS-1$
- CommandContributionItem.STYLE_PUSH)));
- }
-
- manager.add(new Separator("group.save")); //$NON-NLS-1$
- // If the page should have an apply button, add one to the toolbar
- if (hasApplyAction()) {
- Action applyAction = doCreateApplyAction(getEditor());
- if (applyAction != null) manager.add(applyAction);
- }
-
- manager.add(new Separator("group.help")); //$NON-NLS-1$
- // If the page is associated with a context help id, add a default
- // help action button into the toolbar
- if (getContextHelpId() != null) {
- Action helpAction = doCreateHelpAction(getContextHelpId());
- if (helpAction != null) manager.add(helpAction);
- }
- }
-
- /**
- * Create the help action.
- *
- * @param contextHelpId The context help id. Must not be <code>null</code>.
- * @return The help action or <code>null</code>.
- */
- protected Action doCreateHelpAction(String contextHelpId) {
- Assert.isNotNull(contextHelpId);
- return new HelpAction(contextHelpId);
- }
-
- /**
- * Creates the apply action.
- *
- * @param part The editor part. Must not be <code>null</code>.
- * @return The apply action or <code>null</code>.
- */
- protected Action doCreateApplyAction(IEditorPart part) {
- Assert.isNotNull(part);
- return new ApplyAction(part);
- }
-
- /**
- * Returns if or if not the page should have an
- * ShowInSystemManagementView button in the toolbar.
- * <p>
- * The default implementation returns <code>true</code>.
- *
- * @return <code>True</code> if the page does have an ShowInSystemManagementView button, <code>false</code> otherwise.
- */
- protected boolean hasShowInSystemManagementAction() {
- return true;
- }
-
- /**
- * Returns if or if not the page should have an apply button in
- * the toolbar.
- * <p>
- * The default implementation returns <code>false</code>.
- *
- * @return <code>True</code> if the page does have an apply button, <code>false</code> otherwise.
- */
- protected boolean hasApplyAction() {
- return false;
- }
-
- /**
- * Do create the managed form content.
- *
- * @param parent The parent composite. Must not be <code>null</code>
- * @param toolkit The {@link CustomFormToolkit} instance. Must not be <code>null</code>.
- */
- protected abstract void doCreateFormContent(Composite parent, CustomFormToolkit toolkit);
-}
+/*******************************************************************************
+ * 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.ui.views.editor.pages;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ContributionManager;
+import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tcf.te.runtime.interfaces.IDisposable;
+import org.eclipse.tcf.te.ui.forms.CustomFormToolkit;
+import org.eclipse.tcf.te.ui.forms.FormLayoutFactory;
+import org.eclipse.tcf.te.ui.views.activator.UIPlugin;
+import org.eclipse.tcf.te.ui.views.interfaces.ImageConsts;
+import org.eclipse.tcf.te.ui.views.nls.Messages;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IPropertyListener;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.menus.CommandContributionItem;
+import org.eclipse.ui.menus.CommandContributionItemParameter;
+import org.eclipse.ui.menus.IMenuService;
+
+/**
+ * Abstract details editor page implementation managing
+ * an custom form toolkit instance.
+ */
+public abstract class AbstractCustomFormToolkitEditorPage extends AbstractEditorPage {
+ // Reference to the form toolkit instance
+ private CustomFormToolkit toolkit = null;
+ // Reference to the toolbar manager to release menu contributions for
+ private IToolBarManager manager = null;
+
+ // The default help action class definition
+ static protected class HelpAction extends Action {
+ /* default */ final String helpID;
+
+ /**
+ * Constructor.
+ *
+ * @param helpID The context help id. Must not be <code>null</code>.
+ */
+ public HelpAction(String helpID) {
+ super(Messages.AbstractCustomFormToolkitEditorPage_HelpAction_label, IAction.AS_PUSH_BUTTON);
+ Assert.isNotNull(helpID);
+ this.helpID = helpID;
+ setToolTipText(Messages.AbstractCustomFormToolkitEditorPage_HelpAction_tooltip);
+ setImageDescriptor(UIPlugin.getImageDescriptor(ImageConsts.HELP));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ PlatformUI.getWorkbench().getHelpSystem().displayHelp(helpID);
+ }
+ });
+ }
+ }
+
+ // The default apply changes action class definition
+ static protected class ApplyAction extends Action implements IPropertyListener, IDisposable {
+ private final IEditorPart part;
+
+ /**
+ * Constructor
+ */
+ public ApplyAction(IEditorPart part) {
+ super(Messages.AbstractCustomFormToolkitEditorPage_ApplyAction_label, IAction.AS_PUSH_BUTTON);
+ Assert.isNotNull(part);
+ this.part = part;
+ setToolTipText(Messages.AbstractCustomFormToolkitEditorPage_ApplyAction_tooltip);
+ setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ETOOL_SAVE_EDIT));
+ setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ETOOL_SAVE_EDIT_DISABLED));
+
+ part.addPropertyListener(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.interfaces.IDisposable#dispose()
+ */
+ @Override
+ public void dispose() {
+ if (part != null) part.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ if (part != null && part.isDirty()) {
+ part.doSave(new NullProgressMonitor());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IPropertyListener#propertyChanged(java.lang.Object, int)
+ */
+ @Override
+ public void propertyChanged(Object source, int propId) {
+ if (propId == IEditorPart.PROP_DIRTY) {
+ boolean dirty = part != null && part.isDirty();
+ setEnabled(dirty);
+ }
+ }
+ }
+
+ /**
+ * Returns the custom form toolkit instance.
+ *
+ * @return The custom form toolkit instance or <code>null</code>.
+ */
+ protected final CustomFormToolkit getFormToolkit() {
+ return toolkit;
+ }
+
+ /**
+ * Sets the custom form toolkit instance.
+ *
+ * @param toolkit The custom form toolkit instance or <code>null</code>.
+ */
+ protected final void setFormToolkit(CustomFormToolkit toolkit) {
+ this.toolkit = toolkit;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.editor.FormPage#dispose()
+ */
+ @Override
+ public void dispose() {
+ // Get the menu service and release the toolbar manager
+ if (manager instanceof ContributionManager) {
+ IMenuService service = (IMenuService) getSite().getService(IMenuService.class);
+ if (service != null) {
+ service.releaseContributions((ContributionManager)manager);
+ }
+ }
+ // Dispose the custom form toolkit
+ if (toolkit != null) { toolkit.dispose(); toolkit = null; }
+ // Dispose all the rest
+ super.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
+ */
+ @Override
+ protected void createFormContent(IManagedForm managedForm) {
+ super.createFormContent(managedForm);
+
+ Assert.isNotNull(managedForm);
+
+ // Create the toolkit instance
+ toolkit = new CustomFormToolkit(managedForm.getToolkit());
+
+ // Configure the managed form
+ configureManagedForm(managedForm);
+
+ // Do create the content of the form now
+ doCreateFormContent(managedForm.getForm().getBody(), getFormToolkit());
+
+ // Re-arrange the controls
+ managedForm.reflow(true);
+ }
+
+ /**
+ * Configure the managed form to be ready for usage.
+ *
+ * @param managedForm The managed form. Must not be <code>null</code>.
+ */
+ protected void configureManagedForm(IManagedForm managedForm) {
+ Assert.isNotNull(managedForm);
+
+ // Configure main layout
+ Composite body = managedForm.getForm().getBody();
+ body.setLayout(FormLayoutFactory.createFormGridLayout(false, 1));
+
+ // Set context help id
+ if (getContextHelpId() != null) {
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(managedForm.getForm(), getContextHelpId());
+ }
+
+ // Decorate the form header
+ getFormToolkit().getFormToolkit().decorateFormHeading(managedForm.getForm().getForm());
+ // And set the header text and image
+ if (getFormTitle() != null) managedForm.getForm().getForm().setText(getFormTitle());
+ managedForm.getForm().getForm().setImage(getFormImage());
+
+ // Add the toolbar items which will appear in the form header
+ manager = managedForm.getForm().getForm().getToolBarManager();
+ // Add the default "additions" separator
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ // Create fixed toolbar contribution items
+ createToolbarContributionItems(manager);
+ // Get the menu service and populate contributed toolbar actions
+ IMenuService service = (IMenuService) getSite().getService(IMenuService.class);
+ if (service != null && manager instanceof ContributionManager) {
+ service.populateContributionManager((ContributionManager)manager, "toolbar:" + getId()); //$NON-NLS-1$
+ }
+ // Trigger an update of the toolbar widget
+ manager.update(true);
+ }
+
+ /**
+ * Returns the context help id to associate with the page form.
+ *
+ * @return The context help id.
+ */
+ protected String getContextHelpId() {
+ return null;
+ }
+
+ /**
+ * Returns the form title to set to the top form header.
+ *
+ * @return The form title.
+ */
+ protected String getFormTitle() {
+ return null;
+ }
+
+ /**
+ * Returns the image to be set to the top form header.
+ *
+ * @return The image or <code>null</code> to use no image.
+ */
+ protected Image getFormImage() {
+ return null;
+ }
+
+ /**
+ * Create the toolbar contribution items.
+ *
+ * @param manager The toolbar manager. Must not be <code>null</code>.
+ */
+ protected void createToolbarContributionItems(IToolBarManager manager) {
+ Assert.isNotNull(manager);
+
+ manager.add(new Separator("group.connect")); //$NON-NLS-1$
+ manager.add(new Separator("group.launch")); //$NON-NLS-1$
+ manager.add(new GroupMarker("group.launch.rundebug")); //$NON-NLS-1$
+ manager.add(new GroupMarker("group.launch.modes")); //$NON-NLS-1$
+ manager.add(new GroupMarker("group.launch.additions")); //$NON-NLS-1$
+
+ manager.add(new Separator("group.showIn")); //$NON-NLS-1$
+ if (hasShowInSystemManagementAction()) {
+ manager.add(new CommandContributionItem(new CommandContributionItemParameter(PlatformUI.getWorkbench(),
+ "org.eclipse.tcf.te.ui.views.command.showIn.systemManagement", //$NON-NLS-1$
+ "org.eclipse.tcf.te.ui.command.showIn.systemManagement", //$NON-NLS-1$
+ CommandContributionItem.STYLE_PUSH)));
+ }
+
+ manager.add(new Separator("group.save")); //$NON-NLS-1$
+ // If the page should have an apply button, add one to the toolbar
+ if (hasApplyAction()) {
+ Action applyAction = doCreateApplyAction(getEditor());
+ if (applyAction != null) manager.add(applyAction);
+ }
+
+ manager.add(new Separator("group.help")); //$NON-NLS-1$
+ // If the page is associated with a context help id, add a default
+ // help action button into the toolbar
+ if (getContextHelpId() != null) {
+ Action helpAction = doCreateHelpAction(getContextHelpId());
+ if (helpAction != null) manager.add(helpAction);
+ }
+ }
+
+ /**
+ * Create the help action.
+ *
+ * @param contextHelpId The context help id. Must not be <code>null</code>.
+ * @return The help action or <code>null</code>.
+ */
+ protected Action doCreateHelpAction(String contextHelpId) {
+ Assert.isNotNull(contextHelpId);
+ return new HelpAction(contextHelpId);
+ }
+
+ /**
+ * Creates the apply action.
+ *
+ * @param part The editor part. Must not be <code>null</code>.
+ * @return The apply action or <code>null</code>.
+ */
+ protected Action doCreateApplyAction(IEditorPart part) {
+ Assert.isNotNull(part);
+ return new ApplyAction(part);
+ }
+
+ /**
+ * Returns if or if not the page should have an
+ * ShowInSystemManagementView button in the toolbar.
+ * <p>
+ * The default implementation returns <code>true</code>.
+ *
+ * @return <code>True</code> if the page does have an ShowInSystemManagementView button, <code>false</code> otherwise.
+ */
+ protected boolean hasShowInSystemManagementAction() {
+ return true;
+ }
+
+ /**
+ * Returns if or if not the page should have an apply button in
+ * the toolbar.
+ * <p>
+ * The default implementation returns <code>false</code>.
+ *
+ * @return <code>True</code> if the page does have an apply button, <code>false</code> otherwise.
+ */
+ protected boolean hasApplyAction() {
+ return false;
+ }
+
+ /**
+ * Do create the managed form content.
+ *
+ * @param parent The parent composite. Must not be <code>null</code>
+ * @param toolkit The {@link CustomFormToolkit} instance. Must not be <code>null</code>.
+ */
+ protected abstract void doCreateFormContent(Composite parent, CustomFormToolkit toolkit);
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/pages/AbstractEditorPage.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/pages/AbstractEditorPage.java
index b0309e0a7..836008178 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/pages/AbstractEditorPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/pages/AbstractEditorPage.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.ui.views/src/org/eclipse/tcf/te/ui/views/editor/pages/TreeViewerExplorerEditorPage.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/pages/TreeViewerExplorerEditorPage.java
index 63c69d82c..4a2fb12c9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/pages/TreeViewerExplorerEditorPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/editor/pages/TreeViewerExplorerEditorPage.java
@@ -1,507 +1,507 @@
-/*******************************************************************************
- * 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.ui.views.editor.pages;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.net.URL;
-
-import org.eclipse.core.commands.Command;
-import org.eclipse.core.commands.ParameterizedCommand;
-import org.eclipse.core.expressions.EvaluationContext;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.tcf.te.core.interfaces.IFilterable;
-import org.eclipse.tcf.te.core.interfaces.IPropertyChangeProvider;
-import org.eclipse.tcf.te.ui.forms.CustomFormToolkit;
-import org.eclipse.tcf.te.ui.trees.TreeControl;
-import org.eclipse.tcf.te.ui.utils.TreeViewerUtil;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.widgets.Form;
-import org.eclipse.ui.handlers.IHandlerService;
-import org.eclipse.ui.part.MultiPageSelectionProvider;
-import org.osgi.framework.Bundle;
-
-/**
- * Tree viewer based editor page implementation.
- */
-public abstract class TreeViewerExplorerEditorPage extends AbstractCustomFormToolkitEditorPage implements IDoubleClickListener {
- // The references to the pages subcontrol's (needed for disposal)
- private TreeControl treeControl;
- private IToolBarManager toolbarMgr;
- private PropertyChangeListener pcListener;
- private Image formImage;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.forms.editor.FormPage#dispose()
- */
- @Override
- public void dispose() {
- IPropertyChangeProvider provider = getPropertyChangeProvider();
- if(provider != null && pcListener != null) {
- provider.removePropertyChangeListener(pcListener);
- }
- if(formImage != null) {
- formImage.dispose();
- }
- if (treeControl != null) { treeControl.dispose(); treeControl = null; }
- super.dispose();
- }
-
- /**
- * Set the initial focus to the tree.
- */
- @Override
- public void setFocus() {
- Control control = treeControl.getViewer().getControl();
- if(control != null && !control.isDisposed()) {
- control.setFocus();
- }
- else {
- super.setFocus();
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractEditorPage#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
- */
- @Override
- public void setInitializationData(IConfigurationElement config, String propertyName, Object data) {
- super.setInitializationData(config, propertyName, data);
- String iconPath = config.getAttribute("icon"); //$NON-NLS-1$
- if(iconPath != null) {
- String bundleId = config.getContributor().getName();
- Bundle bundle = Platform.getBundle(bundleId);
- if(bundle != null) {
- URL iconURL = bundle.getEntry(iconPath);
- if(iconURL != null) {
- ImageDescriptor iconDesc = ImageDescriptor.createFromURL(iconURL);
- if(iconDesc != null) {
- formImage = iconDesc.createImage();
- }
- }
- }
- }
- treeControl = doCreateTreeControl();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#getFormImage()
- */
- @Override
- protected Image getFormImage() {
- return formImage;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#createToolbarContributionItems(org.eclipse.jface.action.IToolBarManager)
- */
- @Override
- protected void createToolbarContributionItems(IToolBarManager manager) {
- this.toolbarMgr = manager;
- treeControl.createToolbarContributionItems(manager);
- super.createToolbarContributionItems(manager);
- }
-
- /* (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);
-
- // Setup the tree control
- Assert.isNotNull(treeControl);
- treeControl.setupFormPanel(parent, toolkit);
-
- // Register the context menu at the parent workbench part site.
- getSite().registerContextMenu(getId(), treeControl.getContextMenuManager(), treeControl.getViewer());
-
- // Set the initial input
- Object input = getViewerInput();
- treeControl.getViewer().setInput(input);
-
- addViewerListeners();
-
- // adjust the tree column width initially to take the full size of control
- adjustTreeColumnWidth(treeControl.getViewer());
-
- updateUI();
- }
-
- /**
- * Determines the current visible width of the tree control and
- * adjust the column width according to there relative weight.
- *
- * @param viewer The viewer or <code>null</code>.
- */
- protected void adjustTreeColumnWidth(Viewer viewer) {
- if (!(viewer instanceof TreeViewer)) return;
-
- final TreeViewer treeViewer = (TreeViewer)viewer;
- final Tree tree = treeViewer.getTree();
- tree.addControlListener(new ControlListener() {
-
- @Override
- public void controlResized(ControlEvent e) {
- int sumColumnWidth = 0;
- int treeWidth = tree.getSize().x - tree.getVerticalBar().getSize().x;
-
- TreeColumn[] columns = tree.getColumns();
-
- // Summarize the tree column width
- for (TreeColumn column : columns) {
- Object widthHint = column.getData("widthHint"); //$NON-NLS-1$
- sumColumnWidth += widthHint instanceof Integer ? ((Integer)widthHint).intValue() : column.getWidth();
- }
-
- // Calculate the new width for each column
- int sumColumnWidth2 = 0;
- TreeColumn maxColumn = null;
- for (TreeColumn column : columns) {
- Object widthHint = column.getData("widthHint"); //$NON-NLS-1$
- int width = widthHint instanceof Integer ? ((Integer)widthHint).intValue() : column.getWidth();
- int weight = (width * 100) / sumColumnWidth;
- int newWidth = (weight * treeWidth) / 100;
- sumColumnWidth2 += newWidth;
- column.setWidth(newWidth);
- if (maxColumn == null || maxColumn.getWidth() < column.getWidth()) {
- maxColumn = column;
- }
- }
-
- // If we end up with a slighter larger width of all columns than
- // the tree widget is, reduce the size of the largest column
- if (sumColumnWidth2 > treeWidth && maxColumn != null) {
- int delta = sumColumnWidth2 - treeWidth + 2;
- maxColumn.setWidth(maxColumn.getWidth() - delta);
- }
-
- tree.removeControlListener(this);
- }
-
- @Override
- public void controlMoved(ControlEvent e) {
- }
- });
- }
-
- /**
- * Add tree viewer listeners to the tree control.
- */
- private void addViewerListeners() {
- TreeViewer viewer = (TreeViewer) treeControl.getViewer();
- viewer.addSelectionChangedListener(new ISelectionChangedListener(){
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- propagateSelection();
- }});
- viewer.getTree().addFocusListener(new FocusAdapter(){
- @Override
- public void focusGained(FocusEvent e) {
- propagateSelection();
- }
- });
- viewer.addDoubleClickListener(this);
-
- IPropertyChangeProvider provider = getPropertyChangeProvider();
- if(provider != null) {
- pcListener = new PropertyChangeListener() {
- @Override
- public void propertyChange(final PropertyChangeEvent event) {
- Object object = event.getSource();
- Object input = getTreeViewerInput();
- if (object == input) {
- if (Display.getCurrent() != null) {
- updateUI();
- }
- else {
- Display display = getSite().getShell().getDisplay();
- display.asyncExec(new Runnable() {
- @Override
- public void run() {
- updateUI();
- }
- });
- }
- }
- }
- };
- provider.addPropertyChangeListener(pcListener);
- }
- }
-
- @Override
- public Object getAdapter(Class adapter) {
- if(TreeViewer.class.equals(adapter)) {
- return treeControl.getViewer();
- }
- return super.getAdapter(adapter);
- }
-
- /**
- * Get an adapter instance from the adaptable with the specified
- * adapter interface.
- *
- * @param adaptable The adaptable to get the adapter.
- * @param adapter The adapter interface class.
- * @return An adapter or null if it does not adapt to this type.
- */
- @SuppressWarnings("rawtypes")
- private Object getAdapter(Object adaptable, Class adapter) {
- Object adapted = null;
- if(adapter.isInstance(adaptable)) {
- adapted = adaptable;
- }
- if(adapted == null && adaptable instanceof IAdaptable) {
- adapted = ((IAdaptable)adaptable).getAdapter(adapter);
- }
- if(adapted == null && adaptable != null) {
- adapted = Platform.getAdapterManager().getAdapter(adaptable, adapter);
- }
- return adapted;
- }
-
- /**
- * Get an adapter of IFilteringLabelDecorator.
- *
- * @return an IFilteringLabelDecorator adapter or null if it does not adapt to IFilteringLabelDecorator.
- */
- private IFilterable adaptFilterable() {
- Object input = getTreeViewerInput();
- if (input != null) {
- return (IFilterable) getAdapter(input, IFilterable.class);
- }
- return null;
- }
-
- protected abstract Object getViewerInput();
-
- /**
- * Get the viewer input adapter for the input.
- *
- * @param input the input of the tree viewer.
- * @return The adapter.
- */
- private IPropertyChangeProvider getPropertyChangeProvider() {
- Object input = getTreeViewerInput();
- if (input != null) {
- return (IPropertyChangeProvider) getAdapter(input, IPropertyChangeProvider.class);
- }
- return null;
- }
-
- Object getTreeViewerInput() {
- if (treeControl != null && treeControl.getViewer() != null) {
- return treeControl.getViewer().getInput();
- }
- return null;
- }
-
- /**
- * Creates and returns a tree control.
- *
- * @return The new tree control.
- */
- protected TreeControl doCreateTreeControl() {
- return new TreeControl(getViewerId(), this);
- }
-
- /**
- * Returns the associated tree control.
- *
- * @return The associated tree control or <code>null</code>.
- */
- public final TreeControl getTreeControl() {
- return treeControl;
- }
-
- /**
- * Update the page's ui including its toolbar and title text and image.
- */
- protected void updateUI() {
- toolbarMgr.update(true);
- IManagedForm managedForm = getManagedForm();
- Form form = managedForm.getForm().getForm();
- Object element = getTreeViewerInput();
- boolean filterEnabled = false;
- IFilterable filterDecorator = adaptFilterable();
- if (filterDecorator != null) {
- TreeViewer viewer = (TreeViewer) treeControl.getViewer();
- filterEnabled = TreeViewerUtil.isFiltering(viewer, TreePath.EMPTY);
- }
- ILabelDecorator titleDecorator = getTitleBarDecorator();
- String text = getFormTitle();
- if (text != null) {
- if (titleDecorator != null) {
- text = titleDecorator.decorateText(text, element);
- }
- if (filterEnabled) {
- TreeViewer viewer = (TreeViewer) treeControl.getViewer();
- text = TreeViewerUtil.getDecoratedText(text, viewer, TreePath.EMPTY);
- }
- }
- Image image = getFormImage();
- if (image != null) {
- if (titleDecorator != null) {
- image = titleDecorator.decorateImage(image, element);
- }
- if (filterEnabled) {
- TreeViewer viewer = (TreeViewer) treeControl.getViewer();
- image = TreeViewerUtil.getDecoratedImage(image, viewer, TreePath.EMPTY);
- }
- }
- if (text != null) {
- try {
- form.setText(text);
- }
- catch (Exception e) {
- // Ignore any disposed exception
- }
- }
- if (image != null) {
- try {
- form.setImage(image);
- }
- catch (Exception e) {
- // Ignore any disposed exception
- }
- }
- }
-
- /**
- * Get the title bar's decorator or null if there's no decorator for it.
- */
- protected ILabelDecorator getTitleBarDecorator() {
- return null;
- }
-
- /**
- * Propagate the current selection to the editor's selection provider.
- */
- protected void propagateSelection() {
- ISelection selection = treeControl.getViewer().getSelection();
- ISelectionProvider selectionProvider = getSite().getSelectionProvider();
- // If the parent control is already disposed, we have no real chance of
- // testing for it. Catch the SWT exception here just in case.
- try {
- selectionProvider.setSelection(selection);
- if (selectionProvider instanceof MultiPageSelectionProvider) {
- SelectionChangedEvent changedEvent = new SelectionChangedEvent(selectionProvider, selection);
- ((MultiPageSelectionProvider) selectionProvider).firePostSelectionChanged(changedEvent);
- }
- }
- catch (SWTException e) {
- /* ignored on purpose */
- }
- }
-
- /**
- * Get the id of the command invoked when the tree is double-clicked.
- * If the id is null, then no command is invoked.
- *
- * @return The double-click command id.
- */
- protected String getDoubleClickCommandId() {
- return null;
- }
-
- /**
- * Get the tree viewer's id. This viewer id is used by
- * viewer extension to define columns and filters.
- *
- * @return This viewer's id or null.
- */
- protected abstract String getViewerId();
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
- */
- @Override
- public void doubleClick(final DoubleClickEvent event) {
- // If an handled and enabled command is registered for the ICommonActionConstants.OPEN
- // retargetable action id, redirect the double click handling to the command handler.
- //
- // Note: The default tree node expansion must be re-implemented in the active handler!
- String commandId = getDoubleClickCommandId();
- Command cmd = null;
- if(commandId != null) {
- ICommandService service = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
- cmd = service != null ? service.getCommand(commandId) : null;
- }
- if (cmd != null && cmd.isDefined() && cmd.isEnabled()) {
- final Command command = cmd;
- SafeRunner.run(new SafeRunnable(){
- @Override
- public void handleException(Throwable e) {
- // Ignore exception
- }
- @Override
- public void run() throws Exception {
- IHandlerService handlerSvc = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
- Assert.isNotNull(handlerSvc);
-
- ISelection selection = event.getSelection();
- EvaluationContext ctx = new EvaluationContext(handlerSvc.getCurrentState(), selection);
- ctx.addVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME, selection);
- ctx.addVariable(ISources.ACTIVE_MENU_SELECTION_NAME, selection);
- ctx.setAllowPluginActivation(true);
-
- ParameterizedCommand pCmd = ParameterizedCommand.generateCommand(command, null);
- Assert.isNotNull(pCmd);
-
- handlerSvc.executeCommandInContext(pCmd, null, ctx);
- }});
- } else {
- IStructuredSelection selection = (IStructuredSelection) event.getSelection();
- Object element = selection.getFirstElement();
- TreeViewer viewer = (TreeViewer) treeControl.getViewer();
- if (viewer.isExpandable(element)) {
- viewer.setExpandedState(element, !viewer.getExpandedState(element));
- }
- }
- }
-}
+/*******************************************************************************
+ * 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.ui.views.editor.pages;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.net.URL;
+
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.core.expressions.EvaluationContext;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.util.SafeRunnable;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ILabelDecorator;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.tcf.te.core.interfaces.IFilterable;
+import org.eclipse.tcf.te.core.interfaces.IPropertyChangeProvider;
+import org.eclipse.tcf.te.ui.forms.CustomFormToolkit;
+import org.eclipse.tcf.te.ui.trees.TreeControl;
+import org.eclipse.tcf.te.ui.utils.TreeViewerUtil;
+import org.eclipse.ui.ISources;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.widgets.Form;
+import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.ui.part.MultiPageSelectionProvider;
+import org.osgi.framework.Bundle;
+
+/**
+ * Tree viewer based editor page implementation.
+ */
+public abstract class TreeViewerExplorerEditorPage extends AbstractCustomFormToolkitEditorPage implements IDoubleClickListener {
+ // The references to the pages subcontrol's (needed for disposal)
+ private TreeControl treeControl;
+ private IToolBarManager toolbarMgr;
+ private PropertyChangeListener pcListener;
+ private Image formImage;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.editor.FormPage#dispose()
+ */
+ @Override
+ public void dispose() {
+ IPropertyChangeProvider provider = getPropertyChangeProvider();
+ if(provider != null && pcListener != null) {
+ provider.removePropertyChangeListener(pcListener);
+ }
+ if(formImage != null) {
+ formImage.dispose();
+ }
+ if (treeControl != null) { treeControl.dispose(); treeControl = null; }
+ super.dispose();
+ }
+
+ /**
+ * Set the initial focus to the tree.
+ */
+ @Override
+ public void setFocus() {
+ Control control = treeControl.getViewer().getControl();
+ if(control != null && !control.isDisposed()) {
+ control.setFocus();
+ }
+ else {
+ super.setFocus();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractEditorPage#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+ */
+ @Override
+ public void setInitializationData(IConfigurationElement config, String propertyName, Object data) {
+ super.setInitializationData(config, propertyName, data);
+ String iconPath = config.getAttribute("icon"); //$NON-NLS-1$
+ if(iconPath != null) {
+ String bundleId = config.getContributor().getName();
+ Bundle bundle = Platform.getBundle(bundleId);
+ if(bundle != null) {
+ URL iconURL = bundle.getEntry(iconPath);
+ if(iconURL != null) {
+ ImageDescriptor iconDesc = ImageDescriptor.createFromURL(iconURL);
+ if(iconDesc != null) {
+ formImage = iconDesc.createImage();
+ }
+ }
+ }
+ }
+ treeControl = doCreateTreeControl();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#getFormImage()
+ */
+ @Override
+ protected Image getFormImage() {
+ return formImage;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage#createToolbarContributionItems(org.eclipse.jface.action.IToolBarManager)
+ */
+ @Override
+ protected void createToolbarContributionItems(IToolBarManager manager) {
+ this.toolbarMgr = manager;
+ treeControl.createToolbarContributionItems(manager);
+ super.createToolbarContributionItems(manager);
+ }
+
+ /* (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);
+
+ // Setup the tree control
+ Assert.isNotNull(treeControl);
+ treeControl.setupFormPanel(parent, toolkit);
+
+ // Register the context menu at the parent workbench part site.
+ getSite().registerContextMenu(getId(), treeControl.getContextMenuManager(), treeControl.getViewer());
+
+ // Set the initial input
+ Object input = getViewerInput();
+ treeControl.getViewer().setInput(input);
+
+ addViewerListeners();
+
+ // adjust the tree column width initially to take the full size of control
+ adjustTreeColumnWidth(treeControl.getViewer());
+
+ updateUI();
+ }
+
+ /**
+ * Determines the current visible width of the tree control and
+ * adjust the column width according to there relative weight.
+ *
+ * @param viewer The viewer or <code>null</code>.
+ */
+ protected void adjustTreeColumnWidth(Viewer viewer) {
+ if (!(viewer instanceof TreeViewer)) return;
+
+ final TreeViewer treeViewer = (TreeViewer)viewer;
+ final Tree tree = treeViewer.getTree();
+ tree.addControlListener(new ControlListener() {
+
+ @Override
+ public void controlResized(ControlEvent e) {
+ int sumColumnWidth = 0;
+ int treeWidth = tree.getSize().x - tree.getVerticalBar().getSize().x;
+
+ TreeColumn[] columns = tree.getColumns();
+
+ // Summarize the tree column width
+ for (TreeColumn column : columns) {
+ Object widthHint = column.getData("widthHint"); //$NON-NLS-1$
+ sumColumnWidth += widthHint instanceof Integer ? ((Integer)widthHint).intValue() : column.getWidth();
+ }
+
+ // Calculate the new width for each column
+ int sumColumnWidth2 = 0;
+ TreeColumn maxColumn = null;
+ for (TreeColumn column : columns) {
+ Object widthHint = column.getData("widthHint"); //$NON-NLS-1$
+ int width = widthHint instanceof Integer ? ((Integer)widthHint).intValue() : column.getWidth();
+ int weight = (width * 100) / sumColumnWidth;
+ int newWidth = (weight * treeWidth) / 100;
+ sumColumnWidth2 += newWidth;
+ column.setWidth(newWidth);
+ if (maxColumn == null || maxColumn.getWidth() < column.getWidth()) {
+ maxColumn = column;
+ }
+ }
+
+ // If we end up with a slighter larger width of all columns than
+ // the tree widget is, reduce the size of the largest column
+ if (sumColumnWidth2 > treeWidth && maxColumn != null) {
+ int delta = sumColumnWidth2 - treeWidth + 2;
+ maxColumn.setWidth(maxColumn.getWidth() - delta);
+ }
+
+ tree.removeControlListener(this);
+ }
+
+ @Override
+ public void controlMoved(ControlEvent e) {
+ }
+ });
+ }
+
+ /**
+ * Add tree viewer listeners to the tree control.
+ */
+ private void addViewerListeners() {
+ TreeViewer viewer = (TreeViewer) treeControl.getViewer();
+ viewer.addSelectionChangedListener(new ISelectionChangedListener(){
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ propagateSelection();
+ }});
+ viewer.getTree().addFocusListener(new FocusAdapter(){
+ @Override
+ public void focusGained(FocusEvent e) {
+ propagateSelection();
+ }
+ });
+ viewer.addDoubleClickListener(this);
+
+ IPropertyChangeProvider provider = getPropertyChangeProvider();
+ if(provider != null) {
+ pcListener = new PropertyChangeListener() {
+ @Override
+ public void propertyChange(final PropertyChangeEvent event) {
+ Object object = event.getSource();
+ Object input = getTreeViewerInput();
+ if (object == input) {
+ if (Display.getCurrent() != null) {
+ updateUI();
+ }
+ else {
+ Display display = getSite().getShell().getDisplay();
+ display.asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ updateUI();
+ }
+ });
+ }
+ }
+ }
+ };
+ provider.addPropertyChangeListener(pcListener);
+ }
+ }
+
+ @Override
+ public Object getAdapter(Class adapter) {
+ if(TreeViewer.class.equals(adapter)) {
+ return treeControl.getViewer();
+ }
+ return super.getAdapter(adapter);
+ }
+
+ /**
+ * Get an adapter instance from the adaptable with the specified
+ * adapter interface.
+ *
+ * @param adaptable The adaptable to get the adapter.
+ * @param adapter The adapter interface class.
+ * @return An adapter or null if it does not adapt to this type.
+ */
+ @SuppressWarnings("rawtypes")
+ private Object getAdapter(Object adaptable, Class adapter) {
+ Object adapted = null;
+ if(adapter.isInstance(adaptable)) {
+ adapted = adaptable;
+ }
+ if(adapted == null && adaptable instanceof IAdaptable) {
+ adapted = ((IAdaptable)adaptable).getAdapter(adapter);
+ }
+ if(adapted == null && adaptable != null) {
+ adapted = Platform.getAdapterManager().getAdapter(adaptable, adapter);
+ }
+ return adapted;
+ }
+
+ /**
+ * Get an adapter of IFilteringLabelDecorator.
+ *
+ * @return an IFilteringLabelDecorator adapter or null if it does not adapt to IFilteringLabelDecorator.
+ */
+ private IFilterable adaptFilterable() {
+ Object input = getTreeViewerInput();
+ if (input != null) {
+ return (IFilterable) getAdapter(input, IFilterable.class);
+ }
+ return null;
+ }
+
+ protected abstract Object getViewerInput();
+
+ /**
+ * Get the viewer input adapter for the input.
+ *
+ * @param input the input of the tree viewer.
+ * @return The adapter.
+ */
+ private IPropertyChangeProvider getPropertyChangeProvider() {
+ Object input = getTreeViewerInput();
+ if (input != null) {
+ return (IPropertyChangeProvider) getAdapter(input, IPropertyChangeProvider.class);
+ }
+ return null;
+ }
+
+ Object getTreeViewerInput() {
+ if (treeControl != null && treeControl.getViewer() != null) {
+ return treeControl.getViewer().getInput();
+ }
+ return null;
+ }
+
+ /**
+ * Creates and returns a tree control.
+ *
+ * @return The new tree control.
+ */
+ protected TreeControl doCreateTreeControl() {
+ return new TreeControl(getViewerId(), this);
+ }
+
+ /**
+ * Returns the associated tree control.
+ *
+ * @return The associated tree control or <code>null</code>.
+ */
+ public final TreeControl getTreeControl() {
+ return treeControl;
+ }
+
+ /**
+ * Update the page's ui including its toolbar and title text and image.
+ */
+ protected void updateUI() {
+ toolbarMgr.update(true);
+ IManagedForm managedForm = getManagedForm();
+ Form form = managedForm.getForm().getForm();
+ Object element = getTreeViewerInput();
+ boolean filterEnabled = false;
+ IFilterable filterDecorator = adaptFilterable();
+ if (filterDecorator != null) {
+ TreeViewer viewer = (TreeViewer) treeControl.getViewer();
+ filterEnabled = TreeViewerUtil.isFiltering(viewer, TreePath.EMPTY);
+ }
+ ILabelDecorator titleDecorator = getTitleBarDecorator();
+ String text = getFormTitle();
+ if (text != null) {
+ if (titleDecorator != null) {
+ text = titleDecorator.decorateText(text, element);
+ }
+ if (filterEnabled) {
+ TreeViewer viewer = (TreeViewer) treeControl.getViewer();
+ text = TreeViewerUtil.getDecoratedText(text, viewer, TreePath.EMPTY);
+ }
+ }
+ Image image = getFormImage();
+ if (image != null) {
+ if (titleDecorator != null) {
+ image = titleDecorator.decorateImage(image, element);
+ }
+ if (filterEnabled) {
+ TreeViewer viewer = (TreeViewer) treeControl.getViewer();
+ image = TreeViewerUtil.getDecoratedImage(image, viewer, TreePath.EMPTY);
+ }
+ }
+ if (text != null) {
+ try {
+ form.setText(text);
+ }
+ catch (Exception e) {
+ // Ignore any disposed exception
+ }
+ }
+ if (image != null) {
+ try {
+ form.setImage(image);
+ }
+ catch (Exception e) {
+ // Ignore any disposed exception
+ }
+ }
+ }
+
+ /**
+ * Get the title bar's decorator or null if there's no decorator for it.
+ */
+ protected ILabelDecorator getTitleBarDecorator() {
+ return null;
+ }
+
+ /**
+ * Propagate the current selection to the editor's selection provider.
+ */
+ protected void propagateSelection() {
+ ISelection selection = treeControl.getViewer().getSelection();
+ ISelectionProvider selectionProvider = getSite().getSelectionProvider();
+ // If the parent control is already disposed, we have no real chance of
+ // testing for it. Catch the SWT exception here just in case.
+ try {
+ selectionProvider.setSelection(selection);
+ if (selectionProvider instanceof MultiPageSelectionProvider) {
+ SelectionChangedEvent changedEvent = new SelectionChangedEvent(selectionProvider, selection);
+ ((MultiPageSelectionProvider) selectionProvider).firePostSelectionChanged(changedEvent);
+ }
+ }
+ catch (SWTException e) {
+ /* ignored on purpose */
+ }
+ }
+
+ /**
+ * Get the id of the command invoked when the tree is double-clicked.
+ * If the id is null, then no command is invoked.
+ *
+ * @return The double-click command id.
+ */
+ protected String getDoubleClickCommandId() {
+ return null;
+ }
+
+ /**
+ * Get the tree viewer's id. This viewer id is used by
+ * viewer extension to define columns and filters.
+ *
+ * @return This viewer's id or null.
+ */
+ protected abstract String getViewerId();
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
+ */
+ @Override
+ public void doubleClick(final DoubleClickEvent event) {
+ // If an handled and enabled command is registered for the ICommonActionConstants.OPEN
+ // retargetable action id, redirect the double click handling to the command handler.
+ //
+ // Note: The default tree node expansion must be re-implemented in the active handler!
+ String commandId = getDoubleClickCommandId();
+ Command cmd = null;
+ if(commandId != null) {
+ ICommandService service = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
+ cmd = service != null ? service.getCommand(commandId) : null;
+ }
+ if (cmd != null && cmd.isDefined() && cmd.isEnabled()) {
+ final Command command = cmd;
+ SafeRunner.run(new SafeRunnable(){
+ @Override
+ public void handleException(Throwable e) {
+ // Ignore exception
+ }
+ @Override
+ public void run() throws Exception {
+ IHandlerService handlerSvc = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
+ Assert.isNotNull(handlerSvc);
+
+ ISelection selection = event.getSelection();
+ EvaluationContext ctx = new EvaluationContext(handlerSvc.getCurrentState(), selection);
+ ctx.addVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME, selection);
+ ctx.addVariable(ISources.ACTIVE_MENU_SELECTION_NAME, selection);
+ ctx.setAllowPluginActivation(true);
+
+ ParameterizedCommand pCmd = ParameterizedCommand.generateCommand(command, null);
+ Assert.isNotNull(pCmd);
+
+ handlerSvc.executeCommandInContext(pCmd, null, ctx);
+ }});
+ } else {
+ IStructuredSelection selection = (IStructuredSelection) event.getSelection();
+ Object element = selection.getFirstElement();
+ TreeViewer viewer = (TreeViewer) treeControl.getViewer();
+ if (viewer.isExpandable(element)) {
+ viewer.setExpandedState(element, !viewer.getExpandedState(element));
+ }
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/events/AbstractEventListener.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/events/AbstractEventListener.java
index b15ff9159..6ae3c99bd 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/events/AbstractEventListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/events/AbstractEventListener.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.ui.views/src/org/eclipse/tcf/te/ui/views/events/ViewerContentChangeEvent.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/events/ViewerContentChangeEvent.java
index 7e10dfc8c..a28276106 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/events/ViewerContentChangeEvent.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/events/ViewerContentChangeEvent.java
@@ -1,84 +1,84 @@
-/*******************************************************************************
- * 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.ui.views.events;
-
-import java.util.EventObject;
-
-import org.eclipse.tcf.te.runtime.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.runtime.interfaces.tracing.ITraceIds;
-
-/**
- * Target Explorer view viewer change event implementation.
- */
-public class ViewerContentChangeEvent extends EventObject {
- private static final long serialVersionUID = 7168841012111347036L;
-
- private String eventId;
-
- /**
- * Event id used if elements got directly added to the viewer.
- */
- public static final String ADD = "add"; //$NON-NLS-1$
-
- /**
- * Event id used if elements got directly removed the viewer.
- */
- public static final String REMOVE = "remove"; //$NON-NLS-1$
-
- /**
- * Event id used if the viewer got refreshed.
- */
- public static final String REFRESH = "refresh"; //$NON-NLS-1$
-
- /**
- * Constructor.
- *
- * @param source The source object. Must not be <code>null</code>.
- * @param eventId The event id. Must not be <code>null</code>.
- *
- * @exception IllegalArgumentException if eventId == null.
- */
- public ViewerContentChangeEvent(Object source, String eventId) {
- super(source);
-
- if (eventId == null) throw new IllegalArgumentException("null eventId"); //$NON-NLS-1$
- this.eventId = eventId;
- }
-
- /**
- * Returns the event id.
- *
- * @return The event id.
- */
- public final String getEventId() {
- return eventId;
- }
-
- /* (non-Javadoc)
- * @see java.util.EventObject#toString()
- */
- @Override
- public String toString() {
- StringBuilder toString = new StringBuilder(getClass().getName());
-
- String prefix = ""; //$NON-NLS-1$
- // if tracing the event, formating them a little bit better readable.
- if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_EVENTS))
- prefix = "\n\t\t"; //$NON-NLS-1$
-
- toString.append(prefix + "{eventId="); //$NON-NLS-1$
- toString.append(eventId);
- toString.append("," + prefix + "source="); //$NON-NLS-1$ //$NON-NLS-2$
- toString.append(source);
- toString.append("}"); //$NON-NLS-1$
-
- return toString.toString();
- }
-}
+/*******************************************************************************
+ * 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.ui.views.events;
+
+import java.util.EventObject;
+
+import org.eclipse.tcf.te.runtime.activator.CoreBundleActivator;
+import org.eclipse.tcf.te.runtime.interfaces.tracing.ITraceIds;
+
+/**
+ * Target Explorer view viewer change event implementation.
+ */
+public class ViewerContentChangeEvent extends EventObject {
+ private static final long serialVersionUID = 7168841012111347036L;
+
+ private String eventId;
+
+ /**
+ * Event id used if elements got directly added to the viewer.
+ */
+ public static final String ADD = "add"; //$NON-NLS-1$
+
+ /**
+ * Event id used if elements got directly removed the viewer.
+ */
+ public static final String REMOVE = "remove"; //$NON-NLS-1$
+
+ /**
+ * Event id used if the viewer got refreshed.
+ */
+ public static final String REFRESH = "refresh"; //$NON-NLS-1$
+
+ /**
+ * Constructor.
+ *
+ * @param source The source object. Must not be <code>null</code>.
+ * @param eventId The event id. Must not be <code>null</code>.
+ *
+ * @exception IllegalArgumentException if eventId == null.
+ */
+ public ViewerContentChangeEvent(Object source, String eventId) {
+ super(source);
+
+ if (eventId == null) throw new IllegalArgumentException("null eventId"); //$NON-NLS-1$
+ this.eventId = eventId;
+ }
+
+ /**
+ * Returns the event id.
+ *
+ * @return The event id.
+ */
+ public final String getEventId() {
+ return eventId;
+ }
+
+ /* (non-Javadoc)
+ * @see java.util.EventObject#toString()
+ */
+ @Override
+ public String toString() {
+ StringBuilder toString = new StringBuilder(getClass().getName());
+
+ String prefix = ""; //$NON-NLS-1$
+ // if tracing the event, formating them a little bit better readable.
+ if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_EVENTS))
+ prefix = "\n\t\t"; //$NON-NLS-1$
+
+ toString.append(prefix + "{eventId="); //$NON-NLS-1$
+ toString.append(eventId);
+ toString.append("," + prefix + "source="); //$NON-NLS-1$ //$NON-NLS-2$
+ toString.append(source);
+ toString.append("}"); //$NON-NLS-1$
+
+ return toString.toString();
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/expressions/PropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/expressions/PropertyTester.java
index bcbbd614b..d71046ff4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/expressions/PropertyTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/expressions/PropertyTester.java
@@ -1,48 +1,48 @@
-/*******************************************************************************
- * 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.ui.views.expressions;
-
-import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.services.interfaces.IUIService;
-import org.eclipse.tcf.te.ui.interfaces.handler.IEditorHandlerDelegate;
-import org.eclipse.tcf.te.ui.views.editor.Editor;
-import org.eclipse.tcf.te.ui.views.editor.EditorInput;
-import org.eclipse.tcf.te.ui.views.extensions.EditorPageBindingExtensionPointManager;
-import org.eclipse.ui.IEditorInput;
-
-
-/**
- * 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) {
-
- if ("hasApplicableEditorBindings".equals(property)) { //$NON-NLS-1$
- IUIService service = ServiceManager.getInstance().getService(receiver, IUIService.class);
- IEditorHandlerDelegate delegate = service != null ? service.getDelegate(receiver, IEditorHandlerDelegate.class) : null;
- IEditorInput input = (delegate != null) ? delegate.getEditorInput(receiver) : new EditorInput(receiver);
-
- return (expectedValue != null ? expectedValue : Boolean.TRUE).equals(Boolean.valueOf(EditorPageBindingExtensionPointManager.getInstance().getApplicableEditorPageBindings(input).length > 0));
- }
-
- if ("isDirty".equals(property) && receiver instanceof Editor && expectedValue instanceof Boolean) { //$NON-NLS-1$
- Editor editor = (Editor) receiver;
- return ((Boolean)expectedValue).booleanValue() == editor.isDirty();
- }
-
- 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.ui.views.expressions;
+
+import org.eclipse.tcf.te.runtime.services.ServiceManager;
+import org.eclipse.tcf.te.runtime.services.interfaces.IUIService;
+import org.eclipse.tcf.te.ui.interfaces.handler.IEditorHandlerDelegate;
+import org.eclipse.tcf.te.ui.views.editor.Editor;
+import org.eclipse.tcf.te.ui.views.editor.EditorInput;
+import org.eclipse.tcf.te.ui.views.extensions.EditorPageBindingExtensionPointManager;
+import org.eclipse.ui.IEditorInput;
+
+
+/**
+ * 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) {
+
+ if ("hasApplicableEditorBindings".equals(property)) { //$NON-NLS-1$
+ IUIService service = ServiceManager.getInstance().getService(receiver, IUIService.class);
+ IEditorHandlerDelegate delegate = service != null ? service.getDelegate(receiver, IEditorHandlerDelegate.class) : null;
+ IEditorInput input = (delegate != null) ? delegate.getEditorInput(receiver) : new EditorInput(receiver);
+
+ return (expectedValue != null ? expectedValue : Boolean.TRUE).equals(Boolean.valueOf(EditorPageBindingExtensionPointManager.getInstance().getApplicableEditorPageBindings(input).length > 0));
+ }
+
+ if ("isDirty".equals(property) && receiver instanceof Editor && expectedValue instanceof Boolean) { //$NON-NLS-1$
+ Editor editor = (Editor) receiver;
+ return ((Boolean)expectedValue).booleanValue() == editor.isDirty();
+ }
+
+ return false;
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/expressions/SelectionSourceProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/expressions/SelectionSourceProvider.java
index c1dc9d004..4b3c9c0f7 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/expressions/SelectionSourceProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/expressions/SelectionSourceProvider.java
@@ -1,207 +1,207 @@
-/*******************************************************************************
- * 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.ui.views.expressions;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
-import org.eclipse.ui.AbstractSourceProvider;
-import org.eclipse.ui.INullSelectionListener;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.IWindowListener;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.services.IEvaluationService;
-import org.eclipse.ui.services.IServiceLocator;
-
-/**
- * Selection service source provider implementation.
- */
-public class SelectionSourceProvider extends AbstractSourceProvider implements INullSelectionListener, IWindowListener {
-
- /**
- * Source name identifying the System Manager view selection.
- */
- public static final String systemManagerViewSelectionName = "systemManagerViewSelection"; //$NON-NLS-1$
-
- /**
- * Source name identifying the Debug View view selection.
- */
- public static final String debugViewSelectionName = "debugViewSelection"; //$NON-NLS-1$
-
- // The internal list of provided source names
- private final static String[] PROVIDED_SOURCE_NAMES = { systemManagerViewSelectionName, debugViewSelectionName };
-
- /**
- * Debug view identifier (value <code>"org.eclipse.debug.ui.DebugView"</code>).
- * @see IDebugUIConstants
- */
- private static final String ID_DEBUG_VIEW = "org.eclipse.debug.ui.DebugView"; //$NON-NLS-1$
-
- // The map containing the cached selections
- private final Map<String, ISelection> cache = new HashMap<String, ISelection>();
-
- // The reference to the expression evaluation service
- private IEvaluationService service = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.AbstractSourceProvider#initialize(org.eclipse.ui.services.IServiceLocator)
- */
- @Override
- public void initialize(IServiceLocator locator) {
- super.initialize(locator);
-
- if (PlatformUI.getWorkbench() != null) {
- // Register the service provider as workbench window listener
- PlatformUI.getWorkbench().addWindowListener(this);
- // Initialize the selection cache and the selection listener
- if (PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null) {
- windowOpened(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
- }
- }
-
- // Register the source provider with the expression evaluation service
- if (locator.hasService(IEvaluationService.class)) {
- service = (IEvaluationService)locator.getService(IEvaluationService.class);
- if (service != null) service.addSourceProvider(this);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.ISourceProvider#dispose()
- */
- @Override
- public void dispose() {
- // Unregister the selection listener
- if (PlatformUI.getWorkbench() != null) {
- // Unregister the service provide as workbench window listener
- PlatformUI.getWorkbench().removeWindowListener(this);
- // Unregister the selection listener
- if (PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null) {
- windowClosed(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
- }
- }
-
- // Unregister the source provider from the expression evaluation service
- if (service != null) { service.removeSourceProvider(this); service = null; }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.ISourceProvider#getProvidedSourceNames()
- */
- @Override
- public String[] getProvidedSourceNames() {
- return PROVIDED_SOURCE_NAMES;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.ISourceProvider#getCurrentState()
- */
- @Override
- public Map getCurrentState() {
- Map<String, Object> state = new HashMap<String, Object>();
-
- ISelection selection = cache.get(IUIConstants.ID_EXPLORER);
- state.put(systemManagerViewSelectionName, selection != null ? selection : IEvaluationContext.UNDEFINED_VARIABLE);
-
- selection = cache.get(ID_DEBUG_VIEW);
- state.put(debugViewSelectionName, selection != null ? selection : IEvaluationContext.UNDEFINED_VARIABLE);
-
- return state;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- @Override
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- String partId = part != null ? part.getSite().getId() : null;
- if (!IUIConstants.ID_EXPLORER.equals(partId) && !ID_DEBUG_VIEW.equals(partId)) {
- return;
- }
-
- // Update the cached selection
- if (selection != null) cache.put(partId, selection);
- else cache.remove(partId);
-
- // Fire the source changed notification
- fireSourceChanged(ISources.WORKBENCH, IUIConstants.ID_EXPLORER.equals(partId) ? systemManagerViewSelectionName : debugViewSelectionName,
- selection != null ? selection : IEvaluationContext.UNDEFINED_VARIABLE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
- */
- @Override
- public void windowActivated(IWorkbenchWindow window) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow)
- */
- @Override
- public void windowDeactivated(IWorkbenchWindow window) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow)
- */
- @Override
- public void windowClosed(IWorkbenchWindow window) {
- // Remove ourself as selection listener
- if (window != null && window.getSelectionService() != null) {
- ISelectionService service = window.getSelectionService();
- service.removePostSelectionListener(IUIConstants.ID_EXPLORER, this);
- service.removePostSelectionListener(ID_DEBUG_VIEW, this);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow)
- */
- @Override
- public void windowOpened(IWorkbenchWindow window) {
- // A new workbench window opened. We have to register
- // ourself as selection listener if not done
- if (window != null && window.getSelectionService() != null) {
- // Get the selection service
- ISelectionService service = window.getSelectionService();
-
- // Unregister the source provider first, just in case to
- // avoid the listener to be registered multiple time
- service.removePostSelectionListener(IUIConstants.ID_EXPLORER, this);
- service.removePostSelectionListener(ID_DEBUG_VIEW, this);
-
- // Register the source provider now as post selection listener
- service.addPostSelectionListener(IUIConstants.ID_EXPLORER, this);
- service.addPostSelectionListener(ID_DEBUG_VIEW, this);
-
- // Initialize the selections
- ISelection selection = service.getSelection(IUIConstants.ID_EXPLORER);
- if (selection != null) cache.put(IUIConstants.ID_EXPLORER, selection);
- else cache.remove(IUIConstants.ID_EXPLORER);
-
- fireSourceChanged(ISources.WORKBENCH, systemManagerViewSelectionName,
- selection != null ? selection : IEvaluationContext.UNDEFINED_VARIABLE);
-
- selection = service.getSelection(ID_DEBUG_VIEW);
- if (selection != null) cache.put(ID_DEBUG_VIEW, selection);
- else cache.remove(ID_DEBUG_VIEW);
-
- fireSourceChanged(ISources.WORKBENCH, debugViewSelectionName,
- selection != null ? selection : IEvaluationContext.UNDEFINED_VARIABLE);
- }
- }
-}
+/*******************************************************************************
+ * 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.ui.views.expressions;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
+import org.eclipse.ui.AbstractSourceProvider;
+import org.eclipse.ui.INullSelectionListener;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.ISources;
+import org.eclipse.ui.IWindowListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.services.IEvaluationService;
+import org.eclipse.ui.services.IServiceLocator;
+
+/**
+ * Selection service source provider implementation.
+ */
+public class SelectionSourceProvider extends AbstractSourceProvider implements INullSelectionListener, IWindowListener {
+
+ /**
+ * Source name identifying the System Manager view selection.
+ */
+ public static final String systemManagerViewSelectionName = "systemManagerViewSelection"; //$NON-NLS-1$
+
+ /**
+ * Source name identifying the Debug View view selection.
+ */
+ public static final String debugViewSelectionName = "debugViewSelection"; //$NON-NLS-1$
+
+ // The internal list of provided source names
+ private final static String[] PROVIDED_SOURCE_NAMES = { systemManagerViewSelectionName, debugViewSelectionName };
+
+ /**
+ * Debug view identifier (value <code>"org.eclipse.debug.ui.DebugView"</code>).
+ * @see IDebugUIConstants
+ */
+ private static final String ID_DEBUG_VIEW = "org.eclipse.debug.ui.DebugView"; //$NON-NLS-1$
+
+ // The map containing the cached selections
+ private final Map<String, ISelection> cache = new HashMap<String, ISelection>();
+
+ // The reference to the expression evaluation service
+ private IEvaluationService service = null;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.AbstractSourceProvider#initialize(org.eclipse.ui.services.IServiceLocator)
+ */
+ @Override
+ public void initialize(IServiceLocator locator) {
+ super.initialize(locator);
+
+ if (PlatformUI.getWorkbench() != null) {
+ // Register the service provider as workbench window listener
+ PlatformUI.getWorkbench().addWindowListener(this);
+ // Initialize the selection cache and the selection listener
+ if (PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null) {
+ windowOpened(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
+ }
+ }
+
+ // Register the source provider with the expression evaluation service
+ if (locator.hasService(IEvaluationService.class)) {
+ service = (IEvaluationService)locator.getService(IEvaluationService.class);
+ if (service != null) service.addSourceProvider(this);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.ISourceProvider#dispose()
+ */
+ @Override
+ public void dispose() {
+ // Unregister the selection listener
+ if (PlatformUI.getWorkbench() != null) {
+ // Unregister the service provide as workbench window listener
+ PlatformUI.getWorkbench().removeWindowListener(this);
+ // Unregister the selection listener
+ if (PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null) {
+ windowClosed(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
+ }
+ }
+
+ // Unregister the source provider from the expression evaluation service
+ if (service != null) { service.removeSourceProvider(this); service = null; }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.ISourceProvider#getProvidedSourceNames()
+ */
+ @Override
+ public String[] getProvidedSourceNames() {
+ return PROVIDED_SOURCE_NAMES;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.ISourceProvider#getCurrentState()
+ */
+ @Override
+ public Map getCurrentState() {
+ Map<String, Object> state = new HashMap<String, Object>();
+
+ ISelection selection = cache.get(IUIConstants.ID_EXPLORER);
+ state.put(systemManagerViewSelectionName, selection != null ? selection : IEvaluationContext.UNDEFINED_VARIABLE);
+
+ selection = cache.get(ID_DEBUG_VIEW);
+ state.put(debugViewSelectionName, selection != null ? selection : IEvaluationContext.UNDEFINED_VARIABLE);
+
+ return state;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+ */
+ @Override
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ String partId = part != null ? part.getSite().getId() : null;
+ if (!IUIConstants.ID_EXPLORER.equals(partId) && !ID_DEBUG_VIEW.equals(partId)) {
+ return;
+ }
+
+ // Update the cached selection
+ if (selection != null) cache.put(partId, selection);
+ else cache.remove(partId);
+
+ // Fire the source changed notification
+ fireSourceChanged(ISources.WORKBENCH, IUIConstants.ID_EXPLORER.equals(partId) ? systemManagerViewSelectionName : debugViewSelectionName,
+ selection != null ? selection : IEvaluationContext.UNDEFINED_VARIABLE);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
+ */
+ @Override
+ public void windowActivated(IWorkbenchWindow window) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow)
+ */
+ @Override
+ public void windowDeactivated(IWorkbenchWindow window) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow)
+ */
+ @Override
+ public void windowClosed(IWorkbenchWindow window) {
+ // Remove ourself as selection listener
+ if (window != null && window.getSelectionService() != null) {
+ ISelectionService service = window.getSelectionService();
+ service.removePostSelectionListener(IUIConstants.ID_EXPLORER, this);
+ service.removePostSelectionListener(ID_DEBUG_VIEW, this);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow)
+ */
+ @Override
+ public void windowOpened(IWorkbenchWindow window) {
+ // A new workbench window opened. We have to register
+ // ourself as selection listener if not done
+ if (window != null && window.getSelectionService() != null) {
+ // Get the selection service
+ ISelectionService service = window.getSelectionService();
+
+ // Unregister the source provider first, just in case to
+ // avoid the listener to be registered multiple time
+ service.removePostSelectionListener(IUIConstants.ID_EXPLORER, this);
+ service.removePostSelectionListener(ID_DEBUG_VIEW, this);
+
+ // Register the source provider now as post selection listener
+ service.addPostSelectionListener(IUIConstants.ID_EXPLORER, this);
+ service.addPostSelectionListener(ID_DEBUG_VIEW, this);
+
+ // Initialize the selections
+ ISelection selection = service.getSelection(IUIConstants.ID_EXPLORER);
+ if (selection != null) cache.put(IUIConstants.ID_EXPLORER, selection);
+ else cache.remove(IUIConstants.ID_EXPLORER);
+
+ fireSourceChanged(ISources.WORKBENCH, systemManagerViewSelectionName,
+ selection != null ? selection : IEvaluationContext.UNDEFINED_VARIABLE);
+
+ selection = service.getSelection(ID_DEBUG_VIEW);
+ if (selection != null) cache.put(ID_DEBUG_VIEW, selection);
+ else cache.remove(ID_DEBUG_VIEW);
+
+ fireSourceChanged(ISources.WORKBENCH, debugViewSelectionName,
+ selection != null ? selection : IEvaluationContext.UNDEFINED_VARIABLE);
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/extensions/EditorPageBindingExtensionPointManager.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/extensions/EditorPageBindingExtensionPointManager.java
index 0ed911989..ff26ad511 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/extensions/EditorPageBindingExtensionPointManager.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/extensions/EditorPageBindingExtensionPointManager.java
@@ -1,194 +1,194 @@
-/*******************************************************************************
- * 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.ui.views.extensions;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.expressions.EvaluationContext;
-import org.eclipse.core.expressions.EvaluationResult;
-import org.eclipse.core.expressions.Expression;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager;
-import org.eclipse.tcf.te.runtime.extensions.ExecutableExtensionProxy;
-import org.eclipse.tcf.te.ui.views.activator.UIPlugin;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.handlers.IHandlerService;
-
-
-/**
- * Details editor page binding extension point manager implementation.
- */
-public class EditorPageBindingExtensionPointManager extends AbstractExtensionPointManager<EditorPageBinding> {
-
- /*
- * Thread save singleton instance creation.
- */
- private static class LazyInstance {
- public static EditorPageBindingExtensionPointManager instance = new EditorPageBindingExtensionPointManager();
- }
-
- /**
- * Constructor.
- */
- EditorPageBindingExtensionPointManager() {
- super();
- }
-
- /**
- * Returns the singleton instance of the extension point manager.
- */
- public static EditorPageBindingExtensionPointManager getInstance() {
- return LazyInstance.instance;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager#getExtensionPointId()
- */
- @Override
- protected String getExtensionPointId() {
- return "org.eclipse.tcf.te.ui.views.editorPageBindings"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager#getConfigurationElementName()
- */
- @Override
- protected String getConfigurationElementName() {
- return "editorPageBinding"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager#doCreateExtensionProxy(org.eclipse.core.runtime.IConfigurationElement)
- */
- @Override
- protected ExecutableExtensionProxy<EditorPageBinding> doCreateExtensionProxy(IConfigurationElement element) throws CoreException {
- return new ExecutableExtensionProxy<EditorPageBinding>(element) {
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.extensions.ExecutableExtensionProxy#newInstance()
- */
- @Override
- public EditorPageBinding newInstance() {
- EditorPageBinding instance = new EditorPageBinding();
- try {
- instance.setInitializationData(getConfigurationElement(), null, null);
- } catch (CoreException e) {
- IStatus status = new Status(IStatus.ERROR, UIPlugin.getUniqueIdentifier(),
- e.getLocalizedMessage(), e);
- UIPlugin.getDefault().getLog().log(status);
- }
- return instance;
- }
- };
- }
-
- /**
- * Returns the applicable editor page bindings for the given data source model node..
- *
- * @param input The active editor input or <code>null</code>.
- * @return The list of applicable editor page bindings or an empty array.
- */
- public EditorPageBinding[] getApplicableEditorPageBindings(IEditorInput input) {
- List<EditorPageBinding> applicable = new ArrayList<EditorPageBinding>();
-
- for (EditorPageBinding binding : getEditorPageBindings()) {
- Expression enablement = binding.getEnablement();
-
- // The page binding is applicable by default if no expression
- // is specified.
- boolean isApplicable = enablement == null;
-
- if (enablement != null && input != null) {
- // Extract the node from the editor input
- Object node = input.getAdapter(Object.class);
- if (node != null) {
- // Set the default variable to the data source model node instance.
- IEvaluationContext currentState = ((IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class)).getCurrentState();
- EvaluationContext context = new EvaluationContext(currentState, node);
- // Set the "activeEditorInput" variable to the data source model node instance.
- context.addVariable(ISources.ACTIVE_EDITOR_INPUT_NAME, node);
- // Allow plugin activation
- context.setAllowPluginActivation(true);
- // Evaluate the expression
- try {
- isApplicable = enablement.evaluate(context).equals(EvaluationResult.TRUE);
- } catch (CoreException e) {
- IStatus status = new Status(IStatus.ERROR, UIPlugin.getUniqueIdentifier(), e.getLocalizedMessage(), e);
- UIPlugin.getDefault().getLog().log(status);
- }
- } else {
- // The enablement is false by definition if we cannot
- // determine the data source model node.
- isApplicable = false;
- }
- }
-
- // Add the page if applicable
- if (isApplicable) applicable.add(binding);
- }
-
- for (EditorPageUnBinding unBinding : EditorPageUnBindingExtensionPointManager.getInstance().getApplicableEditorPageUnBindings(input)) {
- Iterator<EditorPageBinding> it = applicable.iterator();
- while (it.hasNext()) {
- EditorPageBinding binding = it.next();
- if (binding.getPageId().equals(unBinding.getPageId())) {
- it.remove();
- }
- }
- }
-
- return applicable.toArray(new EditorPageBinding[applicable.size()]);
- }
-
- /**
- * Returns the list of all contributed editor page bindings.
- *
- * @return The list of contributed editor page bindings, or an empty array.
- */
- public EditorPageBinding[] getEditorPageBindings() {
- List<EditorPageBinding> contributions = new ArrayList<EditorPageBinding>();
- Collection<ExecutableExtensionProxy<EditorPageBinding>> editorPageBindings = getExtensions().values();
- for (ExecutableExtensionProxy<EditorPageBinding> editorPageBinding : editorPageBindings) {
- EditorPageBinding instance = editorPageBinding.getInstance();
- if (instance != null && !contributions.contains(instance)) {
- contributions.add(instance);
- }
- }
-
- return contributions.toArray(new EditorPageBinding[contributions.size()]);
- }
-
- /**
- * Returns the editor page binding identified by its unique id. If no editor
- * page binding with the specified id is registered, <code>null</code> is returned.
- *
- * @param id The unique id of the editor page binding or <code>null</code>
- *
- * @return The editor page instance or <code>null</code>.
- */
- public EditorPageBinding getEditorPageBinding(String id) {
- EditorPageBinding contribution = null;
- if (getExtensions().containsKey(id)) {
- ExecutableExtensionProxy<EditorPageBinding> proxy = getExtensions().get(id);
- // Get the extension instance
- contribution = proxy.getInstance();
- }
-
- return contribution;
- }
-}
+/*******************************************************************************
+ * 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.ui.views.extensions;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.expressions.EvaluationContext;
+import org.eclipse.core.expressions.EvaluationResult;
+import org.eclipse.core.expressions.Expression;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager;
+import org.eclipse.tcf.te.runtime.extensions.ExecutableExtensionProxy;
+import org.eclipse.tcf.te.ui.views.activator.UIPlugin;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.ISources;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.handlers.IHandlerService;
+
+
+/**
+ * Details editor page binding extension point manager implementation.
+ */
+public class EditorPageBindingExtensionPointManager extends AbstractExtensionPointManager<EditorPageBinding> {
+
+ /*
+ * Thread save singleton instance creation.
+ */
+ private static class LazyInstance {
+ public static EditorPageBindingExtensionPointManager instance = new EditorPageBindingExtensionPointManager();
+ }
+
+ /**
+ * Constructor.
+ */
+ EditorPageBindingExtensionPointManager() {
+ super();
+ }
+
+ /**
+ * Returns the singleton instance of the extension point manager.
+ */
+ public static EditorPageBindingExtensionPointManager getInstance() {
+ return LazyInstance.instance;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager#getExtensionPointId()
+ */
+ @Override
+ protected String getExtensionPointId() {
+ return "org.eclipse.tcf.te.ui.views.editorPageBindings"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager#getConfigurationElementName()
+ */
+ @Override
+ protected String getConfigurationElementName() {
+ return "editorPageBinding"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager#doCreateExtensionProxy(org.eclipse.core.runtime.IConfigurationElement)
+ */
+ @Override
+ protected ExecutableExtensionProxy<EditorPageBinding> doCreateExtensionProxy(IConfigurationElement element) throws CoreException {
+ return new ExecutableExtensionProxy<EditorPageBinding>(element) {
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.extensions.ExecutableExtensionProxy#newInstance()
+ */
+ @Override
+ public EditorPageBinding newInstance() {
+ EditorPageBinding instance = new EditorPageBinding();
+ try {
+ instance.setInitializationData(getConfigurationElement(), null, null);
+ } catch (CoreException e) {
+ IStatus status = new Status(IStatus.ERROR, UIPlugin.getUniqueIdentifier(),
+ e.getLocalizedMessage(), e);
+ UIPlugin.getDefault().getLog().log(status);
+ }
+ return instance;
+ }
+ };
+ }
+
+ /**
+ * Returns the applicable editor page bindings for the given data source model node..
+ *
+ * @param input The active editor input or <code>null</code>.
+ * @return The list of applicable editor page bindings or an empty array.
+ */
+ public EditorPageBinding[] getApplicableEditorPageBindings(IEditorInput input) {
+ List<EditorPageBinding> applicable = new ArrayList<EditorPageBinding>();
+
+ for (EditorPageBinding binding : getEditorPageBindings()) {
+ Expression enablement = binding.getEnablement();
+
+ // The page binding is applicable by default if no expression
+ // is specified.
+ boolean isApplicable = enablement == null;
+
+ if (enablement != null && input != null) {
+ // Extract the node from the editor input
+ Object node = input.getAdapter(Object.class);
+ if (node != null) {
+ // Set the default variable to the data source model node instance.
+ IEvaluationContext currentState = ((IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class)).getCurrentState();
+ EvaluationContext context = new EvaluationContext(currentState, node);
+ // Set the "activeEditorInput" variable to the data source model node instance.
+ context.addVariable(ISources.ACTIVE_EDITOR_INPUT_NAME, node);
+ // Allow plugin activation
+ context.setAllowPluginActivation(true);
+ // Evaluate the expression
+ try {
+ isApplicable = enablement.evaluate(context).equals(EvaluationResult.TRUE);
+ } catch (CoreException e) {
+ IStatus status = new Status(IStatus.ERROR, UIPlugin.getUniqueIdentifier(), e.getLocalizedMessage(), e);
+ UIPlugin.getDefault().getLog().log(status);
+ }
+ } else {
+ // The enablement is false by definition if we cannot
+ // determine the data source model node.
+ isApplicable = false;
+ }
+ }
+
+ // Add the page if applicable
+ if (isApplicable) applicable.add(binding);
+ }
+
+ for (EditorPageUnBinding unBinding : EditorPageUnBindingExtensionPointManager.getInstance().getApplicableEditorPageUnBindings(input)) {
+ Iterator<EditorPageBinding> it = applicable.iterator();
+ while (it.hasNext()) {
+ EditorPageBinding binding = it.next();
+ if (binding.getPageId().equals(unBinding.getPageId())) {
+ it.remove();
+ }
+ }
+ }
+
+ return applicable.toArray(new EditorPageBinding[applicable.size()]);
+ }
+
+ /**
+ * Returns the list of all contributed editor page bindings.
+ *
+ * @return The list of contributed editor page bindings, or an empty array.
+ */
+ public EditorPageBinding[] getEditorPageBindings() {
+ List<EditorPageBinding> contributions = new ArrayList<EditorPageBinding>();
+ Collection<ExecutableExtensionProxy<EditorPageBinding>> editorPageBindings = getExtensions().values();
+ for (ExecutableExtensionProxy<EditorPageBinding> editorPageBinding : editorPageBindings) {
+ EditorPageBinding instance = editorPageBinding.getInstance();
+ if (instance != null && !contributions.contains(instance)) {
+ contributions.add(instance);
+ }
+ }
+
+ return contributions.toArray(new EditorPageBinding[contributions.size()]);
+ }
+
+ /**
+ * Returns the editor page binding identified by its unique id. If no editor
+ * page binding with the specified id is registered, <code>null</code> is returned.
+ *
+ * @param id The unique id of the editor page binding or <code>null</code>
+ *
+ * @return The editor page instance or <code>null</code>.
+ */
+ public EditorPageBinding getEditorPageBinding(String id) {
+ EditorPageBinding contribution = null;
+ if (getExtensions().containsKey(id)) {
+ ExecutableExtensionProxy<EditorPageBinding> proxy = getExtensions().get(id);
+ // Get the extension instance
+ contribution = proxy.getInstance();
+ }
+
+ return contribution;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/extensions/EditorPageExtensionPointManager.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/extensions/EditorPageExtensionPointManager.java
index a52db5323..04b52e989 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/extensions/EditorPageExtensionPointManager.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/extensions/EditorPageExtensionPointManager.java
@@ -1,102 +1,102 @@
-/*******************************************************************************
- * 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.ui.views.extensions;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.tcf.te.ui.views.interfaces.IEditorPage;
-import org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager;
-import org.eclipse.tcf.te.runtime.extensions.ExecutableExtensionProxy;
-
-
-/**
- * Details editor page extension point manager implementation.
- */
-public class EditorPageExtensionPointManager extends AbstractExtensionPointManager<IEditorPage> {
- /*
- * Thread save singleton instance creation.
- */
- private static class LazyInstance {
- public static EditorPageExtensionPointManager instance = new EditorPageExtensionPointManager();
- }
-
- /**
- * Constructor.
- */
- EditorPageExtensionPointManager() {
- super();
- }
-
- /**
- * Returns the singleton instance of the extension point manager.
- */
- public static EditorPageExtensionPointManager getInstance() {
- return LazyInstance.instance;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager#getExtensionPointId()
- */
- @Override
- protected String getExtensionPointId() {
- return "org.eclipse.tcf.te.ui.views.editorPages"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager#getConfigurationElementName()
- */
- @Override
- protected String getConfigurationElementName() {
- return "editorPage"; //$NON-NLS-1$
- }
-
- /**
- * Returns the list of all contributed editor pages.
- *
- * @param unique If <code>true</code>, the method returns new instances for each
- * contributed editor page.
- *
- * @return The list of contributed editor pages, or an empty array.
- */
- public IEditorPage[] getEditorPages(boolean unique) {
- List<IEditorPage> contributions = new ArrayList<IEditorPage>();
- Collection<ExecutableExtensionProxy<IEditorPage>> editorPages = getExtensions().values();
- for (ExecutableExtensionProxy<IEditorPage> editorPage : editorPages) {
- IEditorPage instance = unique ? editorPage.newInstance() : editorPage.getInstance();
- if (instance != null && !contributions.contains(instance)) {
- contributions.add(instance);
- }
- }
-
- return contributions.toArray(new IEditorPage[contributions.size()]);
- }
-
- /**
- * Returns the editor page identified by its unique id. If no editor
- * page with the specified id is registered, <code>null</code> is returned.
- *
- * @param id The unique id of the editor page or <code>null</code>
- * @param unique If <code>true</code>, the method returns new instances of the editor page contribution.
- *
- * @return The editor page instance or <code>null</code>.
- */
- public IEditorPage getEditorPage(String id, boolean unique) {
- IEditorPage contribution = null;
- if (getExtensions().containsKey(id)) {
- ExecutableExtensionProxy<IEditorPage> proxy = getExtensions().get(id);
- // Get the extension instance
- contribution = unique ? proxy.newInstance() : proxy.getInstance();
- }
-
- return contribution;
- }
-}
+/*******************************************************************************
+ * 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.ui.views.extensions;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.tcf.te.ui.views.interfaces.IEditorPage;
+import org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager;
+import org.eclipse.tcf.te.runtime.extensions.ExecutableExtensionProxy;
+
+
+/**
+ * Details editor page extension point manager implementation.
+ */
+public class EditorPageExtensionPointManager extends AbstractExtensionPointManager<IEditorPage> {
+ /*
+ * Thread save singleton instance creation.
+ */
+ private static class LazyInstance {
+ public static EditorPageExtensionPointManager instance = new EditorPageExtensionPointManager();
+ }
+
+ /**
+ * Constructor.
+ */
+ EditorPageExtensionPointManager() {
+ super();
+ }
+
+ /**
+ * Returns the singleton instance of the extension point manager.
+ */
+ public static EditorPageExtensionPointManager getInstance() {
+ return LazyInstance.instance;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager#getExtensionPointId()
+ */
+ @Override
+ protected String getExtensionPointId() {
+ return "org.eclipse.tcf.te.ui.views.editorPages"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager#getConfigurationElementName()
+ */
+ @Override
+ protected String getConfigurationElementName() {
+ return "editorPage"; //$NON-NLS-1$
+ }
+
+ /**
+ * Returns the list of all contributed editor pages.
+ *
+ * @param unique If <code>true</code>, the method returns new instances for each
+ * contributed editor page.
+ *
+ * @return The list of contributed editor pages, or an empty array.
+ */
+ public IEditorPage[] getEditorPages(boolean unique) {
+ List<IEditorPage> contributions = new ArrayList<IEditorPage>();
+ Collection<ExecutableExtensionProxy<IEditorPage>> editorPages = getExtensions().values();
+ for (ExecutableExtensionProxy<IEditorPage> editorPage : editorPages) {
+ IEditorPage instance = unique ? editorPage.newInstance() : editorPage.getInstance();
+ if (instance != null && !contributions.contains(instance)) {
+ contributions.add(instance);
+ }
+ }
+
+ return contributions.toArray(new IEditorPage[contributions.size()]);
+ }
+
+ /**
+ * Returns the editor page identified by its unique id. If no editor
+ * page with the specified id is registered, <code>null</code> is returned.
+ *
+ * @param id The unique id of the editor page or <code>null</code>
+ * @param unique If <code>true</code>, the method returns new instances of the editor page contribution.
+ *
+ * @return The editor page instance or <code>null</code>.
+ */
+ public IEditorPage getEditorPage(String id, boolean unique) {
+ IEditorPage contribution = null;
+ if (getExtensions().containsKey(id)) {
+ ExecutableExtensionProxy<IEditorPage> proxy = getExtensions().get(id);
+ // Get the extension instance
+ contribution = unique ? proxy.newInstance() : proxy.getInstance();
+ }
+
+ return contribution;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/extensions/LabelProviderDelegateExtensionPointManager.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/extensions/LabelProviderDelegateExtensionPointManager.java
index f55a4116a..01be98f61 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/extensions/LabelProviderDelegateExtensionPointManager.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/extensions/LabelProviderDelegateExtensionPointManager.java
@@ -1,131 +1,131 @@
-/*******************************************************************************
- * 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.ui.views.extensions;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-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.expressions.IEvaluationContext;
-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.jface.viewers.ILabelProvider;
-import org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager;
-import org.eclipse.tcf.te.runtime.extensions.ExecutableExtensionProxy;
-import org.eclipse.tcf.te.ui.activator.UIPlugin;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.handlers.IHandlerService;
-
-/**
- * Label Provider Delegate extension point manager implementation.
- */
-public class LabelProviderDelegateExtensionPointManager extends AbstractExtensionPointManager<ILabelProvider> {
- /*
- * Thread save singleton instance creation.
- */
- private static class LazyInstance {
- public static LabelProviderDelegateExtensionPointManager instance = new LabelProviderDelegateExtensionPointManager();
- }
-
- /**
- * Constructor.
- */
- LabelProviderDelegateExtensionPointManager() {
- super();
- }
-
- /**
- * Returns the singleton instance of the extension point manager.
- */
- public static LabelProviderDelegateExtensionPointManager getInstance() {
- return LazyInstance.instance;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager#getExtensionPointId()
- */
- @Override
- protected String getExtensionPointId() {
- return "org.eclipse.tcf.te.ui.views.labelProviderDelegates"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager#getConfigurationElementName()
- */
- @Override
- protected String getConfigurationElementName() {
- return "labelProviderDelegate"; //$NON-NLS-1$
- }
-
- /**
- * Returns the list of all contributed label provider delegates.
- *
- * @param unique If <code>true</code>, the method returns new instances for each
- * contributed label provider delegate.
- *
- * @return The list of contributed label provider delegates, or an empty array.
- */
- public ILabelProvider[] getDelegates(Object context, boolean unique) {
- List<ILabelProvider> contributions = new ArrayList<ILabelProvider>();
- Collection<ExecutableExtensionProxy<ILabelProvider>> delegates = getExtensions().values();
- for (ExecutableExtensionProxy<ILabelProvider> delegate : delegates) {
- Expression enablement = null;
- // Read the sub elements of the extension
- IConfigurationElement[] children = delegate != null ? delegate.getConfigurationElement().getChildren() : null;
- // The "enablement" element is the only expected one
- if (children != null && children.length > 0) {
- try {
- enablement = ExpressionConverter.getDefault().perform(children[0]);
- }
- catch (CoreException e) {}
- }
-
- // The binding is applicable by default if no expression is specified.
- boolean isApplicable = enablement == null;
-
- if (enablement != null) {
- if (context != null) {
- // Set the default variable to the delegate context.
- IEvaluationContext currentState = ((IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class)).getCurrentState();
- EvaluationContext evalContext = new EvaluationContext(currentState, context);
- evalContext.addVariable("context", context); //$NON-NLS-1$
- // Allow plugin activation
- evalContext.setAllowPluginActivation(true);
- // Evaluate the expression
- try {
- isApplicable = enablement.evaluate(evalContext).equals(EvaluationResult.TRUE);
- } catch (CoreException e) {
- IStatus status = new Status(IStatus.ERROR, UIPlugin.getUniqueIdentifier(), e.getLocalizedMessage(), e);
- Platform.getLog(UIPlugin.getDefault().getBundle()).log(status);
- }
- } else {
- // The enablement is false by definition if no delegate context is given.
- isApplicable = false;
- }
- }
-
- if (isApplicable) {
- ILabelProvider instance = unique ? delegate.newInstance() : delegate.getInstance();
- if (instance != null && !contributions.contains(instance)) {
- contributions.add(instance);
- }
- }
- }
-
- return contributions.toArray(new ILabelProvider[contributions.size()]);
- }
-}
+/*******************************************************************************
+ * 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.ui.views.extensions;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+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.expressions.IEvaluationContext;
+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.jface.viewers.ILabelProvider;
+import org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager;
+import org.eclipse.tcf.te.runtime.extensions.ExecutableExtensionProxy;
+import org.eclipse.tcf.te.ui.activator.UIPlugin;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.handlers.IHandlerService;
+
+/**
+ * Label Provider Delegate extension point manager implementation.
+ */
+public class LabelProviderDelegateExtensionPointManager extends AbstractExtensionPointManager<ILabelProvider> {
+ /*
+ * Thread save singleton instance creation.
+ */
+ private static class LazyInstance {
+ public static LabelProviderDelegateExtensionPointManager instance = new LabelProviderDelegateExtensionPointManager();
+ }
+
+ /**
+ * Constructor.
+ */
+ LabelProviderDelegateExtensionPointManager() {
+ super();
+ }
+
+ /**
+ * Returns the singleton instance of the extension point manager.
+ */
+ public static LabelProviderDelegateExtensionPointManager getInstance() {
+ return LazyInstance.instance;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager#getExtensionPointId()
+ */
+ @Override
+ protected String getExtensionPointId() {
+ return "org.eclipse.tcf.te.ui.views.labelProviderDelegates"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.extensions.AbstractExtensionPointManager#getConfigurationElementName()
+ */
+ @Override
+ protected String getConfigurationElementName() {
+ return "labelProviderDelegate"; //$NON-NLS-1$
+ }
+
+ /**
+ * Returns the list of all contributed label provider delegates.
+ *
+ * @param unique If <code>true</code>, the method returns new instances for each
+ * contributed label provider delegate.
+ *
+ * @return The list of contributed label provider delegates, or an empty array.
+ */
+ public ILabelProvider[] getDelegates(Object context, boolean unique) {
+ List<ILabelProvider> contributions = new ArrayList<ILabelProvider>();
+ Collection<ExecutableExtensionProxy<ILabelProvider>> delegates = getExtensions().values();
+ for (ExecutableExtensionProxy<ILabelProvider> delegate : delegates) {
+ Expression enablement = null;
+ // Read the sub elements of the extension
+ IConfigurationElement[] children = delegate != null ? delegate.getConfigurationElement().getChildren() : null;
+ // The "enablement" element is the only expected one
+ if (children != null && children.length > 0) {
+ try {
+ enablement = ExpressionConverter.getDefault().perform(children[0]);
+ }
+ catch (CoreException e) {}
+ }
+
+ // The binding is applicable by default if no expression is specified.
+ boolean isApplicable = enablement == null;
+
+ if (enablement != null) {
+ if (context != null) {
+ // Set the default variable to the delegate context.
+ IEvaluationContext currentState = ((IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class)).getCurrentState();
+ EvaluationContext evalContext = new EvaluationContext(currentState, context);
+ evalContext.addVariable("context", context); //$NON-NLS-1$
+ // Allow plugin activation
+ evalContext.setAllowPluginActivation(true);
+ // Evaluate the expression
+ try {
+ isApplicable = enablement.evaluate(evalContext).equals(EvaluationResult.TRUE);
+ } catch (CoreException e) {
+ IStatus status = new Status(IStatus.ERROR, UIPlugin.getUniqueIdentifier(), e.getLocalizedMessage(), e);
+ Platform.getLog(UIPlugin.getDefault().getBundle()).log(status);
+ }
+ } else {
+ // The enablement is false by definition if no delegate context is given.
+ isApplicable = false;
+ }
+ }
+
+ if (isApplicable) {
+ ILabelProvider instance = unique ? delegate.newInstance() : delegate.getInstance();
+ if (instance != null && !contributions.contains(instance)) {
+ contributions.add(instance);
+ }
+ }
+ }
+
+ return contributions.toArray(new ILabelProvider[contributions.size()]);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/FilterMRUContribution.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/FilterMRUContribution.java
index 496ea7e73..a57630965 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/FilterMRUContribution.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/FilterMRUContribution.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.ui.views.handler;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.tcf.te.ui.views.ViewsUtil;
-import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
-import org.eclipse.tcf.te.ui.views.internal.preferences.IPreferenceKeys;
-import org.eclipse.ui.actions.CompoundContributionItem;
-import org.eclipse.ui.internal.navigator.NavigatorFilterService;
-import org.eclipse.ui.navigator.CommonNavigator;
-import org.eclipse.ui.navigator.CommonViewer;
-import org.eclipse.ui.navigator.ICommonFilterDescriptor;
-import org.eclipse.ui.navigator.INavigatorContentService;
-
-/**
- * The dynamic contribution of common filter MRU menu list.
- */
-@SuppressWarnings("restriction")
-public class FilterMRUContribution extends CompoundContributionItem {
-
- /**
- * A MRU item action to enable or disable specified common filter.
- */
- static class FilterMRUAction extends Action {
- // The filter service used to enable or disable this filter.
- private NavigatorFilterService filterService;
- // This filter's descriptor
- private ICommonFilterDescriptor filterDescriptor;
- // The common viewer of the navigator.
- private CommonViewer commonViewer;
-
- /**
- * Constructor
- */
- public FilterMRUAction(int order, ICommonFilterDescriptor filterDescriptor, NavigatorFilterService filterService, CommonViewer commonViewer) {
- super("" + order + " " + filterDescriptor.getName(), AS_CHECK_BOX); //$NON-NLS-1$//$NON-NLS-2$
- this.filterDescriptor = filterDescriptor;
- this.filterService = filterService;
- this.commonViewer = commonViewer;
- setChecked(filterService.isActive(filterDescriptor.getId()));
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- @Override
- public void run() {
- ICommonFilterDescriptor[] visibleFilters = filterService.getVisibleFilterDescriptorsForUI();
- Set<String> activeIds = new HashSet<String>();
- if (visibleFilters != null && visibleFilters.length > 0) {
- for (ICommonFilterDescriptor filter : visibleFilters) {
- if (filterService.isActive(filter.getId())) activeIds.add(filter.getId());
- }
- }
- if (isChecked()) activeIds.add(filterDescriptor.getId());
- else activeIds.remove(filterDescriptor.getId());
- UpdateActiveFiltersOperation updateFilters = new UpdateActiveFiltersOperation(commonViewer, activeIds.toArray(new String[activeIds.size()]));
- updateFilters.execute(null, null);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
- */
- @Override
- protected IContributionItem[] getContributionItems() {
- CommonNavigator navigator = (CommonNavigator) ViewsUtil.getPart(IUIConstants.ID_EXPLORER);
- if (navigator == null) return new IContributionItem[0];
-
- INavigatorContentService contentService = navigator.getNavigatorContentService();
- NavigatorFilterService filterService = (NavigatorFilterService) contentService.getFilterService();
- Map<String, ICommonFilterDescriptor> fdMap = new HashMap<String, ICommonFilterDescriptor>();
- ICommonFilterDescriptor[] visibleFilterDescriptors = filterService.getVisibleFilterDescriptorsForUI();
- for(ICommonFilterDescriptor filterDescriptor : visibleFilterDescriptors) {
- fdMap.put(filterDescriptor.getId(), filterDescriptor);
- }
- List<IContributionItem> items = new ArrayList<IContributionItem>();
- List<String> filterSet = new MRUList(IPreferenceKeys.PREF_FILTER_MRU_LIST);
- CommonViewer commonViewer = navigator.getCommonViewer();
- for (int i = 0; i < filterSet.size(); i++) {
- String filterId = filterSet.get(i);
- ICommonFilterDescriptor filterDescriptor = fdMap.get(filterId);
- if (filterDescriptor != null) {
- items.add(new ActionContributionItem(new FilterMRUAction((i+1), filterDescriptor, filterService, commonViewer)));
- }
- }
- return items.toArray(new IContributionItem[items.size()]);
- }
-}
+/*******************************************************************************
+ * 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.ui.views.handler;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.tcf.te.ui.views.ViewsUtil;
+import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
+import org.eclipse.tcf.te.ui.views.internal.preferences.IPreferenceKeys;
+import org.eclipse.ui.actions.CompoundContributionItem;
+import org.eclipse.ui.internal.navigator.NavigatorFilterService;
+import org.eclipse.ui.navigator.CommonNavigator;
+import org.eclipse.ui.navigator.CommonViewer;
+import org.eclipse.ui.navigator.ICommonFilterDescriptor;
+import org.eclipse.ui.navigator.INavigatorContentService;
+
+/**
+ * The dynamic contribution of common filter MRU menu list.
+ */
+@SuppressWarnings("restriction")
+public class FilterMRUContribution extends CompoundContributionItem {
+
+ /**
+ * A MRU item action to enable or disable specified common filter.
+ */
+ static class FilterMRUAction extends Action {
+ // The filter service used to enable or disable this filter.
+ private NavigatorFilterService filterService;
+ // This filter's descriptor
+ private ICommonFilterDescriptor filterDescriptor;
+ // The common viewer of the navigator.
+ private CommonViewer commonViewer;
+
+ /**
+ * Constructor
+ */
+ public FilterMRUAction(int order, ICommonFilterDescriptor filterDescriptor, NavigatorFilterService filterService, CommonViewer commonViewer) {
+ super("" + order + " " + filterDescriptor.getName(), AS_CHECK_BOX); //$NON-NLS-1$//$NON-NLS-2$
+ this.filterDescriptor = filterDescriptor;
+ this.filterService = filterService;
+ this.commonViewer = commonViewer;
+ setChecked(filterService.isActive(filterDescriptor.getId()));
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ ICommonFilterDescriptor[] visibleFilters = filterService.getVisibleFilterDescriptorsForUI();
+ Set<String> activeIds = new HashSet<String>();
+ if (visibleFilters != null && visibleFilters.length > 0) {
+ for (ICommonFilterDescriptor filter : visibleFilters) {
+ if (filterService.isActive(filter.getId())) activeIds.add(filter.getId());
+ }
+ }
+ if (isChecked()) activeIds.add(filterDescriptor.getId());
+ else activeIds.remove(filterDescriptor.getId());
+ UpdateActiveFiltersOperation updateFilters = new UpdateActiveFiltersOperation(commonViewer, activeIds.toArray(new String[activeIds.size()]));
+ updateFilters.execute(null, null);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
+ */
+ @Override
+ protected IContributionItem[] getContributionItems() {
+ CommonNavigator navigator = (CommonNavigator) ViewsUtil.getPart(IUIConstants.ID_EXPLORER);
+ if (navigator == null) return new IContributionItem[0];
+
+ INavigatorContentService contentService = navigator.getNavigatorContentService();
+ NavigatorFilterService filterService = (NavigatorFilterService) contentService.getFilterService();
+ Map<String, ICommonFilterDescriptor> fdMap = new HashMap<String, ICommonFilterDescriptor>();
+ ICommonFilterDescriptor[] visibleFilterDescriptors = filterService.getVisibleFilterDescriptorsForUI();
+ for(ICommonFilterDescriptor filterDescriptor : visibleFilterDescriptors) {
+ fdMap.put(filterDescriptor.getId(), filterDescriptor);
+ }
+ List<IContributionItem> items = new ArrayList<IContributionItem>();
+ List<String> filterSet = new MRUList(IPreferenceKeys.PREF_FILTER_MRU_LIST);
+ CommonViewer commonViewer = navigator.getCommonViewer();
+ for (int i = 0; i < filterSet.size(); i++) {
+ String filterId = filterSet.get(i);
+ ICommonFilterDescriptor filterDescriptor = fdMap.get(filterId);
+ if (filterDescriptor != null) {
+ items.add(new ActionContributionItem(new FilterMRUAction((i+1), filterDescriptor, filterService, commonViewer)));
+ }
+ }
+ return items.toArray(new IContributionItem[items.size()]);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/NewWizardHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/NewWizardHandler.java
index 726fe27df..1809c140c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/NewWizardHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/NewWizardHandler.java
@@ -2,7 +2,7 @@
* NewWizardHandler.java
* Created on Jul 12, 2012
*
- * Copyright (c) 2012 Wind River Systems, Inc.
+ * 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
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/OpenEditorHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/OpenEditorHandler.java
index 86def91a5..6827af676 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/OpenEditorHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/OpenEditorHandler.java
@@ -1,113 +1,113 @@
-/*******************************************************************************
- * 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.ui.views.handler;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.services.interfaces.IUIService;
-import org.eclipse.tcf.te.ui.interfaces.handler.IEditorHandlerDelegate;
-import org.eclipse.tcf.te.ui.views.activator.UIPlugin;
-import org.eclipse.tcf.te.ui.views.editor.EditorInput;
-import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
-import org.eclipse.tcf.te.ui.views.nls.Messages;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.navigator.CommonNavigator;
-
-/**
- * TCF tree elements open command handler implementation.
- */
-public class OpenEditorHandler extends AbstractHandler {
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- // The selection is the Target Explorer tree selection
- ISelection selection = HandlerUtil.getCurrentSelection(event);
- // The active part is the Target Explorer view instance
- IWorkbenchPart part = HandlerUtil.getActivePart(event);
- // Get the currently active workbench window
- IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
- // ALT - Key pressed?
- Object ctrlPressed = HandlerUtil.getVariable(event, "ctrlPressed"); //$NON-NLS-1$
-
- boolean expand = ctrlPressed instanceof Boolean ? ((Boolean)ctrlPressed).booleanValue() : false;
-
- if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
- // If the tree node is expandable, expand or collapse it
- TreeViewer viewer = ((CommonNavigator)part).getCommonViewer();
- Object element = ((IStructuredSelection)selection).getFirstElement();
- if (selection instanceof TreeSelection) {
- TreePath[] path = ((TreeSelection)selection).getPaths();
- if (path != null && path.length > 0) {
- element = path[0].getLastSegment();
- }
- }
- if (viewer.isExpandable(element) && expand) {
- viewer.setExpandedState(element, !viewer.getExpandedState(element));
- }
- else {
- openEditorOnSelection(window, selection);
- }
- }
-
- return null;
- }
-
- /**
- * Opens the properties editor in the given workbench window on the given selection.
- *
- * @param window The workbench window. Must not be <code>null</code>.
- * @param selection The selection. Must not be <code>null</code>.
- */
- public static void openEditorOnSelection(IWorkbenchWindow window, ISelection selection) {
- Assert.isNotNull(window);
- Assert.isNotNull(selection);
-
- if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
- Object element = ((IStructuredSelection)selection).getFirstElement();
- if (element != null) {
- // Get the active page
- IWorkbenchPage page = window.getActivePage();
- // Create the editor input object
- IUIService service = ServiceManager.getInstance().getService(element, IUIService.class);
- IEditorHandlerDelegate delegate = service != null ? service.getDelegate(element, IEditorHandlerDelegate.class) : null;
- IEditorInput input = (delegate != null) ? delegate.getEditorInput(element) : new EditorInput(element);
- try {
- // Opens the Target Explorer properties editor
- IEditorPart editor = page.openEditor(input, IUIConstants.ID_EDITOR);
- // Lookup the ui service for post action
- if (delegate != null)
- delegate.postOpenEditor(editor, element);
- } catch (PartInitException e) {
- IStatus status = new Status(IStatus.ERROR, UIPlugin.getUniqueIdentifier(), Messages.OpenCommandHandler_error_openEditor, e);
- UIPlugin.getDefault().getLog().log(status);
- }
- }
- }
- }
-}
+/*******************************************************************************
+ * 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.ui.views.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.tcf.te.runtime.services.ServiceManager;
+import org.eclipse.tcf.te.runtime.services.interfaces.IUIService;
+import org.eclipse.tcf.te.ui.interfaces.handler.IEditorHandlerDelegate;
+import org.eclipse.tcf.te.ui.views.activator.UIPlugin;
+import org.eclipse.tcf.te.ui.views.editor.EditorInput;
+import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
+import org.eclipse.tcf.te.ui.views.nls.Messages;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.navigator.CommonNavigator;
+
+/**
+ * TCF tree elements open command handler implementation.
+ */
+public class OpenEditorHandler extends AbstractHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ // The selection is the Target Explorer tree selection
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+ // The active part is the Target Explorer view instance
+ IWorkbenchPart part = HandlerUtil.getActivePart(event);
+ // Get the currently active workbench window
+ IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
+ // ALT - Key pressed?
+ Object ctrlPressed = HandlerUtil.getVariable(event, "ctrlPressed"); //$NON-NLS-1$
+
+ boolean expand = ctrlPressed instanceof Boolean ? ((Boolean)ctrlPressed).booleanValue() : false;
+
+ if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
+ // If the tree node is expandable, expand or collapse it
+ TreeViewer viewer = ((CommonNavigator)part).getCommonViewer();
+ Object element = ((IStructuredSelection)selection).getFirstElement();
+ if (selection instanceof TreeSelection) {
+ TreePath[] path = ((TreeSelection)selection).getPaths();
+ if (path != null && path.length > 0) {
+ element = path[0].getLastSegment();
+ }
+ }
+ if (viewer.isExpandable(element) && expand) {
+ viewer.setExpandedState(element, !viewer.getExpandedState(element));
+ }
+ else {
+ openEditorOnSelection(window, selection);
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Opens the properties editor in the given workbench window on the given selection.
+ *
+ * @param window The workbench window. Must not be <code>null</code>.
+ * @param selection The selection. Must not be <code>null</code>.
+ */
+ public static void openEditorOnSelection(IWorkbenchWindow window, ISelection selection) {
+ Assert.isNotNull(window);
+ Assert.isNotNull(selection);
+
+ if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
+ Object element = ((IStructuredSelection)selection).getFirstElement();
+ if (element != null) {
+ // Get the active page
+ IWorkbenchPage page = window.getActivePage();
+ // Create the editor input object
+ IUIService service = ServiceManager.getInstance().getService(element, IUIService.class);
+ IEditorHandlerDelegate delegate = service != null ? service.getDelegate(element, IEditorHandlerDelegate.class) : null;
+ IEditorInput input = (delegate != null) ? delegate.getEditorInput(element) : new EditorInput(element);
+ try {
+ // Opens the Target Explorer properties editor
+ IEditorPart editor = page.openEditor(input, IUIConstants.ID_EDITOR);
+ // Lookup the ui service for post action
+ if (delegate != null)
+ delegate.postOpenEditor(editor, element);
+ } catch (PartInitException e) {
+ IStatus status = new Status(IStatus.ERROR, UIPlugin.getUniqueIdentifier(), Messages.OpenCommandHandler_error_openEditor, e);
+ UIPlugin.getDefault().getLog().log(status);
+ }
+ }
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/ShowInSystemManagementHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/ShowInSystemManagementHandler.java
index 7f282b36e..77ba7328b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/ShowInSystemManagementHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/handler/ShowInSystemManagementHandler.java
@@ -1,115 +1,115 @@
-/*******************************************************************************
- * 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.ui.views.handler;
-
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.tcf.te.ui.views.extensions.CategoriesExtensionPointManager;
-import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
-import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.navigator.CommonNavigator;
-import org.eclipse.ui.part.EditorPart;
-
-/**
- * "Show In System Management" command handler implementation.
- */
-public class ShowInSystemManagementHandler extends AbstractHandler {
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- @Override
- public Object execute(ExecutionEvent event) throws ExecutionException {
- // Get the active part
- IWorkbenchPart part = HandlerUtil.getActivePart(event);
- // The element to select
- Object element = null;
-
- // If the handler is invoked from an editor part, ignore the selection and
- // construct an artificial selection from the active editor input.
- if (part instanceof EditorPart) {
- IEditorInput input = ((EditorPart)part).getEditorInput();
- element = input != null ? input.getAdapter(Object.class) : null;
- }
-
- if (element != null) {
- setAndCheckSelection(IUIConstants.ID_EXPLORER, element);
- }
-
- return null;
- }
-
- private void setAndCheckSelection(final String id, final Object element) {
- Assert.isNotNull(id);
-
- final AtomicReference<IViewPart> viewPart = new AtomicReference<IViewPart>();
- // Create the runnable
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- // Check the active workbench window and active page instances
- if (PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null && PlatformUI
- .getWorkbench().getActiveWorkbenchWindow().getActivePage() != null) {
- // show the view
- try {
- viewPart.set(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(id));
- }
- catch (Exception e) {
- }
- }
- }
- };
- // Execute asynchronously
- if (PlatformUI.isWorkbenchRunning()) {
- PlatformUI.getWorkbench().getDisplay().syncExec(runnable);
- }
-
- // Create the runnable
- runnable = new Runnable() {
- @Override
- public void run() {
- IViewPart part = viewPart.get();
- ((CommonNavigator)part).getCommonViewer().setSelection(new StructuredSelection(element), true);
- IStructuredSelection newSel = (IStructuredSelection)((CommonNavigator)part).getCommonViewer().getSelection();
- if (newSel == null || newSel.isEmpty() || !newSel.getFirstElement().equals(element)) {
- for (ICategory category : CategoriesExtensionPointManager.getInstance().getCategories(false)) {
- if (category.belongsTo(element)) {
- if (part instanceof CommonNavigator) {
- ((CommonNavigator)part).getCommonViewer().setSelection(new StructuredSelection(category), true);
- ((CommonNavigator)part).getCommonViewer().expandToLevel(category, 1);
- }
- ((CommonNavigator)part).getCommonViewer().setSelection(new StructuredSelection(element), true);
- newSel = (IStructuredSelection)((CommonNavigator)part).getCommonViewer().getSelection();
- if (newSel != null && !newSel.isEmpty() && newSel.getFirstElement().equals(element)) {
- return;
- }
- }
- }
- }
- }
- };
-
- // Execute asynchronously
- if (PlatformUI.isWorkbenchRunning()) {
- PlatformUI.getWorkbench().getDisplay().asyncExec(runnable);
- }
- }
-}
+/*******************************************************************************
+ * 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.ui.views.handler;
+
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.tcf.te.ui.views.extensions.CategoriesExtensionPointManager;
+import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
+import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.navigator.CommonNavigator;
+import org.eclipse.ui.part.EditorPart;
+
+/**
+ * "Show In System Management" command handler implementation.
+ */
+public class ShowInSystemManagementHandler extends AbstractHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ // Get the active part
+ IWorkbenchPart part = HandlerUtil.getActivePart(event);
+ // The element to select
+ Object element = null;
+
+ // If the handler is invoked from an editor part, ignore the selection and
+ // construct an artificial selection from the active editor input.
+ if (part instanceof EditorPart) {
+ IEditorInput input = ((EditorPart)part).getEditorInput();
+ element = input != null ? input.getAdapter(Object.class) : null;
+ }
+
+ if (element != null) {
+ setAndCheckSelection(IUIConstants.ID_EXPLORER, element);
+ }
+
+ return null;
+ }
+
+ private void setAndCheckSelection(final String id, final Object element) {
+ Assert.isNotNull(id);
+
+ final AtomicReference<IViewPart> viewPart = new AtomicReference<IViewPart>();
+ // Create the runnable
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ // Check the active workbench window and active page instances
+ if (PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null && PlatformUI
+ .getWorkbench().getActiveWorkbenchWindow().getActivePage() != null) {
+ // show the view
+ try {
+ viewPart.set(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(id));
+ }
+ catch (Exception e) {
+ }
+ }
+ }
+ };
+ // Execute asynchronously
+ if (PlatformUI.isWorkbenchRunning()) {
+ PlatformUI.getWorkbench().getDisplay().syncExec(runnable);
+ }
+
+ // Create the runnable
+ runnable = new Runnable() {
+ @Override
+ public void run() {
+ IViewPart part = viewPart.get();
+ ((CommonNavigator)part).getCommonViewer().setSelection(new StructuredSelection(element), true);
+ IStructuredSelection newSel = (IStructuredSelection)((CommonNavigator)part).getCommonViewer().getSelection();
+ if (newSel == null || newSel.isEmpty() || !newSel.getFirstElement().equals(element)) {
+ for (ICategory category : CategoriesExtensionPointManager.getInstance().getCategories(false)) {
+ if (category.belongsTo(element)) {
+ if (part instanceof CommonNavigator) {
+ ((CommonNavigator)part).getCommonViewer().setSelection(new StructuredSelection(category), true);
+ ((CommonNavigator)part).getCommonViewer().expandToLevel(category, 1);
+ }
+ ((CommonNavigator)part).getCommonViewer().setSelection(new StructuredSelection(element), true);
+ newSel = (IStructuredSelection)((CommonNavigator)part).getCommonViewer().getSelection();
+ if (newSel != null && !newSel.isEmpty() && newSel.getFirstElement().equals(element)) {
+ return;
+ }
+ }
+ }
+ }
+ }
+ };
+
+ // Execute asynchronously
+ if (PlatformUI.isWorkbenchRunning()) {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(runnable);
+ }
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/ICategory.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/ICategory.java
index 8dadbcd2d..05e31427b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/ICategory.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/ICategory.java
@@ -1,56 +1,56 @@
-/*******************************************************************************
- * 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.ui.views.interfaces;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.tcf.te.runtime.interfaces.extensions.IExecutableExtension;
-import org.eclipse.tcf.te.ui.views.navigator.nodes.NewWizardNode;
-
-/**
- * Main view category node.
- */
-public interface ICategory extends IExecutableExtension {
-
- /**
- * Returns the category image.
- *
- * @return The category image or <code>null</code>.
- */
- public Image getImage();
-
- /**
- * Returns the sorting rank.
- *
- * @return The sorting rank, or a value less than -1 to fallback to alphabetical sorting.
- */
- public int getRank();
-
- /**
- * Check whether the given categorizable element belongs to this category.
- *
- * @param element The categorizable element.
- * @return <code>True</code> if the element should be shown within this category.
- */
- public boolean belongsTo(Object element);
-
- /**
- * Returns whether this category is enabled or not.
- *
- * @return <code>True</code> if the category is enabled, <code>false</code> otherwise.
- */
- public boolean isEnabled();
-
- /**
- * Returns an array of children that are always available in this category.
- * This might be a list of {@link NewWizardNode}
- * @return The children or <code>null</code>
- */
- public Object[] getChildren();
-}
+/*******************************************************************************
+ * 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.ui.views.interfaces;
+
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.tcf.te.runtime.interfaces.extensions.IExecutableExtension;
+import org.eclipse.tcf.te.ui.views.navigator.nodes.NewWizardNode;
+
+/**
+ * Main view category node.
+ */
+public interface ICategory extends IExecutableExtension {
+
+ /**
+ * Returns the category image.
+ *
+ * @return The category image or <code>null</code>.
+ */
+ public Image getImage();
+
+ /**
+ * Returns the sorting rank.
+ *
+ * @return The sorting rank, or a value less than -1 to fallback to alphabetical sorting.
+ */
+ public int getRank();
+
+ /**
+ * Check whether the given categorizable element belongs to this category.
+ *
+ * @param element The categorizable element.
+ * @return <code>True</code> if the element should be shown within this category.
+ */
+ public boolean belongsTo(Object element);
+
+ /**
+ * Returns whether this category is enabled or not.
+ *
+ * @return <code>True</code> if the category is enabled, <code>false</code> otherwise.
+ */
+ public boolean isEnabled();
+
+ /**
+ * Returns an array of children that are always available in this category.
+ * This might be a list of {@link NewWizardNode}
+ * @return The children or <code>null</code>
+ */
+ public Object[] getChildren();
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IEditorPage.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IEditorPage.java
index 0206833fb..39370a261 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IEditorPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IEditorPage.java
@@ -1,20 +1,20 @@
-/*******************************************************************************
- * 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.ui.views.interfaces;
-
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.ui.forms.editor.IFormPage;
-
-/**
- * Details editor page public interface.
- */
-public interface IEditorPage extends IFormPage, IExecutableExtension {
-
-}
+/*******************************************************************************
+ * 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.ui.views.interfaces;
+
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.ui.forms.editor.IFormPage;
+
+/**
+ * Details editor page public interface.
+ */
+public interface IEditorPage extends IFormPage, IExecutableExtension {
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IEditorSaveAsAdapter.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IEditorSaveAsAdapter.java
index 8b7a1a25c..09eee796e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IEditorSaveAsAdapter.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IEditorSaveAsAdapter.java
@@ -1,34 +1,34 @@
-/*******************************************************************************
- * 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.ui.views.interfaces;
-
-import org.eclipse.ui.IEditorInput;
-
-/**
- * IEditorSaveAsAdapter
- */
-public interface IEditorSaveAsAdapter {
-
- /**
- * Used by the editor to check whether saveAs is allowed or not.
- * @param input The editor input to check.
- * @return <code>true</code> if saveAs is supported.
- */
- public boolean isSaveAsAllowed(IEditorInput input);
-
- /**
- * Used by the editor to save the input under a new name.
- * @param input The editpr input to duplicate.
- * @return The new Object.
- */
- public Object doSaveAs(IEditorInput input);
-
-}
+/*******************************************************************************
+ * 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.ui.views.interfaces;
+
+import org.eclipse.ui.IEditorInput;
+
+/**
+ * IEditorSaveAsAdapter
+ */
+public interface IEditorSaveAsAdapter {
+
+ /**
+ * Used by the editor to check whether saveAs is allowed or not.
+ * @param input The editor input to check.
+ * @return <code>true</code> if saveAs is supported.
+ */
+ public boolean isSaveAsAllowed(IEditorInput input);
+
+ /**
+ * Used by the editor to save the input under a new name.
+ * @param input The editpr input to duplicate.
+ * @return The new Object.
+ */
+ public Object doSaveAs(IEditorInput input);
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IRoot.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IRoot.java
index f439fbeb1..6550d31ec 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IRoot.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IRoot.java
@@ -1,19 +1,19 @@
-/*******************************************************************************
- * 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.ui.views.interfaces;
-
-import org.eclipse.core.runtime.IAdaptable;
-
-/**
- * Main view root node.
- */
-public interface IRoot extends IAdaptable {
-
-}
+/*******************************************************************************
+ * 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.ui.views.interfaces;
+
+import org.eclipse.core.runtime.IAdaptable;
+
+/**
+ * Main view root node.
+ */
+public interface IRoot extends IAdaptable {
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IUIConstants.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IUIConstants.java
index f78a79a12..de4bb2628 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IUIConstants.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/IUIConstants.java
@@ -1,60 +1,60 @@
-/*******************************************************************************
- * 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.ui.views.interfaces;
-
-/**
- * UI constants.
- */
-public interface IUIConstants {
-
- /**
- * The main view id.
- */
- public static final String ID_EXPLORER = "org.eclipse.tcf.te.ui.views.View"; //$NON-NLS-1$
-
- /**
- * The properties editor id.
- */
- public static final String ID_EDITOR = "org.eclipse.tcf.te.ui.views.Editor"; //$NON-NLS-1$
-
- /**
- * The tabbed properties contributor id.
- */
- public static final String TABBED_PROPERTIES_CONTRIBUTOR_ID = "org.eclipse.tcf.te.ui"; //$NON-NLS-1$
-
- // ***** Define the constants for the main view root mode *****
-
- /**
- * Root nodes are working sets.
- */
- public static final int MODE_WORKING_SETS = 0;
-
- /**
- * Root nodes are whatever is contributed to the view.
- */
- public static final int MODE_NORMAL = 1;
-
- // ***** Define the constants for the default view categories *****
-
- /**
- * Category: Favorites
- */
- public static final String ID_CAT_FAVORITES = "org.eclipse.tcf.te.ui.views.category.favorites"; //$NON-NLS-1$
-
- /**
- * Category: "My Targets"
- */
- public static final String ID_CAT_MY_TARGETS = "org.eclipse.tcf.te.ui.views.category.mytargets"; //$NON-NLS-1$
-
- /**
- * Category: Neighborhood
- */
- public static final String ID_CAT_NEIGHBORHOOD = "org.eclipse.tcf.te.ui.views.category.neighborhood"; //$NON-NLS-1$
-}
+/*******************************************************************************
+ * 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.ui.views.interfaces;
+
+/**
+ * UI constants.
+ */
+public interface IUIConstants {
+
+ /**
+ * The main view id.
+ */
+ public static final String ID_EXPLORER = "org.eclipse.tcf.te.ui.views.View"; //$NON-NLS-1$
+
+ /**
+ * The properties editor id.
+ */
+ public static final String ID_EDITOR = "org.eclipse.tcf.te.ui.views.Editor"; //$NON-NLS-1$
+
+ /**
+ * The tabbed properties contributor id.
+ */
+ public static final String TABBED_PROPERTIES_CONTRIBUTOR_ID = "org.eclipse.tcf.te.ui"; //$NON-NLS-1$
+
+ // ***** Define the constants for the main view root mode *****
+
+ /**
+ * Root nodes are working sets.
+ */
+ public static final int MODE_WORKING_SETS = 0;
+
+ /**
+ * Root nodes are whatever is contributed to the view.
+ */
+ public static final int MODE_NORMAL = 1;
+
+ // ***** Define the constants for the default view categories *****
+
+ /**
+ * Category: Favorites
+ */
+ public static final String ID_CAT_FAVORITES = "org.eclipse.tcf.te.ui.views.category.favorites"; //$NON-NLS-1$
+
+ /**
+ * Category: "My Targets"
+ */
+ public static final String ID_CAT_MY_TARGETS = "org.eclipse.tcf.te.ui.views.category.mytargets"; //$NON-NLS-1$
+
+ /**
+ * Category: Neighborhood
+ */
+ public static final String ID_CAT_NEIGHBORHOOD = "org.eclipse.tcf.te.ui.views.category.neighborhood"; //$NON-NLS-1$
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/ImageConsts.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/ImageConsts.java
index 39fdbe639..c54db9908 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/ImageConsts.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/ImageConsts.java
@@ -1,70 +1,70 @@
-/*******************************************************************************
- * 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.ui.views.interfaces;
-
-/**
- * Image registry constants.
- */
-public interface ImageConsts {
-
- // ***** The directory structure constants *****
-
- /**
- * The root directory where to load the images from, relative to
- * the bundle directory.
- */
- public final static String IMAGE_DIR_ROOT = "icons/"; //$NON-NLS-1$
-
- /**
- * The directory where to load view related images from, relative to
- * the image root directory.
- */
- public final static String IMAGE_DIR_EVIEW = "eview16/"; //$NON-NLS-1$
-
- /**
- * The directory where to load disabled toolbar images from,
- * relative to the image root directory.
- */
- public final static String IMAGE_DIR_DTOOL = "dtool16/"; //$NON-NLS-1$
-
- /**
- * The directory where to load enabled toolbar images from,
- * relative to the image root directory.
- */
- public final static String IMAGE_DIR_ETOOL = "etool16/"; //$NON-NLS-1$
-
- /**
- * The directory where to load model object images from,
- * relative to the image root directory.
- */
- public final static String IMAGE_DIR_OBJ = "obj16/"; //$NON-NLS-1$
-
- // ***** The image constants *****
-
- /**
- * The key to access the editor image.
- */
- public static final String EDITOR = "Editor"; //$NON-NLS-1$
-
- /**
- * The key to access the view image.
- */
- public static final String VIEW = "View"; //$NON-NLS-1$
-
- /**
- * The key to access the help action image.
- */
- public static final String HELP = "HelpAction"; //$NON-NLS-1$
-
- /**
- * The key to access the favorites category image.
- */
- public static final String FAVORITES = "Favorites"; //$NON-NLS-1$
-}
+/*******************************************************************************
+ * 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.ui.views.interfaces;
+
+/**
+ * Image registry constants.
+ */
+public interface ImageConsts {
+
+ // ***** The directory structure constants *****
+
+ /**
+ * The root directory where to load the images from, relative to
+ * the bundle directory.
+ */
+ public final static String IMAGE_DIR_ROOT = "icons/"; //$NON-NLS-1$
+
+ /**
+ * The directory where to load view related images from, relative to
+ * the image root directory.
+ */
+ public final static String IMAGE_DIR_EVIEW = "eview16/"; //$NON-NLS-1$
+
+ /**
+ * The directory where to load disabled toolbar images from,
+ * relative to the image root directory.
+ */
+ public final static String IMAGE_DIR_DTOOL = "dtool16/"; //$NON-NLS-1$
+
+ /**
+ * The directory where to load enabled toolbar images from,
+ * relative to the image root directory.
+ */
+ public final static String IMAGE_DIR_ETOOL = "etool16/"; //$NON-NLS-1$
+
+ /**
+ * The directory where to load model object images from,
+ * relative to the image root directory.
+ */
+ public final static String IMAGE_DIR_OBJ = "obj16/"; //$NON-NLS-1$
+
+ // ***** The image constants *****
+
+ /**
+ * The key to access the editor image.
+ */
+ public static final String EDITOR = "Editor"; //$NON-NLS-1$
+
+ /**
+ * The key to access the view image.
+ */
+ public static final String VIEW = "View"; //$NON-NLS-1$
+
+ /**
+ * The key to access the help action image.
+ */
+ public static final String HELP = "HelpAction"; //$NON-NLS-1$
+
+ /**
+ * The key to access the favorites category image.
+ */
+ public static final String FAVORITES = "Favorites"; //$NON-NLS-1$
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/categories/ICategoryManager.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/categories/ICategoryManager.java
index 614034a21..880885391 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/categories/ICategoryManager.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/interfaces/categories/ICategoryManager.java
@@ -1,91 +1,91 @@
-/*******************************************************************************
- * 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.ui.views.interfaces.categories;
-
-/**
- * Interface to be implemented by category managers.
- */
-public interface ICategoryManager {
-
- /**
- * Flush the current category manager state.
- */
- public void flush();
-
- /**
- * Adds the given id to the given category.
- *
- * @param categoryId The category id. Must not be <code>null</code>.
- * @param id The id. Must not be <code>null</code>.
- *
- * @return <code>True</code> if the id has been added to the category, <code>false</code> if not.
- */
- public boolean add(String categoryId, String id);
-
- /**
- * Adds the given id to the given category.
- * <p>
- * <b>Note:</b> The category association is no persisted, the association is
- * transient and is lost when the category manager is disposed.
- *
- * @param categoryId The category id. Must not be <code>null</code>.
- * @param id The id. Must not be <code>null</code>.
- *
- * @return <code>True</code> if the id has been added to the category, <code>false</code> if not.
- */
- public boolean addTransient(String categoryId, String id);
-
- /**
- * Removes the given id from the given category.
- *
- * @param categoryId The category id. Must not be <code>null</code>.
- * @param id The id. Must not be <code>null</code>.
- *
- * @return <code>True</code> if the id has been removed from the category, <code>false</code> if not.
- */
- public boolean remove(String categoryId, String id);
-
- /**
- * Returns if or if not the given id belongs to the given category.
- *
- * @param categoryId The category id. Must not be <code>null</code>.
- * @param id The id. Must not be <code>null</code>.
- *
- * @return <code>True</code> if the id belongs to the category, <code>false</code> if not.
- */
- public boolean belongsTo(String categoryId, String id);
-
- /**
- * Returns if or if not the given id is linked to the given category.
- *
- * @param categoryId The category id. Must not be <code>null</code>.
- * @param id The id. Must not be <code>null</code>.
- *
- * @return <code>True</code> if the id is linekd to the category, <code>false</code> if not.
- */
- public boolean isLinked(String categoryId, String id);
-
- /**
- * Returns the list of categories the given id belongs to.
- *
- * @param id The id. Must not be <code>null</code>.
- * @return The list of category id's the id belongs to, or an empty list.
- */
- public String[] getCategoryIds(String id);
-
- /**
- * Returns the list of ids for the given category.
- *
- * @param categoryId The category id. Must not be <code>null</code>.
- * @return The list of id's that belongs to the given categoryId, or an empty list.
- */
- public String[] getIdsForCategory(String categoryId);
-
+/*******************************************************************************
+ * 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.ui.views.interfaces.categories;
+
+/**
+ * Interface to be implemented by category managers.
+ */
+public interface ICategoryManager {
+
+ /**
+ * Flush the current category manager state.
+ */
+ public void flush();
+
+ /**
+ * Adds the given id to the given category.
+ *
+ * @param categoryId The category id. Must not be <code>null</code>.
+ * @param id The id. Must not be <code>null</code>.
+ *
+ * @return <code>True</code> if the id has been added to the category, <code>false</code> if not.
+ */
+ public boolean add(String categoryId, String id);
+
+ /**
+ * Adds the given id to the given category.
+ * <p>
+ * <b>Note:</b> The category association is no persisted, the association is
+ * transient and is lost when the category manager is disposed.
+ *
+ * @param categoryId The category id. Must not be <code>null</code>.
+ * @param id The id. Must not be <code>null</code>.
+ *
+ * @return <code>True</code> if the id has been added to the category, <code>false</code> if not.
+ */
+ public boolean addTransient(String categoryId, String id);
+
+ /**
+ * Removes the given id from the given category.
+ *
+ * @param categoryId The category id. Must not be <code>null</code>.
+ * @param id The id. Must not be <code>null</code>.
+ *
+ * @return <code>True</code> if the id has been removed from the category, <code>false</code> if not.
+ */
+ public boolean remove(String categoryId, String id);
+
+ /**
+ * Returns if or if not the given id belongs to the given category.
+ *
+ * @param categoryId The category id. Must not be <code>null</code>.
+ * @param id The id. Must not be <code>null</code>.
+ *
+ * @return <code>True</code> if the id belongs to the category, <code>false</code> if not.
+ */
+ public boolean belongsTo(String categoryId, String id);
+
+ /**
+ * Returns if or if not the given id is linked to the given category.
+ *
+ * @param categoryId The category id. Must not be <code>null</code>.
+ * @param id The id. Must not be <code>null</code>.
+ *
+ * @return <code>True</code> if the id is linekd to the category, <code>false</code> if not.
+ */
+ public boolean isLinked(String categoryId, String id);
+
+ /**
+ * Returns the list of categories the given id belongs to.
+ *
+ * @param id The id. Must not be <code>null</code>.
+ * @return The list of category id's the id belongs to, or an empty list.
+ */
+ public String[] getCategoryIds(String id);
+
+ /**
+ * Returns the list of ids for the given category.
+ *
+ * @param categoryId The category id. Must not be <code>null</code>.
+ * @return The list of id's that belongs to the given categoryId, or an empty list.
+ */
+ public String[] getIdsForCategory(String categoryId);
+
} \ No newline at end of file
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/View.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/View.java
index 1e48fedf0..8a8b39178 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/View.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/View.java
@@ -1,255 +1,255 @@
-/*******************************************************************************
- * 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.ui.views.internal;
-
-import org.eclipse.core.commands.Command;
-import org.eclipse.core.commands.ParameterizedCommand;
-import org.eclipse.core.expressions.EvaluationContext;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ColumnViewerEditor;
-import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrategy;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.TreeViewerEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.tcf.te.ui.trees.TreeViewerEditorActivationStrategy;
-import org.eclipse.tcf.te.ui.views.activator.UIPlugin;
-import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.handlers.IHandlerService;
-import org.eclipse.ui.navigator.CommonNavigator;
-import org.eclipse.ui.navigator.CommonViewer;
-import org.eclipse.ui.navigator.ICommonActionConstants;
-import org.eclipse.ui.navigator.IMementoAware;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
-
-
-/**
- * View implementation.
- * <p>
- * The view is based on the Eclipse Common Navigator framework.
- */
-public class View extends CommonNavigator implements ITabbedPropertySheetPageContributor {
- // The view root mode
- private int rootMode = IUIConstants.MODE_NORMAL;
-
- /**
- * Used only in the case of top level = MODE_NORMAL and only when some
- * working sets are selected.
- */
- private String workingSetLabel;
-
- // The state used to persisted the expanded nodes of the navigator tree.
- IMementoAware expandingState;
-
- /**
- * Constructor.
- */
- public View() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.CommonNavigator#getInitialInput()
- */
- @Override
- protected Object getInitialInput() {
- return ViewRoot.getInstance();
- }
-
- /**
- * Sets the view's root mode.
- *
- * @param mode The root mode.
- * @see IUIConstants
- */
- @Override
- public void setRootMode(int mode) {
- rootMode = mode;
- }
-
- /**
- * Returns the view's root mode.
- *
- * @return The root mode
- * @see IUIConstants
- */
- @Override
- public int getRootMode() {
- return rootMode;
- }
-
- /**
- * Sets the working set label.
- *
- * @param label The working set label or <code>null</code>.
- */
- @Override
- public void setWorkingSetLabel(String label) {
- workingSetLabel = label;
- }
-
- /**
- * Returns the working set label.
- *
- * @return The working set label or <code>null</code>.
- */
- @Override
- public String getWorkingSetLabel() {
- return workingSetLabel;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.CommonNavigator#dispose()
- */
- @Override
- public void dispose() {
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.CommonNavigator#createCommonViewerObject(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected CommonViewer createCommonViewerObject(Composite parent) {
- ViewViewer viewer = new ViewViewer(getViewSite().getId(), parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
- viewer.setComparer(new ViewViewerComparer());
- // Define an editor activation strategy for the common viewer so as to be invoked only programmatically.
- ColumnViewerEditorActivationStrategy activationStrategy = new TreeViewerEditorActivationStrategy(getSite().getId(), viewer);
- TreeViewerEditor.create(viewer, null, activationStrategy, ColumnViewerEditor.DEFAULT);
- return viewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.CommonNavigator#createPartControl(org.eclipse.swt.widgets.Composite)
- */
- @Override
- public void createPartControl(Composite parent) {
- super.createPartControl(parent);
-
- // Add the additional custom toolbar groups
- addCustomToolbarGroups();
-
- // Restore expanding state of the common viewer.
- expandingState = new ViewExpandingState(getCommonViewer());
- if (getMemento() != null) {
- expandingState.restoreState(getMemento());
- }
- }
-
- /**
- * Adds the custom toolbar groups to the view toolbar.
- */
- protected void addCustomToolbarGroups() {
- if (getViewSite() != null && getViewSite().getActionBars() != null) {
- IToolBarManager tbManager = getViewSite().getActionBars().getToolBarManager();
- if (tbManager != null) {
- tbManager.insertBefore("FRAME_ACTION_GROUP_ID", new GroupMarker("group.new")); //$NON-NLS-1$ //$NON-NLS-2$
- tbManager.appendToGroup("group.new", new Separator("group.configure")); //$NON-NLS-1$ //$NON-NLS-2$
- tbManager.appendToGroup("group.configure", new Separator("group.connect")); //$NON-NLS-1$ //$NON-NLS-2$
- tbManager.appendToGroup("group.connect", new Separator("group.symbols.rd")); //$NON-NLS-1$ //$NON-NLS-2$
- tbManager.appendToGroup("group.symbols.rd", new GroupMarker("group.symbols")); //$NON-NLS-1$ //$NON-NLS-2$
- tbManager.appendToGroup("group.symbols", new Separator("group.launch")); //$NON-NLS-1$ //$NON-NLS-2$
- tbManager.appendToGroup("group.launch", new GroupMarker("group.launch.rundebug")); //$NON-NLS-1$ //$NON-NLS-2$
- tbManager.appendToGroup("group.launch.rundebug", new GroupMarker("group.launch.modes")); //$NON-NLS-1$ //$NON-NLS-2$
- tbManager.appendToGroup("group.launch.modes", new GroupMarker("group.launch.additions")); //$NON-NLS-1$ //$NON-NLS-2$
- tbManager.appendToGroup("group.launch.additions", new Separator("group.refresh")); //$NON-NLS-1$ //$NON-NLS-2$
- tbManager.appendToGroup("group.refresh", new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); //$NON-NLS-1$
- }
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.navigator.CommonNavigator#saveState(org.eclipse.ui.IMemento)
- */
- @Override
- public void saveState(IMemento aMemento) {
- super.saveState(aMemento);
-
- // Save expanding state of the common viewer.
- if (expandingState != null && aMemento != null) {
- expandingState.saveState(aMemento);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.CommonNavigator#handleDoubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
- */
- @Override
- protected void handleDoubleClick(DoubleClickEvent dblClickEvent) {
- // If an handled and enabled command is registered for the ICommonActionConstants.OPEN
- // retargetable action id, redirect the double click handling to the command handler.
- //
- // Note: The default tree node expansion must be re-implemented in the active handler!
- ICommandService service = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
- Command command = service != null ? service.getCommand(ICommonActionConstants.OPEN) : null;
- if (command != null && command.isDefined() && command.isEnabled()) {
- try {
- IHandlerService handlerSvc = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
- Assert.isNotNull(handlerSvc);
-
- ISelection selection = dblClickEvent.getSelection();
- EvaluationContext ctx = new EvaluationContext(handlerSvc.getCurrentState(), selection);
- ctx.addVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME, selection);
- ctx.addVariable(ISources.ACTIVE_MENU_SELECTION_NAME, selection);
- ctx.addVariable("altPressed", Boolean.valueOf(dblClickEvent instanceof AltDoubleClickEvent)); //$NON-NLS-1$
- ctx.setAllowPluginActivation(true);
-
- ParameterizedCommand pCmd = ParameterizedCommand.generateCommand(command, null);
- Assert.isNotNull(pCmd);
-
- handlerSvc.executeCommandInContext(pCmd, null, ctx);
- } catch (Exception e) {
- // If the platform is in debug mode, we print the exception to the log view
- if (Platform.inDebugMode()) {
- IStatus status = new Status(IStatus.ERROR, UIPlugin.getUniqueIdentifier(), e.getLocalizedMessage(), e);
- UIPlugin.getDefault().getLog().log(status);
- }
- }
- } else {
- // Fallback to the default implementation
- super.handleDoubleClick(dblClickEvent);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.CommonNavigator#getAdapter(java.lang.Class)
- */
- @Override
- public Object getAdapter(Class adapter) {
- if(adapter == IPropertySheetPage.class) {
- return new TabbedPropertySheetPage(this);
- }
- return super.getAdapter(adapter);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor#getContributorId()
- */
- @Override
- public String getContributorId() {
- return IUIConstants.TABBED_PROPERTIES_CONTRIBUTOR_ID;
- }
-}
+/*******************************************************************************
+ * 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.ui.views.internal;
+
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.core.expressions.EvaluationContext;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.ColumnViewerEditor;
+import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrategy;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.TreeViewerEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tcf.te.ui.trees.TreeViewerEditorActivationStrategy;
+import org.eclipse.tcf.te.ui.views.activator.UIPlugin;
+import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.ISources;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.ui.navigator.CommonNavigator;
+import org.eclipse.ui.navigator.CommonViewer;
+import org.eclipse.ui.navigator.ICommonActionConstants;
+import org.eclipse.ui.navigator.IMementoAware;
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
+
+
+/**
+ * View implementation.
+ * <p>
+ * The view is based on the Eclipse Common Navigator framework.
+ */
+public class View extends CommonNavigator implements ITabbedPropertySheetPageContributor {
+ // The view root mode
+ private int rootMode = IUIConstants.MODE_NORMAL;
+
+ /**
+ * Used only in the case of top level = MODE_NORMAL and only when some
+ * working sets are selected.
+ */
+ private String workingSetLabel;
+
+ // The state used to persisted the expanded nodes of the navigator tree.
+ IMementoAware expandingState;
+
+ /**
+ * Constructor.
+ */
+ public View() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.navigator.CommonNavigator#getInitialInput()
+ */
+ @Override
+ protected Object getInitialInput() {
+ return ViewRoot.getInstance();
+ }
+
+ /**
+ * Sets the view's root mode.
+ *
+ * @param mode The root mode.
+ * @see IUIConstants
+ */
+ @Override
+ public void setRootMode(int mode) {
+ rootMode = mode;
+ }
+
+ /**
+ * Returns the view's root mode.
+ *
+ * @return The root mode
+ * @see IUIConstants
+ */
+ @Override
+ public int getRootMode() {
+ return rootMode;
+ }
+
+ /**
+ * Sets the working set label.
+ *
+ * @param label The working set label or <code>null</code>.
+ */
+ @Override
+ public void setWorkingSetLabel(String label) {
+ workingSetLabel = label;
+ }
+
+ /**
+ * Returns the working set label.
+ *
+ * @return The working set label or <code>null</code>.
+ */
+ @Override
+ public String getWorkingSetLabel() {
+ return workingSetLabel;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.navigator.CommonNavigator#dispose()
+ */
+ @Override
+ public void dispose() {
+ super.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.navigator.CommonNavigator#createCommonViewerObject(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected CommonViewer createCommonViewerObject(Composite parent) {
+ ViewViewer viewer = new ViewViewer(getViewSite().getId(), parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+ viewer.setComparer(new ViewViewerComparer());
+ // Define an editor activation strategy for the common viewer so as to be invoked only programmatically.
+ ColumnViewerEditorActivationStrategy activationStrategy = new TreeViewerEditorActivationStrategy(getSite().getId(), viewer);
+ TreeViewerEditor.create(viewer, null, activationStrategy, ColumnViewerEditor.DEFAULT);
+ return viewer;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.navigator.CommonNavigator#createPartControl(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void createPartControl(Composite parent) {
+ super.createPartControl(parent);
+
+ // Add the additional custom toolbar groups
+ addCustomToolbarGroups();
+
+ // Restore expanding state of the common viewer.
+ expandingState = new ViewExpandingState(getCommonViewer());
+ if (getMemento() != null) {
+ expandingState.restoreState(getMemento());
+ }
+ }
+
+ /**
+ * Adds the custom toolbar groups to the view toolbar.
+ */
+ protected void addCustomToolbarGroups() {
+ if (getViewSite() != null && getViewSite().getActionBars() != null) {
+ IToolBarManager tbManager = getViewSite().getActionBars().getToolBarManager();
+ if (tbManager != null) {
+ tbManager.insertBefore("FRAME_ACTION_GROUP_ID", new GroupMarker("group.new")); //$NON-NLS-1$ //$NON-NLS-2$
+ tbManager.appendToGroup("group.new", new Separator("group.configure")); //$NON-NLS-1$ //$NON-NLS-2$
+ tbManager.appendToGroup("group.configure", new Separator("group.connect")); //$NON-NLS-1$ //$NON-NLS-2$
+ tbManager.appendToGroup("group.connect", new Separator("group.symbols.rd")); //$NON-NLS-1$ //$NON-NLS-2$
+ tbManager.appendToGroup("group.symbols.rd", new GroupMarker("group.symbols")); //$NON-NLS-1$ //$NON-NLS-2$
+ tbManager.appendToGroup("group.symbols", new Separator("group.launch")); //$NON-NLS-1$ //$NON-NLS-2$
+ tbManager.appendToGroup("group.launch", new GroupMarker("group.launch.rundebug")); //$NON-NLS-1$ //$NON-NLS-2$
+ tbManager.appendToGroup("group.launch.rundebug", new GroupMarker("group.launch.modes")); //$NON-NLS-1$ //$NON-NLS-2$
+ tbManager.appendToGroup("group.launch.modes", new GroupMarker("group.launch.additions")); //$NON-NLS-1$ //$NON-NLS-2$
+ tbManager.appendToGroup("group.launch.additions", new Separator("group.refresh")); //$NON-NLS-1$ //$NON-NLS-2$
+ tbManager.appendToGroup("group.refresh", new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); //$NON-NLS-1$
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.navigator.CommonNavigator#saveState(org.eclipse.ui.IMemento)
+ */
+ @Override
+ public void saveState(IMemento aMemento) {
+ super.saveState(aMemento);
+
+ // Save expanding state of the common viewer.
+ if (expandingState != null && aMemento != null) {
+ expandingState.saveState(aMemento);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.navigator.CommonNavigator#handleDoubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
+ */
+ @Override
+ protected void handleDoubleClick(DoubleClickEvent dblClickEvent) {
+ // If an handled and enabled command is registered for the ICommonActionConstants.OPEN
+ // retargetable action id, redirect the double click handling to the command handler.
+ //
+ // Note: The default tree node expansion must be re-implemented in the active handler!
+ ICommandService service = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
+ Command command = service != null ? service.getCommand(ICommonActionConstants.OPEN) : null;
+ if (command != null && command.isDefined() && command.isEnabled()) {
+ try {
+ IHandlerService handlerSvc = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
+ Assert.isNotNull(handlerSvc);
+
+ ISelection selection = dblClickEvent.getSelection();
+ EvaluationContext ctx = new EvaluationContext(handlerSvc.getCurrentState(), selection);
+ ctx.addVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME, selection);
+ ctx.addVariable(ISources.ACTIVE_MENU_SELECTION_NAME, selection);
+ ctx.addVariable("altPressed", Boolean.valueOf(dblClickEvent instanceof AltDoubleClickEvent)); //$NON-NLS-1$
+ ctx.setAllowPluginActivation(true);
+
+ ParameterizedCommand pCmd = ParameterizedCommand.generateCommand(command, null);
+ Assert.isNotNull(pCmd);
+
+ handlerSvc.executeCommandInContext(pCmd, null, ctx);
+ } catch (Exception e) {
+ // If the platform is in debug mode, we print the exception to the log view
+ if (Platform.inDebugMode()) {
+ IStatus status = new Status(IStatus.ERROR, UIPlugin.getUniqueIdentifier(), e.getLocalizedMessage(), e);
+ UIPlugin.getDefault().getLog().log(status);
+ }
+ }
+ } else {
+ // Fallback to the default implementation
+ super.handleDoubleClick(dblClickEvent);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.navigator.CommonNavigator#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(Class adapter) {
+ if(adapter == IPropertySheetPage.class) {
+ return new TabbedPropertySheetPage(this);
+ }
+ return super.getAdapter(adapter);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor#getContributorId()
+ */
+ @Override
+ public String getContributorId() {
+ return IUIConstants.TABBED_PROPERTIES_CONTRIBUTOR_ID;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/ViewViewer.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/ViewViewer.java
index 03d15899c..afab05672 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/ViewViewer.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/ViewViewer.java
@@ -1,153 +1,153 @@
-/*******************************************************************************
- * 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.ui.views.internal;
-
-import java.util.EventObject;
-
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.tcf.te.runtime.events.EventManager;
-import org.eclipse.tcf.te.ui.views.events.ViewerContentChangeEvent;
-import org.eclipse.ui.navigator.CommonViewer;
-import org.eclipse.ui.navigator.INavigatorContentService;
-
-/**
- * View common viewer implementation.
- */
-public class ViewViewer extends CommonViewer {
- // Flag to mark the viewer silent. In silent mode, no
- // ViewerContentChangeEvents are send.
- private boolean silent = false;
-
- // Remember the last double click selection event state mask
- private int lastDoubleClickSelectionEventStateMask = 0;
-
- /**
- * Constructor.
- *
- * @param view
- * The common navigator based parent view. Must not be <code>null</code>.
- * @param viewerId
- * An id tied to the extensions that is used to focus specific
- * content to a particular instance of the Common Navigator
- * @param parent
- * A Composite parent to contain the actual SWT widget
- * @param style
- * A style mask that will be used to create the TreeViewer
- * Composite.
- */
- public ViewViewer(String viewerId, Composite parent, int style) {
- super(viewerId, parent, style);
- }
-
- /**
- * Fire the given event if the viewer is not in silent mode.
- *
- * @param event The event or <code>null</code>.
- */
- private void fireEvent(EventObject event) {
- if (!silent && event != null) {
- EventManager.getInstance().fireEvent(event);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.navigator.CommonViewer#init()
- */
- @Override
- protected void init() {
- setUseHashlookup(true);
- INavigatorContentService contentService = getNavigatorContentService();
- setContentProvider(contentService.createCommonContentProvider());
- setLabelProvider(new ViewViewerDecoratingLabelProvider(this, contentService.createCommonLabelProvider()));
- initDragAndDrop();
- }
-
- /**
- * Sets the viewers event firing silent mode.
- *
- * @param silent <code>True</code> to stop firing change events, <code>false</code> otherwise.
- * @return <code>True</code> if the silent mode changed.
- */
- public boolean setSilentMode(boolean silent) {
- boolean changed = this.silent != silent;
- this.silent = silent;
- return changed;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.CommonViewer#add(java.lang.Object, java.lang.Object[])
- */
- @Override
- public void add(Object parentElement, Object[] childElements) {
- super.add(parentElement, childElements);
-
- ViewerContentChangeEvent event = new ViewerContentChangeEvent(this, ViewerContentChangeEvent.ADD);
- fireEvent(event);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.CommonViewer#remove(java.lang.Object[])
- */
- @Override
- public void remove(Object[] elements) {
- super.remove(elements);
-
- ViewerContentChangeEvent event = new ViewerContentChangeEvent(this, ViewerContentChangeEvent.REMOVE);
- fireEvent(event);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.AbstractTreeViewer#remove(java.lang.Object, java.lang.Object[])
- */
- @Override
- public void remove(Object parent, Object[] elements) {
- super.remove(parent, elements);
-
- ViewerContentChangeEvent event = new ViewerContentChangeEvent(this, ViewerContentChangeEvent.REMOVE);
- fireEvent(event);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.CommonViewer#refresh(java.lang.Object, boolean)
- */
- @Override
- public void refresh(Object element, boolean updateLabels) {
- super.refresh(element, updateLabels);
-
- ViewerContentChangeEvent event = new ViewerContentChangeEvent(this, ViewerContentChangeEvent.REFRESH);
- fireEvent(event);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.CommonViewer#handleDoubleSelect(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- protected void handleDoubleSelect(SelectionEvent event) {
- lastDoubleClickSelectionEventStateMask = event != null ? event.stateMask : 0;
- super.handleDoubleSelect(event);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.StructuredViewer#fireDoubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
- */
- @Override
- protected void fireDoubleClick(DoubleClickEvent event) {
- boolean altPressed = (lastDoubleClickSelectionEventStateMask & SWT.ALT) != 0;
- if (altPressed) {
- event = new AltDoubleClickEvent((Viewer)event.getSource(), event.getSelection());
- }
- super.fireDoubleClick(event);
- }
-}
+/*******************************************************************************
+ * 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.ui.views.internal;
+
+import java.util.EventObject;
+
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tcf.te.runtime.events.EventManager;
+import org.eclipse.tcf.te.ui.views.events.ViewerContentChangeEvent;
+import org.eclipse.ui.navigator.CommonViewer;
+import org.eclipse.ui.navigator.INavigatorContentService;
+
+/**
+ * View common viewer implementation.
+ */
+public class ViewViewer extends CommonViewer {
+ // Flag to mark the viewer silent. In silent mode, no
+ // ViewerContentChangeEvents are send.
+ private boolean silent = false;
+
+ // Remember the last double click selection event state mask
+ private int lastDoubleClickSelectionEventStateMask = 0;
+
+ /**
+ * Constructor.
+ *
+ * @param view
+ * The common navigator based parent view. Must not be <code>null</code>.
+ * @param viewerId
+ * An id tied to the extensions that is used to focus specific
+ * content to a particular instance of the Common Navigator
+ * @param parent
+ * A Composite parent to contain the actual SWT widget
+ * @param style
+ * A style mask that will be used to create the TreeViewer
+ * Composite.
+ */
+ public ViewViewer(String viewerId, Composite parent, int style) {
+ super(viewerId, parent, style);
+ }
+
+ /**
+ * Fire the given event if the viewer is not in silent mode.
+ *
+ * @param event The event or <code>null</code>.
+ */
+ private void fireEvent(EventObject event) {
+ if (!silent && event != null) {
+ EventManager.getInstance().fireEvent(event);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.navigator.CommonViewer#init()
+ */
+ @Override
+ protected void init() {
+ setUseHashlookup(true);
+ INavigatorContentService contentService = getNavigatorContentService();
+ setContentProvider(contentService.createCommonContentProvider());
+ setLabelProvider(new ViewViewerDecoratingLabelProvider(this, contentService.createCommonLabelProvider()));
+ initDragAndDrop();
+ }
+
+ /**
+ * Sets the viewers event firing silent mode.
+ *
+ * @param silent <code>True</code> to stop firing change events, <code>false</code> otherwise.
+ * @return <code>True</code> if the silent mode changed.
+ */
+ public boolean setSilentMode(boolean silent) {
+ boolean changed = this.silent != silent;
+ this.silent = silent;
+ return changed;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.navigator.CommonViewer#add(java.lang.Object, java.lang.Object[])
+ */
+ @Override
+ public void add(Object parentElement, Object[] childElements) {
+ super.add(parentElement, childElements);
+
+ ViewerContentChangeEvent event = new ViewerContentChangeEvent(this, ViewerContentChangeEvent.ADD);
+ fireEvent(event);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.navigator.CommonViewer#remove(java.lang.Object[])
+ */
+ @Override
+ public void remove(Object[] elements) {
+ super.remove(elements);
+
+ ViewerContentChangeEvent event = new ViewerContentChangeEvent(this, ViewerContentChangeEvent.REMOVE);
+ fireEvent(event);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#remove(java.lang.Object, java.lang.Object[])
+ */
+ @Override
+ public void remove(Object parent, Object[] elements) {
+ super.remove(parent, elements);
+
+ ViewerContentChangeEvent event = new ViewerContentChangeEvent(this, ViewerContentChangeEvent.REMOVE);
+ fireEvent(event);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.navigator.CommonViewer#refresh(java.lang.Object, boolean)
+ */
+ @Override
+ public void refresh(Object element, boolean updateLabels) {
+ super.refresh(element, updateLabels);
+
+ ViewerContentChangeEvent event = new ViewerContentChangeEvent(this, ViewerContentChangeEvent.REFRESH);
+ fireEvent(event);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.navigator.CommonViewer#handleDoubleSelect(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ protected void handleDoubleSelect(SelectionEvent event) {
+ lastDoubleClickSelectionEventStateMask = event != null ? event.stateMask : 0;
+ super.handleDoubleSelect(event);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.StructuredViewer#fireDoubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
+ */
+ @Override
+ protected void fireDoubleClick(DoubleClickEvent event) {
+ boolean altPressed = (lastDoubleClickSelectionEventStateMask & SWT.ALT) != 0;
+ if (altPressed) {
+ event = new AltDoubleClickEvent((Viewer)event.getSource(), event.getSelection());
+ }
+ super.fireDoubleClick(event);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/adapters/EditorAdapterFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/adapters/EditorAdapterFactory.java
index aea74c19e..49163cbc5 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/adapters/EditorAdapterFactory.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/adapters/EditorAdapterFactory.java
@@ -1,57 +1,57 @@
-/*******************************************************************************
- * 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.ui.views.internal.adapters;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
-import org.eclipse.tcf.te.ui.views.editor.Editor;
-import org.eclipse.tcf.te.ui.views.editor.EditorInput;
-import org.eclipse.ui.forms.editor.IFormPage;
-
-/**
- * The adapter factory that adapts the editor to its active tree viewer.
- */
-public class EditorAdapterFactory implements IAdapterFactory {
-
- /*
- * (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 Editor) {
- Editor editor = (Editor) adaptableObject;
- if(TreeViewer.class.equals(adapterType)) {
- IFormPage activePage = editor.getActivePageInstance();
- if(activePage != null) {
- return activePage.getAdapter(TreeViewer.class);
- }
- }
- }
- if(adaptableObject instanceof EditorInput) {
- EditorInput editorInput = (EditorInput) adaptableObject;
- if(IModelNode.class.equals(adapterType)) {
- return editorInput.getAdapter(IModelNode.class);
- }
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- @Override
- public Class[] getAdapterList() {
- return new Class[]{TreeViewer.class, IModelNode.class};
- }
-
-}
+/*******************************************************************************
+ * 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.ui.views.internal.adapters;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
+import org.eclipse.tcf.te.ui.views.editor.Editor;
+import org.eclipse.tcf.te.ui.views.editor.EditorInput;
+import org.eclipse.ui.forms.editor.IFormPage;
+
+/**
+ * The adapter factory that adapts the editor to its active tree viewer.
+ */
+public class EditorAdapterFactory implements IAdapterFactory {
+
+ /*
+ * (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 Editor) {
+ Editor editor = (Editor) adaptableObject;
+ if(TreeViewer.class.equals(adapterType)) {
+ IFormPage activePage = editor.getActivePageInstance();
+ if(activePage != null) {
+ return activePage.getAdapter(TreeViewer.class);
+ }
+ }
+ }
+ if(adaptableObject instanceof EditorInput) {
+ EditorInput editorInput = (EditorInput) adaptableObject;
+ if(IModelNode.class.equals(adapterType)) {
+ return editorInput.getAdapter(IModelNode.class);
+ }
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
+ */
+ @Override
+ public Class[] getAdapterList() {
+ return new Class[]{TreeViewer.class, IModelNode.class};
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/AbstractCategoryContributionItem.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/AbstractCategoryContributionItem.java
index 8b9b05909..f54d967ec 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/AbstractCategoryContributionItem.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/AbstractCategoryContributionItem.java
@@ -1,305 +1,305 @@
-/*******************************************************************************
- * 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.ui.views.internal.categories;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.tcf.te.ui.views.ViewsUtil;
-import org.eclipse.tcf.te.ui.views.extensions.CategoriesExtensionPointManager;
-import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
-import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
-import org.eclipse.tcf.te.ui.views.interfaces.categories.ICategorizable;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.actions.CompoundContributionItem;
-import org.eclipse.ui.handlers.IHandlerService;
-import org.eclipse.ui.menus.IWorkbenchContribution;
-import org.eclipse.ui.services.IServiceLocator;
-
-/**
- * Abstract categories dynamic menu contribution implementation.
- */
-public abstract class AbstractCategoryContributionItem extends CompoundContributionItem implements IWorkbenchContribution {
- // Service locator to located the handler service.
- protected IServiceLocator serviceLocator;
-
- /**
- * Abstract category action implementation.
- */
- protected abstract static class AbstractCategoryAction extends Action {
- // The parent contribution item
- private final AbstractCategoryContributionItem item;
- // The selection
- private final ISelection selection;
- // The category
- private final ICategory category;
-
- /**
- * Constructor.
- *
- * @param item The parent contribution item. Must not be <code>null</code>:
- * @param selection The selection. Must not be <code>null</code>.
- * @param category The category. Must not be <code>null</code>.
- * @param single <code>True</code> if the action is the only item added, <code>false</code> otherwise.
- */
- public AbstractCategoryAction(AbstractCategoryContributionItem item, ISelection selection, ICategory category, boolean single) {
- super();
-
- Assert.isNotNull(item);
- this.item = item;
- Assert.isNotNull(selection);
- this.selection = selection;
- Assert.isNotNull(category);
- this.category = category;
-
- initialize(single);
- }
-
- /**
- * Initialize the action state.
- *
- * @param single <code>True</code> if the action is the only item added, <code>false</code> otherwise.
- */
- protected void initialize(boolean single) {
- setText(single ? makeSingleText(category.getLabel()) : category.getLabel());
-
- Image image = category.getImage();
- if (image != null) setImageDescriptor(ImageDescriptor.createFromImage(image));
- }
-
- /**
- * Returns the action label in "single" mode.
- *
- * @param text The original label. Must not be <code>null</code>.
- * @return The "single" mode label.
- */
- protected String makeSingleText(String text) {
- Assert.isNotNull(text);
- return text;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- @Override
- public void run() {
- if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
- boolean refresh = false;
- Iterator<?> iterator = ((IStructuredSelection)selection).iterator();
- while (iterator.hasNext()) {
- Object element = iterator.next();
- refresh |= execute(element, category);
- }
-
- // Refresh the view
- if (refresh) ViewsUtil.refresh(IUIConstants.ID_EXPLORER);
- }
- }
-
- /**
- * Returns the categorizable for the given element.
- *
- * @param element The element or <code>null</code>.
- * @return The categorizable or <code>null</code>.
- */
- protected ICategorizable getCategorizable(Object element) {
- return item.getCategorizable(element);
- }
-
- /**
- * Executes the operation to do on the given element.
- *
- * @param selection The selection. Must not be <code>null</code>.
- * @param category The category. Must not be <code>null</code>.
- *
- * @return <code>True</code> if the view needs refreshment, <code>false</code> otherwise.
- */
- protected abstract boolean execute(Object element, ICategory category);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.menus.IWorkbenchContribution#initialize(org.eclipse.ui.services.IServiceLocator)
- */
- @Override
- public void initialize(IServiceLocator serviceLocator) {
- this.serviceLocator = serviceLocator;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
- */
- @Override
- protected IContributionItem[] getContributionItems() {
- // Get the selected node.
- IHandlerService service = (IHandlerService)serviceLocator.getService(IHandlerService.class);
- IEvaluationContext state = service.getCurrentState();
- ISelection selection = (ISelection)state.getVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME);
- IStructuredSelection iss = (IStructuredSelection)selection;
-
- List<IContributionItem> items = new ArrayList<IContributionItem>();
- ICategory[] categories = getCategories(iss, true);
-
- // Generate the action contribution items
- for (ICategory category : categories) {
- IAction action = createAction(this, iss, category, categories.length == 1);
- if (action != null) {
- action.setEnabled(isEnabled(iss, category));
- items.add(new ActionContributionItem(action));
- }
- }
-
- return items.toArray(new IContributionItem[items.size()]);
- }
-
- /**
- * Returns the list of valid categories for the given selection.
- *
- * @param selection The selection. Must not be <code>null</code>.
- * @param onlyEnabled If <code>true</code>, returns categories which are valid and enabled only.
- *
- * @return The list of valid categories for the given selection, or an empty list.
- */
- protected ICategory[] getCategories(IStructuredSelection selection, boolean onlyEnabled) {
- Assert.isNotNull(selection);
-
- List<ICategory> categories = new ArrayList<ICategory>();
- ICategory[] allCategories = CategoriesExtensionPointManager.getInstance().getCategories(false);
-
- // Analyze the selection and add categories valid for all items in the selection
- boolean firstRun = true;
- Iterator<?> iterator = selection.iterator();
- while (iterator.hasNext()) {
- Object element = iterator.next();
- if (getCategorizable(element) == null) continue;
-
- ICategory parentCategory = getParentCategory(element, selection);
-
- List<ICategory> candidates = new ArrayList<ICategory>();
- for (ICategory category : allCategories) {
- if (!category.isEnabled()) continue;
- if (isValid(parentCategory, element, category)
- && (!onlyEnabled || isEnabled(selection, category))) {
- candidates.add(category);
- }
- }
-
- // On first run, we remember the candidates as is
- if (firstRun) {
- categories.addAll(candidates);
- firstRun = false;
- } else {
- // Eliminate all categories not being listed as candidate too
- Iterator<ICategory> catIterator = categories.iterator();
- while (catIterator.hasNext()) {
- ICategory category = catIterator.next();
- if (!candidates.contains(category)) {
- catIterator.remove();
- }
- }
- }
- }
-
- return categories.toArray(new ICategory[categories.size()]);
- }
-
- /**
- * Creates the category action instance.
- *
- * @param item The parent contribution item. Must not be <code>null</code>:
- * @param selection The selection. Must not be <code>null</code>.
- * @param category The category. Must not be <code>null</code>.
- * @param single <code>True</code> if the action is the only item added, <code>false</code> otherwise.
- *
- * @return The category action instance.
- */
- protected abstract IAction createAction(AbstractCategoryContributionItem item, ISelection selection, ICategory category, boolean single);
-
- /**
- * Tests if the given combination is valid. If not valid, the combination
- * will not be added to the menu.
- *
- * @param parentCategory The parent category or <code>null</code>.
- * @param element The element. Must not be <code>null</code>.
- * @param category The category. Must not be <code>null</code>.
- *
- * @return <code>True</code> if the given combination is valid, <code>false</code> otherwise.
- */
- protected abstract boolean isValid(ICategory parentCategory, Object element, ICategory category);
-
- /**
- * Tests if the given combination is enabled.
- *
- * @param element The selection. Must not be <code>null</code>.
- * @param category The category. Must not be <code>null</code>.
- *
- * @return <code>True</code> if the given combination is enabled, <code>false</code> otherwise.
- */
- protected abstract boolean isEnabled(ISelection selection, ICategory category);
-
- /**
- * Determines the parent category for the given element, based on the
- * given selection.
- *
- * @param element The element. Must not be <code>null</code>.
- * @param selection The selection. Must not be <code>null</code>.
- *
- * @return The parent category or <code>null</code>.
- */
- protected ICategory getParentCategory(Object element, IStructuredSelection selection) {
- Assert.isNotNull(element);
- Assert.isNotNull(selection);
-
- ICategory parent = null;
-
- if (selection instanceof ITreeSelection) {
- TreePath[] pathes = ((ITreeSelection)selection).getPathsFor(element);
- for (TreePath path : pathes) {
- TreePath parentPath = path.getParentPath();
- while (parentPath != null) {
- if (parentPath.getLastSegment() instanceof ICategory) {
- parent = (ICategory)parentPath.getLastSegment();
- break;
- }
- parentPath = parentPath.getParentPath();
- }
- if (parent != null) break;
- }
- }
-
- return parent;
- }
-
- /**
- * Returns the categorizable for the given element.
- *
- * @param element The element or <code>null</code>.
- * @return The categorizable or <code>null</code>.
- */
- protected ICategorizable getCategorizable(Object element) {
- ICategorizable categorizable = element instanceof IAdaptable ? (ICategorizable)((IAdaptable)element).getAdapter(ICategorizable.class) : null;
- if (categorizable == null) categorizable = (ICategorizable)Platform.getAdapterManager().getAdapter(element, ICategorizable.class);
- return categorizable;
- }
-}
+/*******************************************************************************
+ * 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.ui.views.internal.categories;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.tcf.te.ui.views.ViewsUtil;
+import org.eclipse.tcf.te.ui.views.extensions.CategoriesExtensionPointManager;
+import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
+import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
+import org.eclipse.tcf.te.ui.views.interfaces.categories.ICategorizable;
+import org.eclipse.ui.ISources;
+import org.eclipse.ui.actions.CompoundContributionItem;
+import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.ui.menus.IWorkbenchContribution;
+import org.eclipse.ui.services.IServiceLocator;
+
+/**
+ * Abstract categories dynamic menu contribution implementation.
+ */
+public abstract class AbstractCategoryContributionItem extends CompoundContributionItem implements IWorkbenchContribution {
+ // Service locator to located the handler service.
+ protected IServiceLocator serviceLocator;
+
+ /**
+ * Abstract category action implementation.
+ */
+ protected abstract static class AbstractCategoryAction extends Action {
+ // The parent contribution item
+ private final AbstractCategoryContributionItem item;
+ // The selection
+ private final ISelection selection;
+ // The category
+ private final ICategory category;
+
+ /**
+ * Constructor.
+ *
+ * @param item The parent contribution item. Must not be <code>null</code>:
+ * @param selection The selection. Must not be <code>null</code>.
+ * @param category The category. Must not be <code>null</code>.
+ * @param single <code>True</code> if the action is the only item added, <code>false</code> otherwise.
+ */
+ public AbstractCategoryAction(AbstractCategoryContributionItem item, ISelection selection, ICategory category, boolean single) {
+ super();
+
+ Assert.isNotNull(item);
+ this.item = item;
+ Assert.isNotNull(selection);
+ this.selection = selection;
+ Assert.isNotNull(category);
+ this.category = category;
+
+ initialize(single);
+ }
+
+ /**
+ * Initialize the action state.
+ *
+ * @param single <code>True</code> if the action is the only item added, <code>false</code> otherwise.
+ */
+ protected void initialize(boolean single) {
+ setText(single ? makeSingleText(category.getLabel()) : category.getLabel());
+
+ Image image = category.getImage();
+ if (image != null) setImageDescriptor(ImageDescriptor.createFromImage(image));
+ }
+
+ /**
+ * Returns the action label in "single" mode.
+ *
+ * @param text The original label. Must not be <code>null</code>.
+ * @return The "single" mode label.
+ */
+ protected String makeSingleText(String text) {
+ Assert.isNotNull(text);
+ return text;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
+ boolean refresh = false;
+ Iterator<?> iterator = ((IStructuredSelection)selection).iterator();
+ while (iterator.hasNext()) {
+ Object element = iterator.next();
+ refresh |= execute(element, category);
+ }
+
+ // Refresh the view
+ if (refresh) ViewsUtil.refresh(IUIConstants.ID_EXPLORER);
+ }
+ }
+
+ /**
+ * Returns the categorizable for the given element.
+ *
+ * @param element The element or <code>null</code>.
+ * @return The categorizable or <code>null</code>.
+ */
+ protected ICategorizable getCategorizable(Object element) {
+ return item.getCategorizable(element);
+ }
+
+ /**
+ * Executes the operation to do on the given element.
+ *
+ * @param selection The selection. Must not be <code>null</code>.
+ * @param category The category. Must not be <code>null</code>.
+ *
+ * @return <code>True</code> if the view needs refreshment, <code>false</code> otherwise.
+ */
+ protected abstract boolean execute(Object element, ICategory category);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.menus.IWorkbenchContribution#initialize(org.eclipse.ui.services.IServiceLocator)
+ */
+ @Override
+ public void initialize(IServiceLocator serviceLocator) {
+ this.serviceLocator = serviceLocator;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
+ */
+ @Override
+ protected IContributionItem[] getContributionItems() {
+ // Get the selected node.
+ IHandlerService service = (IHandlerService)serviceLocator.getService(IHandlerService.class);
+ IEvaluationContext state = service.getCurrentState();
+ ISelection selection = (ISelection)state.getVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME);
+ IStructuredSelection iss = (IStructuredSelection)selection;
+
+ List<IContributionItem> items = new ArrayList<IContributionItem>();
+ ICategory[] categories = getCategories(iss, true);
+
+ // Generate the action contribution items
+ for (ICategory category : categories) {
+ IAction action = createAction(this, iss, category, categories.length == 1);
+ if (action != null) {
+ action.setEnabled(isEnabled(iss, category));
+ items.add(new ActionContributionItem(action));
+ }
+ }
+
+ return items.toArray(new IContributionItem[items.size()]);
+ }
+
+ /**
+ * Returns the list of valid categories for the given selection.
+ *
+ * @param selection The selection. Must not be <code>null</code>.
+ * @param onlyEnabled If <code>true</code>, returns categories which are valid and enabled only.
+ *
+ * @return The list of valid categories for the given selection, or an empty list.
+ */
+ protected ICategory[] getCategories(IStructuredSelection selection, boolean onlyEnabled) {
+ Assert.isNotNull(selection);
+
+ List<ICategory> categories = new ArrayList<ICategory>();
+ ICategory[] allCategories = CategoriesExtensionPointManager.getInstance().getCategories(false);
+
+ // Analyze the selection and add categories valid for all items in the selection
+ boolean firstRun = true;
+ Iterator<?> iterator = selection.iterator();
+ while (iterator.hasNext()) {
+ Object element = iterator.next();
+ if (getCategorizable(element) == null) continue;
+
+ ICategory parentCategory = getParentCategory(element, selection);
+
+ List<ICategory> candidates = new ArrayList<ICategory>();
+ for (ICategory category : allCategories) {
+ if (!category.isEnabled()) continue;
+ if (isValid(parentCategory, element, category)
+ && (!onlyEnabled || isEnabled(selection, category))) {
+ candidates.add(category);
+ }
+ }
+
+ // On first run, we remember the candidates as is
+ if (firstRun) {
+ categories.addAll(candidates);
+ firstRun = false;
+ } else {
+ // Eliminate all categories not being listed as candidate too
+ Iterator<ICategory> catIterator = categories.iterator();
+ while (catIterator.hasNext()) {
+ ICategory category = catIterator.next();
+ if (!candidates.contains(category)) {
+ catIterator.remove();
+ }
+ }
+ }
+ }
+
+ return categories.toArray(new ICategory[categories.size()]);
+ }
+
+ /**
+ * Creates the category action instance.
+ *
+ * @param item The parent contribution item. Must not be <code>null</code>:
+ * @param selection The selection. Must not be <code>null</code>.
+ * @param category The category. Must not be <code>null</code>.
+ * @param single <code>True</code> if the action is the only item added, <code>false</code> otherwise.
+ *
+ * @return The category action instance.
+ */
+ protected abstract IAction createAction(AbstractCategoryContributionItem item, ISelection selection, ICategory category, boolean single);
+
+ /**
+ * Tests if the given combination is valid. If not valid, the combination
+ * will not be added to the menu.
+ *
+ * @param parentCategory The parent category or <code>null</code>.
+ * @param element The element. Must not be <code>null</code>.
+ * @param category The category. Must not be <code>null</code>.
+ *
+ * @return <code>True</code> if the given combination is valid, <code>false</code> otherwise.
+ */
+ protected abstract boolean isValid(ICategory parentCategory, Object element, ICategory category);
+
+ /**
+ * Tests if the given combination is enabled.
+ *
+ * @param element The selection. Must not be <code>null</code>.
+ * @param category The category. Must not be <code>null</code>.
+ *
+ * @return <code>True</code> if the given combination is enabled, <code>false</code> otherwise.
+ */
+ protected abstract boolean isEnabled(ISelection selection, ICategory category);
+
+ /**
+ * Determines the parent category for the given element, based on the
+ * given selection.
+ *
+ * @param element The element. Must not be <code>null</code>.
+ * @param selection The selection. Must not be <code>null</code>.
+ *
+ * @return The parent category or <code>null</code>.
+ */
+ protected ICategory getParentCategory(Object element, IStructuredSelection selection) {
+ Assert.isNotNull(element);
+ Assert.isNotNull(selection);
+
+ ICategory parent = null;
+
+ if (selection instanceof ITreeSelection) {
+ TreePath[] pathes = ((ITreeSelection)selection).getPathsFor(element);
+ for (TreePath path : pathes) {
+ TreePath parentPath = path.getParentPath();
+ while (parentPath != null) {
+ if (parentPath.getLastSegment() instanceof ICategory) {
+ parent = (ICategory)parentPath.getLastSegment();
+ break;
+ }
+ parentPath = parentPath.getParentPath();
+ }
+ if (parent != null) break;
+ }
+ }
+
+ return parent;
+ }
+
+ /**
+ * Returns the categorizable for the given element.
+ *
+ * @param element The element or <code>null</code>.
+ * @return The categorizable or <code>null</code>.
+ */
+ protected ICategorizable getCategorizable(Object element) {
+ ICategorizable categorizable = element instanceof IAdaptable ? (ICategorizable)((IAdaptable)element).getAdapter(ICategorizable.class) : null;
+ if (categorizable == null) categorizable = (ICategorizable)Platform.getAdapterManager().getAdapter(element, ICategorizable.class);
+ return categorizable;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryFactory.java
index ff6af9538..cb9f998ab 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryFactory.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryFactory.java
@@ -1,49 +1,49 @@
-/*******************************************************************************
- * 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.ui.views.internal.categories;
-
-import java.util.concurrent.atomic.AtomicReference;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.tcf.te.ui.views.extensions.CategoriesExtensionPointManager;
-import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
-import org.eclipse.ui.IElementFactory;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.PlatformUI;
-/**
- * The element factory for a category.
- */
-public class CategoryFactory implements IElementFactory {
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.IElementFactory#createElement(org.eclipse.ui.IMemento)
- */
- @Override
- public IAdaptable createElement(final IMemento memento) {
- final AtomicReference<ICategory> category = new AtomicReference<ICategory>();
-
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- String id = memento.getString("id"); //$NON-NLS-1$
- category.set(CategoriesExtensionPointManager.getInstance().getCategory(id, false));
- }
- };
-
- if (Display.findDisplay(Thread.currentThread()) == null) {
- PlatformUI.getWorkbench().getDisplay().syncExec(runnable);
- } else {
- runnable.run();
- }
-
- return category.get() instanceof IAdaptable ? (IAdaptable)category.get() : null;
- }
-}
+/*******************************************************************************
+ * 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.ui.views.internal.categories;
+
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.tcf.te.ui.views.extensions.CategoriesExtensionPointManager;
+import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
+import org.eclipse.ui.IElementFactory;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.PlatformUI;
+/**
+ * The element factory for a category.
+ */
+public class CategoryFactory implements IElementFactory {
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IElementFactory#createElement(org.eclipse.ui.IMemento)
+ */
+ @Override
+ public IAdaptable createElement(final IMemento memento) {
+ final AtomicReference<ICategory> category = new AtomicReference<ICategory>();
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ String id = memento.getString("id"); //$NON-NLS-1$
+ category.set(CategoriesExtensionPointManager.getInstance().getCategory(id, false));
+ }
+ };
+
+ if (Display.findDisplay(Thread.currentThread()) == null) {
+ PlatformUI.getWorkbench().getDisplay().syncExec(runnable);
+ } else {
+ runnable.run();
+ }
+
+ return category.get() instanceof IAdaptable ? (IAdaptable)category.get() : null;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryManager.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryManager.java
index 228bc0d25..e65f6706b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryManager.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryManager.java
@@ -1,364 +1,364 @@
-/*******************************************************************************
- * 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.ui.views.internal.categories;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.tcf.te.runtime.events.ChangeEvent;
-import org.eclipse.tcf.te.runtime.events.EventManager;
-import org.eclipse.tcf.te.runtime.persistence.interfaces.IURIPersistenceService;
-import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.ui.views.activator.UIPlugin;
-import org.eclipse.tcf.te.ui.views.extensions.CategoriesExtensionPointManager;
-import org.eclipse.tcf.te.ui.views.interfaces.categories.ICategoryManager;
-
-
-/**
- * Category manager implementation.
- */
-public class CategoryManager implements ICategoryManager {
- // The map maintaining the id list per category id
- private Map<String, List<String>> cat2id = new HashMap<String, List<String>>();
- // The map maintaining the category id list per id
- private Map<String, List<String>> id2cat = new HashMap<String, List<String>>();
-
- // The map maintaining the transient id list per category id
- private final Map<String, List<String>> _t_cat2id = new HashMap<String, List<String>>();
- // The map maintaining the transient category id list per id
- private final Map<String, List<String>> _t_id2cat = new HashMap<String, List<String>>();
-
- /**
- * Constructor.
- */
- public CategoryManager() {
- super();
- initialize();
- }
-
- /**
- * Returns the root path where to persist the maps between the sessions.
- *
- * @return The root path or <code>null</code>.
- */
- private IPath getRoot() {
- try {
- File file = UIPlugin.getDefault().getStateLocation().toFile();
- boolean exists = file.exists();
- if (!exists) {
- exists = file.mkdirs();
- }
- if (exists && file.canRead() && file.isDirectory()) {
- return new Path(file.toString());
- }
- } catch (IllegalStateException e) {
- /* ignored on purpose */
- }
-
- File file = new Path(System.getProperty("user.home")).append(".tcf").toFile(); //$NON-NLS-1$ //$NON-NLS-2$
- if (file.canRead() && file.isDirectory()) {
- return new Path(file.toString());
- }
-
- return null;
- }
-
- /**
- * Initialize the category manager.
- */
- private void initialize() {
- IPath root = getRoot();
- if (root == null) {
- return;
- }
-
- // Clear out the transient maps
- _t_cat2id.clear();
- _t_id2cat.clear();
-
- cat2id.clear();
- id2cat.clear();
-
- try {
- // Get the persistence service
- IURIPersistenceService uRIPersistenceService = ServiceManager.getInstance().getService(IURIPersistenceService.class);
- if (uRIPersistenceService == null) {
- throw new IOException("Persistence service instance unavailable."); //$NON-NLS-1$
- }
- // Save the history to the persistence storage
- cat2id = (Map<String,List<String>>)uRIPersistenceService.read(cat2id, root.append("cat2id.json").toFile().toURI()); //$NON-NLS-1$
- } catch (IOException e) {
- }
-
- try {
- // Get the persistence service
- IURIPersistenceService uRIPersistenceService = ServiceManager.getInstance().getService(IURIPersistenceService.class);
- if (uRIPersistenceService == null) {
- throw new IOException("Persistence service instance unavailable."); //$NON-NLS-1$
- }
- // Save the history to the persistence storage
- id2cat = (Map<String,List<String>>)uRIPersistenceService.read(id2cat, root.append("id2cat.json").toFile().toURI()); //$NON-NLS-1$
- } catch (IOException e) {
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.categories.ICategoryManager#flush()
- */
- @Override
- public void flush() {
- IPath root = getRoot();
- if (root == null) {
- return;
- }
-
- try {
- // Get the persistence service
- IURIPersistenceService uRIPersistenceService = ServiceManager.getInstance().getService(IURIPersistenceService.class);
- if (uRIPersistenceService == null) {
- throw new IOException("Persistence service instance unavailable."); //$NON-NLS-1$
- }
- // Save the history to the persistence storage
- uRIPersistenceService.write(cat2id, root.append("cat2id.json").toFile().toURI()); //$NON-NLS-1$
- } catch (IOException e) {
- }
-
- try {
- // Get the persistence service
- IURIPersistenceService uRIPersistenceService = ServiceManager.getInstance().getService(IURIPersistenceService.class);
- if (uRIPersistenceService == null) {
- throw new IOException("Persistence service instance unavailable."); //$NON-NLS-1$
- }
- // Save the history to the persistence storage
- uRIPersistenceService.write(id2cat, root.append("id2cat.json").toFile().toURI()); //$NON-NLS-1$
- } catch (IOException e) {
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.categories.ICategoryManager#add(java.lang.String, java.lang.String)
- */
- @Override
- public boolean add(String categoryId, String id) {
- Assert.isNotNull(categoryId);
- Assert.isNotNull(id);
-
- boolean added = false;
-
- List<String> ids = cat2id.get(categoryId);
- if (ids == null) {
- ids = new ArrayList<String>();
- cat2id.put(categoryId, ids);
- }
- if (!ids.contains(id)) {
- added |= ids.add(id);
- }
-
- List<String> cats = id2cat.get(id);
- if (cats == null) {
- cats = new ArrayList<String>();
- id2cat.put(id, cats);
- }
- if (!cats.contains(categoryId)) {
- added |= cats.add(categoryId);
- }
-
- if (added) {
- flush();
- EventManager.getInstance().fireEvent(
- new ChangeEvent(CategoriesExtensionPointManager.getInstance().getCategory(categoryId, false), ChangeEvent.ID_ADDED, null, id));
- }
-
- return added;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.interfaces.categories.ICategoryManager#addTransient(java.lang.String, java.lang.String)
- */
- @Override
- public boolean addTransient(String categoryId, String id) {
- Assert.isNotNull(categoryId);
- Assert.isNotNull(id);
-
- boolean added = false;
-
- List<String> ids = _t_cat2id.get(categoryId);
- if (ids == null) {
- ids = new ArrayList<String>();
- _t_cat2id.put(categoryId, ids);
- }
- if (!ids.contains(id)) {
- added |= ids.add(id);
- }
-
- List<String> cats = _t_id2cat.get(id);
- if (cats == null) {
- cats = new ArrayList<String>();
- _t_id2cat.put(id, cats);
- }
- if (!cats.contains(categoryId)) {
- added |= cats.add(categoryId);
- }
-
- if (added) {
- EventManager.getInstance().fireEvent(
- new ChangeEvent(CategoriesExtensionPointManager.getInstance().getCategory(categoryId, false), ChangeEvent.ID_ADDED, null, id));
- }
-
- return added;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.categories.ICategoryManager#remove(java.lang.String, java.lang.String)
- */
- @Override
- public boolean remove(String categoryId, String id) {
- Assert.isNotNull(categoryId);
- Assert.isNotNull(id);
-
- boolean removed = false;
-
- List<String> ids = cat2id.get(categoryId);
- if (ids != null) {
- removed |= ids.remove(id);
- if (ids.isEmpty()) {
- cat2id.remove(categoryId);
- }
- }
- ids = _t_cat2id.get(categoryId);
- if (ids != null) {
- removed |= ids.remove(id);
- if (ids.isEmpty()) {
- _t_cat2id.remove(categoryId);
- }
- }
-
- List<String> cats = id2cat.get(id);
- if (cats != null) {
- removed |= cats.remove(categoryId);
- if (cats.isEmpty()) {
- id2cat.remove(id);
- }
- }
- cats = _t_id2cat.get(id);
- if (cats != null) {
- removed |= cats.remove(categoryId);
- if (cats.isEmpty()) {
- _t_id2cat.remove(id);
- }
- }
-
- if (removed) {
- flush();
- EventManager.getInstance().fireEvent(
- new ChangeEvent(CategoriesExtensionPointManager.getInstance().getCategory(categoryId, false), ChangeEvent.ID_REMOVED, id, null));
- }
-
- return removed;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.categories.ICategoryManager#belongsTo(java.lang.String, java.lang.String)
- */
- @Override
- public boolean belongsTo(String categoryId, String id) {
- Assert.isNotNull(categoryId);
- Assert.isNotNull(id);
-
- boolean belongsTo = isLinked(categoryId, id);
-
- List<String> ids = cat2id.get(categoryId);
- if (!belongsTo) {
- ids = _t_cat2id.get(categoryId);
- if (ids != null && ids.contains(id)) {
- belongsTo = true;
- }
- }
-
- return belongsTo;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.interfaces.categories.ICategoryManager#isLinked(java.lang.String, java.lang.String)
- */
- @Override
- public boolean isLinked(String categoryId, String id) {
- Assert.isNotNull(categoryId);
- Assert.isNotNull(id);
-
- boolean belongsTo = false;
-
- List<String> ids = cat2id.get(categoryId);
- if (ids != null && ids.contains(id)) {
- belongsTo = true;
- }
-
- return belongsTo;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.categories.ICategoryManager#getCategoryIds(java.lang.String)
- */
- @Override
- public String[] getCategoryIds(String id) {
- Assert.isNotNull(id);
-
- List<String> allCategories = new ArrayList<String>();
-
- List<String> cats = id2cat.get(id);
- if (cats != null) {
- allCategories.addAll(cats);
- }
-
- cats = _t_id2cat.get(id);
- if (cats != null) {
- for (String cat : cats) {
- if (!allCategories.contains(cat)) {
- allCategories.add(cat);
- }
- }
- }
-
- return allCategories.toArray(new String[allCategories.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.interfaces.categories.ICategoryManager#getIdsForCategory(java.lang.String)
- */
- @Override
- public String[] getIdsForCategory(String categoryId) {
- Assert.isNotNull(categoryId);
-
- List<String> allIds = new ArrayList<String>();
-
- List<String> cats = cat2id.get(categoryId);
- if (cats != null) {
- allIds.addAll(cats);
- }
-
- cats = _t_cat2id.get(categoryId);
- if (cats != null) {
- for (String cat : cats) {
- if (!allIds.contains(cat)) {
- allIds.add(cat);
- }
- }
- }
-
- return allIds.toArray(new String[allIds.size()]);
- }
-}
+/*******************************************************************************
+ * 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.ui.views.internal.categories;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.tcf.te.runtime.events.ChangeEvent;
+import org.eclipse.tcf.te.runtime.events.EventManager;
+import org.eclipse.tcf.te.runtime.persistence.interfaces.IURIPersistenceService;
+import org.eclipse.tcf.te.runtime.services.ServiceManager;
+import org.eclipse.tcf.te.ui.views.activator.UIPlugin;
+import org.eclipse.tcf.te.ui.views.extensions.CategoriesExtensionPointManager;
+import org.eclipse.tcf.te.ui.views.interfaces.categories.ICategoryManager;
+
+
+/**
+ * Category manager implementation.
+ */
+public class CategoryManager implements ICategoryManager {
+ // The map maintaining the id list per category id
+ private Map<String, List<String>> cat2id = new HashMap<String, List<String>>();
+ // The map maintaining the category id list per id
+ private Map<String, List<String>> id2cat = new HashMap<String, List<String>>();
+
+ // The map maintaining the transient id list per category id
+ private final Map<String, List<String>> _t_cat2id = new HashMap<String, List<String>>();
+ // The map maintaining the transient category id list per id
+ private final Map<String, List<String>> _t_id2cat = new HashMap<String, List<String>>();
+
+ /**
+ * Constructor.
+ */
+ public CategoryManager() {
+ super();
+ initialize();
+ }
+
+ /**
+ * Returns the root path where to persist the maps between the sessions.
+ *
+ * @return The root path or <code>null</code>.
+ */
+ private IPath getRoot() {
+ try {
+ File file = UIPlugin.getDefault().getStateLocation().toFile();
+ boolean exists = file.exists();
+ if (!exists) {
+ exists = file.mkdirs();
+ }
+ if (exists && file.canRead() && file.isDirectory()) {
+ return new Path(file.toString());
+ }
+ } catch (IllegalStateException e) {
+ /* ignored on purpose */
+ }
+
+ File file = new Path(System.getProperty("user.home")).append(".tcf").toFile(); //$NON-NLS-1$ //$NON-NLS-2$
+ if (file.canRead() && file.isDirectory()) {
+ return new Path(file.toString());
+ }
+
+ return null;
+ }
+
+ /**
+ * Initialize the category manager.
+ */
+ private void initialize() {
+ IPath root = getRoot();
+ if (root == null) {
+ return;
+ }
+
+ // Clear out the transient maps
+ _t_cat2id.clear();
+ _t_id2cat.clear();
+
+ cat2id.clear();
+ id2cat.clear();
+
+ try {
+ // Get the persistence service
+ IURIPersistenceService uRIPersistenceService = ServiceManager.getInstance().getService(IURIPersistenceService.class);
+ if (uRIPersistenceService == null) {
+ throw new IOException("Persistence service instance unavailable."); //$NON-NLS-1$
+ }
+ // Save the history to the persistence storage
+ cat2id = (Map<String,List<String>>)uRIPersistenceService.read(cat2id, root.append("cat2id.json").toFile().toURI()); //$NON-NLS-1$
+ } catch (IOException e) {
+ }
+
+ try {
+ // Get the persistence service
+ IURIPersistenceService uRIPersistenceService = ServiceManager.getInstance().getService(IURIPersistenceService.class);
+ if (uRIPersistenceService == null) {
+ throw new IOException("Persistence service instance unavailable."); //$NON-NLS-1$
+ }
+ // Save the history to the persistence storage
+ id2cat = (Map<String,List<String>>)uRIPersistenceService.read(id2cat, root.append("id2cat.json").toFile().toURI()); //$NON-NLS-1$
+ } catch (IOException e) {
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.categories.ICategoryManager#flush()
+ */
+ @Override
+ public void flush() {
+ IPath root = getRoot();
+ if (root == null) {
+ return;
+ }
+
+ try {
+ // Get the persistence service
+ IURIPersistenceService uRIPersistenceService = ServiceManager.getInstance().getService(IURIPersistenceService.class);
+ if (uRIPersistenceService == null) {
+ throw new IOException("Persistence service instance unavailable."); //$NON-NLS-1$
+ }
+ // Save the history to the persistence storage
+ uRIPersistenceService.write(cat2id, root.append("cat2id.json").toFile().toURI()); //$NON-NLS-1$
+ } catch (IOException e) {
+ }
+
+ try {
+ // Get the persistence service
+ IURIPersistenceService uRIPersistenceService = ServiceManager.getInstance().getService(IURIPersistenceService.class);
+ if (uRIPersistenceService == null) {
+ throw new IOException("Persistence service instance unavailable."); //$NON-NLS-1$
+ }
+ // Save the history to the persistence storage
+ uRIPersistenceService.write(id2cat, root.append("id2cat.json").toFile().toURI()); //$NON-NLS-1$
+ } catch (IOException e) {
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.categories.ICategoryManager#add(java.lang.String, java.lang.String)
+ */
+ @Override
+ public boolean add(String categoryId, String id) {
+ Assert.isNotNull(categoryId);
+ Assert.isNotNull(id);
+
+ boolean added = false;
+
+ List<String> ids = cat2id.get(categoryId);
+ if (ids == null) {
+ ids = new ArrayList<String>();
+ cat2id.put(categoryId, ids);
+ }
+ if (!ids.contains(id)) {
+ added |= ids.add(id);
+ }
+
+ List<String> cats = id2cat.get(id);
+ if (cats == null) {
+ cats = new ArrayList<String>();
+ id2cat.put(id, cats);
+ }
+ if (!cats.contains(categoryId)) {
+ added |= cats.add(categoryId);
+ }
+
+ if (added) {
+ flush();
+ EventManager.getInstance().fireEvent(
+ new ChangeEvent(CategoriesExtensionPointManager.getInstance().getCategory(categoryId, false), ChangeEvent.ID_ADDED, null, id));
+ }
+
+ return added;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.interfaces.categories.ICategoryManager#addTransient(java.lang.String, java.lang.String)
+ */
+ @Override
+ public boolean addTransient(String categoryId, String id) {
+ Assert.isNotNull(categoryId);
+ Assert.isNotNull(id);
+
+ boolean added = false;
+
+ List<String> ids = _t_cat2id.get(categoryId);
+ if (ids == null) {
+ ids = new ArrayList<String>();
+ _t_cat2id.put(categoryId, ids);
+ }
+ if (!ids.contains(id)) {
+ added |= ids.add(id);
+ }
+
+ List<String> cats = _t_id2cat.get(id);
+ if (cats == null) {
+ cats = new ArrayList<String>();
+ _t_id2cat.put(id, cats);
+ }
+ if (!cats.contains(categoryId)) {
+ added |= cats.add(categoryId);
+ }
+
+ if (added) {
+ EventManager.getInstance().fireEvent(
+ new ChangeEvent(CategoriesExtensionPointManager.getInstance().getCategory(categoryId, false), ChangeEvent.ID_ADDED, null, id));
+ }
+
+ return added;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.categories.ICategoryManager#remove(java.lang.String, java.lang.String)
+ */
+ @Override
+ public boolean remove(String categoryId, String id) {
+ Assert.isNotNull(categoryId);
+ Assert.isNotNull(id);
+
+ boolean removed = false;
+
+ List<String> ids = cat2id.get(categoryId);
+ if (ids != null) {
+ removed |= ids.remove(id);
+ if (ids.isEmpty()) {
+ cat2id.remove(categoryId);
+ }
+ }
+ ids = _t_cat2id.get(categoryId);
+ if (ids != null) {
+ removed |= ids.remove(id);
+ if (ids.isEmpty()) {
+ _t_cat2id.remove(categoryId);
+ }
+ }
+
+ List<String> cats = id2cat.get(id);
+ if (cats != null) {
+ removed |= cats.remove(categoryId);
+ if (cats.isEmpty()) {
+ id2cat.remove(id);
+ }
+ }
+ cats = _t_id2cat.get(id);
+ if (cats != null) {
+ removed |= cats.remove(categoryId);
+ if (cats.isEmpty()) {
+ _t_id2cat.remove(id);
+ }
+ }
+
+ if (removed) {
+ flush();
+ EventManager.getInstance().fireEvent(
+ new ChangeEvent(CategoriesExtensionPointManager.getInstance().getCategory(categoryId, false), ChangeEvent.ID_REMOVED, id, null));
+ }
+
+ return removed;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.categories.ICategoryManager#belongsTo(java.lang.String, java.lang.String)
+ */
+ @Override
+ public boolean belongsTo(String categoryId, String id) {
+ Assert.isNotNull(categoryId);
+ Assert.isNotNull(id);
+
+ boolean belongsTo = isLinked(categoryId, id);
+
+ List<String> ids = cat2id.get(categoryId);
+ if (!belongsTo) {
+ ids = _t_cat2id.get(categoryId);
+ if (ids != null && ids.contains(id)) {
+ belongsTo = true;
+ }
+ }
+
+ return belongsTo;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.interfaces.categories.ICategoryManager#isLinked(java.lang.String, java.lang.String)
+ */
+ @Override
+ public boolean isLinked(String categoryId, String id) {
+ Assert.isNotNull(categoryId);
+ Assert.isNotNull(id);
+
+ boolean belongsTo = false;
+
+ List<String> ids = cat2id.get(categoryId);
+ if (ids != null && ids.contains(id)) {
+ belongsTo = true;
+ }
+
+ return belongsTo;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.categories.ICategoryManager#getCategoryIds(java.lang.String)
+ */
+ @Override
+ public String[] getCategoryIds(String id) {
+ Assert.isNotNull(id);
+
+ List<String> allCategories = new ArrayList<String>();
+
+ List<String> cats = id2cat.get(id);
+ if (cats != null) {
+ allCategories.addAll(cats);
+ }
+
+ cats = _t_id2cat.get(id);
+ if (cats != null) {
+ for (String cat : cats) {
+ if (!allCategories.contains(cat)) {
+ allCategories.add(cat);
+ }
+ }
+ }
+
+ return allCategories.toArray(new String[allCategories.size()]);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.interfaces.categories.ICategoryManager#getIdsForCategory(java.lang.String)
+ */
+ @Override
+ public String[] getIdsForCategory(String categoryId) {
+ Assert.isNotNull(categoryId);
+
+ List<String> allIds = new ArrayList<String>();
+
+ List<String> cats = cat2id.get(categoryId);
+ if (cats != null) {
+ allIds.addAll(cats);
+ }
+
+ cats = _t_cat2id.get(categoryId);
+ if (cats != null) {
+ for (String cat : cats) {
+ if (!allIds.contains(cat)) {
+ allIds.add(cat);
+ }
+ }
+ }
+
+ return allIds.toArray(new String[allIds.size()]);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryPropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryPropertyTester.java
index 58cdca414..d61218544 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryPropertyTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/categories/CategoryPropertyTester.java
@@ -1,176 +1,176 @@
-/*******************************************************************************
- * 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.ui.views.internal.categories;
-
-import org.eclipse.core.expressions.EvaluationContext;
-import org.eclipse.core.expressions.EvaluationResult;
-import org.eclipse.core.expressions.ICountable;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.internal.expressions.CountExpression;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.tcf.te.ui.views.Managers;
-import org.eclipse.tcf.te.ui.views.ViewsUtil;
-import org.eclipse.tcf.te.ui.views.activator.UIPlugin;
-import org.eclipse.tcf.te.ui.views.extensions.CategoriesExtensionPointManager;
-import org.eclipse.tcf.te.ui.views.handler.CategoryAddToContributionItem;
-import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
-import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
-import org.eclipse.tcf.te.ui.views.interfaces.categories.ICategorizable;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.navigator.CommonNavigator;
-import org.eclipse.ui.navigator.INavigatorActivationService;
-import org.eclipse.ui.navigator.INavigatorContentService;
-
-/**
- * Category property tester.
- */
-@SuppressWarnings("restriction")
-public class CategoryPropertyTester extends 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(final Object receiver, final String property, final Object[] args, final Object expectedValue) {
- if (receiver instanceof IStructuredSelection) {
- // Analyze the selection
- return testSelection((IStructuredSelection)receiver, property, args, expectedValue);
- }
-
- return internalTest(receiver, property, args, expectedValue);
- }
-
- /**
- * Test the specific selection properties.
- *
- * @param selection The selection. Must not be <code>null</code>.
- * @param property The property to test.
- * @param args The property arguments.
- * @param expectedValue The expected value.
- *
- * @return <code>True</code> if the property to test has the expected value, <code>false</code>
- * otherwise.
- */
- protected boolean testSelection(IStructuredSelection selection, String property, Object[] args, Object expectedValue) {
- Assert.isNotNull(selection);
-
- if ("parentCategoryId".equals(property) && !selection.isEmpty()) { //$NON-NLS-1$
- // Only single element selection is supported
- Object element = selection.getFirstElement();
-
- TreePath[] pathes = selection instanceof ITreeSelection ? ((ITreeSelection)selection).getPathsFor(element) : null;
- if (pathes != null) {
- for (TreePath path : pathes) {
- // Find the category within the tree path
- TreePath parentPath = path.getParentPath();
- while (parentPath != null) {
- Object lastSegment = parentPath.getLastSegment();
- if (lastSegment instanceof ICategory
- && ((ICategory)lastSegment).getId().equals(expectedValue)) {
- return true;
- }
- parentPath = parentPath.getParentPath();
- }
- }
- }
- }
-
- if ("validAddToCategoriesCount".equals(property)) { //$NON-NLS-1$
- // Determine the number of valid "Add To" Categories
- AbstractCategoryContributionItem item = new CategoryAddToContributionItem();
- ICategory[] categories = item.getCategories(selection, true);
- final int count = categories.length;
-
- // Re-use the count expression to allow the same value syntax
- String value = expectedValue instanceof String ? (String)expectedValue : expectedValue != null ? expectedValue.toString() : null;
- if (value != null) {
- CountExpression expression = new CountExpression(value);
- IEvaluationContext context = new EvaluationContext(null, new ICountable() {
- @Override
- public int count() {
- return count;
- }
- });
-
- EvaluationResult result = EvaluationResult.FALSE;
- try {
- result = expression.evaluate(context);
- } catch (CoreException e) {
- if (Platform.inDebugMode()) e.printStackTrace();
- }
-
- return result.equals(EvaluationResult.TRUE);
- }
- }
-
- return false;
- }
-
- /**
- * Internal helper to {@link #test(Object, String, Object[], Object)}.
- */
- protected boolean internalTest(Object receiver, String property, Object[] args, Object expectedValue) {
- ICategorizable categorizable = receiver instanceof IAdaptable ? (ICategorizable)((IAdaptable)receiver).getAdapter(ICategorizable.class) : null;
- if (categorizable == null) categorizable = (ICategorizable)Platform.getAdapterManager().getAdapter(receiver, ICategorizable.class);
-
- if ("belongsTo".equals(property) && categorizable != null) { //$NON-NLS-1$
- String id = categorizable.getId();
- if (id != null && expectedValue instanceof String) {
- return Managers.getCategoryManager().belongsTo((String)expectedValue, id);
- }
- }
-
- if ("isCategoryID".equals(property) && receiver instanceof ICategory) { //$NON-NLS-1$
- String id = ((ICategory)receiver).getId();
- return id.equals(expectedValue);
- }
-
- if ("isCategoryEnabled".equals(property) && expectedValue instanceof Boolean) { //$NON-NLS-1$
- String categoryId = args != null && args.length == 1 && args[0] instanceof String ? (String)args[0] : null;
- ICategory category = categoryId != null ? CategoriesExtensionPointManager.getInstance().getCategory(categoryId, false) : null;
-
- return category != null && (category.isEnabled() == ((Boolean)expectedValue).booleanValue());
- }
-
- if ("isHiddenByPreferences".equals(property) && receiver instanceof ICategory && expectedValue instanceof Boolean) { //$NON-NLS-1$
- String prefKey = ((ICategory)receiver).getId() + ".hide"; //$NON-NLS-1$
- boolean isHidden = UIPlugin.getScopedPreferences().getBoolean(prefKey) || Boolean.getBoolean(prefKey);
- return ((Boolean)expectedValue).booleanValue() == isHidden;
- }
-
- if ("isVisibleNavigatorContent".equals(property) && receiver instanceof ICategory && expectedValue instanceof Boolean) { //$NON-NLS-1$
- boolean isVisible = false;
-
- String navContentID = args != null && args.length == 1 && args[0] instanceof String ? (String)args[0] : null;
- IWorkbenchPart part = ViewsUtil.getPart(IUIConstants.ID_EXPLORER);
-
- if (part instanceof CommonNavigator) {
- CommonNavigator navigator = (CommonNavigator)part;
- INavigatorContentService service = navigator.getNavigatorContentService();
- INavigatorActivationService activationService = service != null ? service.getActivationService() : null;
- isVisible = activationService != null && navContentID != null && activationService.isNavigatorExtensionActive(navContentID);
- }
- else {
- return true;
- }
-
- return ((Boolean)expectedValue).booleanValue() == isVisible;
- }
-
- 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.ui.views.internal.categories;
+
+import org.eclipse.core.expressions.EvaluationContext;
+import org.eclipse.core.expressions.EvaluationResult;
+import org.eclipse.core.expressions.ICountable;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.core.internal.expressions.CountExpression;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.tcf.te.ui.views.Managers;
+import org.eclipse.tcf.te.ui.views.ViewsUtil;
+import org.eclipse.tcf.te.ui.views.activator.UIPlugin;
+import org.eclipse.tcf.te.ui.views.extensions.CategoriesExtensionPointManager;
+import org.eclipse.tcf.te.ui.views.handler.CategoryAddToContributionItem;
+import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
+import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants;
+import org.eclipse.tcf.te.ui.views.interfaces.categories.ICategorizable;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.navigator.CommonNavigator;
+import org.eclipse.ui.navigator.INavigatorActivationService;
+import org.eclipse.ui.navigator.INavigatorContentService;
+
+/**
+ * Category property tester.
+ */
+@SuppressWarnings("restriction")
+public class CategoryPropertyTester extends 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(final Object receiver, final String property, final Object[] args, final Object expectedValue) {
+ if (receiver instanceof IStructuredSelection) {
+ // Analyze the selection
+ return testSelection((IStructuredSelection)receiver, property, args, expectedValue);
+ }
+
+ return internalTest(receiver, property, args, expectedValue);
+ }
+
+ /**
+ * Test the specific selection properties.
+ *
+ * @param selection The selection. Must not be <code>null</code>.
+ * @param property The property to test.
+ * @param args The property arguments.
+ * @param expectedValue The expected value.
+ *
+ * @return <code>True</code> if the property to test has the expected value, <code>false</code>
+ * otherwise.
+ */
+ protected boolean testSelection(IStructuredSelection selection, String property, Object[] args, Object expectedValue) {
+ Assert.isNotNull(selection);
+
+ if ("parentCategoryId".equals(property) && !selection.isEmpty()) { //$NON-NLS-1$
+ // Only single element selection is supported
+ Object element = selection.getFirstElement();
+
+ TreePath[] pathes = selection instanceof ITreeSelection ? ((ITreeSelection)selection).getPathsFor(element) : null;
+ if (pathes != null) {
+ for (TreePath path : pathes) {
+ // Find the category within the tree path
+ TreePath parentPath = path.getParentPath();
+ while (parentPath != null) {
+ Object lastSegment = parentPath.getLastSegment();
+ if (lastSegment instanceof ICategory
+ && ((ICategory)lastSegment).getId().equals(expectedValue)) {
+ return true;
+ }
+ parentPath = parentPath.getParentPath();
+ }
+ }
+ }
+ }
+
+ if ("validAddToCategoriesCount".equals(property)) { //$NON-NLS-1$
+ // Determine the number of valid "Add To" Categories
+ AbstractCategoryContributionItem item = new CategoryAddToContributionItem();
+ ICategory[] categories = item.getCategories(selection, true);
+ final int count = categories.length;
+
+ // Re-use the count expression to allow the same value syntax
+ String value = expectedValue instanceof String ? (String)expectedValue : expectedValue != null ? expectedValue.toString() : null;
+ if (value != null) {
+ CountExpression expression = new CountExpression(value);
+ IEvaluationContext context = new EvaluationContext(null, new ICountable() {
+ @Override
+ public int count() {
+ return count;
+ }
+ });
+
+ EvaluationResult result = EvaluationResult.FALSE;
+ try {
+ result = expression.evaluate(context);
+ } catch (CoreException e) {
+ if (Platform.inDebugMode()) e.printStackTrace();
+ }
+
+ return result.equals(EvaluationResult.TRUE);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Internal helper to {@link #test(Object, String, Object[], Object)}.
+ */
+ protected boolean internalTest(Object receiver, String property, Object[] args, Object expectedValue) {
+ ICategorizable categorizable = receiver instanceof IAdaptable ? (ICategorizable)((IAdaptable)receiver).getAdapter(ICategorizable.class) : null;
+ if (categorizable == null) categorizable = (ICategorizable)Platform.getAdapterManager().getAdapter(receiver, ICategorizable.class);
+
+ if ("belongsTo".equals(property) && categorizable != null) { //$NON-NLS-1$
+ String id = categorizable.getId();
+ if (id != null && expectedValue instanceof String) {
+ return Managers.getCategoryManager().belongsTo((String)expectedValue, id);
+ }
+ }
+
+ if ("isCategoryID".equals(property) && receiver instanceof ICategory) { //$NON-NLS-1$
+ String id = ((ICategory)receiver).getId();
+ return id.equals(expectedValue);
+ }
+
+ if ("isCategoryEnabled".equals(property) && expectedValue instanceof Boolean) { //$NON-NLS-1$
+ String categoryId = args != null && args.length == 1 && args[0] instanceof String ? (String)args[0] : null;
+ ICategory category = categoryId != null ? CategoriesExtensionPointManager.getInstance().getCategory(categoryId, false) : null;
+
+ return category != null && (category.isEnabled() == ((Boolean)expectedValue).booleanValue());
+ }
+
+ if ("isHiddenByPreferences".equals(property) && receiver instanceof ICategory && expectedValue instanceof Boolean) { //$NON-NLS-1$
+ String prefKey = ((ICategory)receiver).getId() + ".hide"; //$NON-NLS-1$
+ boolean isHidden = UIPlugin.getScopedPreferences().getBoolean(prefKey) || Boolean.getBoolean(prefKey);
+ return ((Boolean)expectedValue).booleanValue() == isHidden;
+ }
+
+ if ("isVisibleNavigatorContent".equals(property) && receiver instanceof ICategory && expectedValue instanceof Boolean) { //$NON-NLS-1$
+ boolean isVisible = false;
+
+ String navContentID = args != null && args.length == 1 && args[0] instanceof String ? (String)args[0] : null;
+ IWorkbenchPart part = ViewsUtil.getPart(IUIConstants.ID_EXPLORER);
+
+ if (part instanceof CommonNavigator) {
+ CommonNavigator navigator = (CommonNavigator)part;
+ INavigatorContentService service = navigator.getNavigatorContentService();
+ INavigatorActivationService activationService = service != null ? service.getActivationService() : null;
+ isVisible = activationService != null && navContentID != null && activationService.isNavigatorExtensionActive(navContentID);
+ }
+ else {
+ return true;
+ }
+
+ return ((Boolean)expectedValue).booleanValue() == isVisible;
+ }
+
+ return false;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/preferences/IPreferenceKeys.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/preferences/IPreferenceKeys.java
index 591e40b9e..0fc6705bb 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/preferences/IPreferenceKeys.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/preferences/IPreferenceKeys.java
@@ -1,50 +1,50 @@
-/*******************************************************************************
- * 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.ui.views.internal.preferences;
-
-/**
- * The constants for the preferences used in the main view.
- */
-public interface IPreferenceKeys {
- /**
- * Common prefix for all preference keys
- */
- public final String PREFIX = "te.ui."; //$NON-NLS-1$
-
- /**
- * The default size of MRU list.
- */
- public static final int DEFAULT_MAX_MRU = 3;
-
- /**
- * Preference key to access MRU filter list.
- */
- public static final String PREF_FILTER_MRU_LIST = PREFIX + "PrefFilterMRUs"; //$NON-NLS-1$
-
- /**
- * Preference key to access max MRU filter size.
- */
- public static final String PREF_MAX_FILTER_MRU = PREFIX + "PrefFilterMRUs.max"; //$NON-NLS-1$
-
- /**
- * Preference key to access MRU content list.
- */
- public static final String PREF_CONTENT_MRU_LIST = PREFIX + "PrefContentMRUs"; //$NON-NLS-1$
-
- /**
- * Preference key to access max MRU content size.
- */
- public static final String PREF_MAX_CONTENT_MRU = PREFIX + "PrefContentMRUs.max"; //$NON-NLS-1$
-
- /**
- * Preference key to access the flag to hide category content extension.
- */
- public static final String PREF_HIDE_CATEGORY_EXTENSION = "org.eclipse.tcf.te.ui.views.navigator.content.hide"; //$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.ui.views.internal.preferences;
+
+/**
+ * The constants for the preferences used in the main view.
+ */
+public interface IPreferenceKeys {
+ /**
+ * Common prefix for all preference keys
+ */
+ public final String PREFIX = "te.ui."; //$NON-NLS-1$
+
+ /**
+ * The default size of MRU list.
+ */
+ public static final int DEFAULT_MAX_MRU = 3;
+
+ /**
+ * Preference key to access MRU filter list.
+ */
+ public static final String PREF_FILTER_MRU_LIST = PREFIX + "PrefFilterMRUs"; //$NON-NLS-1$
+
+ /**
+ * Preference key to access max MRU filter size.
+ */
+ public static final String PREF_MAX_FILTER_MRU = PREFIX + "PrefFilterMRUs.max"; //$NON-NLS-1$
+
+ /**
+ * Preference key to access MRU content list.
+ */
+ public static final String PREF_CONTENT_MRU_LIST = PREFIX + "PrefContentMRUs"; //$NON-NLS-1$
+
+ /**
+ * Preference key to access max MRU content size.
+ */
+ public static final String PREF_MAX_CONTENT_MRU = PREFIX + "PrefContentMRUs.max"; //$NON-NLS-1$
+
+ /**
+ * Preference key to access the flag to hide category content extension.
+ */
+ public static final String PREF_HIDE_CATEGORY_EXTENSION = "org.eclipse.tcf.te.ui.views.navigator.content.hide"; //$NON-NLS-1$
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/preferences/PreferencesInitializer.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/preferences/PreferencesInitializer.java
index 367ad1001..3bbbc79c9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/preferences/PreferencesInitializer.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/preferences/PreferencesInitializer.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.ui.views.internal.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.tcf.te.runtime.preferences.ScopedEclipsePreferences;
-import org.eclipse.tcf.te.ui.views.activator.UIPlugin;
-
-
-/**
- * The bundle's preference initializer implementation.
- */
-public class PreferencesInitializer extends AbstractPreferenceInitializer {
- /**
- * Constructor.
- */
- public PreferencesInitializer() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- @Override
- public void initializeDefaultPreferences() {
- ScopedEclipsePreferences store = UIPlugin.getScopedPreferences();
-
- // Maximum MRU list size "Filter": default IPreferenceKeys.DEFAULT_MAX_MRU
- store.putDefaultInt(IPreferenceKeys.PREF_MAX_FILTER_MRU, IPreferenceKeys.DEFAULT_MAX_MRU);
- // Maximum MRU list size "Content": default IPreferenceKeys.DEFAULT_MAX_MRU
- store.putDefaultInt(IPreferenceKeys.PREF_MAX_CONTENT_MRU, IPreferenceKeys.DEFAULT_MAX_MRU);
- // "Filter" MRU list: default empty
- store.putDefaultString(IPreferenceKeys.PREF_FILTER_MRU_LIST, ""); //$NON-NLS-1$
- // "Content" MRU list: default empty
- store.putDefaultString(IPreferenceKeys.PREF_CONTENT_MRU_LIST, ""); //$NON-NLS-1$
- // [Hidden] Hide categories navigator content extension: default on
- store.putDefaultBoolean(IPreferenceKeys.PREF_HIDE_CATEGORY_EXTENSION, true);
- }
-}
+/*******************************************************************************
+ * 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.ui.views.internal.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.tcf.te.runtime.preferences.ScopedEclipsePreferences;
+import org.eclipse.tcf.te.ui.views.activator.UIPlugin;
+
+
+/**
+ * The bundle's preference initializer implementation.
+ */
+public class PreferencesInitializer extends AbstractPreferenceInitializer {
+ /**
+ * Constructor.
+ */
+ public PreferencesInitializer() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+ */
+ @Override
+ public void initializeDefaultPreferences() {
+ ScopedEclipsePreferences store = UIPlugin.getScopedPreferences();
+
+ // Maximum MRU list size "Filter": default IPreferenceKeys.DEFAULT_MAX_MRU
+ store.putDefaultInt(IPreferenceKeys.PREF_MAX_FILTER_MRU, IPreferenceKeys.DEFAULT_MAX_MRU);
+ // Maximum MRU list size "Content": default IPreferenceKeys.DEFAULT_MAX_MRU
+ store.putDefaultInt(IPreferenceKeys.PREF_MAX_CONTENT_MRU, IPreferenceKeys.DEFAULT_MAX_MRU);
+ // "Filter" MRU list: default empty
+ store.putDefaultString(IPreferenceKeys.PREF_FILTER_MRU_LIST, ""); //$NON-NLS-1$
+ // "Content" MRU list: default empty
+ store.putDefaultString(IPreferenceKeys.PREF_CONTENT_MRU_LIST, ""); //$NON-NLS-1$
+ // [Hidden] Hide categories navigator content extension: default on
+ store.putDefaultBoolean(IPreferenceKeys.PREF_HIDE_CATEGORY_EXTENSION, true);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/quickfilter/EditorQuickFilterTester.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/quickfilter/EditorQuickFilterTester.java
index d025e0cc6..2fde1982b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/quickfilter/EditorQuickFilterTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/quickfilter/EditorQuickFilterTester.java
@@ -1,64 +1,64 @@
-/*******************************************************************************
- * 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.ui.views.internal.quickfilter;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.tcf.te.core.interfaces.IFilterable;
-import org.eclipse.tcf.te.ui.views.editor.Editor;
-import org.eclipse.ui.forms.editor.IFormPage;
-
-/**
- * The tester to test if the current editor page is filterable.
- *
- */
-public class EditorQuickFilterTester extends PropertyTester {
-
- public EditorQuickFilterTester() {
- }
-
- /*
- * (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) {
- if (receiver instanceof Editor && "isEditorFilterable".equals(property)) { //$NON-NLS-1$
- Editor editor = (Editor) receiver;
- IFormPage page = editor.getActivePageInstance();
- if (page != null) {
- TreeViewer viewer = (TreeViewer) page.getAdapter(TreeViewer.class);
- if (viewer != null) {
- Object input = viewer.getInput();
- return adaptFilterable(input) != null;
- }
- }
- }
- return false;
- }
-
- private IFilterable adaptFilterable(Object element) {
- IFilterable decorator = null;
- if (element instanceof IFilterable) {
- decorator = (IFilterable) element;
- }
- if (decorator == null && element instanceof IAdaptable) {
- decorator = (IFilterable) ((IAdaptable) element).getAdapter(IFilterable.class);
- }
- if (decorator == null && element != null) {
- decorator = (IFilterable) Platform.getAdapterManager()
- .getAdapter(element, IFilterable.class);
- }
- return decorator;
- }
-
-}
+/*******************************************************************************
+ * 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.ui.views.internal.quickfilter;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.tcf.te.core.interfaces.IFilterable;
+import org.eclipse.tcf.te.ui.views.editor.Editor;
+import org.eclipse.ui.forms.editor.IFormPage;
+
+/**
+ * The tester to test if the current editor page is filterable.
+ *
+ */
+public class EditorQuickFilterTester extends PropertyTester {
+
+ public EditorQuickFilterTester() {
+ }
+
+ /*
+ * (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) {
+ if (receiver instanceof Editor && "isEditorFilterable".equals(property)) { //$NON-NLS-1$
+ Editor editor = (Editor) receiver;
+ IFormPage page = editor.getActivePageInstance();
+ if (page != null) {
+ TreeViewer viewer = (TreeViewer) page.getAdapter(TreeViewer.class);
+ if (viewer != null) {
+ Object input = viewer.getInput();
+ return adaptFilterable(input) != null;
+ }
+ }
+ }
+ return false;
+ }
+
+ private IFilterable adaptFilterable(Object element) {
+ IFilterable decorator = null;
+ if (element instanceof IFilterable) {
+ decorator = (IFilterable) element;
+ }
+ if (decorator == null && element instanceof IAdaptable) {
+ decorator = (IFilterable) ((IAdaptable) element).getAdapter(IFilterable.class);
+ }
+ if (decorator == null && element != null) {
+ decorator = (IFilterable) Platform.getAdapterManager()
+ .getAdapter(element, IFilterable.class);
+ }
+ return decorator;
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/services/MenuService.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/services/MenuService.java
index b0978eab8..09a13efda 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/services/MenuService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/internal/services/MenuService.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.ui.views.internal.services;
-
-import org.eclipse.tcf.te.runtime.services.AbstractService;
-import org.eclipse.tcf.te.runtime.services.interfaces.IMenuService;
-import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
-
-/**
- * Menu service implementation.
- */
-public class MenuService extends AbstractService implements IMenuService {
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.services.interfaces.IMenuService#isVisible(java.lang.Object, java.lang.String)
- */
- @Override
- public boolean isVisible(Object context, String contributionID) {
-
- if (context instanceof ICategory) {
- if (contributionID.endsWith("menu.showIn")) { //$NON-NLS-1$
- return false;
- }
- if (contributionID.endsWith("file.import") || contributionID.endsWith("file.export")) { //$NON-NLS-1$ //$NON-NLS-2$
- return false;
- }
- }
-
- return true;
- }
-
-}
+/*******************************************************************************
+ * 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.ui.views.internal.services;
+
+import org.eclipse.tcf.te.runtime.services.AbstractService;
+import org.eclipse.tcf.te.runtime.services.interfaces.IMenuService;
+import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
+
+/**
+ * Menu service implementation.
+ */
+public class MenuService extends AbstractService implements IMenuService {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.services.interfaces.IMenuService#isVisible(java.lang.Object, java.lang.String)
+ */
+ @Override
+ public boolean isVisible(Object context, String contributionID) {
+
+ if (context instanceof ICategory) {
+ if (contributionID.endsWith("menu.showIn")) { //$NON-NLS-1$
+ return false;
+ }
+ if (contributionID.endsWith("file.import") || contributionID.endsWith("file.export")) { //$NON-NLS-1$ //$NON-NLS-2$
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/listeners/WorkbenchWindowListener.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/listeners/WorkbenchWindowListener.java
index 95d0d1a2d..a89aad722 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/listeners/WorkbenchWindowListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/listeners/WorkbenchWindowListener.java
@@ -1,36 +1,36 @@
-/*******************************************************************************
- * 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.ui.views.listeners;
-
-import org.eclipse.ui.IPartListener2;
-import org.eclipse.ui.IPerspectiveListener;
-
-/**
- * The window listener implementation. Takes care of the
- * management of the global listeners per workbench window.
- */
-public class WorkbenchWindowListener extends AbstractWindowListener {
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.listeners.AbstractWindowListener#createPartListener()
- */
- @Override
- protected IPartListener2 createPartListener() {
- return new WorkbenchPartListener();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.ui.views.listeners.AbstractWindowListener#createPerspectiveListener()
- */
- @Override
- protected IPerspectiveListener createPerspectiveListener() {
- return new WorkbenchPerspectiveListener();
- }
-}
+/*******************************************************************************
+ * 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.ui.views.listeners;
+
+import org.eclipse.ui.IPartListener2;
+import org.eclipse.ui.IPerspectiveListener;
+
+/**
+ * The window listener implementation. Takes care of the
+ * management of the global listeners per workbench window.
+ */
+public class WorkbenchWindowListener extends AbstractWindowListener {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.listeners.AbstractWindowListener#createPartListener()
+ */
+ @Override
+ protected IPartListener2 createPartListener() {
+ return new WorkbenchPartListener();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.listeners.AbstractWindowListener#createPerspectiveListener()
+ */
+ @Override
+ protected IPerspectiveListener createPerspectiveListener() {
+ return new WorkbenchPerspectiveListener();
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/LabelProviderDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/LabelProviderDelegate.java
index a6fd279a2..b1a19922c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/LabelProviderDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/LabelProviderDelegate.java
@@ -1,50 +1,50 @@
-/*******************************************************************************
- * 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.ui.views.navigator;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
-import org.eclipse.tcf.te.ui.views.navigator.nodes.NewWizardNode;
-
-/**
- * Category label provider delegate implementation.
- */
-public class LabelProviderDelegate extends LabelProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
- */
- @Override
- public String getText(Object element) {
- if (element instanceof ICategory) {
- return ((ICategory)element).getLabel();
- }
- if (element instanceof NewWizardNode) {
- return ((NewWizardNode)element).getLabel();
- }
-
- return super.getText(element);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
- */
- @Override
- public Image getImage(Object element) {
- if (element instanceof ICategory) {
- return ((ICategory)element).getImage();
- }
- if (element instanceof NewWizardNode) {
- return ((NewWizardNode)element).getImage();
- }
- return super.getImage(element);
- }
-}
+/*******************************************************************************
+ * 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.ui.views.navigator;
+
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
+import org.eclipse.tcf.te.ui.views.navigator.nodes.NewWizardNode;
+
+/**
+ * Category label provider delegate implementation.
+ */
+public class LabelProviderDelegate extends LabelProvider {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
+ */
+ @Override
+ public String getText(Object element) {
+ if (element instanceof ICategory) {
+ return ((ICategory)element).getLabel();
+ }
+ if (element instanceof NewWizardNode) {
+ return ((NewWizardNode)element).getLabel();
+ }
+
+ return super.getText(element);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
+ */
+ @Override
+ public Image getImage(Object element) {
+ if (element instanceof ICategory) {
+ return ((ICategory)element).getImage();
+ }
+ if (element instanceof NewWizardNode) {
+ return ((NewWizardNode)element).getImage();
+ }
+ return super.getImage(element);
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/ViewerContentProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/ViewerContentProvider.java
index 9d4eeaad9..cc013650b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/ViewerContentProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/ViewerContentProvider.java
@@ -1,126 +1,126 @@
-/*******************************************************************************
- * 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.ui.views.navigator;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.tcf.te.ui.views.extensions.CategoriesExtensionPointManager;
-import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
-import org.eclipse.tcf.te.ui.views.interfaces.IRoot;
-import org.eclipse.tcf.te.ui.views.internal.ViewRoot;
-import org.eclipse.tcf.te.ui.views.navigator.nodes.NewWizardNode;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.navigator.ICommonContentExtensionSite;
-import org.eclipse.ui.navigator.ICommonContentProvider;
-
-/**
- * Category content provider delegate implementation.
- */
-public class ViewerContentProvider implements ICommonContentProvider {
- private final static Object[] NO_ELEMENTS = new Object[0];
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- */
- @Override
- public Object[] getChildren(Object parentElement) {
- Object[] children = NO_ELEMENTS;
-
- if (parentElement == null || parentElement instanceof IRoot) {
- // Get all contributed categories if there are any
- ICategory[] categories = CategoriesExtensionPointManager.getInstance().getCategories(false);
- // Filter out possible hidden categories
- List<ICategory> visibleCategories = new ArrayList<ICategory>();
- for (ICategory category : categories) {
- // If the category is not enabled by expression --> not shown
- if (!category.isEnabled()) continue;
- // Add category to the list of visible categories
- visibleCategories.add(category);
- }
-
- children = visibleCategories.toArray(new ICategory[visibleCategories.size()]);
- }
- if (parentElement instanceof ICategory) {
- children = ((ICategory)parentElement).getChildren();
- }
-
- return children;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- */
- @Override
- public Object getParent(Object element) {
- if (element instanceof ICategory) {
- return ViewRoot.getInstance();
- }
- if (element instanceof NewWizardNode) {
- return ((NewWizardNode)element).getParent();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- */
- @Override
- public boolean hasChildren(Object element) {
- if (element instanceof ICategory) {
- return ((ICategory)element).getChildren() != null;
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.Object)
- */
- @Override
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- @Override
- public void dispose() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- @Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.ICommonContentProvider#init(org.eclipse.ui.navigator.ICommonContentExtensionSite)
- */
- @Override
- public void init(ICommonContentExtensionSite aConfig) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.IMementoAware#restoreState(org.eclipse.ui.IMemento)
- */
- @Override
- public void restoreState(IMemento aMemento) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.navigator.IMementoAware#saveState(org.eclipse.ui.IMemento)
- */
- @Override
- public void saveState(IMemento aMemento) {
- }
-}
+/*******************************************************************************
+ * 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.ui.views.navigator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.tcf.te.ui.views.extensions.CategoriesExtensionPointManager;
+import org.eclipse.tcf.te.ui.views.interfaces.ICategory;
+import org.eclipse.tcf.te.ui.views.interfaces.IRoot;
+import org.eclipse.tcf.te.ui.views.internal.ViewRoot;
+import org.eclipse.tcf.te.ui.views.navigator.nodes.NewWizardNode;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.navigator.ICommonContentExtensionSite;
+import org.eclipse.ui.navigator.ICommonContentProvider;
+
+/**
+ * Category content provider delegate implementation.
+ */
+public class ViewerContentProvider implements ICommonContentProvider {
+ private final static Object[] NO_ELEMENTS = new Object[0];
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
+ */
+ @Override
+ public Object[] getChildren(Object parentElement) {
+ Object[] children = NO_ELEMENTS;
+
+ if (parentElement == null || parentElement instanceof IRoot) {
+ // Get all contributed categories if there are any
+ ICategory[] categories = CategoriesExtensionPointManager.getInstance().getCategories(false);
+ // Filter out possible hidden categories
+ List<ICategory> visibleCategories = new ArrayList<ICategory>();
+ for (ICategory category : categories) {
+ // If the category is not enabled by expression --> not shown
+ if (!category.isEnabled()) continue;
+ // Add category to the list of visible categories
+ visibleCategories.add(category);
+ }
+
+ children = visibleCategories.toArray(new ICategory[visibleCategories.size()]);
+ }
+ if (parentElement instanceof ICategory) {
+ children = ((ICategory)parentElement).getChildren();
+ }
+
+ return children;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
+ */
+ @Override
+ public Object getParent(Object element) {
+ if (element instanceof ICategory) {
+ return ViewRoot.getInstance();
+ }
+ if (element instanceof NewWizardNode) {
+ return ((NewWizardNode)element).getParent();
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
+ */
+ @Override
+ public boolean hasChildren(Object element) {
+ if (element instanceof ICategory) {
+ return ((ICategory)element).getChildren() != null;
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.Object)
+ */
+ @Override
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ @Override
+ public void dispose() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.navigator.ICommonContentProvider#init(org.eclipse.ui.navigator.ICommonContentExtensionSite)
+ */
+ @Override
+ public void init(ICommonContentExtensionSite aConfig) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.navigator.IMementoAware#restoreState(org.eclipse.ui.IMemento)
+ */
+ @Override
+ public void restoreState(IMemento aMemento) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.navigator.IMementoAware#saveState(org.eclipse.ui.IMemento)
+ */
+ @Override
+ public void saveState(IMemento aMemento) {
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/nodes/NewWizardNode.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/nodes/NewWizardNode.java
index a7a4f0830..6fd578290 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/nodes/NewWizardNode.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/navigator/nodes/NewWizardNode.java
@@ -2,7 +2,7 @@
* NewWizardNode.java
* Created on 28.06.2012
*
- * Copyright (c) 2012 Wind River Systems, Inc.
+ * 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
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/nls/Messages.java
index 5976a46ab..a6cb81811 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/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.ui.views/src/org/eclipse/tcf/te/ui/views/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/nls/Messages.properties
index d5e0eae10..f39f0ecd9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/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.ui.views/src/org/eclipse/tcf/te/ui/views/perspective/PerspectiveFactory.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/perspective/PerspectiveFactory.java
index 1ef502056..8ac85753d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/perspective/PerspectiveFactory.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/perspective/PerspectiveFactory.java
@@ -1,77 +1,77 @@
-/*******************************************************************************
- * 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.ui.views.perspective;
-
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-import org.eclipse.ui.IPlaceholderFolderLayout;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Perspective factory.
- */
-public class PerspectiveFactory extends PlatformObject implements IPerspectiveFactory {
- private final static String[] VIEWS_FOR_LEFT_AREA = new String[] {
- "org.eclipse.tcf.te.ui.views.View", //$NON-NLS-1$
- "org.eclipse.ui.navigator.ProjectExplorer" //$NON-NLS-1$
- };
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
- */
- @Override
- public void createInitialLayout(IPageLayout layout) {
- // editor is placed for free
- String editorArea = layout.getEditorArea();
-
- boolean leftAreaActive = false;
- for (String viewId : VIEWS_FOR_LEFT_AREA) {
- leftAreaActive |= PlatformUI.getWorkbench().getViewRegistry().find(viewId) != null;
- if (leftAreaActive) break;
- }
-
- if (leftAreaActive) {
- // place resource navigator to the left of editor area
- IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT, 0.3f, editorArea); //$NON-NLS-1$
-
- for (String viewId : VIEWS_FOR_LEFT_AREA) {
- if (PlatformUI.getWorkbench().getViewRegistry().find(viewId) != null) {
- left.addView(viewId);
- }
- }
- } else {
- layout.createPlaceholderFolder("left", IPageLayout.LEFT, 0.3f, editorArea); //$NON-NLS-1$
- }
-
- // place debug view and script pad to the left bottom
- IPlaceholderFolderLayout leftbottom = layout.createPlaceholderFolder("leftbottom", IPageLayout.BOTTOM, (float)0.60, "left");//$NON-NLS-1$ //$NON-NLS-2$
- if (PlatformUI.getWorkbench().getViewRegistry().find("org.eclipse.debug.ui.DebugView") != null) //$NON-NLS-1$
- leftbottom.addPlaceholder("org.eclipse.debug.ui.DebugView"); //$NON-NLS-1$
- if (PlatformUI.getWorkbench().getViewRegistry().find("org.eclipse.tcf.te.tcf.ui.views.scriptpad") != null) //$NON-NLS-1$
- leftbottom.addPlaceholder("org.eclipse.tcf.te.tcf.ui.views.scriptpad"); //$NON-NLS-1$
-
- // place console below the main editor
- IFolderLayout lowerRight = layout.createFolder("lowerRight", IPageLayout.BOTTOM, 0.7f, editorArea); //$NON-NLS-1$
- if (PlatformUI.getWorkbench().getViewRegistry().find("org.eclipse.pde.runtime.LogView") != null) //$NON-NLS-1$
- lowerRight.addView("org.eclipse.pde.runtime.LogView"); //$NON-NLS-1$
- if (PlatformUI.getWorkbench().getViewRegistry().find("org.eclipse.ui.views.TaskList") != null) //$NON-NLS-1$
- lowerRight.addPlaceholder("org.eclipse.ui.views.TaskList"); //$NON-NLS-1$
- if (PlatformUI.getWorkbench().getViewRegistry().find("org.eclipse.ui.views.PropertySheet") != null) //$NON-NLS-1$
- lowerRight.addPlaceholder("org.eclipse.ui.views.PropertySheet"); //$NON-NLS-1$
-
- // place details view port to the right of editor area
- IPlaceholderFolderLayout right = layout.createPlaceholderFolder("right", IPageLayout.RIGHT, 0.75f, editorArea); //$NON-NLS-1$
- if (PlatformUI.getWorkbench().getViewRegistry().find(IPageLayout.ID_OUTLINE) != null)
- right.addPlaceholder(IPageLayout.ID_OUTLINE);
- }
-
-}
+/*******************************************************************************
+ * 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.ui.views.perspective;
+
+import org.eclipse.core.runtime.PlatformObject;
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+import org.eclipse.ui.IPlaceholderFolderLayout;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Perspective factory.
+ */
+public class PerspectiveFactory extends PlatformObject implements IPerspectiveFactory {
+ private final static String[] VIEWS_FOR_LEFT_AREA = new String[] {
+ "org.eclipse.tcf.te.ui.views.View", //$NON-NLS-1$
+ "org.eclipse.ui.navigator.ProjectExplorer" //$NON-NLS-1$
+ };
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
+ */
+ @Override
+ public void createInitialLayout(IPageLayout layout) {
+ // editor is placed for free
+ String editorArea = layout.getEditorArea();
+
+ boolean leftAreaActive = false;
+ for (String viewId : VIEWS_FOR_LEFT_AREA) {
+ leftAreaActive |= PlatformUI.getWorkbench().getViewRegistry().find(viewId) != null;
+ if (leftAreaActive) break;
+ }
+
+ if (leftAreaActive) {
+ // place resource navigator to the left of editor area
+ IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT, 0.3f, editorArea); //$NON-NLS-1$
+
+ for (String viewId : VIEWS_FOR_LEFT_AREA) {
+ if (PlatformUI.getWorkbench().getViewRegistry().find(viewId) != null) {
+ left.addView(viewId);
+ }
+ }
+ } else {
+ layout.createPlaceholderFolder("left", IPageLayout.LEFT, 0.3f, editorArea); //$NON-NLS-1$
+ }
+
+ // place debug view and script pad to the left bottom
+ IPlaceholderFolderLayout leftbottom = layout.createPlaceholderFolder("leftbottom", IPageLayout.BOTTOM, (float)0.60, "left");//$NON-NLS-1$ //$NON-NLS-2$
+ if (PlatformUI.getWorkbench().getViewRegistry().find("org.eclipse.debug.ui.DebugView") != null) //$NON-NLS-1$
+ leftbottom.addPlaceholder("org.eclipse.debug.ui.DebugView"); //$NON-NLS-1$
+ if (PlatformUI.getWorkbench().getViewRegistry().find("org.eclipse.tcf.te.tcf.ui.views.scriptpad") != null) //$NON-NLS-1$
+ leftbottom.addPlaceholder("org.eclipse.tcf.te.tcf.ui.views.scriptpad"); //$NON-NLS-1$
+
+ // place console below the main editor
+ IFolderLayout lowerRight = layout.createFolder("lowerRight", IPageLayout.BOTTOM, 0.7f, editorArea); //$NON-NLS-1$
+ if (PlatformUI.getWorkbench().getViewRegistry().find("org.eclipse.pde.runtime.LogView") != null) //$NON-NLS-1$
+ lowerRight.addView("org.eclipse.pde.runtime.LogView"); //$NON-NLS-1$
+ if (PlatformUI.getWorkbench().getViewRegistry().find("org.eclipse.ui.views.TaskList") != null) //$NON-NLS-1$
+ lowerRight.addPlaceholder("org.eclipse.ui.views.TaskList"); //$NON-NLS-1$
+ if (PlatformUI.getWorkbench().getViewRegistry().find("org.eclipse.ui.views.PropertySheet") != null) //$NON-NLS-1$
+ lowerRight.addPlaceholder("org.eclipse.ui.views.PropertySheet"); //$NON-NLS-1$
+
+ // place details view port to the right of editor area
+ IPlaceholderFolderLayout right = layout.createPlaceholderFolder("right", IPageLayout.RIGHT, 0.75f, editorArea); //$NON-NLS-1$
+ if (PlatformUI.getWorkbench().getViewRegistry().find(IPageLayout.ID_OUTLINE) != null)
+ right.addPlaceholder(IPageLayout.ID_OUTLINE);
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.ui/plugin.properties
index 03237be43..c977f3b43 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/plugin.properties
@@ -1,65 +1,65 @@
-##################################################################################
-# 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, Common UI and Helper
-providerName = Eclipse.org - Target Explorer
-
-# ***** Extension Points *****
-
-extension-point.newWizards.name = New Wizards
-extension-point.wizardProviders.name=New Wizard Providers
-extension-point.viewers.name = Tree Viewer Extension
-extension-point.cellEditors.name = Common Viewer Cell Editors
-
-# ***** Views *****
-
-ViewCategory.name=Target Explorer Views
-
-# ***** Wizards *****
-
-NewWizards.category.name=General
-
-# ***** Context and binding contributions *****
-
-context.view.name=In Target Explorer View
-context.view.description=The Target Explorer view is active
-
-context.editor.name=In Target Explorer Editor
-context.editor.description=The Target Explorer properties editor is active
-
-# ***** Command contributions *****
-command.category.name=Target Explorer Commands
-
-command.newWizards.name=New Target
-command.newWizards.description=Open the New target wizard
-
-command.refresh.name=Refresh
-command.refresh.description=Refresh the selected node
-
-command.showConsoleView.name=Show Console View Command
-command.showConsoleView.description=Shows the Console View
-
-command.connect.name=Connect
-command.connect.description=Connect the selected node
-
-command.disconnect.name=Disconnect
-command.disconnect.description=Disconnect the selected node
-
-# ***** Status Handler *****
-
-DefaultStatusHandler.label=Default Status Handler
-
-# ***** Executors / Executor Utility Delegates *****
-
-SWTDisplayExecutorUtilDelegate.label=SWT Display Executor Utility Delegate
-
-# ***** Preference Pages *****
-
-preference.page.name=Target Explorer
+##################################################################################
+# 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, Common UI and Helper
+providerName = Eclipse.org - Target Explorer
+
+# ***** Extension Points *****
+
+extension-point.newWizards.name = New Wizards
+extension-point.wizardProviders.name=New Wizard Providers
+extension-point.viewers.name = Tree Viewer Extension
+extension-point.cellEditors.name = Common Viewer Cell Editors
+
+# ***** Views *****
+
+ViewCategory.name=Target Explorer Views
+
+# ***** Wizards *****
+
+NewWizards.category.name=General
+
+# ***** Context and binding contributions *****
+
+context.view.name=In Target Explorer View
+context.view.description=The Target Explorer view is active
+
+context.editor.name=In Target Explorer Editor
+context.editor.description=The Target Explorer properties editor is active
+
+# ***** Command contributions *****
+command.category.name=Target Explorer Commands
+
+command.newWizards.name=New Target
+command.newWizards.description=Open the New target wizard
+
+command.refresh.name=Refresh
+command.refresh.description=Refresh the selected node
+
+command.showConsoleView.name=Show Console View Command
+command.showConsoleView.description=Shows the Console View
+
+command.connect.name=Connect
+command.connect.description=Connect the selected node
+
+command.disconnect.name=Disconnect
+command.disconnect.description=Disconnect the selected node
+
+# ***** Status Handler *****
+
+DefaultStatusHandler.label=Default Status Handler
+
+# ***** Executors / Executor Utility Delegates *****
+
+SWTDisplayExecutorUtilDelegate.label=SWT Display Executor Utility Delegate
+
+# ***** Preference Pages *****
+
+preference.page.name=Target Explorer
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/activator/UIPlugin.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/activator/UIPlugin.java
index 66e122647..ff851eae7 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/activator/UIPlugin.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/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.ui/src/org/eclipse/tcf/te/ui/dialogs/NameValuePairDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/NameValuePairDialog.java
index ebcd36ed0..da32cece1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/NameValuePairDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/NameValuePairDialog.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.ui/src/org/eclipse/tcf/te/ui/dialogs/RenameDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/RenameDialog.java
index ee390573b..dc3e086b5 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/RenameDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/RenameDialog.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.ui/src/org/eclipse/tcf/te/ui/events/AbstractEventListener.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/events/AbstractEventListener.java
index 6ea83a75d..7af4c5909 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/events/AbstractEventListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/events/AbstractEventListener.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.ui/src/org/eclipse/tcf/te/ui/help/IContextHelpIds.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/help/IContextHelpIds.java
index 481d65ba9..45e5e8e70 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/help/IContextHelpIds.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/help/IContextHelpIds.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.ui/src/org/eclipse/tcf/te/ui/interfaces/ImageConsts.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/ImageConsts.java
index 812f003ef..a3950f820 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/ImageConsts.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/ImageConsts.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.ui/src/org/eclipse/tcf/te/ui/interfaces/handler/IDeleteHandlerDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/handler/IDeleteHandlerDelegate.java
index 829031c42..0acb16713 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/handler/IDeleteHandlerDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/handler/IDeleteHandlerDelegate.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.ui/src/org/eclipse/tcf/te/ui/interfaces/handler/IEditorHandlerDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/handler/IEditorHandlerDelegate.java
index 810b363a6..ce66538f1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/handler/IEditorHandlerDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/handler/IEditorHandlerDelegate.java
@@ -1,33 +1,33 @@
-/*******************************************************************************
- * 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.ui.interfaces.handler;
-
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * IEditorHandlerDelegate
- */
-public interface IEditorHandlerDelegate {
-
- /**
- * Get a valid editor input for the given element.
- * @param element The selected element.
- * @return The editor input.
- */
- public IEditorInput getEditorInput(Object element);
-
- /**
- * Action that should be done after the editor was opened.
- * @param element The selected element.
- */
- public void postOpenEditor(IEditorPart editor, Object element);
-}
+/*******************************************************************************
+ * 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.ui.interfaces.handler;
+
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+
+/**
+ * IEditorHandlerDelegate
+ */
+public interface IEditorHandlerDelegate {
+
+ /**
+ * Get a valid editor input for the given element.
+ * @param element The selected element.
+ * @return The editor input.
+ */
+ public IEditorInput getEditorInput(Object element);
+
+ /**
+ * Action that should be done after the editor was opened.
+ * @param element The selected element.
+ */
+ public void postOpenEditor(IEditorPart editor, Object element);
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/internal/utils/TablePatternFilter.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/internal/utils/TablePatternFilter.java
index e094d8c7b..9a2074d1b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/internal/utils/TablePatternFilter.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/internal/utils/TablePatternFilter.java
@@ -1,125 +1,125 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012, 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.ui.internal.utils;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.tcf.te.ui.utils.StringMatcher;
-
-/**
- * The viewer filter to select those elements which matches the given filter pattern.
- * <p>
- * Copied from org.eclipse.ui.internal.navigator.filters.CommonFiltersTab$TablePatternFilter
- */
-public class TablePatternFilter extends ViewerFilter {
- private static final String ALL = "*"; //$NON-NLS-1$
-
- protected StringMatcher matcher = null;
- protected ILabelProvider labelProvider;
- protected List<PropertyChangeListener> listeners;
- protected String pattern;
-
- public TablePatternFilter(ILabelProvider labelProvider) {
- this.labelProvider = labelProvider;
- listeners = Collections.synchronizedList(new ArrayList<PropertyChangeListener>());
- }
-
- /**
- * Add a property change listener to this pattern filter.
- *
- * @param l The listener.
- */
- public void addPropertyChangeListener(PropertyChangeListener l) {
- listeners.add(l);
- }
-
- /**
- * Remove a property change listener to this pattern filter.
- *
- * @param l The listener.
- */
- public void removePropertyChangeListener(PropertyChangeListener l) {
- listeners.remove(l);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer,
- * java.lang.Object, java.lang.Object)
- */
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- return match(labelProvider.getText(element));
- }
-
- /**
- * Set a new pattern to filter elements.
- *
- * @param newPattern The new pattern
- */
- public void setPattern(String newPattern) {
- StringMatcher old = matcher;
- pattern = newPattern;
- if (newPattern == null || newPattern.trim().length() == 0) {
- matcher = null;
- }
- else {
- String patternString = ALL + newPattern + ALL;
- matcher = new StringMatcher(patternString, true, false);
- }
- firePatternChangedEvent(old, matcher);
- }
-
- /**
- * Fire a pattern changed event to all listening listeners.
- *
- * @param oldMatcher The old matcher.
- * @param newMatcher The new matcher.
- */
- protected void firePatternChangedEvent(StringMatcher oldMatcher, StringMatcher newMatcher) {
- PropertyChangeEvent event = new PropertyChangeEvent(this, "pattern", oldMatcher, newMatcher); //$NON-NLS-1$
- synchronized(listeners) {
- for(PropertyChangeListener listener : listeners) {
- listener.propertyChange(event);
- }
- }
- }
-
- /**
- * Get the filter text typed by the end user.
- *
- * @return The current filter text.
- */
- public String getFilterText() {
- return pattern;
- }
-
- /**
- * Answers whether the given String matches the pattern.
- *
- * @param input the String to test
- *
- * @return whether the string matches the pattern
- */
- public boolean match(String input) {
- if (input == null) {
- return false;
- }
- return matcher == null || matcher.match(input);
- }
+/*******************************************************************************
+ * Copyright (c) 2006, 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.ui.internal.utils;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.tcf.te.ui.utils.StringMatcher;
+
+/**
+ * The viewer filter to select those elements which matches the given filter pattern.
+ * <p>
+ * Copied from org.eclipse.ui.internal.navigator.filters.CommonFiltersTab$TablePatternFilter
+ */
+public class TablePatternFilter extends ViewerFilter {
+ private static final String ALL = "*"; //$NON-NLS-1$
+
+ protected StringMatcher matcher = null;
+ protected ILabelProvider labelProvider;
+ protected List<PropertyChangeListener> listeners;
+ protected String pattern;
+
+ public TablePatternFilter(ILabelProvider labelProvider) {
+ this.labelProvider = labelProvider;
+ listeners = Collections.synchronizedList(new ArrayList<PropertyChangeListener>());
+ }
+
+ /**
+ * Add a property change listener to this pattern filter.
+ *
+ * @param l The listener.
+ */
+ public void addPropertyChangeListener(PropertyChangeListener l) {
+ listeners.add(l);
+ }
+
+ /**
+ * Remove a property change listener to this pattern filter.
+ *
+ * @param l The listener.
+ */
+ public void removePropertyChangeListener(PropertyChangeListener l) {
+ listeners.remove(l);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer,
+ * java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ return match(labelProvider.getText(element));
+ }
+
+ /**
+ * Set a new pattern to filter elements.
+ *
+ * @param newPattern The new pattern
+ */
+ public void setPattern(String newPattern) {
+ StringMatcher old = matcher;
+ pattern = newPattern;
+ if (newPattern == null || newPattern.trim().length() == 0) {
+ matcher = null;
+ }
+ else {
+ String patternString = ALL + newPattern + ALL;
+ matcher = new StringMatcher(patternString, true, false);
+ }
+ firePatternChangedEvent(old, matcher);
+ }
+
+ /**
+ * Fire a pattern changed event to all listening listeners.
+ *
+ * @param oldMatcher The old matcher.
+ * @param newMatcher The new matcher.
+ */
+ protected void firePatternChangedEvent(StringMatcher oldMatcher, StringMatcher newMatcher) {
+ PropertyChangeEvent event = new PropertyChangeEvent(this, "pattern", oldMatcher, newMatcher); //$NON-NLS-1$
+ synchronized(listeners) {
+ for(PropertyChangeListener listener : listeners) {
+ listener.propertyChange(event);
+ }
+ }
+ }
+
+ /**
+ * Get the filter text typed by the end user.
+ *
+ * @return The current filter text.
+ */
+ public String getFilterText() {
+ return pattern;
+ }
+
+ /**
+ * Answers whether the given String matches the pattern.
+ *
+ * @param input the String to test
+ *
+ * @return whether the string matches the pattern
+ */
+ public boolean match(String input) {
+ if (input == null) {
+ return false;
+ }
+ return matcher == null || matcher.match(input);
+ }
} \ No newline at end of file
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/internal/utils/TreeViewerSearchDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/internal/utils/TreeViewerSearchDialog.java
index 0dc464666..f789ee909 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/internal/utils/TreeViewerSearchDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/internal/utils/TreeViewerSearchDialog.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.ui/src/org/eclipse/tcf/te/ui/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/nls/Messages.java
index 897e33a23..239ba9f05 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/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.ui/src/org/eclipse/tcf/te/ui/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/nls/Messages.properties
index a1fcd60ec..4ab4ea01f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/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.ui/src/org/eclipse/tcf/te/ui/tables/properties/NodePropertiesTableControl.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/tables/properties/NodePropertiesTableControl.java
index bd13ac330..7fa8c3d61 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/tables/properties/NodePropertiesTableControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/tables/properties/NodePropertiesTableControl.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.ui/src/org/eclipse/tcf/te/ui/trees/ColumnDescriptor.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/ColumnDescriptor.java
index 3edf7e5b9..946cd7105 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/ColumnDescriptor.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/ColumnDescriptor.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.ui/src/org/eclipse/tcf/te/ui/trees/Pending.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/Pending.java
index bdd8615cc..b4b20ffad 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/Pending.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/Pending.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.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerEditorActivationStrategy.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerEditorActivationStrategy.java
index 16821fdf6..f8ba8bc3f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerEditorActivationStrategy.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerEditorActivationStrategy.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.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerExtension.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerExtension.java
index 71d675a23..71d80c18c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerExtension.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerExtension.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.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerHeaderMenu.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerHeaderMenu.java
index acbc5bade..7e2f9b2fd 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerHeaderMenu.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerHeaderMenu.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.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerSorter.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerSorter.java
index f6bd0d998..944a29333 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerSorter.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/trees/TreeViewerSorter.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.ui/src/org/eclipse/tcf/te/ui/utils/StringMatcher.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/utils/StringMatcher.java
index a5f678c3d..b875e12ff 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/utils/StringMatcher.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/utils/StringMatcher.java
@@ -1,493 +1,493 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2012, 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.ui.utils;
-
-import java.util.Vector;
-
-/**
- * A string pattern matcher, supporting "*" and "?" wild cards.
- * <p>
- * Copied from org.eclipse.ui.internal.navigator.StringMatcher
- */
-public class StringMatcher {
- protected String fPattern;
-
- protected int fLength; // pattern length
-
- protected boolean fIgnoreWildCards;
-
- protected boolean fIgnoreCase;
-
- protected boolean fHasLeadingStar;
-
- protected boolean fHasTrailingStar;
-
- protected String fSegments[]; // the given pattern is split into *
-
- // separated segments
-
- /* boundary value beyond which we don't need to search in the text */
- protected int fBound = 0;
-
- protected static final char fSingleWildCard = '\u0000';
-
- /**
- *
- */
- static class Position {
- int start; // inclusive
-
- int end; // exclusive
-
- Position(int start, int end) {
- this.start = start;
- this.end = end;
- }
-
- int getStart() {
- return start;
- }
-
- int getEnd() {
- return end;
- }
- }
-
- /**
- * StringMatcher constructor takes in a String object that is a simple
- * pattern which may contain '*' for 0 and many characters and '?' for
- * exactly one character.
- *
- * Literal '*' and '?' characters must be escaped in the pattern e.g., "\*"
- * means literal "*", etc.
- *
- * Escaping any other character (including the escape character itself),
- * just results in that character in the pattern. e.g., "\a" means "a" and
- * "\\" means "\"
- *
- * If invoking the StringMatcher with string literals in Java, don't forget
- * escape characters are represented by "\\".
- *
- * @param pattern
- * the pattern to match text against
- * @param ignoreCase
- * if true, case is ignored
- * @param ignoreWildCards
- * if true, wild cards and their escape sequences are ignored
- * (everything is taken literally).
- */
- public StringMatcher(String pattern, boolean ignoreCase,
- boolean ignoreWildCards) {
- if (pattern == null) {
- throw new IllegalArgumentException();
- }
- fIgnoreCase = ignoreCase;
- fIgnoreWildCards = ignoreWildCards;
- fPattern = pattern;
- fLength = pattern.length();
-
- if (fIgnoreWildCards) {
- parseNoWildCards();
- } else {
- parseWildCards();
- }
- }
-
- /**
- * Find the first occurrence of the pattern between
- * <code>start</code)(inclusive)
- * and <code>end</code>(exclusive).
- * @param text the String object to search in
- * @param start the starting index of the search range, inclusive
- * @param end the ending index of the search range, exclusive
- * @return an <code>StringMatcher.Position</code> object that keeps the starting
- * (inclusive) and ending positions (exclusive) of the first occurrence of the
- * pattern in the specified range of the text; return null if not found or subtext
- * is empty (start==end). A pair of zeros is returned if pattern is empty string
- * Note that for pattern like "*abc*" with leading and trailing stars, position of "abc"
- * is returned. For a pattern like"*??*" in text "abcdf", (1,3) is returned
- */
- public StringMatcher.Position find(String text, int start, int end) {
- if (text == null) {
- throw new IllegalArgumentException();
- }
-
- int tlen = text.length();
- if (start < 0) {
- start = 0;
- }
- if (end > tlen) {
- end = tlen;
- }
- if (end < 0 || start >= end) {
- return null;
- }
- if (fLength == 0) {
- return new Position(start, start);
- }
- if (fIgnoreWildCards) {
- int x = posIn(text, start, end);
- if (x < 0) {
- return null;
- }
- return new Position(x, x + fLength);
- }
-
- int segCount = fSegments.length;
- if (segCount == 0) {
- return new Position(start, end);
- }
-
- int curPos = start;
- int matchStart = -1;
- int i;
- for (i = 0; i < segCount && curPos < end; ++i) {
- String current = fSegments[i];
- int nextMatch = regExpPosIn(text, curPos, end, current);
- if (nextMatch < 0) {
- return null;
- }
- if (i == 0) {
- matchStart = nextMatch;
- }
- curPos = nextMatch + current.length();
- }
- if (i < segCount) {
- return null;
- }
- return new Position(matchStart, curPos);
- }
-
- /**
- * match the given <code>text</code> with the pattern
- *
- * @return true if matched eitherwise false
- * @param text
- * a String object
- */
- public boolean match(String text) {
- if (text == null) {
- return false;
- }
- return match(text, 0, text.length());
- }
-
- /**
- * Given the starting (inclusive) and the ending (exclusive) positions in
- * the <code>text</code>, determine if the given substring matches with
- * aPattern
- *
- * @return true if the specified portion of the text matches the pattern
- * @param text
- * a String object that contains the substring to match
- * @param start
- * marks the starting position (inclusive) of the substring
- * @param end
- * marks the ending index (exclusive) of the substring
- */
- public boolean match(String text, int start, int end) {
- if (null == text) {
- throw new IllegalArgumentException();
- }
-
- if (start > end) {
- return false;
- }
-
- if (fIgnoreWildCards) {
- return (end - start == fLength)
- && fPattern.regionMatches(fIgnoreCase, 0, text, start,
- fLength);
- }
- int segCount = fSegments.length;
- if (segCount == 0 && (fHasLeadingStar || fHasTrailingStar)) {
- // contains
- // only
- // '*'(s)
- return true;
- }
- if (start == end) {
- return fLength == 0;
- }
- if (fLength == 0) {
- return start == end;
- }
-
- int tlen = text.length();
- if (start < 0) {
- start = 0;
- }
- if (end > tlen) {
- end = tlen;
- }
-
- int tCurPos = start;
- int bound = end - fBound;
- if (bound < 0) {
- return false;
- }
- int i = 0;
- String current = fSegments[i];
- int segLength = current.length();
-
- /* process first segment */
- if (!fHasLeadingStar) {
- if (!regExpRegionMatches(text, start, current, 0, segLength)) {
- return false;
- }
- ++i;
- tCurPos = tCurPos + segLength;
-
- }
- if ((fSegments.length == 1) && (!fHasLeadingStar)
- && (!fHasTrailingStar)) {
- // only one segment to match, no wildcards specified
- return tCurPos == end;
- }
- /* process middle segments */
- while (i < segCount) {
- current = fSegments[i];
- int currentMatch;
- int k = current.indexOf(fSingleWildCard);
- if (k < 0) {
- currentMatch = textPosIn(text, tCurPos, end, current);
- if (currentMatch < 0) {
- return false;
- }
- } else {
- currentMatch = regExpPosIn(text, tCurPos, end, current);
- if (currentMatch < 0) {
- return false;
- }
- }
- tCurPos = currentMatch + current.length();
- i++;
- }
-
- /* process final segment */
- if (!fHasTrailingStar && tCurPos != end) {
- int clen = current.length();
- return regExpRegionMatches(text, end - clen, current, 0, clen);
- }
- return i == segCount;
- }
-
- /**
- * This method parses the given pattern into segments seperated by wildcard
- * '*' characters. Since wildcards are not being used in this case, the
- * pattern consists of a single segment.
- */
- private void parseNoWildCards() {
- fSegments = new String[1];
- fSegments[0] = fPattern;
- fBound = fLength;
- }
-
- /**
- * Parses the given pattern into segments seperated by wildcard '*'
- * characters.
- *
- */
- private void parseWildCards() {
- if (fPattern.startsWith("*")) { //$NON-NLS-1$
- fHasLeadingStar = true;
- }
- if (fPattern.endsWith("*")) {//$NON-NLS-1$
- /* make sure it's not an escaped wildcard */
- if (fLength > 1 && fPattern.charAt(fLength - 2) != '\\') {
- fHasTrailingStar = true;
- }
- }
-
- Vector<Object> temp = new Vector<Object>();
-
- int pos = 0;
- StringBuffer buf = new StringBuffer();
- while (pos < fLength) {
- char c = fPattern.charAt(pos++);
- switch (c) {
- case '\\':
- if (pos >= fLength) {
- buf.append(c);
- } else {
- char next = fPattern.charAt(pos++);
- /* if it's an escape sequence */
- if (next == '*' || next == '?' || next == '\\') {
- buf.append(next);
- } else {
- /* not an escape sequence, just insert literally */
- buf.append(c);
- buf.append(next);
- }
- }
- break;
- case '*':
- if (buf.length() > 0) {
- /* new segment */
- temp.addElement(buf.toString());
- fBound += buf.length();
- buf.setLength(0);
- }
- break;
- case '?':
- /* append special character representing single match wildcard */
- buf.append(fSingleWildCard);
- break;
- default:
- buf.append(c);
- }
- }
-
- /* add last buffer to segment list */
- if (buf.length() > 0) {
- temp.addElement(buf.toString());
- fBound += buf.length();
- }
-
- fSegments = new String[temp.size()];
- temp.copyInto(fSegments);
- }
-
- /**
- * @param text
- * a string which contains no wildcard
- * @param start
- * the starting index in the text for search, inclusive
- * @param end
- * the stopping point of search, exclusive
- * @return the starting index in the text of the pattern , or -1 if not
- * found
- */
- protected int posIn(String text, int start, int end) {// no wild card in
- // pattern
- int max = end - fLength;
-
- if (!fIgnoreCase) {
- int i = text.indexOf(fPattern, start);
- if (i == -1 || i > max) {
- return -1;
- }
- return i;
- }
-
- for (int i = start; i <= max; ++i) {
- if (text.regionMatches(true, i, fPattern, 0, fLength)) {
- return i;
- }
- }
-
- return -1;
- }
-
- /**
- * @param text
- * a simple regular expression that may only contain '?'(s)
- * @param start
- * the starting index in the text for search, inclusive
- * @param end
- * the stopping point of search, exclusive
- * @param p
- * a simple regular expression that may contains '?'
- * @return the starting index in the text of the pattern , or -1 if not
- * found
- */
- protected int regExpPosIn(String text, int start, int end, String p) {
- int plen = p.length();
-
- int max = end - plen;
- for (int i = start; i <= max; ++i) {
- if (regExpRegionMatches(text, i, p, 0, plen)) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- *
- * @return boolean
- * @param text
- * a String to match
- * @param tStart
- * indicates the starting index of match, inclusive
- * @param p
- * a simple regular expression that may contain '?'
- * @param pStart
- * @param plen
- */
- protected boolean regExpRegionMatches(String text, int tStart, String p,
- int pStart, int plen) {
- while (plen-- > 0) {
- char tchar = text.charAt(tStart++);
- char pchar = p.charAt(pStart++);
-
- /* process wild cards */
- if (!fIgnoreWildCards) {
- /* skip single wild cards */
- if (pchar == fSingleWildCard) {
- continue;
- }
- }
- if (pchar == tchar) {
- continue;
- }
- if (fIgnoreCase) {
- if (Character.toUpperCase(tchar) == Character
- .toUpperCase(pchar)) {
- continue;
- }
- // comparing after converting to upper case doesn't handle all
- // cases;
- // also compare after converting to lower case
- if (Character.toLowerCase(tchar) == Character
- .toLowerCase(pchar)) {
- continue;
- }
- }
- return false;
- }
- return true;
- }
-
- /**
- * @param text
- * the string to match
- * @param start
- * the starting index in the text for search, inclusive
- * @param end
- * the stopping point of search, exclusive
- * @param p
- * a string that has no wildcard
- * @return the starting index in the text of the pattern , or -1 if not
- * found
- */
- protected int textPosIn(String text, int start, int end, String p) {
-
- int plen = p.length();
- int max = end - plen;
-
- if (!fIgnoreCase) {
- int i = text.indexOf(p, start);
- if (i == -1 || i > max) {
- return -1;
- }
- return i;
- }
-
- for (int i = start; i <= max; ++i) {
- if (text.regionMatches(true, i, p, 0, plen)) {
- return i;
- }
- }
-
- return -1;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2000, 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.ui.utils;
+
+import java.util.Vector;
+
+/**
+ * A string pattern matcher, supporting "*" and "?" wild cards.
+ * <p>
+ * Copied from org.eclipse.ui.internal.navigator.StringMatcher
+ */
+public class StringMatcher {
+ protected String fPattern;
+
+ protected int fLength; // pattern length
+
+ protected boolean fIgnoreWildCards;
+
+ protected boolean fIgnoreCase;
+
+ protected boolean fHasLeadingStar;
+
+ protected boolean fHasTrailingStar;
+
+ protected String fSegments[]; // the given pattern is split into *
+
+ // separated segments
+
+ /* boundary value beyond which we don't need to search in the text */
+ protected int fBound = 0;
+
+ protected static final char fSingleWildCard = '\u0000';
+
+ /**
+ *
+ */
+ static class Position {
+ int start; // inclusive
+
+ int end; // exclusive
+
+ Position(int start, int end) {
+ this.start = start;
+ this.end = end;
+ }
+
+ int getStart() {
+ return start;
+ }
+
+ int getEnd() {
+ return end;
+ }
+ }
+
+ /**
+ * StringMatcher constructor takes in a String object that is a simple
+ * pattern which may contain '*' for 0 and many characters and '?' for
+ * exactly one character.
+ *
+ * Literal '*' and '?' characters must be escaped in the pattern e.g., "\*"
+ * means literal "*", etc.
+ *
+ * Escaping any other character (including the escape character itself),
+ * just results in that character in the pattern. e.g., "\a" means "a" and
+ * "\\" means "\"
+ *
+ * If invoking the StringMatcher with string literals in Java, don't forget
+ * escape characters are represented by "\\".
+ *
+ * @param pattern
+ * the pattern to match text against
+ * @param ignoreCase
+ * if true, case is ignored
+ * @param ignoreWildCards
+ * if true, wild cards and their escape sequences are ignored
+ * (everything is taken literally).
+ */
+ public StringMatcher(String pattern, boolean ignoreCase,
+ boolean ignoreWildCards) {
+ if (pattern == null) {
+ throw new IllegalArgumentException();
+ }
+ fIgnoreCase = ignoreCase;
+ fIgnoreWildCards = ignoreWildCards;
+ fPattern = pattern;
+ fLength = pattern.length();
+
+ if (fIgnoreWildCards) {
+ parseNoWildCards();
+ } else {
+ parseWildCards();
+ }
+ }
+
+ /**
+ * Find the first occurrence of the pattern between
+ * <code>start</code)(inclusive)
+ * and <code>end</code>(exclusive).
+ * @param text the String object to search in
+ * @param start the starting index of the search range, inclusive
+ * @param end the ending index of the search range, exclusive
+ * @return an <code>StringMatcher.Position</code> object that keeps the starting
+ * (inclusive) and ending positions (exclusive) of the first occurrence of the
+ * pattern in the specified range of the text; return null if not found or subtext
+ * is empty (start==end). A pair of zeros is returned if pattern is empty string
+ * Note that for pattern like "*abc*" with leading and trailing stars, position of "abc"
+ * is returned. For a pattern like"*??*" in text "abcdf", (1,3) is returned
+ */
+ public StringMatcher.Position find(String text, int start, int end) {
+ if (text == null) {
+ throw new IllegalArgumentException();
+ }
+
+ int tlen = text.length();
+ if (start < 0) {
+ start = 0;
+ }
+ if (end > tlen) {
+ end = tlen;
+ }
+ if (end < 0 || start >= end) {
+ return null;
+ }
+ if (fLength == 0) {
+ return new Position(start, start);
+ }
+ if (fIgnoreWildCards) {
+ int x = posIn(text, start, end);
+ if (x < 0) {
+ return null;
+ }
+ return new Position(x, x + fLength);
+ }
+
+ int segCount = fSegments.length;
+ if (segCount == 0) {
+ return new Position(start, end);
+ }
+
+ int curPos = start;
+ int matchStart = -1;
+ int i;
+ for (i = 0; i < segCount && curPos < end; ++i) {
+ String current = fSegments[i];
+ int nextMatch = regExpPosIn(text, curPos, end, current);
+ if (nextMatch < 0) {
+ return null;
+ }
+ if (i == 0) {
+ matchStart = nextMatch;
+ }
+ curPos = nextMatch + current.length();
+ }
+ if (i < segCount) {
+ return null;
+ }
+ return new Position(matchStart, curPos);
+ }
+
+ /**
+ * match the given <code>text</code> with the pattern
+ *
+ * @return true if matched eitherwise false
+ * @param text
+ * a String object
+ */
+ public boolean match(String text) {
+ if (text == null) {
+ return false;
+ }
+ return match(text, 0, text.length());
+ }
+
+ /**
+ * Given the starting (inclusive) and the ending (exclusive) positions in
+ * the <code>text</code>, determine if the given substring matches with
+ * aPattern
+ *
+ * @return true if the specified portion of the text matches the pattern
+ * @param text
+ * a String object that contains the substring to match
+ * @param start
+ * marks the starting position (inclusive) of the substring
+ * @param end
+ * marks the ending index (exclusive) of the substring
+ */
+ public boolean match(String text, int start, int end) {
+ if (null == text) {
+ throw new IllegalArgumentException();
+ }
+
+ if (start > end) {
+ return false;
+ }
+
+ if (fIgnoreWildCards) {
+ return (end - start == fLength)
+ && fPattern.regionMatches(fIgnoreCase, 0, text, start,
+ fLength);
+ }
+ int segCount = fSegments.length;
+ if (segCount == 0 && (fHasLeadingStar || fHasTrailingStar)) {
+ // contains
+ // only
+ // '*'(s)
+ return true;
+ }
+ if (start == end) {
+ return fLength == 0;
+ }
+ if (fLength == 0) {
+ return start == end;
+ }
+
+ int tlen = text.length();
+ if (start < 0) {
+ start = 0;
+ }
+ if (end > tlen) {
+ end = tlen;
+ }
+
+ int tCurPos = start;
+ int bound = end - fBound;
+ if (bound < 0) {
+ return false;
+ }
+ int i = 0;
+ String current = fSegments[i];
+ int segLength = current.length();
+
+ /* process first segment */
+ if (!fHasLeadingStar) {
+ if (!regExpRegionMatches(text, start, current, 0, segLength)) {
+ return false;
+ }
+ ++i;
+ tCurPos = tCurPos + segLength;
+
+ }
+ if ((fSegments.length == 1) && (!fHasLeadingStar)
+ && (!fHasTrailingStar)) {
+ // only one segment to match, no wildcards specified
+ return tCurPos == end;
+ }
+ /* process middle segments */
+ while (i < segCount) {
+ current = fSegments[i];
+ int currentMatch;
+ int k = current.indexOf(fSingleWildCard);
+ if (k < 0) {
+ currentMatch = textPosIn(text, tCurPos, end, current);
+ if (currentMatch < 0) {
+ return false;
+ }
+ } else {
+ currentMatch = regExpPosIn(text, tCurPos, end, current);
+ if (currentMatch < 0) {
+ return false;
+ }
+ }
+ tCurPos = currentMatch + current.length();
+ i++;
+ }
+
+ /* process final segment */
+ if (!fHasTrailingStar && tCurPos != end) {
+ int clen = current.length();
+ return regExpRegionMatches(text, end - clen, current, 0, clen);
+ }
+ return i == segCount;
+ }
+
+ /**
+ * This method parses the given pattern into segments seperated by wildcard
+ * '*' characters. Since wildcards are not being used in this case, the
+ * pattern consists of a single segment.
+ */
+ private void parseNoWildCards() {
+ fSegments = new String[1];
+ fSegments[0] = fPattern;
+ fBound = fLength;
+ }
+
+ /**
+ * Parses the given pattern into segments seperated by wildcard '*'
+ * characters.
+ *
+ */
+ private void parseWildCards() {
+ if (fPattern.startsWith("*")) { //$NON-NLS-1$
+ fHasLeadingStar = true;
+ }
+ if (fPattern.endsWith("*")) {//$NON-NLS-1$
+ /* make sure it's not an escaped wildcard */
+ if (fLength > 1 && fPattern.charAt(fLength - 2) != '\\') {
+ fHasTrailingStar = true;
+ }
+ }
+
+ Vector<Object> temp = new Vector<Object>();
+
+ int pos = 0;
+ StringBuffer buf = new StringBuffer();
+ while (pos < fLength) {
+ char c = fPattern.charAt(pos++);
+ switch (c) {
+ case '\\':
+ if (pos >= fLength) {
+ buf.append(c);
+ } else {
+ char next = fPattern.charAt(pos++);
+ /* if it's an escape sequence */
+ if (next == '*' || next == '?' || next == '\\') {
+ buf.append(next);
+ } else {
+ /* not an escape sequence, just insert literally */
+ buf.append(c);
+ buf.append(next);
+ }
+ }
+ break;
+ case '*':
+ if (buf.length() > 0) {
+ /* new segment */
+ temp.addElement(buf.toString());
+ fBound += buf.length();
+ buf.setLength(0);
+ }
+ break;
+ case '?':
+ /* append special character representing single match wildcard */
+ buf.append(fSingleWildCard);
+ break;
+ default:
+ buf.append(c);
+ }
+ }
+
+ /* add last buffer to segment list */
+ if (buf.length() > 0) {
+ temp.addElement(buf.toString());
+ fBound += buf.length();
+ }
+
+ fSegments = new String[temp.size()];
+ temp.copyInto(fSegments);
+ }
+
+ /**
+ * @param text
+ * a string which contains no wildcard
+ * @param start
+ * the starting index in the text for search, inclusive
+ * @param end
+ * the stopping point of search, exclusive
+ * @return the starting index in the text of the pattern , or -1 if not
+ * found
+ */
+ protected int posIn(String text, int start, int end) {// no wild card in
+ // pattern
+ int max = end - fLength;
+
+ if (!fIgnoreCase) {
+ int i = text.indexOf(fPattern, start);
+ if (i == -1 || i > max) {
+ return -1;
+ }
+ return i;
+ }
+
+ for (int i = start; i <= max; ++i) {
+ if (text.regionMatches(true, i, fPattern, 0, fLength)) {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ /**
+ * @param text
+ * a simple regular expression that may only contain '?'(s)
+ * @param start
+ * the starting index in the text for search, inclusive
+ * @param end
+ * the stopping point of search, exclusive
+ * @param p
+ * a simple regular expression that may contains '?'
+ * @return the starting index in the text of the pattern , or -1 if not
+ * found
+ */
+ protected int regExpPosIn(String text, int start, int end, String p) {
+ int plen = p.length();
+
+ int max = end - plen;
+ for (int i = start; i <= max; ++i) {
+ if (regExpRegionMatches(text, i, p, 0, plen)) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ /**
+ *
+ * @return boolean
+ * @param text
+ * a String to match
+ * @param tStart
+ * indicates the starting index of match, inclusive
+ * @param p
+ * a simple regular expression that may contain '?'
+ * @param pStart
+ * @param plen
+ */
+ protected boolean regExpRegionMatches(String text, int tStart, String p,
+ int pStart, int plen) {
+ while (plen-- > 0) {
+ char tchar = text.charAt(tStart++);
+ char pchar = p.charAt(pStart++);
+
+ /* process wild cards */
+ if (!fIgnoreWildCards) {
+ /* skip single wild cards */
+ if (pchar == fSingleWildCard) {
+ continue;
+ }
+ }
+ if (pchar == tchar) {
+ continue;
+ }
+ if (fIgnoreCase) {
+ if (Character.toUpperCase(tchar) == Character
+ .toUpperCase(pchar)) {
+ continue;
+ }
+ // comparing after converting to upper case doesn't handle all
+ // cases;
+ // also compare after converting to lower case
+ if (Character.toLowerCase(tchar) == Character
+ .toLowerCase(pchar)) {
+ continue;
+ }
+ }
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * @param text
+ * the string to match
+ * @param start
+ * the starting index in the text for search, inclusive
+ * @param end
+ * the stopping point of search, exclusive
+ * @param p
+ * a string that has no wildcard
+ * @return the starting index in the text of the pattern , or -1 if not
+ * found
+ */
+ protected int textPosIn(String text, int start, int end, String p) {
+
+ int plen = p.length();
+ int max = end - plen;
+
+ if (!fIgnoreCase) {
+ int i = text.indexOf(p, start);
+ if (i == -1 || i > max) {
+ return -1;
+ }
+ return i;
+ }
+
+ for (int i = start; i <= max; ++i) {
+ if (text.regionMatches(true, i, p, 0, plen)) {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/AbstractWizard.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/AbstractWizard.java
index 07add9061..4228cc012 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/AbstractWizard.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/AbstractWizard.java
@@ -1,120 +1,120 @@
-/*******************************************************************************
- * 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.ui.wizards;
-
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.tcf.te.ui.activator.UIPlugin;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWizard;
-
-/**
- * An abstract wizard implementation.
- * <p>
- * This wizard implementation is adding dialog settings management.
- */
-public abstract class AbstractWizard extends Wizard implements IWorkbenchWizard {
- // A marker to remember if the dialog settings got
- // initialized for this wizard
- private boolean dialogSettingsInitialized = false;
-
- // The workbench instance passed to the wizard via IWorkbenchWizard#init.
- private IWorkbench workbench = null;
- // The selection passed to the wizard via IWorkbenchWizard#init.
- private IStructuredSelection selection = null;
-
- /**
- * Initialize the dialog settings and associate them with the wizard.
- */
- private final void initializeDialogSettings() {
- // Get the root dialog settings
- IDialogSettings rootSettings = getRootDialogSettings();
- // Get the wizards dialog settings section
- IDialogSettings section = rootSettings.getSection(getWizardSectionName());
- if (section == null) {
- // The section does not exist -> create it
- section = rootSettings.addNewSection(getWizardSectionName());
- }
- // Push the section to the wizard
- setDialogSettings(section);
- // Mark the dialog settings initialized
- dialogSettingsInitialized = true;
- }
-
- /**
- * Returns the root dialog settings.
- * <p>
- * Typically, this are the dialog settings of the parent bundle. The
- * default implementation returns the dialog settings of the bundle
- * &quot;<code>org.eclipse.tcf.te.ui</code>&quot;. Overwrite to return
- * different root dialog settings.
- *
- * @return The root dialog settings.
- */
- protected IDialogSettings getRootDialogSettings() {
- return UIPlugin.getDefault().getDialogSettings();
- }
-
- /**
- * Returns the name of the wizards associated dialog settings
- * section.
- * <p>
- * The default implementation returns the simple name of the
- * implementation class.
- *
- * @return The name of the wizards dialog settings section.
- */
- protected String getWizardSectionName() {
- return getClass().getName();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.Wizard#getDialogSettings()
- */
- @Override
- public IDialogSettings getDialogSettings() {
- if (!dialogSettingsInitialized) {
- initializeDialogSettings();
- }
- return super.getDialogSettings();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
- */
- @Override
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.workbench = workbench;
- this.selection = selection;
- }
-
- /**
- * Returns the workbench instance.
- * <p>
- * <b>Note:</b> The workbench instance is set via {@link IWorkbenchWizard#init(IWorkbench, IStructuredSelection)}.
- *
- * @return The workbench instance or <code>null</code>.
- */
- public final IWorkbench getWorkbench() {
- return workbench;
- }
-
- /**
- * Returns the selection.
- * <p>
- * <b>Note:</b> The selection is set via {@link IWorkbenchWizard#init(IWorkbench, IStructuredSelection)}.
- *
- * @return The selection or <code>null</code>.
- */
- public final IStructuredSelection getSelection() {
- return selection;
- }
-}
+/*******************************************************************************
+ * 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.ui.wizards;
+
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.tcf.te.ui.activator.UIPlugin;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWizard;
+
+/**
+ * An abstract wizard implementation.
+ * <p>
+ * This wizard implementation is adding dialog settings management.
+ */
+public abstract class AbstractWizard extends Wizard implements IWorkbenchWizard {
+ // A marker to remember if the dialog settings got
+ // initialized for this wizard
+ private boolean dialogSettingsInitialized = false;
+
+ // The workbench instance passed to the wizard via IWorkbenchWizard#init.
+ private IWorkbench workbench = null;
+ // The selection passed to the wizard via IWorkbenchWizard#init.
+ private IStructuredSelection selection = null;
+
+ /**
+ * Initialize the dialog settings and associate them with the wizard.
+ */
+ private final void initializeDialogSettings() {
+ // Get the root dialog settings
+ IDialogSettings rootSettings = getRootDialogSettings();
+ // Get the wizards dialog settings section
+ IDialogSettings section = rootSettings.getSection(getWizardSectionName());
+ if (section == null) {
+ // The section does not exist -> create it
+ section = rootSettings.addNewSection(getWizardSectionName());
+ }
+ // Push the section to the wizard
+ setDialogSettings(section);
+ // Mark the dialog settings initialized
+ dialogSettingsInitialized = true;
+ }
+
+ /**
+ * Returns the root dialog settings.
+ * <p>
+ * Typically, this are the dialog settings of the parent bundle. The
+ * default implementation returns the dialog settings of the bundle
+ * &quot;<code>org.eclipse.tcf.te.ui</code>&quot;. Overwrite to return
+ * different root dialog settings.
+ *
+ * @return The root dialog settings.
+ */
+ protected IDialogSettings getRootDialogSettings() {
+ return UIPlugin.getDefault().getDialogSettings();
+ }
+
+ /**
+ * Returns the name of the wizards associated dialog settings
+ * section.
+ * <p>
+ * The default implementation returns the simple name of the
+ * implementation class.
+ *
+ * @return The name of the wizards dialog settings section.
+ */
+ protected String getWizardSectionName() {
+ return getClass().getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#getDialogSettings()
+ */
+ @Override
+ public IDialogSettings getDialogSettings() {
+ if (!dialogSettingsInitialized) {
+ initializeDialogSettings();
+ }
+ return super.getDialogSettings();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ @Override
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.workbench = workbench;
+ this.selection = selection;
+ }
+
+ /**
+ * Returns the workbench instance.
+ * <p>
+ * <b>Note:</b> The workbench instance is set via {@link IWorkbenchWizard#init(IWorkbench, IStructuredSelection)}.
+ *
+ * @return The workbench instance or <code>null</code>.
+ */
+ public final IWorkbench getWorkbench() {
+ return workbench;
+ }
+
+ /**
+ * Returns the selection.
+ * <p>
+ * <b>Note:</b> The selection is set via {@link IWorkbenchWizard#init(IWorkbench, IStructuredSelection)}.
+ *
+ * @return The selection or <code>null</code>.
+ */
+ public final IStructuredSelection getSelection() {
+ return selection;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/newWizard/NewWizardCommandHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/newWizard/NewWizardCommandHandler.java
index e58c091c1..cff6589f5 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/newWizard/NewWizardCommandHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/newWizard/NewWizardCommandHandler.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.ui/src/org/eclipse/tcf/te/ui/wizards/newWizard/NewWizardSelectionPage.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/newWizard/NewWizardSelectionPage.java
index f5dfc5265..f909d278a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/newWizard/NewWizardSelectionPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/newWizard/NewWizardSelectionPage.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.ui/src/org/eclipse/tcf/te/ui/wizards/pages/AbstractFormsWizardPage.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/pages/AbstractFormsWizardPage.java
index 3f9590b21..5fed0ebee 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/pages/AbstractFormsWizardPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/pages/AbstractFormsWizardPage.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/build.properties b/target_explorer/plugins/org.eclipse.tcf.te/build.properties
index 494a348b4..a16625e12 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te/build.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te/build.properties
@@ -1,3 +1,12 @@
+###############################################################################
+# Copyright (c) 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
+###############################################################################
source.. = src/
output.. = bin/
bin.includes = META-INF/,\

Back to the top