Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcvs2svn2009-11-12 20:03:37 +0000
committercvs2svn2009-11-12 20:03:37 +0000
commit44abbde7c141b702357ced55c72a1d6ecd2bdf69 (patch)
treee77b6108e9d59c5927046d701764f49e3f89a457 /org.eclipse.debug.ui/ui/org
parent92698767bf2efdc2e3593c7bdc85bfef39f0577b (diff)
downloadeclipse.platform.debug-FlexBreakpoint.tar.gz
eclipse.platform.debug-FlexBreakpoint.tar.xz
eclipse.platform.debug-FlexBreakpoint.zip
This commit was manufactured by cvs2svn to create branch 'FlexBreakpoint'.FlexBreakpoint
Sprout from master 2009-11-12 20:03:34 UTC Darin Wright <darin> 'REVERT CHANGES FOR Bug 41353 - [launching] Launch config templates' Delete: org.eclipse.core.externaltools/.classpath org.eclipse.core.externaltools/.cvsignore org.eclipse.core.externaltools/.project org.eclipse.core.externaltools/.settings/org.eclipse.jdt.core.prefs org.eclipse.core.externaltools/.settings/org.eclipse.pde.prefs org.eclipse.core.externaltools/META-INF/MANIFEST.MF org.eclipse.core.externaltools/about.html org.eclipse.core.externaltools/build.properties org.eclipse.core.externaltools/plugin.properties org.eclipse.core.externaltools/plugin.xml org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/ExternalToolsCore.java org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/IExternalToolConstants.java org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/BackgroundResourceRefresher.java org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsProgramMessages.java org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsProgramMessages.properties org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ProgramLaunchDelegate.java org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/BuilderCoreUtils.java org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolsModelMessages.java org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolsModelMessages.properties org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolMigration.java org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolsMigrationMessages.java org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolsMigrationMessages.properties org.eclipse.core.variables/.classpath org.eclipse.core.variables/.cvsignore org.eclipse.core.variables/.project org.eclipse.core.variables/.settings/org.eclipse.jdt.core.prefs org.eclipse.core.variables/.settings/org.eclipse.pde.prefs org.eclipse.core.variables/META-INF/MANIFEST.MF org.eclipse.core.variables/about.html org.eclipse.core.variables/build.properties org.eclipse.core.variables/plugin.properties org.eclipse.core.variables/plugin.xml org.eclipse.core.variables/schema/dynamicVariables.exsd org.eclipse.core.variables/schema/valueVariables.exsd org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ContributedValueVariable.java org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java org.eclipse.core.variables/src/org/eclipse/core/internal/variables/EclipseHomeVariableResolver.java org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringSubstitutionEngine.java org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariable.java org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ValueVariable.java org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.java org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.properties org.eclipse.core.variables/src/org/eclipse/core/variables/IDynamicVariable.java org.eclipse.core.variables/src/org/eclipse/core/variables/IDynamicVariableResolver.java org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariable.java org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariableManager.java org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariable.java org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariableInitializer.java org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariableListener.java org.eclipse.core.variables/src/org/eclipse/core/variables/VariablesPlugin.java org.eclipse.core.variables/src/org/eclipse/core/variables/package.html org.eclipse.debug.examples.core/.classpath org.eclipse.debug.examples.core/.cvsignore org.eclipse.debug.examples.core/.project org.eclipse.debug.examples.core/.settings/org.eclipse.jdt.core.prefs org.eclipse.debug.examples.core/META-INF/MANIFEST.MF org.eclipse.debug.examples.core/about.html org.eclipse.debug.examples.core/build.properties org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java org.eclipse.debug.examples.core/pdavm/tests/vmtest10.pda org.eclipse.debug.examples.core/pdavm/tests/vmtest2.pda org.eclipse.debug.examples.core/pdavm/tests/vmtest3.pda org.eclipse.debug.examples.core/pdavm/tests/vmtest6.pda org.eclipse.debug.examples.core/pdavm/tests/vmtest8.pda org.eclipse.debug.examples.core/pdavm/tests/vmtest9.pda org.eclipse.debug.examples.core/pdavm/tests/vmtest_children.pda org.eclipse.debug.examples.core/plugin.xml org.eclipse.debug.examples.core/readme.html org.eclipse.debug.examples.core/samples/counter.pda org.eclipse.debug.examples.core/samples/drop.pda org.eclipse.debug.examples.core/samples/example.pda org.eclipse.debug.examples.core/samples/fibonacci.pda org.eclipse.debug.examples.core/samples/registers.pda org.eclipse.debug.examples.core/samples/stack.pda org.eclipse.debug.examples.core/samples/structures.pda org.eclipse.debug.examples.core/scripts/build.xml org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/ClockControl.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/LengthControl.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunch.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunchDelegate.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/SequencerControl.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TempoControl.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TimeControl.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/DebugCorePlugin.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDARunToLineBreakpoint.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDAWatchpoint.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/launcher/PDALaunchDelegate.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/IPDAEventListener.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArray.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArrayEntry.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugElement.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackFrame.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackValue.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAValue.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAVariable.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/WordStructureDelegate.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDABitFieldData.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAChildrenCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAClearBreakpointCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommandResult.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADataCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADropFrameCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalResultEvent.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvent.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEventStopCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAExitedEvent.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommandResult.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameData.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAGroupsCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAListResult.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDANoSuchLabelEvent.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPopDataCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPushDataCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegisterData.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommandResult.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersEvent.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARestartCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumeCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumedEvent.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARunControlEvent.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetBreakpointCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetDataCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetVarCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommandResult.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommandResult.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStartedEvent.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepReturnCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendedEvent.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminateCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminatedEvent.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAUnimplementedInstructionEvent.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumeCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumedEvent.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMStartedEvent.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendedEvent.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMTerminatedEvent.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVarCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAWatchCommand.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/package.html org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupDirector.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupParticipant.java org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourcePathComputerDelegate.java org.eclipse.debug.examples.core/src_ant/org/eclipse/debug/examples/ant/tasks/PreProcessor.java org.eclipse.debug.examples.ui/.classpath org.eclipse.debug.examples.ui/.cvsignore org.eclipse.debug.examples.ui/.project org.eclipse.debug.examples.ui/.settings/org.eclipse.jdt.core.prefs org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF org.eclipse.debug.examples.ui/about.html org.eclipse.debug.examples.ui/build.properties org.eclipse.debug.examples.ui/icons/full/dlcl16/pop.gif org.eclipse.debug.examples.ui/icons/full/dlcl16/push.gif org.eclipse.debug.examples.ui/icons/full/elcl16/pop.gif org.eclipse.debug.examples.ui/icons/full/elcl16/push.gif org.eclipse.debug.examples.ui/icons/full/obj16/clef.png org.eclipse.debug.examples.ui/icons/full/obj16/note.gif org.eclipse.debug.examples.ui/icons/full/obj16/pda.gif org.eclipse.debug.examples.ui/plugin.xml org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/CheckboxModelProxyFactory.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlCellModifier.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEditor.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEventHandler.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlLabelProvider.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlsMementoProvider.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiAdapterFactory.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiEventLabelProvider.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiEventModelProxy.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiStepOverHandler.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerColumnFactory.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerColumnPresentation.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerContentProvider.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerControlsModelProxy.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerModelProxyFactory.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackColumnFactory.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackColumnPresentation.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackContentProvider.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackLabelProvider.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackModelProxy.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/detailpanes/ClockSliderDetailPane.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/detailpanes/ControlDetailPaneFactory.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/detailpanes/TempoSliderDetailPane.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/MidiLaunchShortcut.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/MidiMainTab.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/MidiTabGroup.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/DebugUIPlugin.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AdapterFactory.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/ModelProxyFactory.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDADebugTargetContentProvider.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDADebugTargetProxy.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDARestartDebugCommand.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAThreadEventHandler.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDARunToLineAdapter.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTargetFactory.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/AnnotationHover.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAContentAssistProcessor.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAContentAssistant.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAEditor.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAEditorMessages.properties org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAScanner.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDASourceViewerConfiguration.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PopFrameActionDelegate.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/TextHover.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/WordFinder.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDALaunchShortcut.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDAMainTab.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDATabGroup.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/presentation/PDAModelPresentation.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/AbstractDataStackViewHandler.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CanPushTester.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CheckboxView.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/DataStackView.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/PopHandler.java org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/PushHandler.java org.eclipse.debug.tests/.classpath org.eclipse.debug.tests/.cvsignore org.eclipse.debug.tests/.project org.eclipse.debug.tests/.settings/org.eclipse.jdt.core.prefs org.eclipse.debug.tests/META-INF/MANIFEST.MF org.eclipse.debug.tests/about.html org.eclipse.debug.tests/build.properties org.eclipse.debug.tests/plugin.properties org.eclipse.debug.tests/plugin.xml org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/AbstractLaunchTest.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/AcceleratorSubstitutionTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/DebugFileStore.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/DebugFileSystem.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchConfigurationTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchHistoryTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchManagerTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/RefreshTabTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/TestLaunchDelegate.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/DynamicRenderingBindings.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlock.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockDynamic.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockOne.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockThree.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockTwo.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryRenderingTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/RenderingTypeDelegate.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/CheckTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ChildrenUpdateTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ContentTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/DeltaTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/FilterTransformTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ITestModelUpdatesListenerConstants.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerCheckTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerContentTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerDeltaTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerPerformanceTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerSelectionTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerStateTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerUpdateTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PerformanceTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PresentationContextTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/SelectionTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/StateTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TestModel.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TestModelUpdatesListener.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TreeModelViewerAutopopulateAgent.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/UpdateTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerDeltaTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerLazyModeTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerPerformanceTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerSelectionTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerStateTests.java org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerUpdateTests.java org.eclipse.debug.tests/src/org/eclipse/debug/tests/AutomatedSuite.java org.eclipse.debug.tests/src/org/eclipse/debug/tests/PerformanceSuite.java org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestsPlugin.java org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandler.java org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandlerTests.java org.eclipse.debug.tests/test-import/Import1.launch org.eclipse.debug.tests/test-import/Import2.launch org.eclipse.debug.tests/test-import/Import3.launch org.eclipse.debug.tests/test-import/Import4.launch org.eclipse.debug.tests/test-import/Import5.launch org.eclipse.debug.tests/test.xml org.eclipse.debug.ui/.classpath org.eclipse.debug.ui/.cvsignore org.eclipse.debug.ui/.options org.eclipse.debug.ui/.project org.eclipse.debug.ui/.settings/org.eclipse.core.resources.prefs org.eclipse.debug.ui/.settings/org.eclipse.jdt.core.prefs org.eclipse.debug.ui/.settings/org.eclipse.pde.prefs org.eclipse.debug.ui/META-INF/MANIFEST.MF org.eclipse.debug.ui/about.html org.eclipse.debug.ui/build.properties org.eclipse.debug.ui/doc/.cvsignore org.eclipse.debug.ui/icons/full/dlcl16/changevariablevalue_co.gif org.eclipse.debug.ui/icons/full/dlcl16/clear_co.gif org.eclipse.debug.ui/icons/full/dlcl16/collapseall.gif org.eclipse.debug.ui/icons/full/dlcl16/copy_edit_co.gif org.eclipse.debug.ui/icons/full/dlcl16/copyviewtoclipboard_tsk.gif org.eclipse.debug.ui/icons/full/dlcl16/debuglast_co.gif org.eclipse.debug.ui/icons/full/dlcl16/det_pane_hide.gif org.eclipse.debug.ui/icons/full/dlcl16/det_pane_right.gif org.eclipse.debug.ui/icons/full/dlcl16/det_pane_under.gif org.eclipse.debug.ui/icons/full/dlcl16/disabled_co.gif org.eclipse.debug.ui/icons/full/dlcl16/disconnect_co.gif org.eclipse.debug.ui/icons/full/dlcl16/display_selected_mb.gif org.eclipse.debug.ui/icons/full/dlcl16/edtsrclkup_co.gif org.eclipse.debug.ui/icons/full/dlcl16/enabled_co.gif org.eclipse.debug.ui/icons/full/dlcl16/export_brkpts.gif org.eclipse.debug.ui/icons/full/dlcl16/filter_ps.gif org.eclipse.debug.ui/icons/full/dlcl16/import_brkpts.gif org.eclipse.debug.ui/icons/full/dlcl16/lock_co.gif org.eclipse.debug.ui/icons/full/dlcl16/memoryreset_tsk.gif org.eclipse.debug.ui/icons/full/dlcl16/metharg_obj.gif org.eclipse.debug.ui/icons/full/dlcl16/monitorexpression_tsk.gif org.eclipse.debug.ui/icons/full/dlcl16/new_con.gif org.eclipse.debug.ui/icons/full/dlcl16/next_thread_nav.gif org.eclipse.debug.ui/icons/full/dlcl16/prev_thread_nav.gif org.eclipse.debug.ui/icons/full/dlcl16/printview_tsk.gif org.eclipse.debug.ui/icons/full/dlcl16/prop_ps.gif org.eclipse.debug.ui/icons/full/dlcl16/rem_all_co.gif org.eclipse.debug.ui/icons/full/dlcl16/rem_co.gif org.eclipse.debug.ui/icons/full/dlcl16/removememory_tsk.gif org.eclipse.debug.ui/icons/full/dlcl16/restart_co.gif org.eclipse.debug.ui/icons/full/dlcl16/resume_co.gif org.eclipse.debug.ui/icons/full/dlcl16/runlast_co.gif org.eclipse.debug.ui/icons/full/dlcl16/runtoline_co.gif org.eclipse.debug.ui/icons/full/dlcl16/skip_brkp.gif org.eclipse.debug.ui/icons/full/dlcl16/stepbystep_co.gif org.eclipse.debug.ui/icons/full/dlcl16/stepinto_co.gif org.eclipse.debug.ui/icons/full/dlcl16/stepover_co.gif org.eclipse.debug.ui/icons/full/dlcl16/stepreturn_co.gif org.eclipse.debug.ui/icons/full/dlcl16/suspend_co.gif org.eclipse.debug.ui/icons/full/dlcl16/synced.gif org.eclipse.debug.ui/icons/full/dlcl16/terminate_all_co.gif org.eclipse.debug.ui/icons/full/dlcl16/terminate_co.gif org.eclipse.debug.ui/icons/full/dlcl16/terminate_rem_co.gif org.eclipse.debug.ui/icons/full/dlcl16/tnames_co.gif org.eclipse.debug.ui/icons/full/dlcl16/toggledetailpane_co.gif org.eclipse.debug.ui/icons/full/dlcl16/var_cntnt_prvdr.gif org.eclipse.debug.ui/icons/full/dtool16/debug_exc.gif org.eclipse.debug.ui/icons/full/dtool16/environment_co.gif org.eclipse.debug.ui/icons/full/dtool16/profile_exc.gif org.eclipse.debug.ui/icons/full/dtool16/run_exc.gif org.eclipse.debug.ui/icons/full/dtool16/term_restart.gif org.eclipse.debug.ui/icons/full/dtool16/watch_exp.gif org.eclipse.debug.ui/icons/full/elcl16/changevariablevalue_co.gif org.eclipse.debug.ui/icons/full/elcl16/collapseall.gif org.eclipse.debug.ui/icons/full/elcl16/copy_edit_co.gif org.eclipse.debug.ui/icons/full/elcl16/copyviewtoclipboard_tsk.gif org.eclipse.debug.ui/icons/full/elcl16/debuglast_co.gif org.eclipse.debug.ui/icons/full/elcl16/delete_config.gif org.eclipse.debug.ui/icons/full/elcl16/det_pane_hide.gif org.eclipse.debug.ui/icons/full/elcl16/det_pane_right.gif org.eclipse.debug.ui/icons/full/elcl16/det_pane_under.gif org.eclipse.debug.ui/icons/full/elcl16/disabled_co.gif org.eclipse.debug.ui/icons/full/elcl16/disconnect_co.gif org.eclipse.debug.ui/icons/full/elcl16/display_selected_mb.gif org.eclipse.debug.ui/icons/full/elcl16/dissolve_group.gif org.eclipse.debug.ui/icons/full/elcl16/drop_to_frame.gif org.eclipse.debug.ui/icons/full/elcl16/edtsrclkup_co.gif org.eclipse.debug.ui/icons/full/elcl16/enabled_co.gif org.eclipse.debug.ui/icons/full/elcl16/expandall.gif org.eclipse.debug.ui/icons/full/elcl16/export_brkpts.gif org.eclipse.debug.ui/icons/full/elcl16/filter_ps.gif org.eclipse.debug.ui/icons/full/elcl16/hierarchicalLayout.gif org.eclipse.debug.ui/icons/full/elcl16/import_brkpts.gif org.eclipse.debug.ui/icons/full/elcl16/lock_co.gif org.eclipse.debug.ui/icons/full/elcl16/memoryreset_tsk.gif org.eclipse.debug.ui/icons/full/elcl16/metharg_obj.gif org.eclipse.debug.ui/icons/full/elcl16/monitorexpression_tsk.gif org.eclipse.debug.ui/icons/full/elcl16/new_con.gif org.eclipse.debug.ui/icons/full/elcl16/next_thread_nav.gif org.eclipse.debug.ui/icons/full/elcl16/pin.gif org.eclipse.debug.ui/icons/full/elcl16/prev_thread_nav.gif org.eclipse.debug.ui/icons/full/elcl16/printview_tsk.gif org.eclipse.debug.ui/icons/full/elcl16/prop_ps.gif org.eclipse.debug.ui/icons/full/elcl16/rem_all_co.gif org.eclipse.debug.ui/icons/full/elcl16/rem_co.gif org.eclipse.debug.ui/icons/full/elcl16/removememory_tsk.gif org.eclipse.debug.ui/icons/full/elcl16/restart_co.gif org.eclipse.debug.ui/icons/full/elcl16/resume_co.gif org.eclipse.debug.ui/icons/full/elcl16/runlast_co.gif org.eclipse.debug.ui/icons/full/elcl16/runtoline_co.gif org.eclipse.debug.ui/icons/full/elcl16/skip_brkp.gif org.eclipse.debug.ui/icons/full/elcl16/stepbystep_co.gif org.eclipse.debug.ui/icons/full/elcl16/stepinto_co.gif org.eclipse.debug.ui/icons/full/elcl16/stepover_co.gif org.eclipse.debug.ui/icons/full/elcl16/stepreturn_co.gif org.eclipse.debug.ui/icons/full/elcl16/suspend_co.gif org.eclipse.debug.ui/icons/full/elcl16/synced.gif org.eclipse.debug.ui/icons/full/elcl16/terminate_all_co.gif org.eclipse.debug.ui/icons/full/elcl16/terminate_co.gif org.eclipse.debug.ui/icons/full/elcl16/terminate_rem_co.gif org.eclipse.debug.ui/icons/full/elcl16/tnames_co.gif org.eclipse.debug.ui/icons/full/elcl16/toggledetailpane_co.gif org.eclipse.debug.ui/icons/full/elcl16/var_cntnt_prvdr.gif org.eclipse.debug.ui/icons/full/elcl16/writeerr_co.gif org.eclipse.debug.ui/icons/full/elcl16/writeout_co.gif org.eclipse.debug.ui/icons/full/etool16/debug_exc.gif org.eclipse.debug.ui/icons/full/etool16/environment_co.gif org.eclipse.debug.ui/icons/full/etool16/profile_exc.gif org.eclipse.debug.ui/icons/full/etool16/run_exc.gif org.eclipse.debug.ui/icons/full/etool16/term_restart.gif org.eclipse.debug.ui/icons/full/etool16/watch_exp.gif org.eclipse.debug.ui/icons/full/eview16/breakpoint_view.gif org.eclipse.debug.ui/icons/full/eview16/debug_persp.gif org.eclipse.debug.ui/icons/full/eview16/debug_view.gif org.eclipse.debug.ui/icons/full/eview16/details_view.gif org.eclipse.debug.ui/icons/full/eview16/memory_view.gif org.eclipse.debug.ui/icons/full/eview16/module_view.gif org.eclipse.debug.ui/icons/full/eview16/register_view.gif org.eclipse.debug.ui/icons/full/eview16/variable_view.gif org.eclipse.debug.ui/icons/full/eview16/watchlist_view.gif org.eclipse.debug.ui/icons/full/obj16/arraypartition_obj.gif org.eclipse.debug.ui/icons/full/obj16/brkp_grp.gif org.eclipse.debug.ui/icons/full/obj16/brkp_grp_disabled.gif org.eclipse.debug.ui/icons/full/obj16/brkp_obj.gif org.eclipse.debug.ui/icons/full/obj16/brkp_type.gif org.eclipse.debug.ui/icons/full/obj16/brkpd_obj.gif org.eclipse.debug.ui/icons/full/obj16/common_tab.gif org.eclipse.debug.ui/icons/full/obj16/debugt_obj.gif org.eclipse.debug.ui/icons/full/obj16/debugts_obj.gif org.eclipse.debug.ui/icons/full/obj16/debugtt_obj.gif org.eclipse.debug.ui/icons/full/obj16/environment_obj.gif org.eclipse.debug.ui/icons/full/obj16/envvar_obj.gif org.eclipse.debug.ui/icons/full/obj16/export_config_obj.gif org.eclipse.debug.ui/icons/full/obj16/expression_obj.gif org.eclipse.debug.ui/icons/full/obj16/file_obj.gif org.eclipse.debug.ui/icons/full/obj16/fldr_obj.gif org.eclipse.debug.ui/icons/full/obj16/genericreggroup_obj.gif org.eclipse.debug.ui/icons/full/obj16/genericregister_obj.gif org.eclipse.debug.ui/icons/full/obj16/genericvariable_obj.gif org.eclipse.debug.ui/icons/full/obj16/import_config_obj.gif org.eclipse.debug.ui/icons/full/obj16/inst_ptr.gif org.eclipse.debug.ui/icons/full/obj16/inst_ptr_top.gif org.eclipse.debug.ui/icons/full/obj16/jar_obj.gif org.eclipse.debug.ui/icons/full/obj16/ldebug_obj.gif org.eclipse.debug.ui/icons/full/obj16/lrun_obj.gif org.eclipse.debug.ui/icons/full/obj16/memory_obj.gif org.eclipse.debug.ui/icons/full/obj16/memorychanged_obj.gif org.eclipse.debug.ui/icons/full/obj16/osprc_obj.gif org.eclipse.debug.ui/icons/full/obj16/osprct_obj.gif org.eclipse.debug.ui/icons/full/obj16/persp_tab.gif org.eclipse.debug.ui/icons/full/obj16/prj_obj.gif org.eclipse.debug.ui/icons/full/obj16/read_obj.gif org.eclipse.debug.ui/icons/full/obj16/read_obj_disabled.gif org.eclipse.debug.ui/icons/full/obj16/readwrite_obj.gif org.eclipse.debug.ui/icons/full/obj16/readwrite_obj_disabled.gif org.eclipse.debug.ui/icons/full/obj16/refresh_tab.gif org.eclipse.debug.ui/icons/full/obj16/rundebug.gif org.eclipse.debug.ui/icons/full/obj16/stckframe_obj.gif org.eclipse.debug.ui/icons/full/obj16/stckframe_running_obj.gif org.eclipse.debug.ui/icons/full/obj16/terminatedlaunch_obj.gif org.eclipse.debug.ui/icons/full/obj16/thread_obj.gif org.eclipse.debug.ui/icons/full/obj16/threads_obj.gif org.eclipse.debug.ui/icons/full/obj16/threadt_obj.gif org.eclipse.debug.ui/icons/full/obj16/workset.gif org.eclipse.debug.ui/icons/full/obj16/write_obj.gif org.eclipse.debug.ui/icons/full/obj16/write_obj_disabled.gif org.eclipse.debug.ui/icons/full/ovr16/error.gif org.eclipse.debug.ui/icons/full/ovr16/skip_breakpoint_ov.gif org.eclipse.debug.ui/icons/full/ovr16/stcksync_ov.gif org.eclipse.debug.ui/icons/full/ovr16/transparent.gif org.eclipse.debug.ui/icons/full/wizban/adddir_wiz.png org.eclipse.debug.ui/icons/full/wizban/addsrcloc_wiz.png org.eclipse.debug.ui/icons/full/wizban/debug_wiz.png org.eclipse.debug.ui/icons/full/wizban/editdir_wiz.png org.eclipse.debug.ui/icons/full/wizban/edtsrclkup_wiz.png org.eclipse.debug.ui/icons/full/wizban/export_brkpts_wizban.png org.eclipse.debug.ui/icons/full/wizban/export_config_wizban.png org.eclipse.debug.ui/icons/full/wizban/import_brkpts_wizban.png org.eclipse.debug.ui/icons/full/wizban/import_config_wizban.png org.eclipse.debug.ui/icons/full/wizban/profile_wiz.png org.eclipse.debug.ui/icons/full/wizban/run_wiz.png org.eclipse.debug.ui/plugin.properties org.eclipse.debug.ui/plugin.xml org.eclipse.debug.ui/schema/breakpointOrganizers.exsd org.eclipse.debug.ui/schema/consoleColorProviders.exsd org.eclipse.debug.ui/schema/consoleLineTrackers.exsd org.eclipse.debug.ui/schema/contextViewBindings.exsd org.eclipse.debug.ui/schema/debugModelContextBindings.exsd org.eclipse.debug.ui/schema/debugModelPresentations.exsd org.eclipse.debug.ui/schema/detailPaneFactories.exsd org.eclipse.debug.ui/schema/launchConfigurationTabGroups.exsd org.eclipse.debug.ui/schema/launchConfigurationTabs.exsd org.eclipse.debug.ui/schema/launchConfigurationTypeImages.exsd org.eclipse.debug.ui/schema/launchGroups.exsd org.eclipse.debug.ui/schema/launchShortcuts.exsd org.eclipse.debug.ui/schema/memoryRenderings.exsd org.eclipse.debug.ui/schema/sourceContainerPresentations.exsd org.eclipse.debug.ui/schema/stringVariablePresentations.exsd org.eclipse.debug.ui/schema/toggleBreakpointsTargetFactories.exsd org.eclipse.debug.ui/schema/variableValueEditors.exsd org.eclipse.debug.ui/scripts/exportplugin.xml org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugCheckboxSelectionDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugListSelectionDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugSelectionDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/BreakpointImageProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/CompositeDebugImageDescriptor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugModelPropertyTester.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIAdapterFactory.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DynamicInstructionPointerAnnotation.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ILaunchHistoryChangedListener.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ILaunchLabelChangedListener.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerAnnotation.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerContext.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerImageProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/Pair.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ResourceExtender.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/SWTFactory.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariableValueEditorManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariablesViewModelPresentation.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/WorkingDirectoryStatusHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveAllActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractSelectionActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CollapseAllAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ConfigureColumnsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugAsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugContextualLaunchAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugHistoryMenuAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugLastAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugToolbarAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EditLaunchConfigurationAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ExecutionAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/IToggleBreakpointsTargetManagerListener.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchConfigurationAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchShortcutAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchablePropertyTester.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenDebugConfigurations.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenProfileConfigurations.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenRunConfigurations.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileAsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileContextualLaunchAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileHistoryMenuAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileLastAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileToolbarAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchLastAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetRunToLineAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunAsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunContextualLaunchAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunHistoryMenuAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunLastAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunToolbarAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StatusInfo.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ViewManagementAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractBreakpointsViewAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AdvancedGroupBreakpointsByAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointGroupMessages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointGroupMessages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointSelectionAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointWorkingSetAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ClearDefaultBreakpointGroupAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/CopyBreakpointsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/EditBreakpointGroupAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/PasteBreakpointsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/RemoveFromWorkingSetAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SetDefaultBreakpointGroupAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ToggleDefaultGroupAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/WorkingSetsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/AccessWatchpointToggleAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointTypesContribution.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsCollapseAllAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsExpandAllAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DeleteWorkingsetsMessageDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DisableBreakpointsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/LinkBreakpointsWithDebugViewAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/Messages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/Messages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModificationWatchpointToggleAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModifyWatchpointAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/OpenBreakpointMarkerAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveAllBreakpointsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveBreakpointAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetBreakpointAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetMethodBreakpointAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleBreakpointAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleLineBreakpointAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetWatchpointAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RulerEnableDisableBreakpointAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SelectAllBreakpointsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SkipAllBreakpointsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ToggleBreakpointObjectActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/AddWatchExpressionAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ConvertToWatchExpressionAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/DisableWatchExpressionAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressionAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/PasteWatchExpressionsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ReevaluateWatchExpressionAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveAllExpressionsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveExpressionAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/SelectAllExpressionsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionFactoryTester.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/SelectAllVariablesAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ToggleDetailPaneAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneAssignValueAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneWordWrapAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/AbstractRequestMonitor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionsUpdater.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandService.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ICommandParticipant.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/IEnabledTarget.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRemoveAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateActionsRequest.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateHandlerRequest.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextMessages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextMessages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextRunner.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextSourceProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/AsynchronousDebugLabelAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultVariableCellModifier.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultViewerInputProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockLabelAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryRetrievalContentAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/Messages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/Messages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/RegisterGroupProxy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameSourceDisplayAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameViewerInputProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnFactoryAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnPresentation.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointImportExport.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ExportBreakpoints.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/IImportExportConstants.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportBreakpoints.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportExportMessages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpoints.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpoints.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizard.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizard.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/WizardMessages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/WizardMessages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CollapseAllLaunchConfigurationAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorProjectPromptStatusHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorPromptStatusHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DebugModePromptStatusHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeleteLaunchConfigurationAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchConfigurationAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchDelegatesStatusHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/EnvironmentVariable.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterDropDownMenuCreator.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterLaunchConfigurationAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchCategoryFilter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationComparator.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationEditDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPropertiesDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationSelectionDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabImageDescriptor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTreeContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeContribution.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeFilter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationViewer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateContribution.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupExtension.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupFilter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchHistory.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutSelectionDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchTabContribution.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/OrganizeFavoritesAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetComparator.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IMemoryBlockConnection.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IMemoryRenderingUpdater.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IPersistableDebugElement.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingType.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/RenderingBindings.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTextRendering.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/MemoryViewPresentationContext.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementLabelProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementMementoProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugTargetContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionLabelProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerMementoProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionMementoProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchManagerContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockLabelProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryRetrievalContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryViewElementMementoProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupLabelProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupMementoProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameMementoProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ThreadContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableEditor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableLabelProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableMementoProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ViewerInputProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/BooleanFieldEditor2.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ConsolePreferencePage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencePage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/IDebugPreferenceConstants.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchersPreferencePage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchingPreferencePage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ViewManagementPreferencePage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddContainerAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/BasicContainerContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/DownAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditContainerAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditSourceLookupPathAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/LookupSourceAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/Prompter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RemoveAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/ResolveDuplicatesHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RestoreDefaultAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAdapterFactory.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerLabelProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerViewer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerWorkbenchAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementAdapterFactory.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementLabelProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementWorkbenchAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupPanel.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupResult.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIMessages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIMessages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIUtils.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/UpAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/WorkingSetSourceContainerType.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerBrowser.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ExternalArchiveSourceContainerBrowser.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerBrowser.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerBrowser.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkingSetSourceContainerBrowser.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkspaceSourceContainerBrowser.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePrompt.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FolderPrompt.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/IArgumentSelector.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PasswordPrompt.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/ResourceSelector.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceResolver.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedTextResolver.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringPrompt.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringSubstitutionMessages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringSubstitutionMessages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariableLabelProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariablePresentationManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SystemPropertyArgumentSelector.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AbstractUpdatePolicy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousSchedulingRuleFactory.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableModel.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableViewer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ChildrenRequestMonitor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/FindElementDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ILabelResult.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelRequestMonitor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelResult.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ModelNode.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/PartPresentationContext.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableAddRequestMonitor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableEditorImpl.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableInsertRequestMonitor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableRemoveRequestMonitor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableReplaceRequestMonitor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableUpdatePolicy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/AbstractBreadcrumb.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItem.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDetails.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbMessages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbMessages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/IBreadcrumbDropDownSite.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/FilterTransform.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ILabelUpdateListener.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/IMementoManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelCheckProviderTarget.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProviderTarget.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelLabelProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelLabelProviderTarget.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelViewer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ModelContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeCursor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualItem.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualTree.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckUpdate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckboxModelProxy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenCountUpdate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenUpdate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentation.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentationFactory.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementCompareRequest.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementEditor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementLabelProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoRequest.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IHasChildrenUpdate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ILabelUpdate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelChangedListener.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDelta.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDeltaVisitor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory2.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicyFactory.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStateUpdateListener.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStatusMonitor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputRequestor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputUpdate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdateListener.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTreeModelViewer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractColumnPresentation.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractModelProxy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousContentAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousLabelAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IAsynchronousContentAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IAsynchronousLabelAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IChildrenRequestMonitor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IContainerRequestMonitor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/ILabelRequestMonitor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugEventHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetEventHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetProxy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultExpressionModelProxy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelProxyFactory.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelSelectionPolicyFactory.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultSelectionPolicy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultVariableViewModelProxy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultWatchExpressionModelProxy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/EventHandlerModelProxy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionEventHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionManagerModelProxy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchManagerProxy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryBlockProxy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ProcessProxy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/StackFrameEventHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/VariablesViewEventHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugModelPresentationContext.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/IDebugExceptionHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFactory.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetCache.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetElementAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsComparator.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDragAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDropAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsLabelProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewEventHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/FileBreakpointOrganizer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/IBreakpointOrganizer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/OtherBreakpointCategory.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ProjectBreakpointOrganizer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetCategory.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleLineNotifier.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleMessages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleMessages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveLaunchAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleShowPreferencesAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleTerminateAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsoleManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessTypePropertyTester.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardErrorAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardOutAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowWhenContentChangesAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementHelper.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewModeAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/Decoration.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DecorationManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/ImageImageDescriptor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditorInput.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/StandardDecoration.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingContextAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/CodePagesPreferencePage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryView.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewPane.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewTab.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/LinkRenderingPanesAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewIdRegistry.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPrefAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeModelContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeViewer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MonitorMemoryBlockDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/NewMemoryViewAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PinMemoryBlockAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PropertyChangeNotifier.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveMemoryRenderingAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveRenderingContextAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockPreferencePage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SetPaddedStringPreferencePage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SynchronizeInfo.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleMemoryMonitorsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleSplitPaneAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleViewPaneAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneOrientationAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneSelectionProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRendering.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRenderingTypeDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractBaseTableRendering.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractIntegerRendering.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractTableRenderingLabelProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractVirtualContentTableModel.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncCopyTableRenderingAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncVirtualContentTableViewer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BigEndianAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/DefaultEndianessAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ErrorRendering.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressComposite.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRenderingDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRenderingTypeDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/IContentChangeComputer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/IPresentationErrorListener.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/IVirtualContentListener.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/LittleEndianAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/MemorySegment.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PendingPropertyChanges.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ReformatAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/RenderingsUtil.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ResetToBaseAddressAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRendering.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRenderingTypeDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingCellModifier.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentDescriptor.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProviderEx.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLine.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPrefAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPreferencePage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRendering.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRenderingTypeDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/IHelpContextIdProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesViewMessages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesViewMessages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersView.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersViewMessages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersViewMessages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedValuePartition.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedVariablePartition.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/LogicalStructureCache.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectionDragAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleLogicalStructureAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleShowColumnsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariableViewToggleAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesViewMessages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesViewMessages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesViewResourceBundleMessages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AbstractDetailPane.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AvailableDetailPanesAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPaneFactory.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailMessages.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailMessages.properties org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneProxy.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/IDetailPaneContainer.java org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/IDetailPaneContainer2.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTab.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTabGroup.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/BreakpointTypeCategory.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugElementWorkbenchAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DeferredDebugElementWorkbenchAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegateExtension.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointTypeCategory.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugEditorPresentation.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentation.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentationExtension.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPane.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPane2.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPaneFactory.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IInstructionPointerPresentation.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTabGroup.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchGroup.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchShortcut.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchShortcut2.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ISourcePresentation.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IValueDetailListener.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/WorkingDirectoryBlock.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchToolbarAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ExportBreakpointsOperation.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IAddMemoryBlocksTarget.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IAddMemoryRenderingsTarget.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ILaunchable.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IRunToLineTarget.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTarget.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetExtension.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetFactory.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IVariableValueEditor.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapter.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapter2.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapterExtension.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerEnableDisableBreakpointActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerToggleBreakpointActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleMethodBreakpointActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleWatchpointActionDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/package.html org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/ConsoleColorProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsole.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleColorProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleHyperlink.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleLineTracker.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleLineTrackerExtension.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/package.html org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/AbstractDebugContextProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/DebugContextEvent.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextListener.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextService.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISuspendTrigger.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISuspendTriggerListener.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/package.html org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRenderingBindingsProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTextRendering.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryBlockTablePresentation.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRendering.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingBindingsListener.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingBindingsProvider.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingContainer.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingManager.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingSite.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingSynchronizationService.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingType.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingTypeDelegate.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IRepositionableMemoryRendering.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IResettableMemoryRendering.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/MemoryRenderingElement.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/package.html org.eclipse.debug.ui/ui/org/eclipse/debug/ui/package.html org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/AbstractSourceContainerBrowser.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditorInput.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/ISourceContainerBrowser.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/ISourceDisplay.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/ISourceLookupResult.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupDialog.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupTab.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/package.html org.eclipse.ui.console/.classpath org.eclipse.ui.console/.cvsignore org.eclipse.ui.console/.project org.eclipse.ui.console/.settings/org.eclipse.jdt.core.prefs org.eclipse.ui.console/.settings/org.eclipse.pde.prefs org.eclipse.ui.console/META-INF/MANIFEST.MF org.eclipse.ui.console/about.html org.eclipse.ui.console/build.properties org.eclipse.ui.console/icons/full/clcl16/clear_co.gif org.eclipse.ui.console/icons/full/clcl16/lock_co.gif org.eclipse.ui.console/icons/full/clcl16/pin.gif org.eclipse.ui.console/icons/full/cview16/console_view.gif org.eclipse.ui.console/icons/full/dlcl16/clear_co.gif org.eclipse.ui.console/icons/full/dlcl16/lock_co.gif org.eclipse.ui.console/icons/full/dlcl16/pin.gif org.eclipse.ui.console/icons/full/dlcl16/rem_co.gif org.eclipse.ui.console/icons/full/elcl16/clear_co.gif org.eclipse.ui.console/icons/full/elcl16/lock_co.gif org.eclipse.ui.console/icons/full/elcl16/new_con.gif org.eclipse.ui.console/icons/full/elcl16/pin.gif org.eclipse.ui.console/icons/full/elcl16/rem_co.gif org.eclipse.ui.console/icons/full/eview16/console_view.gif org.eclipse.ui.console/plugin.properties org.eclipse.ui.console/plugin.xml org.eclipse.ui.console/schema/consoleFactories.exsd org.eclipse.ui.console/schema/consolePageParticipants.exsd org.eclipse.ui.console/schema/consolePatternMatchListeners.exsd org.eclipse.ui.console/scripts/exportplugin.xml org.eclipse.ui.console/src/org/eclipse/ui/console/AbstractConsole.java org.eclipse.ui.console/src/org/eclipse/ui/console/ConsolePlugin.java org.eclipse.ui.console/src/org/eclipse/ui/console/IConsole.java org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleConstants.java org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleDocumentPartitioner.java org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleFactory.java org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleListener.java org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleManager.java org.eclipse.ui.console/src/org/eclipse/ui/console/IConsolePageParticipant.java org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleView.java org.eclipse.ui.console/src/org/eclipse/ui/console/IHyperlink.java org.eclipse.ui.console/src/org/eclipse/ui/console/IHyperlink2.java org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleOutputStream.java org.eclipse.ui.console/src/org/eclipse/ui/console/IPatternMatchListener.java org.eclipse.ui.console/src/org/eclipse/ui/console/IPatternMatchListenerDelegate.java org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsole.java org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsoleStream.java org.eclipse.ui.console/src/org/eclipse/ui/console/PatternMatchEvent.java org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsole.java org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java org.eclipse.ui.console/src/org/eclipse/ui/console/actions/ClearOutputAction.java org.eclipse.ui.console/src/org/eclipse/ui/console/actions/CloseConsoleAction.java org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerAction.java org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerGotoLineAction.java org.eclipse.ui.console/src/org/eclipse/ui/console/actions/package.html org.eclipse.ui.console/src/org/eclipse/ui/console/package.html org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocument.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleFactoryExtension.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleHyperlinkPosition.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleMessages.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleMessages.properties org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePageParticipantExtension.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePatternMatcher.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePluginImages.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleResourceBundleMessages.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleResourceBundleMessages.properties org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleTypePropertyTester.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleViewConsoleFactory.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleWorkbenchPart.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/FollowHyperlinkAction.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/HyperlinkUpdater.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IConsoleHelpContextIds.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IInternalConsoleConstants.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePage.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartition.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartitioner.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsoleViewer.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/OpenConsoleAction.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PatternMatchListener.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PatternMatchListenerExtension.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PinConsoleAction.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ScrollLockAction.java org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ShowConsoleAction.java org.eclipse.ui.externaltools/.classpath org.eclipse.ui.externaltools/.cvsignore org.eclipse.ui.externaltools/.project org.eclipse.ui.externaltools/.settings/org.eclipse.jdt.core.prefs org.eclipse.ui.externaltools/.settings/org.eclipse.jdt.ui.prefs org.eclipse.ui.externaltools/.settings/org.eclipse.pde.prefs org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuildTab.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuilderTab.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.properties org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsMainTab.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsUtil.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/IgnoreWhiteSpaceComparator.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/WorkingSetComparator.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/menu/ExternalToolMenuDelegate.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/menu/OpenExternalToolsConfigurations.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/BuilderUtils.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsImages.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsModelMessages.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsModelMessages.properties org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsPlugin.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsPreferenceInitializer.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolConstants.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolsHelpContextIds.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IPreferenceConstants.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ImageDescriptorRegistry.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderLabelProvider.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/EditCommandDialog.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/ExternalToolsPreferencePage.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/ExternalToolsUIMessages.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/ExternalToolsUIMessages.properties org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/FileSelectionDialog.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/TreeAndListGroup.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildFilesResolver.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildProjectResolver.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildTypeResolver.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/SystemPathResolver.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/VariableMessages.java org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/VariableMessages.properties org.eclipse.ui.externaltools/META-INF/MANIFEST.MF org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ExternalToolsProgramMessages.java org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ExternalToolsProgramMessages.properties org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramBuilderTabGroup.java org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramMainTab.java org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramTabGroup.java org.eclipse.ui.externaltools/about.html org.eclipse.ui.externaltools/build.properties org.eclipse.ui.externaltools/buildfiles/exportplugin.xml org.eclipse.ui.externaltools/icons/full/dtool16/external_tools.gif org.eclipse.ui.externaltools/icons/full/etool16/external_tools.gif org.eclipse.ui.externaltools/icons/full/obj16/build_tab.gif org.eclipse.ui.externaltools/icons/full/obj16/builder.gif org.eclipse.ui.externaltools/icons/full/obj16/classpath.gif org.eclipse.ui.externaltools/icons/full/obj16/external_tools.gif org.eclipse.ui.externaltools/icons/full/obj16/invalid_build_tool.gif org.eclipse.ui.externaltools/icons/full/obj16/main_tab.gif org.eclipse.ui.externaltools/icons/full/wizban/ext_tools_wiz.png org.eclipse.ui.externaltools/plugin.properties org.eclipse.ui.externaltools/plugin.xml org.eclipse.ui.externaltools/schema/configurationDuplicationMaps.exsd
Diffstat (limited to 'org.eclipse.debug.ui/ui/org')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugCheckboxSelectionDialog.java155
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugListSelectionDialog.java99
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugSelectionDialog.java215
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/BreakpointImageProvider.java56
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java57
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/CompositeDebugImageDescriptor.java122
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugModelPropertyTester.java92
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java67
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java355
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIAdapterFactory.java61
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java259
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties238
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java1271
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java213
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.java568
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java478
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DynamicInstructionPointerAnnotation.java65
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java153
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java430
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ILaunchHistoryChangedListener.java28
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ILaunchLabelChangedListener.java39
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java91
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerAnnotation.java49
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerContext.java100
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerImageProvider.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerManager.java338
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java119
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java483
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java339
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/Pair.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ResourceExtender.java140
-rwxr-xr-xorg.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/SWTFactory.java520
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariableValueEditorManager.java108
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariablesViewModelPresentation.java59
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/WorkingDirectoryStatusHandler.java39
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java323
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveActionDelegate.java39
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveAllActionDelegate.java117
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractSelectionActionDelegate.java232
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java233
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties215
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java189
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CollapseAllAction.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ConfigureColumnsAction.java147
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugAsAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugContextualLaunchAction.java29
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugHistoryMenuAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugLastAction.java81
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugToolbarAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EditLaunchConfigurationAction.java156
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ExecutionAction.java93
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/IToggleBreakpointsTargetManagerListener.java29
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchConfigurationAction.java84
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchShortcutAction.java153
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchablePropertyTester.java70
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenDebugConfigurations.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenProfileConfigurations.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenRunConfigurations.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileAsAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileContextualLaunchAction.java29
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileHistoryMenuAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileLastAction.java82
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileToolbarAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchActionDelegate.java86
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchLastAction.java228
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java112
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetAction.java287
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetRunToLineAction.java118
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunAsAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunContextualLaunchAction.java29
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunHistoryMenuAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunLastAction.java81
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunToolbarAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java74
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StatusInfo.java171
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java724
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java90
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ViewManagementAction.java36
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractBreakpointsViewAction.java62
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AdvancedGroupBreakpointsByAction.java45
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointGroupMessages.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointGroupMessages.properties30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointSelectionAction.java43
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointWorkingSetAction.java70
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ClearDefaultBreakpointGroupAction.java32
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/CopyBreakpointsAction.java136
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/EditBreakpointGroupAction.java66
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsAction.java63
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByAction.java167
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java534
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/PasteBreakpointsAction.java87
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/RemoveFromWorkingSetAction.java64
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java106
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SetDefaultBreakpointGroupAction.java45
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ToggleDefaultGroupAction.java69
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/WorkingSetsAction.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/AccessWatchpointToggleAction.java46
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointTypesContribution.java123
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsCollapseAllAction.java78
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsExpandAllAction.java46
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DeleteWorkingsetsMessageDialog.java143
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DisableBreakpointsAction.java22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java294
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/LinkBreakpointsWithDebugViewAction.java55
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/Messages.java32
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/Messages.properties15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModificationWatchpointToggleAction.java46
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModifyWatchpointAction.java127
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/OpenBreakpointMarkerAction.java103
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveAllBreakpointsAction.java125
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveBreakpointAction.java165
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetBreakpointAction.java82
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetMethodBreakpointAction.java44
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleBreakpointAction.java55
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleLineBreakpointAction.java44
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetWatchpointAction.java44
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RulerEnableDisableBreakpointAction.java67
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SelectAllBreakpointsAction.java87
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.java228
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SkipAllBreakpointsAction.java153
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ToggleBreakpointObjectActionDelegate.java107
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/AddWatchExpressionAction.java56
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ConvertToWatchExpressionAction.java46
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/DisableWatchExpressionAction.java23
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressionAction.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java140
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/PasteWatchExpressionsAction.java49
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ReevaluateWatchExpressionAction.java93
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveAllExpressionsAction.java100
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveExpressionAction.java70
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/SelectAllExpressionsAction.java69
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionAction.java118
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java178
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionFactoryTester.java56
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchHandler.java137
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java178
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java286
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/SelectAllVariablesAction.java36
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java103
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ToggleDetailPaneAction.java93
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneAssignValueAction.java151
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthAction.java43
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthDialog.java178
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneWordWrapAction.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/AbstractRequestMonitor.java84
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionsUpdater.java52
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandActionDelegate.java90
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandService.java278
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandAction.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandAction.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java70
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ICommandParticipant.java23
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/IEnabledTarget.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandAction.java60
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandActionDelegate.java55
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandAction.java62
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandActionDelegate.java55
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandAction.java62
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandActionDelegate.java27
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandAction.java64
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandActionDelegate.java27
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandAction.java64
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandActionDelegate.java27
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandAction.java59
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandActionDelegate.java27
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllAction.java124
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java112
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRemoveAction.java76
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandAction.java62
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandActionDelegate.java27
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java179
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandActionDelegate.java36
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateActionsRequest.java51
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateHandlerRequest.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextMessages.java39
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextMessages.properties23
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextRunner.java291
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java699
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java158
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextSourceProvider.java73
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.java453
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java329
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java138
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java55
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/AsynchronousDebugLabelAdapter.java135
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultVariableCellModifier.java74
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultViewerInputProvider.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.java503
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockLabelAdapter.java60
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryRetrievalContentAdapter.java52
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java418
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/Messages.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/Messages.properties14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/RegisterGroupProxy.java429
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameSourceDisplayAdapter.java237
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameViewerInputProvider.java47
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnFactoryAdapter.java52
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnPresentation.java86
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointImportExport.properties33
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java321
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ExportBreakpoints.java65
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/IImportExportConstants.java150
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportBreakpoints.java59
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportExportMessages.java49
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpoints.java105
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java340
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpoints.java98
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java220
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizard.java66
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java432
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizard.java69
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java359
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/WizardMessages.java53
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/WizardMessages.properties39
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java142
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java67
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CollapseAllLaunchConfigurationAction.java85
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorProjectPromptStatusHandler.java104
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorPromptStatusHandler.java71
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationAction.java115
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DebugModePromptStatusHandler.java73
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeleteLaunchConfigurationAction.java114
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java65
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchConfigurationAction.java84
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchDelegatesStatusHandler.java66
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/EnvironmentVariable.java86
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java471
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterDropDownMenuCreator.java143
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterLaunchConfigurationAction.java91
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchCategoryFilter.java88
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationComparator.java83
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java74
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationEditDialog.java93
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java221
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java1226
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java382
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPropertiesDialog.java270
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationSelectionDialog.java68
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java215
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java1412
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java250
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabImageDescriptor.java119
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTreeContentProvider.java212
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeContribution.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeFilter.java57
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java435
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationViewer.java275
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java1501
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java225
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties208
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateContribution.java46
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java50
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupExtension.java159
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupFilter.java85
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchHistory.java489
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java544
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutSelectionDialog.java149
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchTabContribution.java44
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/OrganizeFavoritesAction.java41
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java1094
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java281
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java129
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java115
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java297
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetComparator.java52
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java114
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IMemoryBlockConnection.java27
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IMemoryRenderingUpdater.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IPersistableDebugElement.java63
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingManager.java183
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingType.java87
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/RenderingBindings.java296
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java3304
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTextRendering.java144
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/MemoryViewPresentationContext.java73
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementLabelProvider.java118
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementMementoProvider.java76
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugTargetContentProvider.java87
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java284
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java361
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java100
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionContentProvider.java163
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionLabelProvider.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerContentProvider.java52
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerMementoProvider.java36
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionMementoProvider.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchContentProvider.java50
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchManagerContentProvider.java45
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockContentProvider.java50
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockLabelProvider.java71
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryRetrievalContentProvider.java52
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryViewElementMementoProvider.java53
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupContentProvider.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupLabelProvider.java46
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupMementoProvider.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameContentProvider.java82
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameMementoProvider.java41
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ThreadContentProvider.java49
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java264
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableEditor.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableLabelProvider.java174
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableMementoProvider.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ViewerInputProvider.java115
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/BooleanFieldEditor2.java49
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ConsolePreferencePage.java237
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencePage.java83
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.java196
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties155
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/IDebugPreferenceConstants.java298
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java396
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java625
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchersPreferencePage.java323
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchingPreferencePage.java218
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java169
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java527
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java715
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ViewManagementPreferencePage.java272
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddContainerAction.java52
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java160
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/BasicContainerContentProvider.java90
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/DownAction.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditContainerAction.java90
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditSourceLookupPathAction.java86
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/LookupSourceAction.java74
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/Prompter.java86
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RemoveAction.java45
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/ResolveDuplicatesHandler.java82
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RestoreDefaultAction.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAction.java180
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAdapterFactory.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerLabelProvider.java88
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerViewer.java210
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerWorkbenchAdapter.java74
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementAdapterFactory.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementLabelProvider.java61
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementWorkbenchAdapter.java90
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java490
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java98
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupPanel.java392
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupResult.java129
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java95
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIMessages.java88
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIMessages.properties64
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIUtils.java111
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/UpAction.java62
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/WorkingSetSourceContainerType.java94
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java102
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java103
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerBrowser.java69
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerDialog.java230
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ExternalArchiveSourceContainerBrowser.java62
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerBrowser.java83
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java146
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerBrowser.java59
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerDialog.java78
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkingSetSourceContainerBrowser.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkspaceSourceContainerBrowser.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePrompt.java32
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FolderPrompt.java32
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/IArgumentSelector.java36
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PasswordPrompt.java96
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java115
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/ResourceSelector.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java250
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceResolver.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedTextResolver.java35
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringPrompt.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringSubstitutionMessages.java60
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringSubstitutionMessages.properties44
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariableLabelProvider.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariablePresentationManager.java109
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SystemPropertyArgumentSelector.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AbstractUpdatePolicy.java52
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java641
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java180
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousSchedulingRuleFactory.java99
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableModel.java200
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableViewer.java517
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java1193
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ChildrenRequestMonitor.java97
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/FindElementDialog.java51
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ILabelResult.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelRequestMonitor.java152
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelResult.java77
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ModelNode.java209
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/PartPresentationContext.java39
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableAddRequestMonitor.java45
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableEditorImpl.java355
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableInsertRequestMonitor.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableRemoveRequestMonitor.java35
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableReplaceRequestMonitor.java47
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableUpdatePolicy.java108
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/AbstractBreadcrumb.java318
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItem.java226
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDetails.java423
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java562
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbMessages.java35
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbMessages.properties13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java876
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/IBreadcrumbDropDownSite.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java306
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java137
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java193
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java120
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java55
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/FilterTransform.java503
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java140
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ILabelUpdateListener.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/IMementoManager.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelCheckProviderTarget.java50
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProvider.java182
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProviderTarget.java251
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelLabelProvider.java69
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelLabelProviderTarget.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelViewer.java199
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java2439
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java1470
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java193
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java89
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ModelContentProvider.java2041
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java552
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeCursor.java697
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java632
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java399
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java160
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java155
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java276
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java270
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java153
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualItem.java410
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualTree.java209
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckUpdate.java36
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckboxModelProxy.java43
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenCountUpdate.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenUpdate.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentation.java88
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentationFactory.java41
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementCompareRequest.java29
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementContentProvider.java50
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementEditor.java44
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementLabelProvider.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoProvider.java43
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoRequest.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IHasChildrenUpdate.java29
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ILabelUpdate.java75
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelChangedListener.java31
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDelta.java193
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDeltaVisitor.java31
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxy.java95
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory.java35
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory2.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicy.java87
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicyFactory.java35
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java99
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStateUpdateListener.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStatusMonitor.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputProvider.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputRequestor.java31
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputUpdate.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdate.java55
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdateListener.java47
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java359
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java244
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewer.java178
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java88
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTreeModelViewer.java174
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractColumnPresentation.java62
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractModelProxy.java165
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousContentAdapter.java173
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousLabelAdapter.java171
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IAsynchronousContentAdapter.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IAsynchronousLabelAdapter.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IChildrenRequestMonitor.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IContainerRequestMonitor.java32
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/ILabelRequestMonitor.java63
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugEventHandler.java186
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetEventHandler.java73
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetProxy.java150
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultExpressionModelProxy.java65
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelProxyFactory.java86
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelSelectionPolicyFactory.java36
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultSelectionPolicy.java126
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultVariableViewModelProxy.java66
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultWatchExpressionModelProxy.java135
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/EventHandlerModelProxy.java272
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionEventHandler.java59
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionManagerModelProxy.java120
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchManagerProxy.java100
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java172
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryBlockProxy.java71
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java176
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ProcessProxy.java103
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/StackFrameEventHandler.java61
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java357
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/VariablesViewEventHandler.java52
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugModelPresentationContext.java41
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.java59
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.properties45
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/IDebugExceptionHandler.java28
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextManager.java103
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java1122
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java201
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java118
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFactory.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java198
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java156
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java63
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java456
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java59
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetCache.java108
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetElementAdapter.java60
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java210
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsComparator.java135
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsContentProvider.java269
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDragAdapter.java83
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDropAdapter.java56
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsLabelProvider.java109
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java791
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewEventHandler.java186
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewer.java447
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/FileBreakpointOrganizer.java41
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/IBreakpointOrganizer.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/OtherBreakpointCategory.java95
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ProjectBreakpointOrganizer.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java99
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetCategory.java137
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleLineNotifier.java161
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleMessages.java41
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleMessages.properties25
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java96
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveLaunchAction.java139
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleShowPreferencesAction.java52
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleTerminateAction.java105
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java828
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsoleManager.java331
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java269
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessTypePropertyTester.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardErrorAction.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardOutAction.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowWhenContentChangesAction.java86
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java511
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java272
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java55
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java117
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java287
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementHelper.java239
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewModeAction.java78
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/Decoration.java32
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DecorationManager.java95
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/ImageImageDescriptor.java51
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java1392
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java518
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java53
-rwxr-xr-xorg.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.java39
-rwxr-xr-xorg.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.properties27
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditor.java109
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditorInput.java95
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/StandardDecoration.java46
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java430
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java430
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingAction.java44
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingContextAction.java89
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java586
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/CodePagesPreferencePage.java92
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryView.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewPane.java97
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewTab.java65
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/LinkRenderingPanesAction.java76
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java570
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java857
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewIdRegistry.java63
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPrefAction.java62
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java429
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java255
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeModelContentProvider.java104
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeViewer.java47
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java265
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MonitorMemoryBlockDialog.java167
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/NewMemoryViewAction.java107
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PinMemoryBlockAction.java47
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PropertyChangeNotifier.java49
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveMemoryRenderingAction.java77
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveRenderingContextAction.java88
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java1276
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java92
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockPreferencePage.java44
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java115
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SetPaddedStringPreferencePage.java56
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java410
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SynchronizeInfo.java115
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleMemoryMonitorsAction.java28
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleSplitPaneAction.java29
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleViewPaneAction.java101
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneOrientationAction.java57
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java407
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneSelectionProvider.java77
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java103
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRendering.java123
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRenderingTypeDelegate.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractBaseTableRendering.java175
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractIntegerRendering.java79
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractTableRenderingLabelProvider.java107
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractVirtualContentTableModel.java85
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncCopyTableRenderingAction.java55
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java56
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java283
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java195
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java1041
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncVirtualContentTableViewer.java483
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java123
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BigEndianAction.java101
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java189
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java362
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/DefaultEndianessAction.java70
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ErrorRendering.java90
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingAction.java47
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java563
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java206
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressComposite.java174
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressDialog.java148
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java105
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRenderingDelegate.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java71
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRenderingTypeDelegate.java31
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/IContentChangeComputer.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/IPresentationErrorListener.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/IVirtualContentListener.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/LittleEndianAction.java104
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/MemorySegment.java84
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PendingPropertyChanges.java79
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java196
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ReformatAction.java41
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/RenderingsUtil.java580
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ResetToBaseAddressAction.java87
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRendering.java213
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRenderingTypeDelegate.java31
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingCellModifier.java260
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentDescriptor.java212
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java205
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java989
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProvider.java101
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProviderEx.java158
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLine.java305
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java484
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPrefAction.java60
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPreferencePage.java219
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java175
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRendering.java241
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRenderingTypeDelegate.java31
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/IHelpContextIdProvider.java35
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java195
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesViewMessages.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesViewMessages.properties15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersView.java62
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersViewMessages.java25
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersViewMessages.properties11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java172
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedValuePartition.java138
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedVariablePartition.java181
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/LogicalStructureCache.java153
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java77
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectionDragAdapter.java80
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleLogicalStructureAction.java73
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleShowColumnsAction.java66
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariableViewToggleAction.java129
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java1218
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesViewMessages.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesViewMessages.properties25
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesViewResourceBundleMessages.properties14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AbstractDetailPane.java175
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AvailableDetailPanesAction.java157
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java984
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPaneFactory.java77
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailMessages.java41
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailMessages.properties28
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java510
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneProxy.java229
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/IDetailPaneContainer.java69
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/IDetailPaneContainer2.java29
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java123
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java998
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTab.java445
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTabGroup.java115
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/BreakpointTypeCategory.java109
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java935
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugElementWorkbenchAdapter.java71
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java215
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java895
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DeferredDebugElementWorkbenchAdapter.java72
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java685
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegate.java154
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegateExtension.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointTypeCategory.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugEditorPresentation.java53
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentation.java143
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentationExtension.java41
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java1266
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java177
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPane.java97
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPane2.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPaneFactory.java90
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IInstructionPointerPresentation.java109
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java120
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java238
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTabGroup.java158
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchGroup.java102
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchShortcut.java153
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchShortcut2.java93
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ISourcePresentation.java74
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IValueDetailListener.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java357
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java487
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java245
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/WorkingDirectoryBlock.java476
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java504
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchToolbarAction.java91
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java345
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java324
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugAction.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java343
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java279
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ExportBreakpointsOperation.java219
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IAddMemoryBlocksTarget.java65
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IAddMemoryRenderingsTarget.java84
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ILaunchable.java28
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IRunToLineTarget.java66
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTarget.java114
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetExtension.java56
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetFactory.java118
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IVariableValueEditor.java74
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapter.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapter2.java53
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapterExtension.java44
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java409
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAction.java178
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java310
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java329
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java149
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointAction.java106
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java243
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerEnableDisableBreakpointActionDelegate.java55
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerToggleBreakpointActionDelegate.java124
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunAction.java41
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java201
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java151
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java227
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleMethodBreakpointActionDelegate.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleWatchpointActionDelegate.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/package.html17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/ConsoleColorProvider.java98
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java159
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsole.java144
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleColorProvider.java88
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleHyperlink.java28
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleLineTracker.java68
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleLineTrackerExtension.java29
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/package.html51
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/AbstractDebugContextProvider.java88
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/DebugContextEvent.java98
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextListener.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextManager.java55
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextProvider.java72
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextService.java127
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISuspendTrigger.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISuspendTriggerListener.java39
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/package.html50
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java404
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRenderingBindingsProvider.java73
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java3814
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTextRendering.java143
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryBlockTablePresentation.java62
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRendering.java176
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingBindingsListener.java35
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingBindingsProvider.java79
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingContainer.java78
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingManager.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingSite.java63
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingSynchronizationService.java72
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingType.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingTypeDelegate.java36
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IRepositionableMemoryRendering.java53
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IResettableMemoryRendering.java36
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/MemoryRenderingElement.java77
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/package.html19
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/package.html72
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/AbstractSourceContainerBrowser.java58
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java313
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditorInput.java105
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/ISourceContainerBrowser.java82
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/ISourceDisplay.java45
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/ISourceLookupResult.java61
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupDialog.java145
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupTab.java150
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java109
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/package.html21
795 files changed, 0 insertions, 139472 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugCheckboxSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugCheckboxSelectionDialog.java
deleted file mode 100644
index cf7ce86f5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugCheckboxSelectionDialog.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-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.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-
-/**
- * This class provides selection dialog using a check box table viewer.
- *
- * @since 3.4
- */
-public abstract class AbstractDebugCheckboxSelectionDialog extends AbstractDebugSelectionDialog {
-
- /**
- * Whether to add Select All / De-select All buttons to the custom footer controls.
- */
- private boolean fShowSelectButtons = false;
-
- /**
- * Constructor
- * @param parentShell
- */
- public AbstractDebugCheckboxSelectionDialog(Shell parentShell) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- }
-
- /**
- * Returns the viewer cast to the correct instance. Possibly <code>null</code> if
- * the viewer has not been created yet.
- * @return the viewer cast to CheckboxTableViewer
- */
- protected CheckboxTableViewer getCheckBoxTableViewer() {
- return (CheckboxTableViewer) fViewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#initializeControls()
- */
- protected void initializeControls() {
- List selectedElements = getInitialElementSelections();
- if (selectedElements != null && !selectedElements.isEmpty()){
- getCheckBoxTableViewer().setCheckedElements(selectedElements.toArray());
- getCheckBoxTableViewer().setSelection(StructuredSelection.EMPTY);
- }
- super.initializeControls();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#createViewer(org.eclipse.swt.widgets.Composite)
- */
- protected StructuredViewer createViewer(Composite parent){
- //by default return a checkbox table viewer
- Table table = new Table(parent, SWT.BORDER | SWT.SINGLE | SWT.CHECK);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 150;
- table.setLayoutData(gd);
- return new CheckboxTableViewer(table);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#addViewerListeners(org.eclipse.jface.viewers.StructuredViewer)
- */
- protected void addViewerListeners(StructuredViewer viewer) {
- getCheckBoxTableViewer().addCheckStateListener(new DefaultCheckboxListener());
- }
-
- /**
- * A checkbox state listener that ensures that exactly one element is checked
- * and enables the OK button when this is the case.
- *
- */
- private class DefaultCheckboxListener implements ICheckStateListener{
- public void checkStateChanged(CheckStateChangedEvent event) {
- getButton(IDialogConstants.OK_ID).setEnabled(isValid());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.AbstractDebugSelectionDialog#isValid()
- */
- protected boolean isValid() {
- return getCheckBoxTableViewer().getCheckedElements().length > 0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- Object[] elements = getCheckBoxTableViewer().getCheckedElements();
- setResult(Arrays.asList(elements));
- super.okPressed();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#addCustomFooterControls(org.eclipse.swt.widgets.Composite)
- */
- protected void addCustomFooterControls(Composite parent) {
- if (fShowSelectButtons){
- Composite comp = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_HORIZONTAL);
- GridData gd = (GridData) comp.getLayoutData();
- gd.horizontalAlignment = SWT.END;
- Button button = SWTFactory.createPushButton(comp, DebugUIMessages.AbstractDebugCheckboxSelectionDialog_0, null);
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- getCheckBoxTableViewer().setAllChecked(true);
- getButton(IDialogConstants.OK_ID).setEnabled(isValid());
- }
- });
- button = SWTFactory.createPushButton(comp, DebugUIMessages.AbstractDebugCheckboxSelectionDialog_1, null);
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- getCheckBoxTableViewer().setAllChecked(false);
- getButton(IDialogConstants.OK_ID).setEnabled(isValid());
- }
- });
- }
- }
-
- /**
- * If this setting is set to true before the dialog is opened, a Select All and
- * a De-select All button will be added to the custom footer controls. The default
- * setting is false.
- *
- * @param setting whether to show the select all and de-select all buttons
- */
- protected void setShowSelectAllButtons(boolean setting){
- fShowSelectButtons = setting;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugListSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugListSelectionDialog.java
deleted file mode 100644
index 5235b9105..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugListSelectionDialog.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This class provides a simple selection dialog displaying items in a table.
- *
- * @since 3.3
- */
-public abstract class AbstractDebugListSelectionDialog extends AbstractDebugSelectionDialog {
-
- protected TableViewer fListViewer;
-
- /**
- * Constructor
- * @param parentShell
- */
- public AbstractDebugListSelectionDialog(Shell parentShell) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.AbstractDebugSelectionDialog#createViewer(org.eclipse.swt.widgets.Composite)
- */
- protected StructuredViewer createViewer(Composite parent){
- //by default return a table viewer
- fListViewer = new TableViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 150;
- fListViewer.getTable().setLayoutData(gd);
- return fListViewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#addViewerListeners(org.eclipse.jface.viewers.StructuredViewer)
- */
- protected void addViewerListeners(StructuredViewer viewer) {
- viewer.addSelectionChangedListener(new ISelectionChangedListener(){
- public void selectionChanged(SelectionChangedEvent event) {
- getButton(IDialogConstants.OK_ID).setEnabled(isValid());
- }
- });
- viewer.addDoubleClickListener(new IDoubleClickListener(){
- public void doubleClick(DoubleClickEvent event) {
- if (isValid()){
- okPressed();
- }
- }
- });
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.AbstractDebugSelectionDialog#isValid()
- */
- protected boolean isValid() {
- if(fListViewer != null) {
- ISelection sel = fListViewer.getSelection();
- if(sel instanceof IStructuredSelection) {
- return ((IStructuredSelection)sel).size() == 1;
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- ISelection selection = fViewer.getSelection();
- if (selection instanceof IStructuredSelection) {
- setResult(((IStructuredSelection) selection).toList());
- }
- super.okPressed();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugSelectionDialog.java
deleted file mode 100644
index cbf3d0870..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugSelectionDialog.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-import java.util.List;
-
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-
-/**
- * This class provides the framework for a general selection dialog class.
- *
- * @see AbstractDebugListSelectionDialog
- * @see AbstractDebugCheckboxSelectionDialog
- *
- * @since 3.3
- */
-public abstract class AbstractDebugSelectionDialog extends SelectionDialog {
-
- protected StructuredViewer fViewer = null;
-
- /**
- * Constructor
- * @param parentShell
- */
- public AbstractDebugSelectionDialog(Shell parentShell) {
- super(parentShell);
- setDialogBoundsSettings(getDialogBoundsSettings(), Dialog.DIALOG_PERSISTSIZE);
- }
-
- /**
- * returns the dialog settings area id
- * @return the id of the dialog settings area
- */
- protected abstract String getDialogSettingsId();
-
- /**
- * Returns the object to use as input for the viewer
- * @return the object to use as input for the viewer
- */
- protected abstract Object getViewerInput();
-
- /**
- * Create and return a viewer to use in this dialog.
- *
- * @param parent the composite the viewer should be created in
- * @return the viewer to use in the dialog
- */
- protected abstract StructuredViewer createViewer(Composite parent);
-
- /**
- * Returns if the dialog and/or current selection is/are valid.
- * This method is polled when selection changes are made to update the enablement
- * of the OK button by default
- * @return true if the dialog is in a valid state, false otherwise
- *
- * @since 3.4
- */
- protected abstract boolean isValid();
-
- /**
- * Returns the content provider for the viewer
- * @return the content provider for the viewer
- */
- protected IContentProvider getContentProvider() {
- //by default return a simple array content provider
- return new ArrayContentProvider();
- }
-
- /**
- * Returns the label provider used by the viewer
- * @return the label provider used in the viewer
- */
- protected IBaseLabelProvider getLabelProvider() {
- return new DefaultLabelProvider();
- }
-
- /**
- * Returns the help context id for this dialog
- * @return the help context id for this dialog
- */
- abstract protected String getHelpContextId();
-
- /**
- * This method allows listeners to be added to the viewer after it
- * is created.
- */
- /**
- * This method allows listeners to be added to the viewer. Called
- * after the viewer has been created and its input set.
- *
- * @param viewer the viewer returned by createViewer()
- */
- protected void addViewerListeners(StructuredViewer viewer){
- //do nothing by default
- }
-
- /**
- * This method allows custom controls to be added before the viewer
- * @param parent the parent composite to add these custom controls to
- */
- protected void addCustomHeaderControls(Composite parent) {
- //do nothing by default
- }
-
- /**
- * This method allows custom controls to be added after the viewer
- * @param parent the parent composite to add these controls to
- */
- protected void addCustomFooterControls(Composite parent) {
- //do nothing by default
- }
-
- /**
- * This method allows the newly created controls to be initialized.
- * This method is called only once all controls have been created from the
- * <code>createContents</code> method.
- *
- * By default this method initializes the OK button control.
- */
- protected void initializeControls() {
- getButton(IDialogConstants.OK_ID).setEnabled(isValid());
- }
-
- /**
- * Returns the viewer used to display information in this dialog.
- * Can be <code>null</code> if the viewer has not been created.
- * @return viewer used in this dialog
- */
- protected Viewer getViewer(){
- return fViewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Composite comp = (Composite) super.createContents(parent);
- initializeControls();
- return comp;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- initializeDialogUnits(parent);
- Composite comp = (Composite) super.createDialogArea(parent);
- addCustomHeaderControls(comp);
- String label = getMessage();
- if(label != null && !IInternalDebugCoreConstants.EMPTY_STRING.equals(label)) {
- SWTFactory.createWrapLabel(comp, label, 1);
- }
- label = getViewerLabel();
- if(label != null && !IInternalDebugCoreConstants.EMPTY_STRING.equals(label)) {
- SWTFactory.createLabel(comp, label, 1);
- }
- fViewer = createViewer(comp);
- fViewer.setLabelProvider(getLabelProvider());
- fViewer.setContentProvider(getContentProvider());
- fViewer.setInput(getViewerInput());
- List selectedElements = getInitialElementSelections();
- if (selectedElements != null && !selectedElements.isEmpty()){
- fViewer.setSelection(new StructuredSelection(selectedElements));
- }
- addViewerListeners(fViewer);
- addCustomFooterControls(comp);
- Dialog.applyDialogFont(comp);
- String help = getHelpContextId();
- if(help != null) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(comp, help);
- }
- return comp;
- }
-
- /**
- * This method returns the label describing what to do with the viewer. Typically this label
- * will include the key accelerator to get to the viewer via the keyboard
- * @return the label for the viewer
- */
- abstract protected String getViewerLabel();
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.dialogs.SelectionDialog#getDialogBoundsSettings()
- */
- protected IDialogSettings getDialogBoundsSettings() {
- IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(getDialogSettingsId());
- if (section == null) {
- section = settings.addNewSection(getDialogSettingsId());
- }
- return section;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/BreakpointImageProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/BreakpointImageProvider.java
deleted file mode 100644
index 6f8b99ebc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/BreakpointImageProvider.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.texteditor.IAnnotationImageProvider;
-import org.eclipse.ui.texteditor.MarkerAnnotation;
-
-/**
- * Provides managed images for breakpoint annotations.
- * @since 3.0
- */
-public class BreakpointImageProvider implements IAnnotationImageProvider {
-
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getManagedImage(org.eclipse.jface.text.source.Annotation)
- */
- public Image getManagedImage(Annotation annotation) {
- if (annotation instanceof MarkerAnnotation) {
- IMarker marker = ((MarkerAnnotation)annotation).getMarker();
- if (marker != null) {
- IBreakpoint breakpoint = DebugPlugin.getDefault().getBreakpointManager().getBreakpoint(marker);
- if (breakpoint != null) {
- return DebugUIPlugin.getModelPresentation().getImage(breakpoint);
- }
- }
- }
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getImageDescriptorId(org.eclipse.jface.text.source.Annotation)
- */
- public String getImageDescriptorId(Annotation annotation) {
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getImageDescriptor(java.lang.String)
- */
- public ImageDescriptor getImageDescriptor(String imageDescritporId) {
- return null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java
deleted file mode 100644
index a09ae6d0b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Generic color manager.
- */
-public class ColorManager {
-
- private static ColorManager fgColorManager;
-
- private ColorManager() {
- }
-
- public static ColorManager getDefault() {
- if (fgColorManager == null) {
- fgColorManager= new ColorManager();
- }
- return fgColorManager;
- }
-
- protected Map fColorTable= new HashMap(10);
-
- public Color getColor(RGB rgb) {
- Color color= (Color) fColorTable.get(rgb);
- if (color == null) {
- color= new Color(Display.getCurrent(), rgb);
- fColorTable.put(rgb, color);
- }
- return color;
- }
-
- public void dispose() {
- Iterator e= fColorTable.values().iterator();
- while (e.hasNext())
- ((Color) e.next()).dispose();
- }
-}
-
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/CompositeDebugImageDescriptor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/CompositeDebugImageDescriptor.java
deleted file mode 100644
index e43235ce7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/CompositeDebugImageDescriptor.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.resource.CompositeImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.Point;
-
-/**
- * A JDIImageDescriptor consists of a main icon and several adornments. The adornments
- * are computed according to flags set on creation of the descriptor.
- */
-public class CompositeDebugImageDescriptor extends CompositeImageDescriptor {
-
- /** Flag to render the skip breakpoint adornment */
- public final static int SKIP_BREAKPOINT= 0x0001;
-
- private Image fBaseImage;
- private int fFlags;
- private Point fSize;
-
- /**
- * Create a new composite image descriptor.
- *
- * @param baseImage an image used as the base image
- * @param flags flags indicating which adornments are to be rendered
- *
- */
- public CompositeDebugImageDescriptor(Image baseImage, int flags) {
- setBaseImage(baseImage);
- setFlags(flags);
- }
-
- /**
- * @see CompositeImageDescriptor#getSize()
- */
- protected Point getSize() {
- if (fSize == null) {
- ImageData data= getBaseImage().getImageData();
- setSize(new Point(data.width, data.height));
- }
- return fSize;
- }
-
- /**
- * @see Object#equals(java.lang.Object)
- */
- public boolean equals(Object object) {
- if (!(object instanceof CompositeDebugImageDescriptor)){
- return false;
- }
- CompositeDebugImageDescriptor other= (CompositeDebugImageDescriptor)object;
- return (getBaseImage().equals(other.getBaseImage()) && getFlags() == other.getFlags());
- }
-
- /**
- * @see Object#hashCode()
- */
- public int hashCode() {
- return getBaseImage().hashCode() | getFlags();
- }
-
- /**
- * @see CompositeImageDescriptor#drawCompositeImage(int, int)
- */
- protected void drawCompositeImage(int width, int height) {
- ImageData bg= getBaseImage().getImageData();
- if (bg == null) {
- bg= DEFAULT_IMAGE_DATA;
- }
- drawImage(bg, 0, 0);
- drawOverlays();
- }
-
- /**
- * Add any overlays to the image as specified in the flags.
- */
- protected void drawOverlays() {
- int flags= getFlags();
- int x= 0;
- int y= 0;
- ImageData data= null;
- if ((flags & SKIP_BREAKPOINT) != 0) {
- x= 0;
- y= 0;
- data= DebugUITools.getImage(IDebugUIConstants.IMG_OVR_SKIP_BREAKPOINT).getImageData();
- drawImage(data, x, y);
- }
- }
-
- protected Image getBaseImage() {
- return fBaseImage;
- }
-
- protected void setBaseImage(Image image) {
- fBaseImage = image;
- }
-
- protected int getFlags() {
- return fFlags;
- }
-
- protected void setFlags(int flags) {
- fFlags = flags;
- }
-
- protected void setSize(Point size) {
- fSize = size;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugModelPropertyTester.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugModelPropertyTester.java
deleted file mode 100644
index 39b92de65..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugModelPropertyTester.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems (Pawel Piech) - added support for IDebugModelProvider (Bug 212314)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugModelProvider;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IDisconnect;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.ITerminate;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-
-/**
- * This class is used to check properties of a debug model. Two properties can be checked.
- * Using "getModelIdentifier" compares the debug model identifier of the receiver against the
- * expected value passed as an argument. The "isTerminatedOrDisconnected" property checks if
- * the receiver is terminated or disconnected.
- *
- * @since 3.3
- */
-public class DebugModelPropertyTester extends PropertyTester {
-
- public static final String MODEL_TYPE_PROPERTY = "getModelIdentifier"; //$NON-NLS-1$
- public static final String IS_TERMINATED_OR_DISCONNECTED_PROPERTY = "isTerminatedOrDisconnected"; //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.core.expressions.PropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
- */
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if (MODEL_TYPE_PROPERTY.equals(property)){
- IDebugTarget target = null;
- if(receiver instanceof IProcess) {
- target = (IDebugTarget) ((IProcess)receiver).getAdapter(IDebugTarget.class);
- }
- else if(receiver instanceof IDebugElement) {
- target = (IDebugTarget) ((IDebugElement)receiver).getAdapter(IDebugTarget.class);
- }
- if(target != null) {
- // check that the expected value argument is valid
- if (expectedValue == null || expectedValue.equals(IInternalDebugCoreConstants.EMPTY_STRING)){
- return false;
- }
- //!target.isTerminated() && !target.isDisconnected()
- if(expectedValue.equals(target.getModelIdentifier())) {
- return true;
- }
- }
- IDebugModelProvider modelProvider = null;
- if (receiver instanceof IAdaptable) {
- modelProvider = (IDebugModelProvider) ((IAdaptable)receiver).getAdapter(IDebugModelProvider.class);
- } else {
- modelProvider =
- (IDebugModelProvider) Platform.getAdapterManager().
- getAdapter(receiver, IDebugModelProvider.class);
- }
- if (modelProvider != null) {
- String[] ids = modelProvider.getModelIdentifiers();
- for (int i = 0; i < ids.length; i++) {
- if (ids[i].equals(expectedValue)) {
- return true;
- }
- }
- return false;
- }
- // There is no element selected with an associated debug model.
- // Return true iff the expected value is an empty string.
- return "".equals(expectedValue); //$NON-NLS-1$
- } else if (IS_TERMINATED_OR_DISCONNECTED_PROPERTY.equals(property)){
- if (receiver instanceof ITerminate && ((ITerminate)receiver).isTerminated()){
- return true;
- } if (receiver instanceof IDisconnect && ((IDisconnect)receiver).isDisconnected()){
- return true;
- } else {
- return false;
- }
- } else {
- return false;
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java
deleted file mode 100644
index 93b2f7d17..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-import org.eclipse.ui.console.IConsoleConstants;
-
-/**
- * The debug perspective factory.
- */
-public class DebugPerspectiveFactory implements IPerspectiveFactory {
-
- /**
- * @see IPerspectiveFactory#createInitialLayout(IPageLayout)
- */
- public void createInitialLayout(IPageLayout layout) {
-
- IFolderLayout consoleFolder = layout.createFolder(IInternalDebugUIConstants.ID_CONSOLE_FOLDER_VIEW, IPageLayout.BOTTOM, (float)0.75, layout.getEditorArea());
- consoleFolder.addView(IConsoleConstants.ID_CONSOLE_VIEW);
- consoleFolder.addView(IPageLayout.ID_TASK_LIST);
- consoleFolder.addPlaceholder(IPageLayout.ID_BOOKMARKS);
- consoleFolder.addPlaceholder(IPageLayout.ID_PROP_SHEET);
-
- IFolderLayout navFolder= layout.createFolder(IInternalDebugUIConstants.ID_NAVIGATOR_FOLDER_VIEW, IPageLayout.TOP, (float) 0.45, layout.getEditorArea());
- navFolder.addView(IDebugUIConstants.ID_DEBUG_VIEW);
- navFolder.addPlaceholder(IPageLayout.ID_RES_NAV);
-
- IFolderLayout toolsFolder= layout.createFolder(IInternalDebugUIConstants.ID_TOOLS_FOLDER_VIEW, IPageLayout.RIGHT, (float) 0.50, IInternalDebugUIConstants.ID_NAVIGATOR_FOLDER_VIEW);
- toolsFolder.addView(IDebugUIConstants.ID_VARIABLE_VIEW);
- toolsFolder.addView(IDebugUIConstants.ID_BREAKPOINT_VIEW);
- toolsFolder.addPlaceholder(IDebugUIConstants.ID_EXPRESSION_VIEW);
- toolsFolder.addPlaceholder(IDebugUIConstants.ID_REGISTER_VIEW);
-
- IFolderLayout outlineFolder= layout.createFolder(IInternalDebugUIConstants.ID_OUTLINE_FOLDER_VIEW, IPageLayout.RIGHT, (float) 0.75, layout.getEditorArea());
- outlineFolder.addView(IPageLayout.ID_OUTLINE);
-
- layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
- layout.addActionSet(IDebugUIConstants.DEBUG_ACTION_SET);
-
- setContentsOfShowViewMenu(layout);
- }
-
- /**
- * Sets the initial contents of the "Show View" menu.
- */
- protected void setContentsOfShowViewMenu(IPageLayout layout) {
- layout.addShowViewShortcut(IDebugUIConstants.ID_DEBUG_VIEW);
- layout.addShowViewShortcut(IDebugUIConstants.ID_VARIABLE_VIEW);
- layout.addShowViewShortcut(IDebugUIConstants.ID_BREAKPOINT_VIEW);
- layout.addShowViewShortcut(IDebugUIConstants.ID_EXPRESSION_VIEW);
- layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
- layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW);
- layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java
deleted file mode 100644
index 20472307e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java
+++ /dev/null
@@ -1,355 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * QNX Software Systems - Mikhail Khodjaiants - Registers View (Bug 53640)
- * QNX Software Systems - Mikhail Khodjaiants - Bug 114664
- * Wind River Systems - Pawel Piech - Added Modules view (bug 211158)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-
-import java.net.URL;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.internal.core.IConfigurationElementConstants;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.osgi.framework.Bundle;
-
-/**
- * The images provided by the debug plugin.
- */
-public class DebugPluginImages {
-
- /**
- * The image registry containing <code>Image</code>s and <code>ImageDescriptor</code>s.
- */
- private static ImageRegistry imageRegistry;
-
- private static final String ATTR_LAUNCH_CONFIG_TYPE_ICON = "icon"; //$NON-NLS-1$
- private static final String ATTR_LAUNCH_CONFIG_TYPE_ID = "configTypeID"; //$NON-NLS-1$
-
- private static String ICONS_PATH = "$nl$/icons/full/"; //$NON-NLS-1$
-
- // Use IPath and toOSString to build the names to ensure they have the slashes correct
- private final static String CTOOL= ICONS_PATH + "etool16/"; //basic colors - size 16x16 //$NON-NLS-1$
- private final static String DTOOL= ICONS_PATH + "dtool16/"; //basic colors - size 16x16 //$NON-NLS-1$
- private final static String DLCL= ICONS_PATH + "dlcl16/"; //disabled - size 16x16 //$NON-NLS-1$
- private final static String ELCL= ICONS_PATH + "elcl16/"; //enabled - size 16x16 //$NON-NLS-1$
- private final static String OBJECT= ICONS_PATH + "obj16/"; //basic colors - size 16x16 //$NON-NLS-1$
- private final static String WIZBAN= ICONS_PATH + "wizban/"; //basic colors - size 16x16 //$NON-NLS-1$
- private final static String OVR= ICONS_PATH + "ovr16/"; //basic colors - size 7x8 //$NON-NLS-1$
- private final static String VIEW= ICONS_PATH + "eview16/"; // views //$NON-NLS-1$
-
- /**
- * Declare all images
- */
- private static void declareImages() {
- // Actions
- declareRegistryImage(IDebugUIConstants.IMG_ACT_DEBUG, CTOOL + "debug_exc.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_ACT_RUN, CTOOL + "run_exc.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_ACT_SYNCED, ELCL + "synced.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_SKIP_BREAKPOINTS, ELCL + "skip_brkp.gif"); //$NON-NLS-1$
-
- //menus
- declareRegistryImage(IDebugUIConstants.IMG_LCL_CHANGE_VARIABLE_VALUE, ELCL + "changevariablevalue_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_CHANGE_VARIABLE_VALUE, DLCL + "changevariablevalue_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_CHANGE_VARIABLE_VALUE, ELCL + "changevariablevalue_co.gif"); //$NON-NLS-1$
-
- declareRegistryImage(IDebugUIConstants.IMG_LCL_CONTENT_ASSIST, ELCL + "metharg_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_DLCL_CONTENT_ASSIST, DLCL + "metharg_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_ELCL_CONTENT_ASSIST, ELCL + "metharg_obj.gif"); //$NON-NLS-1$
-
- //Local toolbars
- declareRegistryImage(IDebugUIConstants.IMG_LCL_DETAIL_PANE, ELCL + "toggledetailpane_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_LCL_DETAIL_PANE_UNDER, ELCL + "det_pane_under.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_LCL_DETAIL_PANE_RIGHT, ELCL + "det_pane_right.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_LCL_DETAIL_PANE_HIDE, ELCL + "det_pane_hide.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_LCL_LOCK, ELCL + "lock_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_LCL_TYPE_NAMES, ELCL + "tnames_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_LCL_DISCONNECT, ELCL + "disconnect_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_LCL_REMOVE_ALL, ELCL + "rem_all_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_LCL_REMOVE, ELCL + "rem_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_LCL_SHOW_LOGICAL_STRUCTURE, ELCL + "var_cntnt_prvdr.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_LCL_COLLAPSE_ALL, ELCL + "collapseall.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_LCL_TERMINATE, ELCL + "terminate_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_LCL_RUN_TO_LINE, ELCL + "runtoline_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_LCL_MONITOR_EXPRESSION, ELCL + "monitorexpression_tsk.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_LCL_REMOVE_MEMORY, ELCL + "removememory_tsk.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_LCL_RESET_MEMORY, ELCL + "memoryreset_tsk.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_LCL_COPY_VIEW_TO_CLIPBOARD, ELCL + "copyviewtoclipboard_tsk.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_LCL_PRINT_TOP_VIEW_TAB, ELCL + "printview_tsk.gif"); //$NON-NLS-1$
-
- // disabled local toolbars
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE, DLCL + "toggledetailpane_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE_UNDER, DLCL + "det_pane_under.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE_RIGHT, DLCL + "det_pane_right.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE_HIDE, DLCL + "det_pane_hide.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_LOCK, DLCL + "lock_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_TYPE_NAMES, DLCL + "tnames_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_SHOW_LOGICAL_STRUCTURE, DLCL + "var_cntnt_prvdr.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_COLLAPSE_ALL, DLCL + "collapseall.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_TERMINATE, DLCL + "terminate_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_REMOVE_ALL, DLCL + "rem_all_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_REMOVE, DLCL + "rem_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_RUN_TO_LINE, DLCL + "runtoline_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_MONITOR_EXPRESSION, DLCL + "monitorexpression_tsk.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_REMOVE_MEMORY, DLCL + "removememory_tsk.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_RESET_MEMORY, DLCL + "memoryreset_tsk.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_COPY_VIEW_TO_CLIPBOARD, DLCL + "copyviewtoclipboard_tsk.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_PRINT_TOP_VIEW_TAB, DLCL + "printview_tsk.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_DUPLICATE_CONFIG, DLCL + "copy_edit_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_NEW_CONFIG, DLCL + "new_con.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_DELETE_CONFIG, DLCL + "rem_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_FILTER_CONFIGS, DLCL + "filter_ps.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_DISCONNECT, DLCL + "disconnect_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_SUSPEND, DLCL + "suspend_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_RESUME, DLCL + "resume_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_STEP_RETURN, DLCL+ "stepreturn_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_STEP_OVER, DLCL + "stepover_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_STEP_INTO, DLCL + "stepinto_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_TERMINATE_AND_REMOVE, DLCL + "terminate_rem_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_TERMINATE_ALL, DLCL + "terminate_all_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_TERMINATE_AND_RELAUNCH, DTOOL + "term_restart.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_TOGGLE_STEP_FILTERS, DLCL+"stepbystep_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_NEXT_THREAD, DLCL+"next_thread_nav.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_PREVIOUS_THREAD, DLCL+"prev_thread_nav.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_DLCL_RESTART, DLCL+"restart_co.gif"); //$NON-NLS-1$
-
- // enabled local toolbars
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE, ELCL + "toggledetailpane_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_UNDER, ELCL + "det_pane_under.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_RIGHT, ELCL + "det_pane_right.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_HIDE, ELCL + "det_pane_hide.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_LOCK, ELCL + "lock_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_TYPE_NAMES, ELCL + "tnames_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_SHOW_LOGICAL_STRUCTURE, ELCL + "var_cntnt_prvdr.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_COLLAPSE_ALL, ELCL + "collapseall.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_TERMINATE, ELCL + "terminate_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_MONITOR_EXPRESSION, ELCL + "monitorexpression_tsk.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_REMOVE_MEMORY, ELCL + "removememory_tsk.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_RESET_MEMORY, ELCL + "memoryreset_tsk.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_COPY_VIEW_TO_CLIPBOARD, ELCL + "copyviewtoclipboard_tsk.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_PRINT_TOP_VIEW_TAB, ELCL + "printview_tsk.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_REMOVE_ALL, ELCL + "rem_all_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_REMOVE, ELCL + "rem_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_HIERARCHICAL, ELCL + "hierarchicalLayout.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_FILTER_CONFIGS, ELCL + "filter_ps.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_DUPLICATE_CONFIG, ELCL + "copy_edit_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_NEW_CONFIG, ELCL + "new_con.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_DELETE_CONFIG, ELCL + "delete_config.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_SUSPEND, ELCL + "suspend_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_RESUME, ELCL + "resume_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_STEP_RETURN, ELCL + "stepreturn_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_STEP_OVER, ELCL + "stepover_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_STEP_INTO, ELCL + "stepinto_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_DROP_TO_FRAME, ELCL + "drop_to_frame.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_AND_REMOVE, ELCL + "terminate_rem_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_ALL, ELCL + "terminate_all_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_AND_RELAUNCH, CTOOL + "term_restart.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_TOGGLE_STEP_FILTERS, ELCL+"stepbystep_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_STANDARD_OUT, ELCL+"writeout_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_STANDARD_ERR, ELCL+"writeerr_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_NEXT_THREAD, ELCL+"next_thread_nav.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_PREVIOUS_THREAD, ELCL+"prev_thread_nav.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ELCL_RESTART, ELCL+"restart_co.gif"); //$NON-NLS-1$
-
- //Object
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_LAUNCH_DEBUG, OBJECT + "ldebug_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_LAUNCH_RUN, OBJECT + "lrun_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_LAUNCH_RUN_TERMINATED, OBJECT + "terminatedlaunch_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_DEBUG_TARGET, OBJECT + "debugt_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_DEBUG_TARGET_SUSPENDED, OBJECT + "debugts_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_DEBUG_TARGET_TERMINATED, OBJECT + "debugtt_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_THREAD_RUNNING, OBJECT + "thread_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_THREAD_SUSPENDED, OBJECT + "threads_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_THREAD_TERMINATED, OBJECT + "threadt_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_STACKFRAME, OBJECT + "stckframe_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_STACKFRAME_RUNNING, OBJECT + "stckframe_running_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_VARIABLE, OBJECT + "genericvariable_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_REGISTER, OBJECT + "genericregister_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_REGISTER_GROUP, OBJECT + "genericreggroup_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT, OBJECT + "brkp_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT_DISABLED, OBJECT + "brkpd_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT_GROUP, OBJECT + "brkp_grp.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT_GROUP_DISABLED, OBJECT + "brkp_grp_disabled.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_WATCHPOINT, OBJECT + "readwrite_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_WATCHPOINT_DISABLED, OBJECT + "readwrite_obj_disabled.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_ACCESS_WATCHPOINT, OBJECT + "read_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_ACCESS_WATCHPOINT_DISABLED, OBJECT + "read_obj_disabled.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_MODIFICATION_WATCHPOINT, OBJECT + "write_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_MODIFICATION_WATCHPOINT_DISABLED, OBJECT + "write_obj_disabled.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_OS_PROCESS, OBJECT + "osprc_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_OS_PROCESS_TERMINATED, OBJECT + "osprct_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_EXPRESSION, OBJECT + "expression_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_INSTRUCTION_POINTER_TOP, OBJECT + "inst_ptr_top.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_INSTRUCTION_POINTER, OBJECT + "inst_ptr.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_OBJS_ARRAY_PARTITION, OBJECT + "arraypartition_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_ENV_VAR, OBJECT + "envvar_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_OBJECT_MEMORY_CHANGED, OBJECT + "memorychanged_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_OBJECT_MEMORY, OBJECT + "memory_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_OBJS_BREAKPOINT_TYPE, OBJECT + "brkp_type.gif"); //$NON-NLS-1$
-
- // tabs
- declareRegistryImage(IInternalDebugUIConstants.IMG_OBJS_COMMON_TAB, OBJECT + "common_tab.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_OBJS_REFRESH_TAB, OBJECT + "refresh_tab.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_OBJS_PERSPECTIVE_TAB, OBJECT + "persp_tab.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_ENVIRONMENT, OBJECT + "environment_obj.gif"); //$NON-NLS-1$
-
- // Views
- declareRegistryImage(IDebugUIConstants.IMG_VIEW_BREAKPOINTS, VIEW + "breakpoint_view.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_VIEW_EXPRESSIONS, VIEW + "watchlist_view.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_VIEW_LAUNCHES, VIEW + "debug_view.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_VIEW_VARIABLES, VIEW + "variable_view.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_CVIEW_MEMORY_VIEW, VIEW + "memory_view.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_CVIEW_MODULES_VIEW, VIEW + "module_view.gif"); //$NON-NLS-1$
-
- // Perspectives
- declareRegistryImage(IDebugUIConstants.IMG_PERSPECTIVE_DEBUG, VIEW + "debug_persp.gif"); //$NON-NLS-1$
-
- //Wizard Banners
- declareRegistryImage(IDebugUIConstants.IMG_WIZBAN_DEBUG, WIZBAN + "debug_wiz.png"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_WIZBAN_RUN, WIZBAN + "run_wiz.png"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_WIZBAN_IMPORT_BREAKPOINTS, WIZBAN + "import_brkpts_wizban.png"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_WIZBAN_EXPORT_BREAKPOINTS, WIZBAN + "export_brkpts_wizban.png"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_WIZBAN_IMPORT_CONFIGS, WIZBAN + "import_config_wizban.png"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_WIZBAN_EXPORT_CONFIGS, WIZBAN + "export_config_wizban.png"); //$NON-NLS-1$
-
- // Overlays
- declareRegistryImage(IDebugUIConstants.IMG_OVR_ERROR, OVR + "error.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_OVR_TRANSPARENT, OVR + "transparent.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OVR_SKIP_BREAKPOINT, OVR + "skip_breakpoint_ov.gif"); //$NON-NLS-1$
-
- //source location
- declareRegistryImage(IInternalDebugUIConstants.IMG_SRC_LOOKUP_MENU, ELCL + "edtsrclkup_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_SRC_LOOKUP_MENU_DLCL, DLCL + "edtsrclkup_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_SRC_LOOKUP_MENU_ELCL, ELCL + "edtsrclkup_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_SRC_LOOKUP_TAB, ELCL + "edtsrclkup_co.gif"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ADD_SRC_LOC_WIZ, WIZBAN + "addsrcloc_wiz.png"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_EDIT_SRC_LOC_WIZ, WIZBAN + "edtsrclkup_wiz.png"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_ADD_SRC_DIR_WIZ, WIZBAN + "adddir_wiz.png"); //$NON-NLS-1$
- declareRegistryImage(IInternalDebugUIConstants.IMG_EDIT_SRC_DIR_WIZ, WIZBAN + "editdir_wiz.png"); //$NON-NLS-1$
-
- // launch configuration types
- //try to get the images from the config types themselves, cache those that could not be found
- IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPE_IMAGES);
- IConfigurationElement[] configElements= extensionPoint.getConfigurationElements();
- for (int i = 0; i < configElements.length; i++) {
- IConfigurationElement configElement = configElements[i];
- ImageDescriptor descriptor = DebugUIPlugin.getImageDescriptor(configElement, ATTR_LAUNCH_CONFIG_TYPE_ICON);
- if (descriptor == null) {
- descriptor = ImageDescriptor.getMissingImageDescriptor();
- }
- String configTypeID = configElement.getAttribute(ATTR_LAUNCH_CONFIG_TYPE_ID);
- if (configTypeID == null) {
- // bug 12652
- configTypeID = configElement.getAttribute(IConfigurationElementConstants.TYPE);
- }
- imageRegistry.put(configTypeID, descriptor);
- }
- }
-
- /**
- * Declare an Image in the registry table.
- * @param key The key to use when registering the image
- * @param path The path where the image can be found. This path is relative to where
- * this plugin class is found (i.e. typically the packages directory)
- */
- private final static void declareRegistryImage(String key, String path) {
- ImageDescriptor desc = ImageDescriptor.getMissingImageDescriptor();
- Bundle bundle = Platform.getBundle(DebugUIPlugin.getUniqueIdentifier());
- URL url = null;
- if (bundle != null){
- url = FileLocator.find(bundle, new Path(path), null);
- if(url != null) {
- desc = ImageDescriptor.createFromURL(url);
- }
- }
- imageRegistry.put(key, desc);
- }
-
- /**
- * Returns the ImageRegistry.
- */
- public static ImageRegistry getImageRegistry() {
- if (imageRegistry == null) {
- initializeImageRegistry();
- }
- return imageRegistry;
- }
-
- /**
- * Returns whether the image registry has been initialized.
- *
- * @return whether the image registry has been initialized
- */
- public synchronized static boolean isInitialized() {
- return imageRegistry != null;
- }
-
- /**
- * Initialize the image registry by declaring all of the required
- * graphics. This involves creating JFace image descriptors describing
- * how to create/find the image should it be needed.
- * The image is not actually allocated until requested.
- *
- * Prefix conventions
- * Wizard Banners WIZBAN_
- * Preference Banners PREF_BAN_
- * Property Page Banners PROPBAN_
- * Color toolbar CTOOL_
- * Enable toolbar ETOOL_
- * Disable toolbar DTOOL_
- * Local enabled toolbar ELCL_
- * Local Disable toolbar DLCL_
- * Object large OBJL_
- * Object small OBJS_
- * View VIEW_
- * Product images PROD_
- * Misc images MISC_
- *
- * Where are the images?
- * The images (typically gifs) are found in the same location as this plugin class.
- * This may mean the same package directory as the package holding this class.
- * The images are declared using this.getClass() to ensure they are looked up via
- * this plugin class.
- * @see org.eclipse.jface.resource.ImageRegistry
- */
- public synchronized static ImageRegistry initializeImageRegistry() {
- if (imageRegistry == null) {
- imageRegistry = new ImageRegistry(DebugUIPlugin.getStandardDisplay());
- declareImages();
- }
- return imageRegistry;
- }
-
- /**
- * Returns the <code>Image</code> identified by the given key,
- * or <code>null</code> if it does not exist.
- */
- public static Image getImage(String key) {
- return getImageRegistry().get(key);
- }
-
- /**
- * Returns the <code>ImageDescriptor</code> identified by the given key,
- * or <code>null</code> if it does not exist.
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- return getImageRegistry().getDescriptor(key);
- }
-}
-
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIAdapterFactory.java
deleted file mode 100644
index e788f8025..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIAdapterFactory.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointContainer;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointContainerWorkbenchAdapter;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointPersistableElementAdapter;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.ui.model.IWorkbenchAdapter2;
-
-public class DebugUIAdapterFactory implements IAdapterFactory {
-
- /**
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(Object, Class)
- */
- public Object getAdapter(Object obj, Class adapterType) {
- if (adapterType.isInstance(obj)) {
- return obj;
- }
-
- if (adapterType == IPersistableElement.class) {
- if (obj instanceof IBreakpoint) {
- return new BreakpointPersistableElementAdapter((IBreakpoint)obj);
- }
- }
-
- if (adapterType == IWorkbenchAdapter.class) {
- if (obj instanceof BreakpointContainer) {
- return new BreakpointContainerWorkbenchAdapter();
- }
- }
-
- if (adapterType == IWorkbenchAdapter2.class) {
- if (obj instanceof BreakpointContainer) {
- return new BreakpointContainerWorkbenchAdapter();
- }
- }
-
- return null;
- }
-
- /**
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList() {
- return new Class[] {IPersistableElement.class, IWorkbenchAdapter.class, IWorkbenchAdapter2.class};
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java
deleted file mode 100644
index 72518dc52..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- * Wind River Systems - Ted Williams - [Memory View] Memory View: Workflow Enhancements (Bug 215432)
- * Remy Chi Jian Suen - Make WorkingDirectoryBlock from JDT a Debug API class (Bug 221973)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-import org.eclipse.osgi.util.NLS;
-
-public class DebugUIMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.DebugUIMessages";//$NON-NLS-1$
-
- public static String AbstractAsyncTableRendering_2;
-
- public static String AbstractDebugCheckboxSelectionDialog_0;
-
- public static String AbstractDebugCheckboxSelectionDialog_1;
-
- public static String DebugUIPlugin_23;
- public static String DebugUIPlugin_24;
- public static String DebugUIPlugin_0;
-
- public static String DebugUIPlugin_25;
- public static String DebugUIPlugin_Build_error__Check_log_for_details__2;
- public static String DebugUIPlugin_Run_Debug_1;
-
- public static String DefaultLabelProvider__disconnected__1;
-
- public static String DefaultLabelProvider_0;
- public static String DefaultLabelProvider_1;
- public static String DefaultLabelProvider__unknown__1;
- public static String DefaultLabelProvider_Breakpoint_1;
- public static String DefaultLabelProvider_12;
- public static String DefaultLabelProvider_13;
- public static String DefaultLabelProvider_15;
- public static String DefaultLabelProvider_16;
- public static String MultipleInputDialog_6;
- public static String MultipleInputDialog_7;
- public static String MultipleInputDialog_8;
-
- public static String SwitchMemoryBlockAction_4;
-
- public static String WorkingDirectoryStatusHandler_0;
- public static String WorkingDirectoryStatusHandler_Eclipse_Runtime_1;
-
- public static String DebugUITools_3;
- public static String DebugUITools_Error_1;
- public static String DebugUITools_Exception_occurred_during_launch_2;
-
- public static String InstructionPointerAnnotation_0;
- public static String InstructionPointerAnnotation_1;
-
- public static String DefaultLabelProvider_17;
-
- //
- // Action
- //
- public static String AddMemoryBlockAction_title;
- public static String AddMemoryBlockAction_tooltip;
- public static String AddMemoryBlockAction_failed;
- public static String AddMemoryBlockAction_input_invalid;
- public static String AddMemoryRenderingDialog_Memory_Monitor;
- public static String AddMemoryRenderingAction_Add_renderings;
- public static String AddMemoryRenderingDialog_Memory_renderings;
- public static String AddMemoryRenderingDialog_Add_memory_rendering;
- public static String AddMemoryBlockAction_noMemoryBlock;
- public static String AddMemoryRenderingDialog_Add_New;
- public static String AddMemoryRenderingDialog_Unknown;
- public static String RemoveMemoryBlockAction_title;
- public static String RemoveMemoryBlockAction_tooltip;
- public static String MemoryViewCellModifier_failure_title;
- public static String MemoryViewCellModifier_failed;
- public static String MemoryViewCellModifier_data_is_invalid;
- public static String ResetMemoryBlockAction_title;
- public static String ResetMemoryBlockAction_tootip;
- public static String GoToAddressAction_title;
- public static String GoToAddressAction_Go_to_address_failed;
- public static String GoToAddressAction_Address_is_invalid;
- public static String CopyViewToClipboardAction_title;
- public static String CopyViewToClipboardAction_tooltip;
- public static String PrintViewTabAction_title;
- public static String PrintViewTabAction_tooltip;
- public static String PrintViewTabAction_jobtitle;
- public static String ReformatAction_title;
-
- //
- // Dialog
- //
- public static String MonitorMemoryBlockDialog_EnterExpressionToMonitor;
- public static String MonitorMemoryBlockDialog_MonitorMemory;
- public static String MonitorMemoryBlockDialog_NumberOfBytes;
- public static String GoToAddressDialog_Address;
- public static String GoToAddressDialog_GoToAddress;
- public static String CodePagesPrefDialog_1;
- public static String CodePagesPrefDialog_2;
- public static String CodePagesPrefDialog_4;
- public static String CodePagesPrefDialog_6;
- public static String CodePagesPrefDialog_7;
- public static String CodePagesPrefDialog_8;
- public static String CodePagesPrefDialog_9;
- public static String CodePagesPrefDialog_0;
-
- //
- // View Tab
- //
- public static String MemoryView_Memory_monitors;
- public static String MemoryBlocksTreeViewPane_0;
- public static String MemoryBlocksTreeViewPane_1;
- public static String MemoryBlocksTreeViewPane_2;
- public static String MemoryView_Memory_renderings;
- public static String MemoryViewContentProvider_Unable_to_retrieve_content;
-
- //
- // Views
- //
- public static String RemoveMemoryRenderingAction_Remove_rendering;
- public static String EmptyViewTab_Unable_to_create;
- public static String CreateRenderingTab_Memory_monitor;
- public static String CreateRenderingTab_Select_renderings_to_create;
- public static String CreateRenderingTab_Add_renderings;
- public static String CreateRenderingTab_0;
- public static String CreateRenderingTab_1;
- public static String CreateRenderingTab_2;
-
- public static String CreateRenderingTab_label;
-
- public static String CreateRendering_0;
- public static String CreateRendering_1;
-
- //
- // Managers
- //
- public static String ShowAddressColumnAction_0;
- public static String ShowAddressColumnAction_1;
- public static String ImageDescriptorRegistry_0;
- public static String ErrorRendering_0;
- public static String AbstractTableRendering_1;
- public static String AbstractTableRendering_2;
- public static String AbstractTableRendering_3;
- public static String AbstractTableRendering_4;
- public static String AbstractTableRendering_6;
- public static String AbstractTableRendering_8;
- public static String AbstractTableRendering_10;
- public static String AbstractTableRendering_11;
- public static String AbstractTableRendering_12;
- public static String AbstractTableRendering_13;
- public static String AbstractTableRendering_16;
- public static String AbstractTableRendering_18;
- public static String AbstractTableRendering_20;
- public static String SetPaddedStringDialog_0;
- public static String SetPaddedStringDialog_1;
-
-
- public static String TableRenderingPropertiesPage_1;
- public static String TableRenderingPropertiesPage_2;
- public static String TableRenderingPropertiesPage_3;
- public static String TableRenderingPropertiesPage_4;
- public static String TableRenderingPropertiesPage_5;
- public static String TableRenderingPropertiesPage_6;
- public static String TableRenderingPropertiesPage_8;
- public static String TableRenderingPropertiesPage_9;
- public static String TableRenderingPropertiesPage_10;
- public static String TableRenderingPropertiesPage_11;
- public static String TableRenderingPropertiesPage_12;
- public static String TableRenderingPropertiesPage_13;
- public static String TableRenderingPropertiesPage_14;
- public static String TableRenderingPropertiesPage_15;
- public static String TableRenderingPropertiesPage_16;
- public static String TableRenderingPropertiesPage_17;
- public static String TableRenderingPropertiesPage_18;
- public static String TableRenderingPropertiesPage_19;
- public static String TableRenderingPropertiesPage_20;
- public static String TableRenderingPropertiesPage_21;
- public static String TableRenderingPropertiesPage_22;
- public static String TableRenderingPropertiesPage_23;
- public static String TableRenderingPropertiesPage_25;
- public static String TableRenderingPropertiesPage_26;
- public static String TableRenderingPrefAction_0;
- public static String TableRenderingPreferencePage_0;
- public static String TableRenderingPreferencePage_2;
- public static String TableRenderingPreferencePage_3;
- public static String TableRenderingPreferencePage_4;
- public static String TableRenderingPreferencePage_5;
- public static String TableRenderingPreferencePage_6;
- public static String TableRenderingPreferencePage_7;
- public static String TableRenderingPreferencePage_8;
- public static String TableRenderingPreferencePage_9;
- public static String TableRenderingPreferencePage_10;
- public static String TableRenderingContentProvider_0;
- public static String TableRenderingContentProvider_1;
- public static String TableRenderingContentProvider_2;
- public static String SwitchMemoryBlockAction_0;
- public static String ResetMemoryBlockPreferencePage_0;
- public static String ResetMemoryBlockPreferencePage_1;
- public static String ResetMemoryBlockPreferencePage_2;
- public static String ResetMemoryBlockPreferencePage_3;
- public static String FormatTableRenderingAction_0;
- public static String FormatTableRenderingAction_1;
- public static String FormatTableRenderingAction_2;
- public static String FormatTableRenderingAction_3;
- public static String FormatTableRenderingAction_4;
- public static String FormatTableRenderingAction_5;
- public static String FormatTableRenderingAction_6;
- public static String FormatTableRenderingAction_7;
- public static String FormatTableRenderingAction_8;
- public static String FormatTableRenderingAction_9;
- public static String FormatTableRenderingAction_11;
- public static String FormatTableRenderingAction_13;
- public static String FormatTableRenderingAction_15;
- public static String FormatTableRenderingAction_16;
- public static String FormatTableRenderingDialog_0;
- public static String FormatTableRenderingDialog_1;
- public static String FormatTableRenderingDialog_2;
- public static String FormatTableRenderingDialog_3;
- public static String FormatTableRenderingDialog_4;
- public static String FormatTableRenderingDialog_5;
- public static String AbstractAsyncTableRendering_1;
- public static String CreateRendering_2;
- public static String SetPaddedStringPreferencePage_0;
- public static String ViewPaneOrientationAction_0;
- public static String ViewPaneOrientationAction_1;
- public static String ViewPaneOrientationAction_2;
- public static String ViewPaneOrientationAction_3;
- public static String GoToAddressComposite_0;
- public static String GoToAddressComposite_1;
- public static String GoToAddressComposite_2;
- public static String GoToAddressComposite_4;
- public static String GoToAddressComposite_5;
- public static String GoToAddressComposite_6;
- public static String GoToAddressComposite_7;
-
- //
- // Blocks
- //
- public static String WorkingDirectoryBlock_4;
- public static String WorkingDirectoryBlock_7;
- public static String WorkingDirectoryBlock_0;
- public static String WorkingDirectoryBlock_Working_Directory_8;
- public static String WorkingDirectoryBlock_10;
- public static String WorkingDirectoryBlock_12;
- public static String WorkingDirectoryBlock_17;
- public static String WorkingDirectoryBlock_18;
- public static String WorkingDirectoryBlock_19;
- public static String WorkingDirectoryBlock_20;
- public static String WorkingDirectoryBlock_1;
- public static String WorkingDirectoryBlock_Exception_occurred_reading_configuration___15;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, DebugUIMessages.class);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties
deleted file mode 100644
index f0e2cb06c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties
+++ /dev/null
@@ -1,238 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2009 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-# Wind River Systems - Ted Williams - [Memory View] Memory View: Workflow Enhancements (Bug 215432)
-# Remy Chi Jian Suen - Make WorkingDirectoryBlock from JDT a Debug API class (Bug 221973)
-###############################################################################
-
-DebugUIPlugin_23=Build in Progress
-DebugUIPlugin_24=Wait for build to finish?
-DebugUIPlugin_25=Launching {0}
-DebugUIPlugin_0=\ (waiting for build...)
-DebugUIPlugin_Build_error__Check_log_for_details__2=Build error. Check log for details.
-DebugUIPlugin_Run_Debug_1=Run/Debug
-
-DefaultLabelProvider__disconnected__1=<disconnected>
-DefaultLabelProvider_1=<terminated>
-DefaultLabelProvider_0=...
-DefaultLabelProvider__unknown__1=<unknown>
-DefaultLabelProvider_Breakpoint_1=Breakpoint
-DefaultLabelProvider_12=\ (pending)
-DefaultLabelProvider_13=\ <error(s)_during_the_evaluation>
-DefaultLabelProvider_15=\ (disabled)
-DefaultLabelProvider_16=<terminated, exit value: {0}>
-MultipleInputDialog_6=&Browse...
-MultipleInputDialog_7=Select a file:
-MultipleInputDialog_8=Varia&bles...
-
-WorkingDirectoryStatusHandler_Eclipse_Runtime_1=Eclipse Runtime
-WorkingDirectoryStatusHandler_0=Eclipse is not able to set the working directory specified by the program being launched as the current runtime does not support working directories.\nContinue launch without setting the working directory?
-
-DebugUITools_3=Launching
-DebugUITools_Error_1=Error
-DebugUITools_Exception_occurred_during_launch_2=Exception occurred during launch
-
-InstructionPointerAnnotation_0=Debug Current Instruction Pointer
-InstructionPointerAnnotation_1=Debug Call Stack
-
-DefaultLabelProvider_17=\ [line: {0}]
-
-##############################################################
-# Action
-##############################################################
-AddMemoryBlockAction_title=Add Memory Monitor
-AddMemoryBlockAction_tooltip=Add Memory Monitor
-AddMemoryBlockAction_failed =Add Memory Monitor Failed.
-AddMemoryBlockAction_input_invalid = Input is invalid.
-AddMemoryRenderingDialog_Memory_Monitor=Memory Monitor
-AddMemoryRenderingAction_Add_renderings=Add Rendering(s)
-AddMemoryRenderingDialog_Memory_renderings=Memory Rendering(s)
-AddMemoryRenderingDialog_Add_memory_rendering=Add Memory Rendering
-AddMemoryBlockAction_noMemoryBlock = Failed to get memory monitor.
-AddMemoryRenderingDialog_Add_New=Add New...
-AddMemoryRenderingDialog_Unknown=Unknown
-RemoveMemoryBlockAction_title=Remove Memory Monitor
-RemoveMemoryBlockAction_tooltip=Remove Memory Monitor
-MemoryViewCellModifier_failure_title = Edit Memory
-MemoryViewCellModifier_failed = Edit failed:
-MemoryViewCellModifier_data_is_invalid = Data is invalid.
-ResetMemoryBlockAction_title = Reset to Base Address
-ResetMemoryBlockAction_tootip = Reset to Base Address
-ResetMemoryBlockPreferencePage_0=Reset Memory Monitor
-ResetMemoryBlockPreferencePage_1=When resetting memory monitor:
-ResetMemoryBlockPreferencePage_2=Reset visible renderings
-ResetMemoryBlockPreferencePage_3=Reset all renderings
-GoToAddressAction_title = Go to Address...
-GoToAddressComposite_0=Go to Address:
-GoToAddressComposite_1=OK
-GoToAddressComposite_2=Cancel
-GoToAddressComposite_4=Go to Offset:
-GoToAddressComposite_5=Jump Memory Units:
-GoToAddressComposite_6=Input as Hex
-GoToAddressComposite_7=Unable to calculate address from offset.
-GoToAddressAction_Go_to_address_failed = Go To Address Failed
-GoToAddressAction_Address_is_invalid = Address is invalid
-FormatTableRenderingAction_0=Format...
-FormatTableRenderingAction_1=Please specify column and row size.
-FormatTableRenderingAction_2=Row Size:
-FormatTableRenderingAction_3=unit(s) per row
-FormatTableRenderingAction_4=Column Size:
-FormatTableRenderingAction_5=unit(s) per column
-FormatTableRenderingAction_6=Restore Defaults
-FormatTableRenderingAction_7=Preview:
-FormatTableRenderingAction_8=Save as Defaults
-FormatTableRenderingAction_9=Preview is not available.
-FormatTableRenderingDialog_0=Default Row Size:
-FormatTableRenderingDialog_1=unit(s) per row
-FormatTableRenderingDialog_2=Default Column Size:
-FormatTableRenderingDialog_3=unit(s) per column
-FormatTableRenderingDialog_4=Failed to Save Settings
-FormatTableRenderingDialog_5=Default settings cannot be saved.
-CopyViewToClipboardAction_title = Copy To Clipboard
-CopyViewToClipboardAction_tooltip = Copy To Clipboard
-PrintViewTabAction_title = Print
-PrintViewTabAction_tooltip = Print
-PrintViewTabAction_jobtitle = Memory for
-ReformatAction_title = Resize to Fit
-
-##############################################################
-# Dialog
-##############################################################
-MonitorMemoryBlockDialog_EnterExpressionToMonitor = Enter address or expression to monitor:
-MonitorMemoryBlockDialog_MonitorMemory = Monitor Memory
-MonitorMemoryBlockDialog_NumberOfBytes = Number of bytes:
-GoToAddressDialog_Address = Address:
-GoToAddressDialog_GoToAddress = Go To Address...
-CodePagesPrefDialog_1=Select Codepages
-CodePagesPrefDialog_2=Memory to ASCII strings:
-CodePagesPrefDialog_4=Memory to EBCDIC strings:
-CodePagesPrefDialog_6=Invalid codepage
-CodePagesPrefDialog_7=ASCII codepage entered is invalid.
-CodePagesPrefDialog_8=Invalid codepage
-CodePagesPrefDialog_9=EBCDIC codepage entered is invalid.
-CodePagesPrefDialog_0=The codepage is not supported.
-
-##############################################################
-# View Tab
-##############################################################
-MemoryView_Memory_monitors=Monitors
-MemoryBlocksTreeViewPane_0=Remove All Memory Monitors
-MemoryBlocksTreeViewPane_1=Are you sure you want to remove all memory monitors?
-MemoryBlocksTreeViewPane_2=Remove All
-MemoryView_Memory_renderings=Renderings
-MemoryViewContentProvider_Unable_to_retrieve_content = Unable to retrieve content.
-
-##############################################################
-# Views
-##############################################################
-RemoveMemoryRenderingAction_Remove_rendering=Remove Rendering
-EmptyViewTab_Unable_to_create=Unable to create
-CreateRenderingTab_Memory_monitor=Memory Monitor:
-CreateRenderingTab_label=New Renderings...
-CreateRenderingTab_Select_renderings_to_create=Select rendering(s) to create:
-CreateRenderingTab_Add_renderings=Add Rendering(s)
-CreateRenderingTab_0=No rendering is selected.
-CreateRenderingTab_1=Add Rendering Failed
-CreateRenderingTab_2=No rendering is selected.
-CreateRendering_0=Add Memory Rendering Failed
-CreateRendering_1=Unable to add the selected rendering.
-CreateRendering_2=Pending
-
-##############################################################
-# Managers
-##############################################################
-ShowAddressColumnAction_0=Hide Address Column
-ShowAddressColumnAction_1=Show Address Column
-ImageDescriptorRegistry_0=Allocating image for wrong display
-ErrorRendering_0=Reason:\n
-AbstractTableRendering_1=Unable to get the base address from the memory block.
-AbstractTableRendering_2=Address
-AbstractTableRendering_3=Error occurred:\n
-AbstractTableRendering_8=Unknown
-AbstractTableRendering_4=Next Page
-AbstractTableRendering_6=Previous Page
-AbstractTableRendering_10=Unable to get base address.
-AbstractTableRendering_11=Address is out of range.
-AbstractTableRendering_12=Reset Failed.
-AbstractTableRendering_13=Unable to reset to the base address.
-AbstractTableRendering_20=Default format is invalid:
-AbstractTableRendering_16=Please specify row and column sizes to use.
-AbstractTableRendering_18=Save these settings to avoid this problem in the future.
-AbstractAsyncTableRendering_1=Pending...
-AbstractAsyncTableRendering_2=Create Table Rendering
-SetPaddedStringDialog_0=Padded String
-SetPaddedStringDialog_1=Enter string to show unretrievable memory.
-SetPaddedStringPreferencePage_0=Padded String:
-TableRenderingPropertiesPage_1=Rendering:
-TableRenderingPropertiesPage_2=Selected Address:
-TableRenderingPropertiesPage_3=units
-TableRenderingPropertiesPage_4=Length:
-TableRenderingPropertiesPage_5=Selected Content:
-TableRenderingPropertiesPage_6=Addressable Size:
-TableRenderingPropertiesPage_8=bits
-TableRenderingPropertiesPage_9=Changed:
-TableRenderingPropertiesPage_10=Changed:
-TableRenderingPropertiesPage_11=Unknown
-TableRenderingPropertiesPage_12=Unknown
-TableRenderingPropertiesPage_13=Big Endian
-TableRenderingPropertiesPage_14=Little Endian
-TableRenderingPropertiesPage_15=Unknown
-TableRenderingPropertiesPage_16=Data Endianess:
-TableRenderingPropertiesPage_17=Unknown
-TableRenderingPropertiesPage_18=Big Endian
-TableRenderingPropertiesPage_19=Little Endian
-TableRenderingPropertiesPage_20=Unknown
-TableRenderingPropertiesPage_21=Display Endianess:
-TableRenderingPropertiesPage_22=Readable:
-TableRenderingPropertiesPage_23=Writable:
-TableRenderingPropertiesPage_25=Line Address:
-TableRenderingPropertiesPage_26=Units Per Line:
-TableRenderingContentProvider_0=Unable to load memory from the specified address: 0x
-TableRenderingContentProvider_1=Buffer start and end address are invalid.
-TableRenderingContentProvider_2=Buffer start and end address are invalid.
-TableRenderingPreferencePage_10=Select memory loading mode when rendering is scrolled to end of buffer:
-TableRenderingPreferencePage_2=Number of lines per page:
-TableRenderingPreferencePage_3=Page size cannot be less than 1.
-TableRenderingPreferencePage_4=Sizes specified are invalid.
-TableRenderingPreferencePage_0=Automatic
-TableRenderingPreferencePage_5=Number of lines to preload
-TableRenderingPreferencePage_6=Before visible region:
-TableRenderingPreferencePage_7=After visible region:
-TableRenderingPreferencePage_8=Manual
-TableRenderingPreferencePage_9=Minimum number of lines to preload is 1.
-TableRenderingPrefAction_0=Table Renderings
-SwitchMemoryBlockAction_0=Unknown
-SwitchMemoryBlockAction_4=Pending
-FormatTableRenderingAction_11=Format specified is invalid.
-FormatTableRenderingAction_13=Column size cannot be larger than the row size.
-FormatTableRenderingAction_15=<Address>
-FormatTableRenderingAction_16=&Format...
-ViewPaneOrientationAction_0=Horizontal Orientation
-ViewPaneOrientationAction_1=Horizontal Orientation
-ViewPaneOrientationAction_2=Vertical Orientation
-ViewPaneOrientationAction_3=Vertical Orientation
-AbstractDebugCheckboxSelectionDialog_0=&Select All
-AbstractDebugCheckboxSelectionDialog_1=&Deselect All
-
-##############################################################
-# Blocks
-##############################################################
-
-WorkingDirectoryBlock_4=Select a &workspace relative working directory:
-WorkingDirectoryBlock_7=Select a working directory for the launch configuration:
-WorkingDirectoryBlock_0=W&orkspace...
-WorkingDirectoryBlock_Working_Directory_8=Working Directory
-WorkingDirectoryBlock_10=Working directory does not exist
-WorkingDirectoryBlock_12=Working directory:
-WorkingDirectoryBlock_17=Variabl&es...
-WorkingDirectoryBlock_18=Defa&ult:
-WorkingDirectoryBlock_19=Ot&her:
-WorkingDirectoryBlock_20=Working directory not specified
-WorkingDirectoryBlock_1=&File System...
-WorkingDirectoryBlock_Exception_occurred_reading_configuration___15=Exception occurred reading configuration:
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
deleted file mode 100644
index 9af543be8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
+++ /dev/null
@@ -1,1271 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Sascha Radike - bug 56642
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-
-import java.lang.reflect.InvocationTargetException;
-import java.net.URL;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.core.resources.ISaveContext;
-import org.eclipse.core.resources.ISaveParticipant;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.IJobChangeListener;
-import org.eclipse.core.runtime.jobs.IJobManager;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugException;
-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.debug.core.ILaunchManager;
-import org.eclipse.debug.core.IStatusHandler;
-import org.eclipse.debug.core.Launch;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.ClosedProjectFilter;
-import org.eclipse.debug.internal.ui.launchConfigurations.DeletedProjectFilter;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationEditDialog;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTypeFilter;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension;
-import org.eclipse.debug.internal.ui.launchConfigurations.PerspectiveManager;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupFacility;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupManager;
-import org.eclipse.debug.internal.ui.stringsubstitution.SelectedResourceManager;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointOrganizerManager;
-import org.eclipse.debug.internal.ui.views.console.ProcessConsoleManager;
-import org.eclipse.debug.internal.ui.views.launch.DebugElementHelper;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.ui.progress.IProgressService;
-import org.eclipse.ui.themes.IThemeManager;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.service.packageadmin.PackageAdmin;
-import org.osgi.util.tracker.ServiceTracker;
-import org.w3c.dom.Document;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * The Debug UI Plug-in.
- *
- * Since 3.3 this plugin registers an <code>ISaveParticipant</code>, allowing this plugin to participate
- * in workspace persistence life-cycles
- *
- * @see ISaveParticipant
- * @see ILaunchListener
- * @see LaunchConfigurationManager
- * @see PerspectiveManager
- * @see ContextLaunch
- */
-public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener {
-
-
- /**
- * The singleton debug plug-in instance
- */
- private static DebugUIPlugin fgDebugUIPlugin = null;
-
- /**
- * A utility presentation used to obtain labels
- */
- protected static IDebugModelPresentation fgPresentation = null;
-
- /**
- * Default label provider
- */
- private static DefaultLabelProvider fgDefaultLabelProvider;
-
- /**
- * Launch configuration attribute - used by the stand-in launch
- * config working copies that are created while a launch is waiting
- * for a build to finish. This attribute allows the EditLaunchConfigurationAction
- * to access the original config if the user asks to edit it.
- */
- public static String ATTR_LAUNCHING_CONFIG_HANDLE= getUniqueIdentifier() + "launching_config_handle"; //$NON-NLS-1$
-
- /**
- * Singleton console document manager
- */
- private ProcessConsoleManager fProcessConsoleManager = null;
-
- /**
- * Perspective manager
- */
- private PerspectiveManager fPerspectiveManager = null;
-
- /**
- * Launch configuration manager
- */
- private LaunchConfigurationManager fLaunchConfigurationManager = null;
-
- /**
- * Context launching manager
- */
- private LaunchingResourceManager fContextLaunchingManager = null;
-
- /**
- * Image descriptor registry used for images with common overlays.
- *
- * @since 3.1
- */
- private ImageDescriptorRegistry fImageDescriptorRegistry;
-
- /**
- * Service tracker and service used for finding plug-ins associated
- * with a class.
- */
- private ServiceTracker fServiceTracker;
- private PackageAdmin fPackageAdminService;
-
- /**
- * A set of <code>ISaveParticipant</code>s that want to contribute to saving via this plugin
- *
- * @since 3.3
- */
- private Set fSaveParticipants = new HashSet();
-
- /**
- * Theme listener.
- *
- * @since 3.4
- */
- private IPropertyChangeListener fThemeListener;
-
-
- public static boolean DEBUG = false;
-
- /**
- * Dummy launch node representing a launch that is waiting
- * for a build to finish before proceeding. This node exists
- * to provide immediate feedback to the user in the Debug view and
- * allows termination, which equates to cancellation of the launch.
- */
- public static class PendingLaunch extends Launch {
- private Job fJob;
- public PendingLaunch(ILaunchConfiguration launchConfiguration, String mode, Job job) {
- super(launchConfiguration, mode, null);
- fJob= job;
- }
-
- // Allow the user to terminate the dummy launch as a means to
- // cancel the launch while waiting for a build to finish.
- public boolean canTerminate() {
- return true;
- }
-
- public void terminate() throws DebugException {
- fJob.cancel();
- }
- }
-
- /**
- * Returns the bundle the given class originated from.
- *
- * @param clazz a class
- * @return the bundle the given class originated from, or <code>null</code>
- * if unable to be determined
- * @since 3.1
- */
- public Bundle getBundle(Class clazz) {
- if (fPackageAdminService != null) {
- return fPackageAdminService.getBundle(clazz);
- }
- return null;
- }
-
- /**
- * Constructs the debug UI plug-in
- */
- public DebugUIPlugin() {
- super();
- fgDebugUIPlugin= this;
- }
-
- /**
- * If the debug flag is set the specified message is printed to the console
- * @param message
- */
- public static void debug(String message) {
- if (DEBUG) {
- System.out.println(message);
- }
- }
-
- /**
- * Returns the singleton instance of the debug plug-in.
- */
- public static DebugUIPlugin getDefault() {
- if(fgDebugUIPlugin == null) {
- fgDebugUIPlugin = new DebugUIPlugin();
- }
- return fgDebugUIPlugin;
- }
-
- /**
- * Convenience method which returns the unique identifier of this plug-in.
- */
- public static String getUniqueIdentifier() {
- return IDebugUIConstants.PLUGIN_ID;
- }
-
- /**
- * Returns the default delegating model presentation
- * @return the default delegating model presentation
- */
- public static IDebugModelPresentation getModelPresentation() {
- if (fgPresentation == null) {
- fgPresentation = new DelegatingModelPresentation();
- }
- return fgPresentation;
- }
-
- /**
- * Returns the launch configuration manager
- * @return the launch configuration manager
- */
- public LaunchConfigurationManager getLaunchConfigurationManager() {
- if (fLaunchConfigurationManager == null) {
- fLaunchConfigurationManager = new LaunchConfigurationManager();
- }
- return fLaunchConfigurationManager;
- }
-
- /**
- * Returns the context launching resource manager. If one has not been created prior to this
- * method call, a new manager is created and initialized, by calling its startup() method.
- * @return the context launching resource manager
- *
- * @since 3.3
- */
- public LaunchingResourceManager getLaunchingResourceManager() {
- if(fContextLaunchingManager == null) {
- fContextLaunchingManager = new LaunchingResourceManager();
- fContextLaunchingManager.startup();
- }
- return fContextLaunchingManager;
- }
-
- /**
- * Returns the currently active workbench window or <code>null</code>
- * if none.
- *
- * @return the currently active workbench window or <code>null</code>
- */
- public static IWorkbenchWindow getActiveWorkbenchWindow() {
- return getDefault().getWorkbench().getActiveWorkbenchWindow();
- }
-
- /**
- * Returns the currently active workbench window shell or <code>null</code>
- * if none.
- *
- * @return the currently active workbench window shell or <code>null</code>
- */
- public static Shell getShell() {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if (window == null) {
- IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
- if (windows.length > 0) {
- return windows[0].getShell();
- }
- }
- else {
- return window.getShell();
- }
- return null;
- }
-
- /**
- * Returns the default label provider for the debug UI.
- */
- public static ILabelProvider getDefaultLabelProvider() {
- if (fgDefaultLabelProvider == null) {
- fgDefaultLabelProvider = new DefaultLabelProvider();
- }
- return fgDefaultLabelProvider;
- }
-
- /**
- * Creates an extension. If the extension plug-in has not
- * been loaded a busy cursor will be activated during the duration of
- * the load.
- *
- * @param element the config element defining the extension
- * @param classAttribute the name of the attribute carrying the class
- * @return the extension object
- */
- public static Object createExtension(final IConfigurationElement element, final String classAttribute) throws CoreException {
- // If plug-n has been loaded create extension.
- // Otherwise, show busy cursor then create extension.
- Bundle bundle = Platform.getBundle(element.getContributor().getName());
- if (bundle.getState() == Bundle.ACTIVE) {
- return element.createExecutableExtension(classAttribute);
- }
- final Object [] ret = new Object[1];
- final CoreException [] exc = new CoreException[1];
- BusyIndicator.showWhile(null, new Runnable() {
- public void run() {
- try {
- ret[0] = element.createExecutableExtension(classAttribute);
- } catch (CoreException e) {
- exc[0] = e;
- }
- }
- });
- if (exc[0] != null) {
- throw exc[0];
- }
- return ret[0];
- }
-
- /**
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#createImageRegistry()
- */
- protected ImageRegistry createImageRegistry() {
- return DebugPluginImages.initializeImageRegistry();
- }
-
- /* (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- try {
- if (fProcessConsoleManager != null) {
- fProcessConsoleManager.shutdown();
- }
-
- BreakpointOrganizerManager.getDefault().shutdown();
-
- if (fPerspectiveManager != null) {
- fPerspectiveManager.shutdown();
- }
- if (fLaunchConfigurationManager != null) {
- fLaunchConfigurationManager.shutdown();
- }
- if(fContextLaunchingManager != null) {
- fContextLaunchingManager.shutdown();
- }
-
- ColorManager.getDefault().dispose();
-
- if (fgPresentation != null) {
- fgPresentation.dispose();
- }
-
- if (fImageDescriptorRegistry != null) {
- fImageDescriptorRegistry.dispose();
- }
-
- SourceLookupFacility.shutdown();
-
- DebugElementHelper.dispose();
-
- fServiceTracker.close();
- fPackageAdminService = null;
-
- fSaveParticipants.clear();
-
- ResourcesPlugin.getWorkspace().removeSaveParticipant(this);
-
- if (fThemeListener != null) {
- if (PlatformUI.isWorkbenchRunning())
- PlatformUI.getWorkbench().getThemeManager().removePropertyChangeListener(fThemeListener);
- fThemeListener= null;
- }
-
- } finally {
- super.stop(context);
- }
- }
-
- /**
- * Add the specified <code>ISaveParticipant</code> to the current listing of
- * registered participants
- * @param participant
- * @return true if this current listing did not already contain the specified participant
- * @since 3.3
- */
- public boolean addSaveParticipant(ISaveParticipant participant) {
- return fSaveParticipants.add(participant);
- }
-
- /**
- * Removes the specified <code>ISaveParticipant</code> from the current listing of registered
- * participants
- * @param participant
- * @return true if the set contained the specified element
- *
- * @since 3.3
- */
- public boolean removeSaveParticipant(ISaveParticipant participant) {
- return fSaveParticipants.remove(participant);
- }
-
- /**
- * @see AbstractUIPlugin#startup()
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- ResourcesPlugin.getWorkspace().addSaveParticipant(this,
- new ISaveParticipant() {
- public void saving(ISaveContext saveContext) throws CoreException {
- savePluginPreferences();
- for(Iterator iter = fSaveParticipants.iterator(); iter.hasNext();) {
- ((ISaveParticipant)iter.next()).saving(saveContext);
- }
- }
- public void rollback(ISaveContext saveContext) {
- for(Iterator iter = fSaveParticipants.iterator(); iter.hasNext();) {
- ((ISaveParticipant)iter.next()).rollback(saveContext);
- }
- }
- public void prepareToSave(ISaveContext saveContext) throws CoreException {
- for(Iterator iter = fSaveParticipants.iterator(); iter.hasNext();) {
- ((ISaveParticipant)iter.next()).prepareToSave(saveContext);
- }
- }
- public void doneSaving(ISaveContext saveContext) {
- for(Iterator iter = fSaveParticipants.iterator(); iter.hasNext();) {
- ((ISaveParticipant)iter.next()).doneSaving(saveContext);
- }
- }
- });
- DEBUG = "true".equals(Platform.getDebugOption("org.eclipse.debug.ui/debug")); //$NON-NLS-1$//$NON-NLS-2$
-
- // make sure the perspective manager is created
- // and be the first debug event listener
- fPerspectiveManager = new PerspectiveManager();
- fPerspectiveManager.startup();
-
- getLaunchingResourceManager();
-
- // Listen to launches to lazily create "launch processors"
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunch[] launches = launchManager.getLaunches();
- if (launches.length > 0) {
- // if already launches, initialize processors
- initializeLaunchListeners();
- } else {
- // if no launches, wait for first launch to initialize processors
- launchManager.addLaunchListener(this);
- }
-
- // start the breakpoint organizer manager
- BreakpointOrganizerManager.getDefault();
-
- fServiceTracker = new ServiceTracker(context, PackageAdmin.class.getName(), null);
- fServiceTracker.open();
- fPackageAdminService = (PackageAdmin) fServiceTracker.getService();
-
- getLaunchConfigurationManager().startup();
-
- if (PlatformUI.isWorkbenchRunning()) {
- fThemeListener= new IPropertyChangeListener() {
-
- public void propertyChange(PropertyChangeEvent event) {
- if (IThemeManager.CHANGE_CURRENT_THEME.equals(event.getProperty()))
- DebugUIPreferenceInitializer.setThemeBasedPreferences(getPreferenceStore(), true);
- }
- };
- PlatformUI.getWorkbench().getThemeManager().addPropertyChangeListener(fThemeListener);
- }
-
- // do the asynchronous exec last - see bug 209920
- getStandardDisplay().asyncExec(
- new Runnable() {
- public void run() {
- //initialize the selected resource `
- SelectedResourceManager.getDefault();
- // forces launch shortcuts to be initialized so their key-bindings work
- getLaunchConfigurationManager().getLaunchShortcuts();
- }
- });
- }
-
- /**
- * Utility method with conventions
- */
- public static void errorDialog(Shell shell, String title, String message, IStatus s) {
- // if the 'message' resource string and the IStatus' message are the same,
- // don't show both in the dialog
- if (s != null && message.equals(s.getMessage())) {
- message= null;
- }
- ErrorDialog.openError(shell, title, message, s);
- }
-
- /**
- * Utility method with conventions
- */
- public static void errorDialog(Shell shell, String title, String message, Throwable t) {
- IStatus status;
- if (t instanceof CoreException) {
- status= ((CoreException)t).getStatus();
- // if the 'message' resource string and the IStatus' message are the same,
- // don't show both in the dialog
- if (status != null && message.equals(status.getMessage())) {
- message= null;
- }
- } else {
- status= new Status(IStatus.ERROR, getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR, "Error within Debug UI: ", t); //$NON-NLS-1$
- log(status);
- }
- ErrorDialog.openError(shell, title, message, status);
- }
-
- /**
- * Logs the specified status with this plug-in's log.
- *
- * @param status status to log
- */
- public static void log(IStatus status) {
- getDefault().getLog().log(status);
- }
-
- /**
- * Logs the specified throwable with this plug-in's log.
- *
- * @param t throwable to log
- */
- public static void log(Throwable t) {
- log(newErrorStatus("Error logged from Debug UI: ", t)); //$NON-NLS-1$
- }
-
- /**
- * Logs an internal error with the specified message.
- *
- * @param message the error message to log
- */
- public static void logErrorMessage(String message) {
- // this message is intentionally not internationalized, as an exception may
- // be due to the resource bundle itself
- log(newErrorStatus("Internal message logged from Debug UI: " + message, null)); //$NON-NLS-1$
- }
-
- /**
- * Returns a new error status for this plug-in with the given message
- * @param message the message to be included in the status
- * @param exception the exception to be included in the status or <code>null</code> if none
- * @return a new error status
- */
- public static IStatus newErrorStatus(String message, Throwable exception) {
- return new Status(IStatus.ERROR, getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR, message, exception);
- }
-
- /**
- * Open the launch configuration dialog on the specified launch
- * configuration. The dialog displays the tabs for a single configuration
- * only (a tree of launch configuration is not displayed)
- * <p>
- * If a status is specified, a status handler is consulted to handle the
- * status. The status handler is passed the instance of the launch
- * configuration dialog that is opened. This gives the status handler an
- * opportunity to perform error handling/initialization as required.
- * </p>
- * @param shell the parent shell for the launch configuration dialog
- * @param configuration the configuration to display
- * @param groupIdentifier group identifier of the launch group the launch configuration
- * belongs to
- * @param status the status to display, or <code>null</code> if none
- * @param showCancel if the cancel button should be shown in the particular instance of the dialog
- * @return the return code from opening the launch configuration dialog -
- * one of <code>Window.OK</code> or <code>Window.CANCEL</code>
- *
- * @since 3.3
- *
- */
- public static int openLaunchConfigurationEditDialog(Shell shell, ILaunchConfiguration configuration, String groupIdentifier, IStatus status, boolean showCancel) {
- LaunchGroupExtension group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(groupIdentifier);
- if (group != null) {
- LaunchConfigurationEditDialog dialog = new LaunchConfigurationEditDialog(shell, configuration, group, showCancel);
- dialog.setInitialStatus(status);
- return dialog.open();
- }
- return Window.CANCEL;
- }
-
- /**
- * Open the launch configuration dialog on the specified launch
- * configuration. The dialog displays the tabs for a single configuration
- * only (a tree of launch configuration is not displayed)
- * <p>
- * If a status is specified, a status handler is consulted to handle the
- * status. The status handler is passed the instance of the launch
- * configuration dialog that is opened. This gives the status handler an
- * opportunity to perform error handling/initialization as required.
- * </p>
- * @param shell the parent shell for the launch configuration dialog
- * @param configuration the configuration to display
- * @param groupIdentifier group identifier of the launch group the launch configuration
- * belongs to
- * @param reservednames a set of launch configuration names that cannot be used when creating or renaming
- * the specified launch configuration
- * @param status the status to display, or <code>null</code> if none
- * @param setDefaults whether to set default values in the configuration
- * @return the return code from opening the launch configuration dialog -
- * one of <code>Window.OK</code> or <code>Window.CANCEL</code>
- *
- * @since 3.3
- *
- */
- public static int openLaunchConfigurationPropertiesDialog(Shell shell, ILaunchConfiguration configuration, String groupIdentifier, Set reservednames, IStatus status, boolean setDefaults) {
- LaunchGroupExtension group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(groupIdentifier);
- if (group != null) {
- LaunchConfigurationPropertiesDialog dialog = new LaunchConfigurationPropertiesDialog(shell, configuration, group, reservednames);
- dialog.setInitialStatus(status);
- dialog.setDefaultsOnOpen(setDefaults);
- return dialog.open();
- }
- return Window.CANCEL;
- }
-
- /**
- * Save all dirty editors in the workbench.
- * Returns whether the operation succeeded.
- *
- * @return whether all saving was completed
- * @deprecated Saving has been moved to the launch delegate <code>LaunchConfigurationDelegate</code> to allow for scoped saving
- * of resources that are only involved in the current launch, no longer the entire workspace
- */
- protected static boolean saveAllEditors(boolean confirm) {
- if (getActiveWorkbenchWindow() == null) {
- return false;
- }
- return PlatformUI.getWorkbench().saveAllEditors(confirm);
- }
-
- /**
- * Save & build the workspace according to the user-specified preferences. Return <code>false</code> if
- * any problems were encountered, <code>true</code> otherwise.
- *
- * @deprecated this method is no longer to be used. It is an artifact from 2.0, and all saving is now done with the
- * launch delegate <code>LaunchConfigurationDelegate</code>
- */
- public static boolean saveAndBuild() {
- boolean status = true;
- String saveDirty = getDefault().getPreferenceStore().getString(IInternalDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH);
- boolean buildBeforeLaunch = getDefault().getPreferenceStore().getBoolean(IDebugUIConstants.PREF_BUILD_BEFORE_LAUNCH);
-
- // If we're ignoring dirty editors, check if we need to build
- if (saveDirty.equals(MessageDialogWithToggle.NEVER)) {
- if (buildBeforeLaunch) {
- return doBuild();
- }
- } else {
- status = saveAllEditors(saveDirty.equals(MessageDialogWithToggle.PROMPT));
- if (status && buildBeforeLaunch) {
- status = doBuild();
- }
- }
-
- return status;
- }
-
- private static boolean doBuild() {
- try {
- PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException {
- try {
- ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
- }
- });
- } catch (InterruptedException e) {
- // canceled by user
- return false;
- } catch (InvocationTargetException e) {
- String title= DebugUIMessages.DebugUIPlugin_Run_Debug_1;
- String message= DebugUIMessages.DebugUIPlugin_Build_error__Check_log_for_details__2;
- Throwable t = e.getTargetException();
- errorDialog(getShell(), title, message, t);
- return false;
- }
- return true;
- }
-
- /**
- * Returns the workbench's display.
- *
- */
- public static Display getStandardDisplay() {
- return PlatformUI.getWorkbench().getDisplay();
- }
-
- /**
- * Returns the a color based on the type of output.
- * Valid types:
- * <li>CONSOLE_SYS_OUT_RGB</li>
- * <li>CONSOLE_SYS_ERR_RGB</li>
- * <li>CONSOLE_SYS_IN_RGB</li>
- * <li>CHANGED_VARIABLE_RGB</li>
- */
- public static Color getPreferenceColor(String type) {
- return ColorManager.getDefault().getColor(PreferenceConverter.getColor(getDefault().getPreferenceStore(), type));
- }
-
- /**
- * Returns the process console manager. The manager will be created lazily on
- * the first access.
- *
- * @return ProcessConsoleManager
- */
- public ProcessConsoleManager getProcessConsoleManager() {
- if (fProcessConsoleManager == null) {
- fProcessConsoleManager = new ProcessConsoleManager();
- }
- return fProcessConsoleManager;
- }
-
- /**
- * Returns a Document that can be used to build a DOM tree
- * @return the Document
- * @throws ParserConfigurationException if an exception occurs creating the document builder
- * @since 3.0
- */
- public static Document getDocument() throws ParserConfigurationException {
- DocumentBuilderFactory dfactory= DocumentBuilderFactory.newInstance();
-
- DocumentBuilder docBuilder= dfactory.newDocumentBuilder();
- Document doc= docBuilder.newDocument();
- return doc;
- }
-
- /**
- * When the first launch is added, instantiate launch processors,
- * and stop listening to launch notifications.
- *
- * @see org.eclipse.debug.core.ILaunchListener#launchAdded(org.eclipse.debug.core.ILaunch)
- */
- public void launchAdded(ILaunch launch) {
- DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
- initializeLaunchListeners();
- }
-
- /**
- * Creates/starts launch listeners after a launch has been added.
- * <p>
- * Launch processors are:
- * <ul>
- * <li>console document manager</li>
- * <li>perspective manager</li>
- * </ul>
- * </p>
- */
- private void initializeLaunchListeners() {
- getProcessConsoleManager().startup();
- SourceLookupManager.getDefault();
- }
-
- /**
- * Returns the perspective manager.
- *
- * @return
- */
- public PerspectiveManager getPerspectiveManager() {
- return fPerspectiveManager;
- }
-
- /**
- * @see org.eclipse.debug.core.ILaunchListener#launchChanged(org.eclipse.debug.core.ILaunch)
- */
- public void launchChanged(ILaunch launch) {}
-
- /**
- * @see org.eclipse.debug.core.ILaunchListener#launchRemoved(org.eclipse.debug.core.ILaunch)
- */
- public void launchRemoved(ILaunch launch) {}
-
- /**
- * Return the ILaunch associated with a model element, or null if there is
- * no such association.
- *
- * @param element the model element
- * @return the ILaunch associated with the element, or null.
- * @since 3.6
- */
- public static ILaunch getLaunch(Object element) {
- // support for custom models
- ILaunch launch= (ILaunch)DebugPlugin.getAdapter(element, ILaunch.class);
- if (launch == null) {
- // support for standard debug model
- if (element instanceof IDebugElement) {
- launch= ((IDebugElement)element).getLaunch();
- } else if (element instanceof ILaunch) {
- launch= ((ILaunch)element);
- } else if (element instanceof IProcess) {
- launch= ((IProcess)element).getLaunch();
- }
- }
- return launch;
- }
-
-
- /**
- * Save dirty editors before launching, according to preferences.
- *
- * @return whether to proceed with launch
- * @deprecated Saving has been moved to the launch delegate <code>LaunchConfigurationDelegate</code> to allow for scoped saving
- * of resources that are only involved in the current launch, no longer the entire workspace
- */
- public static boolean preLaunchSave() {
- String saveDirty = getDefault().getPreferenceStore().getString(IInternalDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH);
- if (saveDirty.equals(MessageDialogWithToggle.NEVER)) {
- return true;
- }
- return saveAllEditors(saveDirty.equals(MessageDialogWithToggle.PROMPT));
- }
-
- /**
- * Builds the workspace (according to preferences) and launches the given launch
- * configuration in the specified mode. May return null if auto build is in process and
- * user cancels the launch.
- *
- * @param configuration the configuration to launch
- * @param mode launch mode - run or debug
- * @param monitor progress monitor
- * @exception CoreException if an exception occurs while building or launching
- * @return resulting launch or <code>null</code> if user cancels
- */
- public static ILaunch buildAndLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
- boolean buildBeforeLaunch = getDefault().getPreferenceStore().getBoolean(IDebugUIConstants.PREF_BUILD_BEFORE_LAUNCH);
-
- monitor.beginTask(IInternalDebugCoreConstants.EMPTY_STRING, 1);
- try
- {
- return configuration.launch(
- mode,
- new SubProgressMonitor(monitor, 1),
- buildBeforeLaunch);
- }
- finally
- {
- monitor.done();
- }
- }
-
- /**
- * Saves and builds the workspace according to current preference settings and
- * launches the given launch configuration in the specified mode in the
- * foreground with a progress dialog. Reports any exceptions that occur
- * in an error dialog.
- *
- * @param configuration the configuration to launch
- * @param mode launch mode
- * @since 3.0
- */
- public static void launchInForeground(final ILaunchConfiguration configuration, final String mode) {
- final IJobManager jobManager = Job.getJobManager();
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- boolean wait = false;
-
- if (jobManager.find(ResourcesPlugin.FAMILY_AUTO_BUILD).length > 0 || jobManager.find(ResourcesPlugin.FAMILY_MANUAL_BUILD).length >0) {
- String waitForBuild = store.getString(IInternalDebugUIConstants.PREF_WAIT_FOR_BUILD);
-
- if (waitForBuild.equals(MessageDialogWithToggle.PROMPT)) {
- MessageDialogWithToggle dialog = MessageDialogWithToggle.openYesNoCancelQuestion(getShell(), DebugUIMessages.DebugUIPlugin_23, DebugUIMessages.DebugUIPlugin_24, null, false, store, IInternalDebugUIConstants.PREF_WAIT_FOR_BUILD); //
-
- switch (dialog.getReturnCode()) {
- case IDialogConstants.CANCEL_ID:
- return;
- case IDialogConstants.YES_ID:
- wait = false;
- break;
- case IDialogConstants.NO_ID:
- wait = true;
- break;
- }
- } else if (waitForBuild.equals(MessageDialogWithToggle.ALWAYS)) {
- wait = true;
- }
- }
-
- if (wait) {
- IWorkbench workbench = DebugUIPlugin.getDefault().getWorkbench();
- IProgressService progressService = workbench.getProgressService();
- final IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException {
- /* Setup progress monitor
- * - Waiting for jobs to finish (2)
- * - Build & launch (98) */
- monitor.beginTask(MessageFormat.format(DebugUIMessages.DebugUIPlugin_25, new Object[] {configuration.getName()}), 100);
-
- try {
- jobManager.join(ResourcesPlugin.FAMILY_MANUAL_BUILD, new SubProgressMonitor(monitor, 1));
- jobManager.join(ResourcesPlugin.FAMILY_AUTO_BUILD, new SubProgressMonitor(monitor, 1));
- }
- catch (InterruptedException e) {/* continue*/}
- if (!monitor.isCanceled()) {
- try {
- buildAndLaunch(configuration, mode, new SubProgressMonitor(monitor, 98));
- }
- catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
- }
- }
- };
- try {
- progressService.busyCursorWhile(runnable);
- }
- catch (InterruptedException e) {}
- catch (InvocationTargetException e2) {
- handleInvocationTargetException(e2, configuration, mode);
- }
- } else {
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException {
- /* Setup progress monitor
- * - Build & launch (1) */
- monitor.beginTask(MessageFormat.format(DebugUIMessages.DebugUIPlugin_25, new Object[] {configuration.getName()}), 1);
- try {
- buildAndLaunch(configuration, mode, new SubProgressMonitor(monitor, 1));
- }
- catch (CoreException e) {
- throw new InvocationTargetException(e);
- }
- }
- };
- try {
- PlatformUI.getWorkbench().getProgressService().busyCursorWhile(runnable);
- }
- catch (InvocationTargetException e) {
- handleInvocationTargetException(e, configuration, mode);
- }
- catch (InterruptedException e) {}
-
- }
- }
-
- private static void handleInvocationTargetException(InvocationTargetException e, ILaunchConfiguration configuration, String mode) {
- Throwable targetException = e.getTargetException();
- Throwable t = e;
- if (targetException instanceof CoreException) {
- t = targetException;
- }
- if (t instanceof CoreException) {
- CoreException ce = (CoreException)t;
- IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(ce.getStatus());
- if (handler != null) {
- ILaunchGroup group = DebugUITools.getLaunchGroup(configuration, mode);
- if (group != null) {
- DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUIPlugin.getShell(), new StructuredSelection(configuration), group.getIdentifier(), ce.getStatus());
- return;
- }
- }
- if ((ce.getStatus().getSeverity() & (IStatus.ERROR | IStatus.WARNING)) == 0) {
- // If the exception is a CoreException with a status other
- // than ERROR or WARNING, don't open an error dialog.
- return;
- }
- }
- DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, DebugUIMessages.DebugUITools_Exception_occurred_during_launch_2, t); //
- }
-
- /**
- * Saves and builds the workspace according to current preference settings and
- * launches the given launch configuration in the specified mode in a background
- * Job with progress reported via the Job. Exceptions are reported in the Progress
- * view.
- *
- * @param configuration the configuration to launch
- * @param mode launch mode
- * @since 3.0
- */
- public static void launchInBackground(final ILaunchConfiguration configuration, final String mode) {
- final IJobManager jobManager = Job.getJobManager();
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- boolean wait = (jobManager.find(ResourcesPlugin.FAMILY_AUTO_BUILD).length > 0) || (jobManager.find(ResourcesPlugin.FAMILY_MANUAL_BUILD).length > 0);
- String waitPref = store.getString(IInternalDebugUIConstants.PREF_WAIT_FOR_BUILD);
- if (wait) { // if there are build jobs running, do we wait or not??
- if (waitPref.equals(MessageDialogWithToggle.PROMPT)) {
- MessageDialogWithToggle dialog = MessageDialogWithToggle.openYesNoCancelQuestion(getShell(), DebugUIMessages.DebugUIPlugin_23, DebugUIMessages.DebugUIPlugin_24, null, false, store, IInternalDebugUIConstants.PREF_WAIT_FOR_BUILD); //
- switch (dialog.getReturnCode()) {
- case IDialogConstants.CANCEL_ID:
- return;
- case IDialogConstants.YES_ID:
- wait = true;
- break;
- case IDialogConstants.NO_ID:
- wait = false;
- break;
- }
- }
- else {
- wait = waitPref.equals(MessageDialogWithToggle.ALWAYS);
- }
- }
- final boolean waitInJob = wait;
- Job job = new Job(MessageFormat.format(DebugUIMessages.DebugUIPlugin_25, new Object[] {configuration.getName()})) {
- public IStatus run(final IProgressMonitor monitor) {
- /* Setup progress monitor
- * - Waiting for jobs to finish (2)
- * - Build & launch (98) */
- monitor.beginTask(DebugUIMessages.DebugUITools_3, 100);
- try {
- if(waitInJob) {
- StringBuffer buffer = new StringBuffer(configuration.getName());
- buffer.append(DebugUIMessages.DebugUIPlugin_0);
- ILaunchConfigurationWorkingCopy workingCopy = configuration.copy(buffer.toString());
- workingCopy.setAttribute(ATTR_LAUNCHING_CONFIG_HANDLE, configuration.getMemento());
- final ILaunch pendingLaunch = new PendingLaunch(workingCopy, mode, this);
- DebugPlugin.getDefault().getLaunchManager().addLaunch(pendingLaunch);
- IJobChangeListener listener= new IJobChangeListener() {
- public void sleeping(IJobChangeEvent event) {}
- public void scheduled(IJobChangeEvent event) {}
- public void running(IJobChangeEvent event) {}
- public void awake(IJobChangeEvent event) {}
- public void aboutToRun(IJobChangeEvent event) {}
- public void done(IJobChangeEvent event) {
- DebugPlugin dp = DebugPlugin.getDefault();
- if (dp != null) {
- dp.getLaunchManager().removeLaunch(pendingLaunch);
- }
- removeJobChangeListener(this);
- }
- };
- addJobChangeListener(listener);
- try {
- jobManager.join(ResourcesPlugin.FAMILY_MANUAL_BUILD, new SubProgressMonitor(monitor, 1));
- jobManager.join(ResourcesPlugin.FAMILY_AUTO_BUILD, new SubProgressMonitor(monitor, 1));
- }
- catch (InterruptedException e) {/*just continue.*/}
- DebugPlugin.getDefault().getLaunchManager().removeLaunch(pendingLaunch);
- }
- else {
- monitor.worked(2); /* don't wait for jobs to finish */
- }
- if (!monitor.isCanceled()) {
- buildAndLaunch(configuration, mode, new SubProgressMonitor(monitor, 98));
- }
- } catch (CoreException e) {
- final IStatus status = e.getStatus();
- IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(status);
- if (handler == null) {
- return status;
- }
- final ILaunchGroup group = DebugUITools.getLaunchGroup(configuration, mode);
- if (group == null) {
- return status;
- }
- Runnable r = new Runnable() {
- public void run() {
- DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUIPlugin.getShell(), new StructuredSelection(configuration), group.getIdentifier(), status);
- }
- };
- DebugUIPlugin.getStandardDisplay().asyncExec(r);
- }
- finally {
- monitor.done();
- }
-
- return Status.OK_STATUS;
- }
- };
-
- IWorkbench workbench = DebugUIPlugin.getDefault().getWorkbench();
- IProgressService progressService = workbench.getProgressService();
-
- job.setPriority(Job.INTERACTIVE);
- job.setName(MessageFormat.format(DebugUIMessages.DebugUIPlugin_25, new Object[] {configuration.getName()}));
-
- if (wait) {
- progressService.showInDialog(workbench.getActiveWorkbenchWindow().getShell(), job);
- }
- job.schedule();
- }
-
- /**
- * Returns the label with any accelerators removed.
- *
- * @return label without accelerators
- */
- public static String removeAccelerators(String label) {
- String title = label;
- if (title != null) {
- // strip out any '&' (accelerators)
- int index = title.indexOf('&');
- if (index == 0) {
- title = title.substring(1);
- } else if (index > 0) {
- //DBCS languages use "(&X)" format
- if (title.charAt(index - 1) == '(' && title.length() >= index + 3 && title.charAt(index + 2) == ')') {
- String first = title.substring(0, index - 1);
- String last = title.substring(index + 3);
- title = first + last;
- } else if (index < (title.length() - 1)) {
- String first = title.substring(0, index);
- String last = title.substring(index + 1);
- title = first + last;
- }
- }
- }
- return title;
- }
-
- /**
- * Returns the label with any DBCS accelerator moved to the end of the string.
- * See bug 186921.
- *
- * @return label with moved accelerator
- */
- public static String adjustDBCSAccelerator(String label) {
- String title = label;
- if (title != null) {
- // strip out any '&' (accelerators)
- int index = title.indexOf('&');
- if (index > 0) {
- //DBCS languages use "(&X)" format
- if (title.charAt(index - 1) == '(' && title.length() >= index + 3 && title.charAt(index + 2) == ')') {
- String first = title.substring(0, index - 1);
- String accel = title.substring(index - 1, index + 3);
- String last = title.substring(index + 3);
- title = first + last;
- if (title.endsWith("...")) { //$NON-NLS-1$
- title = title.substring(0, title.length() - 3);
- title = title + accel + "..."; //$NON-NLS-1$
- } else {
- title = title + accel;
- }
- }
- }
- }
- return title;
- }
-
- /**
- * Returns the image descriptor registry used for this plug-in.
- *
- * @since 3.1
- */
- public static ImageDescriptorRegistry getImageDescriptorRegistry() {
- if (getDefault().fImageDescriptorRegistry == null) {
- getDefault().fImageDescriptorRegistry = new ImageDescriptorRegistry();
- }
- return getDefault().fImageDescriptorRegistry;
- }
-
- /**
- * Returns an image descriptor for the icon referenced by the given attribute
- * and configuration element, or <code>null</code> if none.
- *
- * @param element
- * @param attr
- * @return image descriptor or <code>null</code>
- */
- public static ImageDescriptor getImageDescriptor(IConfigurationElement element, String attr) {
- Bundle bundle = Platform.getBundle(element.getContributor().getName());
- String iconPath = element.getAttribute(attr);
- if (iconPath != null) {
- URL iconURL = FileLocator.find(bundle , new Path(iconPath), null);
- if (iconURL != null) {
- return ImageDescriptor.createFromURL(iconURL);
- }
- }
- return null;
- }
-
- /**
- * Returns an image descriptor for the icon referenced by the given path
- * and contributor name, or <code>null</code> if none.
- *
- * @param name the name of the contributor
- * @param path the path of the icon (from the configuration element)
- * @return image descriptor or <code>null</code>
- * @since 3.3
- */
- public static ImageDescriptor getImageDescriptor(String name, String path) {
- Bundle bundle = Platform.getBundle(name);
- if (path != null) {
- URL iconURL = FileLocator.find(bundle , new Path(path), null);
- if (iconURL != null) {
- return ImageDescriptor.createFromURL(iconURL);
- }
- }
- return null;
- }
-
- /**
- * Performs extra filtering for launch configurations based on the preferences set on the
- * Launch Configurations page
- * @param config the config to filter
- * @return true if it should pass the filter, false otherwise
- * @since 3.2
- */
- public static boolean doLaunchConfigurationFiltering(ILaunchConfiguration config) {
- boolean ret = true;
- if(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_CLOSED)) {
- ret &= new ClosedProjectFilter().select(null, null, config);
- }
- if(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_DELETED)) {
- ret &= new DeletedProjectFilter().select(null, null, config);
- }
- if(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_TYPES)) {
- try {
- ret &= new LaunchConfigurationTypeFilter().select(null, null, config.getType());
- }
- catch(CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- return ret;
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java
deleted file mode 100644
index 494d1e877..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.resource.ColorRegistry;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.ui.PlatformUI;
-
-public class DebugUIPreferenceInitializer extends AbstractPreferenceInitializer {
-
- public DebugUIPreferenceInitializer() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- public void initializeDefaultPreferences() {
- IPreferenceStore prefs = DebugUIPlugin.getDefault().getPreferenceStore();
-// Debug PreferencePage
- prefs.setDefault(IDebugUIConstants.PREF_BUILD_BEFORE_LAUNCH, true);
- prefs.setDefault(IInternalDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH, MessageDialogWithToggle.PROMPT);
- prefs.setDefault(IDebugUIConstants.PREF_SHOW_DEBUG_PERSPECTIVE_DEFAULT, IDebugUIConstants.ID_DEBUG_PERSPECTIVE);
- prefs.setDefault(IDebugUIConstants.PREF_SHOW_RUN_PERSPECTIVE_DEFAULT, IDebugUIConstants.PERSPECTIVE_NONE);
- prefs.setDefault(IDebugUIConstants.PREF_AUTO_REMOVE_OLD_LAUNCHES, true);
- prefs.setDefault(IDebugUIConstants.PREF_ACTIVATE_WORKBENCH, true);
- prefs.setDefault(IInternalDebugUIConstants.PREF_ACTIVATE_DEBUG_VIEW, true);
- prefs.setDefault(IInternalDebugUIConstants.PREF_SWITCH_TO_PERSPECTIVE, MessageDialogWithToggle.NEVER);
- prefs.setDefault(IInternalDebugUIConstants.PREF_SWITCH_PERSPECTIVE_ON_SUSPEND, MessageDialogWithToggle.PROMPT);
- prefs.setDefault(IInternalDebugUIConstants.PREF_WAIT_FOR_BUILD, MessageDialogWithToggle.ALWAYS);
- prefs.setDefault(IDebugUIConstants.PREF_REUSE_EDITOR, true);
- prefs.setDefault(IDebugUIConstants.PREF_SKIP_BREAKPOINTS_DURING_RUN_TO_LINE, false);
- prefs.setDefault(IInternalDebugUIConstants.PREF_RELAUNCH_IN_DEBUG_MODE, MessageDialogWithToggle.NEVER);
- prefs.setDefault(IInternalDebugUIConstants.PREF_CONTINUE_WITH_COMPILE_ERROR, MessageDialogWithToggle.PROMPT);
- prefs.setDefault(IDebugPreferenceConstants.PREF_PROMPT_REMOVE_ALL_BREAKPOINTS, true);
- prefs.setDefault(IDebugPreferenceConstants.PREF_PROMPT_REMOVE_BREAKPOINTS_FROM_CONTAINER, true);
- prefs.setDefault(IDebugPreferenceConstants.PREF_PROMPT_REMOVE_ALL_EXPRESSIONS, true);
-
- /**
- * Context launching preferences. Appear on the the Launching preference page
- *
- * @since 3.3.0
- */
- prefs.setDefault(IInternalDebugUIConstants.PREF_USE_CONTEXTUAL_LAUNCH, true);
- prefs.setDefault(IInternalDebugUIConstants.PREF_LAUNCH_PARENT_PROJECT, true);
- prefs.setDefault(IInternalDebugUIConstants.PREF_LAUNCH_LAST_IF_NOT_LAUNCHABLE, false);
-
- //View Management preference page
- prefs.setDefault(IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES, IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES_DEFAULT);
- prefs.setDefault(IInternalDebugUIConstants.PREF_TRACK_VIEWS, true);
-
- //ConsolePreferencePage
- prefs.setDefault(IDebugPreferenceConstants.CONSOLE_WRAP, false);
- prefs.setDefault(IDebugPreferenceConstants.CONSOLE_WIDTH, 80);
- prefs.setDefault(IDebugPreferenceConstants.CONSOLE_OPEN_ON_OUT, true);
- prefs.setDefault(IDebugPreferenceConstants.CONSOLE_OPEN_ON_ERR, true);
- prefs.setDefault(IDebugPreferenceConstants.CONSOLE_LIMIT_CONSOLE_OUTPUT, true);
- prefs.setDefault(IDebugPreferenceConstants.CONSOLE_LOW_WATER_MARK, 80000);
- prefs.setDefault(IDebugPreferenceConstants.CONSOLE_HIGH_WATER_MARK, 100000);
- prefs.setDefault(IDebugPreferenceConstants.CONSOLE_TAB_WIDTH, 8);
-
- // console colors
- setThemeBasedPreferences(prefs, false);
-
- PreferenceConverter.setDefault(prefs, IDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND, new RGB(255, 255, 0));
- PreferenceConverter.setDefault(prefs, IDebugUIConstants.PREF_MEMORY_HISTORY_UNKNOWN_COLOR, new RGB(114, 119, 129));
- PreferenceConverter.setDefault(prefs, IDebugUIConstants.PREF_MEMORY_HISTORY_KNOWN_COLOR, new RGB(0, 0, 0));
-
- //Launching Preference Page
- prefs.setDefault(IDebugUIConstants.PREF_MAX_HISTORY_SIZE, 10);
- prefs.setDefault(IInternalDebugUIConstants.PREF_REMOVE_FROM_LAUNCH_HISTORY, true);
-
- //VariableViewsPreferencePage
- prefs.setDefault(IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_ORIENTATION, IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_UNDERNEATH);
- PreferenceConverter.setDefault(prefs, IDebugUIConstants.PREF_CHANGED_DEBUG_ELEMENT_COLOR, new RGB(255, 0, 0));
- prefs.setDefault(IDebugPreferenceConstants.PREF_DETAIL_PANE_WORD_WRAP, false);
- prefs.setDefault(IDebugUIConstants.PREF_MAX_DETAIL_LENGTH, 10000);
-
- //Registers View
- prefs.setDefault(IDebugPreferenceConstants.REGISTERS_DETAIL_PANE_ORIENTATION, IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_UNDERNEATH);
-
- // Variable/Expression view default settings
- prefs.setDefault(IDebugUIConstants.ID_VARIABLE_VIEW + '+' + "org.eclipse.debug.ui.ShowDetailPaneAction", true); //$NON-NLS-1$
- prefs.setDefault(IDebugUIConstants.ID_EXPRESSION_VIEW + '+' + "org.eclipse.debug.ui.ShowDetailPaneAction", true); //$NON-NLS-1$
- prefs.setDefault(IDebugUIConstants.ID_VARIABLE_VIEW + '+' + "org.eclipse.debug.ui.ShowTypeNamesAction", false); //$NON-NLS-1$
- prefs.setDefault(IDebugUIConstants.ID_EXPRESSION_VIEW + '+' + "org.eclipse.debug.ui.ShowTypeNamesAction", false); //$NON-NLS-1$
-
- // set default for column size preference
- prefs.setDefault(IDebugPreferenceConstants.PREF_COLUMN_SIZE,
- IDebugPreferenceConstants.PREF_COLUMN_SIZE_DEFAULT);
-
- // set default for row size preference
- prefs.setDefault(IDebugPreferenceConstants.PREF_ROW_SIZE,
- IDebugPreferenceConstants.PREF_ROW_SIZE_DEFAULT);
-
- // set default padded string
- prefs.setDefault(IDebugUIConstants.PREF_PADDED_STR,
- IDebugPreferenceConstants.PREF_PADDED_STR_DEFAULT);
-
- // set default code page for ascii and ebcdic
- prefs.setDefault(IDebugUIConstants.PREF_DEFAULT_ASCII_CODE_PAGE,
- IDebugPreferenceConstants.DEFAULT_ASCII_CP);
- prefs.setDefault(IDebugUIConstants.PREF_DEFAULT_EBCDIC_CODE_PAGE,
- IDebugPreferenceConstants.DEFAULT_EBCDIC_CP);
-
- if (MemoryViewUtil.isLinuxGTK()) {
- prefs.setDefault(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM, false);
- }
- else {
- prefs.setDefault(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM, true);
- }
-
- prefs.setDefault(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE, IDebugPreferenceConstants.DEFAULT_PAGE_SIZE);
- prefs.setDefault(IDebugPreferenceConstants.PREF_RESET_MEMORY_BLOCK, IDebugPreferenceConstants.RESET_VISIBLE);
- prefs.setDefault(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PRE_BUFFER_SIZE,IDebugPreferenceConstants.DEFAULT_PAGE_SIZE);
- prefs.setDefault(IDebugPreferenceConstants.PREF_TABLE_RENDERING_POST_BUFFER_SIZE,IDebugPreferenceConstants.DEFAULT_PAGE_SIZE);
-
- /**
- * new launch configuration filtering options
- * @since 3.2
- */
- prefs.setDefault(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_CLOSED, true);
- prefs.setDefault(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_DELETED, true);
- prefs.setDefault(IInternalDebugUIConstants.PREF_FILTER_WORKING_SETS, false);
- prefs.setDefault(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_TYPES, false);
-
- /**
- * Debug view mode default
- *
- * @since 3.5
- */
- prefs.setDefault(IDebugPreferenceConstants.DEBUG_VIEW_MODE, IDebugPreferenceConstants.DEBUG_VIEW_MODE_AUTO);
- }
-
- /**
- * Returns the RGB for the given key in the given color registry.
- *
- * @param registry the color registry
- * @param key the key for the constant in the registry
- * @param defaultRGB the default RGB if no entry is found
- * @return RGB the RGB
- * @since 3.4
- */
- private static RGB findRGB(ColorRegistry registry, String key, RGB defaultRGB) {
- if (registry == null)
- return defaultRGB;
-
- RGB rgb= registry.getRGB(key);
- if (rgb != null)
- return rgb;
-
- return defaultRGB;
- }
-
- /**
- * Sets the default value and fires a property
- * change event if necessary.
- *
- * @param store the preference store
- * @param key the preference key
- * @param newValue the new value
- * @param fireEvent <code>false</code> if no event should be fired
- * @since 3.4
- */
- private static void setDefault(IPreferenceStore store, String key, RGB newValue, boolean fireEvent) {
- if (!fireEvent) {
- PreferenceConverter.setDefault(store, key, newValue);
- } else {
- RGB oldValue= null;
- if (store.isDefault(key))
- oldValue= PreferenceConverter.getDefaultColor(store, key);
-
- PreferenceConverter.setDefault(store, key, newValue);
-
- if (oldValue != null && !oldValue.equals(newValue))
- store.firePropertyChangeEvent(key, oldValue, newValue);
- }
- }
-
- public static void setThemeBasedPreferences(IPreferenceStore store, boolean fireEvent) {
- ColorRegistry registry= null;
- if (PlatformUI.isWorkbenchRunning())
- registry= PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
-
- setDefault(store,
- IDebugPreferenceConstants.CONSOLE_BAKGROUND_COLOR,
- findRGB(registry, IInternalDebugUIConstants.THEME_CONSOLE_COLOR_BACKGROUND, new RGB(255, 255, 255)), fireEvent);
- setDefault(store,
- IDebugPreferenceConstants.CONSOLE_SYS_OUT_COLOR,
- findRGB(registry, IInternalDebugUIConstants.THEME_CONSOLE_COLOR_STD_OUT, new RGB(0, 0, 0)), fireEvent);
- setDefault(store,
- IDebugPreferenceConstants.CONSOLE_SYS_IN_COLOR,
- findRGB(registry, IInternalDebugUIConstants.THEME_CONSOLE_COLOR_STD_IN, new RGB(0, 200, 125)), fireEvent);
- setDefault(store,
- IDebugPreferenceConstants.CONSOLE_SYS_ERR_COLOR,
- findRGB(registry, IInternalDebugUIConstants.THEME_CONSOLE_COLOR_STD_ERR, new RGB(255, 0, 0)), fireEvent);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.java
deleted file mode 100644
index 083e58427..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.java
+++ /dev/null
@@ -1,568 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * QNX Software Systems - Mikhail Khodjaiants - Registers View (Bug 53640)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.DebugException;
-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.ILaunchDelegate;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IDisconnect;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.core.model.ILineBreakpoint;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.IRegister;
-import org.eclipse.debug.core.model.IRegisterGroup;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.ITerminate;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.core.model.IWatchExpression;
-import org.eclipse.debug.core.model.IWatchpoint;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension;
-import org.eclipse.debug.internal.ui.views.variables.IndexedVariablePartition;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-import com.ibm.icu.text.MessageFormat;
-
-public class DefaultLabelProvider implements ILabelProvider {
-
- /**
- * @see ILabelProvider#getImage(Object)
- */
- public Image getImage(Object element) {
- String key= getImageKey(element);
- if (key == null && element instanceof ILaunch) {
- return null;
- }
- if (key == null && element instanceof IAdaptable) {
- IWorkbenchAdapter de= (IWorkbenchAdapter) ((IAdaptable) element).getAdapter(IWorkbenchAdapter.class);
- if (de != null) {
- ImageDescriptor descriptor= de.getImageDescriptor(element);
- if( descriptor != null) {
- return descriptor.createImage();
- }
- }
- return null;
- }
- if(element instanceof LaunchShortcutExtension) {
- return ((LaunchShortcutExtension)element).getImageDescriptor().createImage();
- }
- return DebugPluginImages.getImage(key);
- }
-
- /**
- * Returns the key (<code>String</code>) of the default image
- * appropriate for the given element or <code>null</code>
- * if no default image is defined.
- */
- public String getImageKey(Object element) {
- if (element instanceof IDebugElement) {
- // Group elements into debug elements and non-debug elements
- // to reduce the number of instanceof checks performed
- if (element instanceof IRegister) {
- return IDebugUIConstants.IMG_OBJS_REGISTER;
- } else if (element instanceof IRegisterGroup) {
- return IDebugUIConstants.IMG_OBJS_REGISTER_GROUP;
- } else if (element instanceof IVariable || element instanceof IValue) {
- if (element instanceof IndexedVariablePartition) {
- return IInternalDebugUIConstants.IMG_OBJS_ARRAY_PARTITION;
- }
- return IDebugUIConstants.IMG_OBJS_VARIABLE;
- } else if (element instanceof IStackFrame) {
- if (((IStackFrame)element).getThread().isSuspended()) {
- return IDebugUIConstants.IMG_OBJS_STACKFRAME;
- }
- return IDebugUIConstants.IMG_OBJS_STACKFRAME_RUNNING;
- } else if (element instanceof IThread) {
- IThread thread = (IThread)element;
- if (thread.isSuspended()) {
- return IDebugUIConstants.IMG_OBJS_THREAD_SUSPENDED;
- } else if (thread.isTerminated()) {
- return IDebugUIConstants.IMG_OBJS_THREAD_TERMINATED;
- } else {
- return IDebugUIConstants.IMG_OBJS_THREAD_RUNNING;
- }
- } else if (element instanceof IDebugTarget) {
- IDebugTarget target= (IDebugTarget) element;
- if (target.isTerminated() || target.isDisconnected()) {
- return IDebugUIConstants.IMG_OBJS_DEBUG_TARGET_TERMINATED;
- } else if (target.isSuspended()) {
- return IDebugUIConstants.IMG_OBJS_DEBUG_TARGET_SUSPENDED;
- } else {
- return IDebugUIConstants.IMG_OBJS_DEBUG_TARGET;
- }
- } else if (element instanceof IExpression) {
- return IDebugUIConstants.IMG_OBJS_EXPRESSION;
- }
- } else {
- if (element instanceof IMarker) {
- return getMarkerImageKey((IMarker)element);
- } else if (element instanceof IBreakpoint) {
- return getBreakpointImageKey((IBreakpoint)element);
- } else if (element instanceof IProcess) {
- if (((IProcess) element).isTerminated()) {
- return IDebugUIConstants.IMG_OBJS_OS_PROCESS_TERMINATED;
- }
- return IDebugUIConstants.IMG_OBJS_OS_PROCESS;
- } else if (element instanceof ILaunch) {
- // determine the image from the launch config type
- ILaunch launch= (ILaunch)element;
- ILaunchConfiguration configuration = launch.getLaunchConfiguration();
- if (configuration != null) {
- try {
- return configuration.getType().getIdentifier();
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- return null;
- }
- }
- // if no config, use the old "mode" way
- if (launch.getLaunchMode().equals(ILaunchManager.DEBUG_MODE)) {
- return IDebugUIConstants.IMG_OBJS_LAUNCH_DEBUG;
- } else if (launch.isTerminated()) {
- return IDebugUIConstants.IMG_OBJS_LAUNCH_RUN_TERMINATED;
- } else {
- return IDebugUIConstants.IMG_OBJS_LAUNCH_RUN;
- }
- } else if (element instanceof ILaunchConfigurationType) {
- return ((ILaunchConfigurationType)element).getIdentifier();
- } else if (element instanceof ILaunchConfiguration) {
- try {
- return ((ILaunchConfiguration)element).getType().getIdentifier();
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- return null;
- }
- }
- }
- return null;
- }
-
- /**
- * @see ILabelProvider#getText(Object)
- */
- public String getText(Object element) {
- StringBuffer label= new StringBuffer();
- try {
- // Group elements into debug elements and non-debug elements
- // to reduce the number of instanceof checks performed
- if (element instanceof IDebugElement) {
- if (element instanceof IStackFrame) {
- label.append(((IStackFrame)element).getName());
- } else if (element instanceof IndexedVariablePartition) {
- label.append(((IndexedVariablePartition)element).getName());
- } else if (element instanceof IVariable) {
- label.append(getVariableText((IVariable)element));
- } else if (element instanceof IThread) {
- label.append(((IThread)element).getName());
- } else if (element instanceof IDebugTarget) {
- label.append((((IDebugTarget)element).getName()));
- } else if (element instanceof IExpression) {
- label.append(getExpressionText((IExpression)element));
- } else if (element instanceof IRegisterGroup) {
- label.append(getRegisterGroupText((IRegisterGroup)element));
- } else if (element instanceof IValue) {
- label.append(((IValue)element).getValueString());
- }
- } else {
- if (element instanceof IMarker) {
- label.append(getMarkerText((IMarker) element));
- } else if (element instanceof IBreakpoint) {
- label.append(getBreakpointText((IBreakpoint)element));
- } else if (element instanceof IProcess) {
- label.append(((IProcess) element).getLabel());
- } else if (element instanceof ILaunch) {
- label.append(getLaunchText((ILaunch) element));
- } else if (element instanceof ILaunchConfiguration) {
- label.append(((ILaunchConfiguration)element).getName());
- } else if (element instanceof ILaunchConfigurationType) {
- label.append(((ILaunchConfigurationType)element).getName());
- } else if(element instanceof ILaunchDelegate) {
- ILaunchDelegate delegate = (ILaunchDelegate) element;
- String name = delegate.getName();
- if(name == null) {
- name = delegate.getContributorName();
- }
- label.append(name);
- } else if(element instanceof LaunchShortcutExtension) {
- label.append(((LaunchShortcutExtension)element).getLabel());
- } else if (element instanceof String) {
- label.append(element);
- } else {
- label.append(getAdapterLabel(element));
- }
- }
- if (element instanceof ITerminate) {
- if (((ITerminate) element).isTerminated()) {
- String terminatedMessage= null;
- if (element instanceof IProcess) {
- IProcess process = (IProcess)element;
- int exit = process.getExitValue();
- terminatedMessage= MessageFormat.format(DebugUIMessages.DefaultLabelProvider_16, new String[]{new Integer(exit).toString()});
- } else {
- terminatedMessage= DebugUIMessages.DefaultLabelProvider_1;
- }
- label.insert(0, terminatedMessage);
- }
- } else if (element instanceof IDisconnect) {
- if (((IDisconnect) element).isDisconnected()) {
- label.insert(0, DebugUIMessages.DefaultLabelProvider__disconnected__1);
- }
- }
- } catch (DebugException e) {
- DebugUIPlugin.log(e);
- label.append(DebugUIMessages.DefaultLabelProvider__unknown__1);
- }
- return label.toString();
- }
-
- /**
- * Returns default label for a breakpoint.
- *
- * @param breakpoint
- * @return default label for a breakpoint
- */
- private String getBreakpointText(IBreakpoint breakpoint) {
- IResource resource = breakpoint.getMarker().getResource();
- StringBuffer label = new StringBuffer();
- if (resource != null) {
- label.append(resource.getName());
- }
- if (breakpoint instanceof ILineBreakpoint) {
- try {
- int lineNumber = ((ILineBreakpoint)breakpoint).getLineNumber();
- label.append(MessageFormat.format(DebugUIMessages.DefaultLabelProvider_17, new String[]{Integer.toString(lineNumber)}));
- } catch (CoreException e) {
- }
- }
- return label.toString();
- }
-
- public String getAdapterLabel(Object object) {
- if (object instanceof IAdaptable) {
- IWorkbenchAdapter de= (IWorkbenchAdapter) ((IAdaptable) object).getAdapter(IWorkbenchAdapter.class);
- if (de != null) {
- return de.getLabel(object);
- }
- }
- return DebugUIMessages.DefaultLabelProvider__unknown__1;
- }
-
- /**
- * Used to render launch history items in the re-launch drop downs
- */
- protected String getLaunchText(ILaunch launch) {
- if (launch.getLaunchConfiguration() == null || (!launch.getLaunchConfiguration().exists() && !launch.getLaunchConfiguration().isWorkingCopy())) {
- return DebugUIMessages.DefaultLabelProvider__unknown__1;
- }
- // new launch configuration
- ILaunchConfiguration config = launch.getLaunchConfiguration();
- StringBuffer buff= new StringBuffer(config.getName());
- buff.append(" ["); //$NON-NLS-1$
- try {
- buff.append(config.getType().getName());
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- buff.append("]"); //$NON-NLS-1$
- return buff.toString();
- }
-
- protected String getExpressionText(IExpression expression) {
- if (expression instanceof IWatchExpression) {
- return getWatchExpressionText((IWatchExpression) expression);
- }
- StringBuffer buffer= new StringBuffer(expression.getExpressionText());
- String valueString= null;
- IValue value= expression.getValue();
- if (value != null) {
- try {
- valueString= value.getValueString();
- } catch (DebugException de) {
- DebugUIPlugin.log(de);
- }
- }
- if (valueString != null && valueString.length() > 0) {
- buffer.append("= "); //$NON-NLS-1$
- buffer.append(valueString);
- }
- return buffer.toString();
- }
-
- /**
- * @param expression
- * @return
- */
- protected String getWatchExpressionText(IWatchExpression expression) {
- StringBuffer result= new StringBuffer();
-
- String snippet = expression.getExpressionText().trim();
- StringBuffer snippetBuffer = new StringBuffer();
- if (snippet.length() > 30){
- snippetBuffer.append(snippet.substring(0, 15));
- snippetBuffer.append(DebugUIMessages.DefaultLabelProvider_0);
- snippetBuffer.append(snippet.substring(snippet.length() - 15));
- } else {
- snippetBuffer.append(snippet);
- }
- snippet = snippetBuffer.toString().replaceAll("[\n\r\t]+", " "); //$NON-NLS-1$//$NON-NLS-2$
-
- result.append('"');
- result.append(snippet);
- result.append('"');
-
- if (expression.isPending()) {
- result.append(DebugUIMessages.DefaultLabelProvider_12);
- } else if (expression.hasErrors()) {
- result.append(DebugUIMessages.DefaultLabelProvider_13);
- } else {
- IValue value= expression.getValue();
- if (value != null) {
- String valueString= DebugUIPlugin.getModelPresentation().getText(value);
- if (valueString.length() > 0) {
- result.append(" = ").append(valueString); //$NON-NLS-1$
- }
- }
- }
- if (!expression.isEnabled()) {
- result.append(DebugUIMessages.DefaultLabelProvider_15);
- }
- return result.toString();
- }
-
- protected String getVariableText(IVariable variable) {
- StringBuffer buffer= new StringBuffer();
- try {
- IValue value = variable.getValue();
- buffer.append(variable.getName());
- buffer.append(" = "); //$NON-NLS-1$
- buffer.append(value.getValueString());
- } catch (DebugException de) {
- DebugUIPlugin.log(de);
- }
- return buffer.toString();
- }
-
- protected String getRegisterGroupText(IRegisterGroup registerGroup) {
- StringBuffer buffer= new StringBuffer();
- try {
- buffer.append(registerGroup.getName());
- } catch (DebugException de) {
- DebugUIPlugin.log(de);
- }
- return buffer.toString();
- }
-
- protected String getMarkerText(IMarker marker) {
- try {
- if (marker.exists() && marker.isSubtypeOf(IBreakpoint.BREAKPOINT_MARKER)) {
- return DebugUIMessages.DefaultLabelProvider_Breakpoint_1;
- }
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- return IInternalDebugCoreConstants.EMPTY_STRING;
- }
-
- protected String getMarkerImageKey(IMarker marker) {
- try {
- IBreakpoint breakpoint= DebugPlugin.getDefault().getBreakpointManager().getBreakpoint(marker);
- if (breakpoint != null && marker.exists()) {
- if (breakpoint.isEnabled()) {
- return IDebugUIConstants.IMG_OBJS_BREAKPOINT;
- }
- return IDebugUIConstants.IMG_OBJS_BREAKPOINT_DISABLED;
- }
- } catch (CoreException e) {
- }
- return null;
- }
-
- protected String getBreakpointImageKey(IBreakpoint breakpoint) {
- if (breakpoint != null && breakpoint.getMarker().exists()) {
- try {
- boolean enabled = breakpoint.isEnabled();
- if (breakpoint instanceof IWatchpoint) {
- IWatchpoint watchpoint = (IWatchpoint) breakpoint;
- if (watchpoint.isAccess()) {
- if (watchpoint.isModification()) {
- //access and modification
- if (enabled) {
- return IDebugUIConstants.IMG_OBJS_WATCHPOINT;
- }
- return IDebugUIConstants.IMG_OBJS_WATCHPOINT_DISABLED;
- }
- if (enabled) {
- return IDebugUIConstants.IMG_OBJS_ACCESS_WATCHPOINT;
- }
- return IDebugUIConstants.IMG_OBJS_ACCESS_WATCHPOINT_DISABLED;
- } else if (watchpoint.isModification()) {
- if (enabled) {
- return IDebugUIConstants.IMG_OBJS_MODIFICATION_WATCHPOINT;
- }
- return IDebugUIConstants.IMG_OBJS_MODIFICATION_WATCHPOINT_DISABLED;
- } else {
- //neither access nor modification
- return IDebugUIConstants.IMG_OBJS_WATCHPOINT_DISABLED;
- }
- }
- if (enabled) {
- return IDebugUIConstants.IMG_OBJS_BREAKPOINT;
- }
- return IDebugUIConstants.IMG_OBJS_BREAKPOINT_DISABLED;
- } catch (CoreException e) {
- }
- }
- return null;
- }
-
- /**
- * @see IBaseLabelProvider#addListener(ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener) {
- }
-
- /**
- * @see IBaseLabelProvider#dispose()
- */
- public void dispose() {
- }
-
- /**
- * @see IBaseLabelProvider#isLabelProperty(Object, String)
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- /**
- * @see IBaseLabelProvider#removeListener(ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener) {
- }
-
- /**
- * Returns the given string with special chars in escaped sequences.
- *
- * @param label
- * @return the given string with special chars in escaped sequences
- * @since 3.3
- */
- public static String escapeSpecialChars(String string) {
- if (string == null) {
- return null;
- }
- StringBuffer escaped = new StringBuffer();
- for (int i = 0; i < string.length(); i++) {
- char c = string.charAt(i);
- switch (c) {
- case '\b':
- escaped.append("\\b"); //$NON-NLS-1$
- break;
- case '\f':
- escaped.append("\\f"); //$NON-NLS-1$
- break;
- case '\n':
- escaped.append("\\n"); //$NON-NLS-1$
- break;
- case '\r':
- escaped.append("\\r"); //$NON-NLS-1$
- break;
- case '\t':
- escaped.append("\\t"); //$NON-NLS-1$
- break;
- case '\\':
- escaped.append("\\\\"); //$NON-NLS-1$
- break;
- default:
- escaped.append(c);
- break;
- }
- }
- return escaped.toString();
- }
-
- /**
- * Returns the string with escaped sequences replaced with single chars.
- *
- * @param string
- * @return the string with escaped sequences replaced with single chars
- * @since 3.3
- */
- public static String encodeEsacpedChars(String string) {
- if (string == null) {
- return null;
- }
- StringBuffer encoded = new StringBuffer();
- if (string.length() == 1) {
- return string;
- }
- for (int i = 0; i < string.length(); i++) {
- char c = string.charAt(i);
- if (c == '\\') {
- switch (string.charAt(i+1)) {
- case 'b':
- c= '\b';
- i++;
- break;
- case 'f':
- c= '\f';
- i++;
- break;
- case 'n':
- c= '\n';
- i++;
- break;
- case 'r':
- c= '\r';
- i++;
- break;
- case 't':
- c= '\t';
- i++;
- break;
- case '\'':
- c= '\'';
- i++;
- break;
- case '\\':
- c= '\\';
- i++;
- break;
- default :
- break;
- }
- }
- encoded.append(c);
- }
- return encoded.toString();
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
deleted file mode 100644
index 8f3425e57..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
+++ /dev/null
@@ -1,478 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugEditorPresentation;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IDebugModelPresentationExtension;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.IInstructionPointerPresentation;
-import org.eclipse.debug.ui.IValueDetailListener;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.jface.viewers.IFontProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * A model presentation that delegates to the appropriate extension. This
- * presentation contains a table of specialized presentations that are defined
- * as <code>org.eclipse.debug.ui.debugModelPresentations</code> extensions. When
- * asked to render an object from a debug model, this presentation delegates
- * to the extension registered for that debug model.
- */
-public class DelegatingModelPresentation implements IDebugModelPresentation, IDebugEditorPresentation,
- IColorProvider, IFontProvider, IInstructionPointerPresentation, IDebugModelPresentationExtension {
-
- /**
- * A mapping of attribute ids to their values
- * @see IDebugModelPresentation#setAttribute
- */
- private HashMap fAttributes= new HashMap(3);
- /**
- * A table of label providers keyed by debug model identifiers.
- */
- private HashMap fLabelProviders= new HashMap(5);
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDebugEditorPresentation#removeAnnotations(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IThread)
- */
- public void removeAnnotations(IEditorPart editorPart, IThread thread) {
- IDebugModelPresentation presentation = getConfiguredPresentation(thread);
- if (presentation instanceof IDebugEditorPresentation) {
- ((IDebugEditorPresentation)presentation).removeAnnotations(editorPart, thread);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDebugEditorPresentation#addAnnotations(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
- */
- public boolean addAnnotations(IEditorPart editorPart, IStackFrame frame) {
- IDebugModelPresentation presentation = getConfiguredPresentation(frame);
- if (presentation instanceof IDebugEditorPresentation) {
- return((IDebugEditorPresentation)presentation).addAnnotations(editorPart, frame);
- }
- return false;
- }
-
- /**
- * Constructs a new DelegatingLabelProvider that delegates to extensions
- * of kind <code>org.eclipse.debug.ui.debugLabelProvider</code>
- */
- public DelegatingModelPresentation() {
- IExtensionPoint point= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.ID_DEBUG_MODEL_PRESENTATION);
- if (point != null) {
- IExtension[] extensions= point.getExtensions();
- for (int i= 0; i < extensions.length; i++) {
- IExtension extension= extensions[i];
- IConfigurationElement[] configElements= extension.getConfigurationElements();
- for (int j= 0; j < configElements.length; j++) {
- IConfigurationElement elt= configElements[j];
- String id= elt.getAttribute("id"); //$NON-NLS-1$
- if (id != null) {
- IDebugModelPresentation lp= new LazyModelPresentation(this, elt);
- getLabelProviders().put(id, lp);
- }
- }
- }
- }
- }
-
- /**
- * Delegate to all extensions.
- *
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener) {
- Iterator i= getLabelProviders().values().iterator();
- while (i.hasNext()) {
- ((ILabelProvider) i.next()).addListener(listener);
- }
- }
-
- /**
- * Delegate to all extensions.
- *
- * @see IBaseLabelProvider#dispose()
- */
- public void dispose() {
- Iterator i= getLabelProviders().values().iterator();
- while (i.hasNext()) {
- ((ILabelProvider) i.next()).dispose();
- }
- }
-
- /**
- * @see IDebugModelPresentation#getImage(Object)
- */
- public Image getImage(Object item) {
- // Attempt to delegate
- IDebugModelPresentation lp= getConfiguredPresentation(item);
- if (lp != null) {
- Image image= lp.getImage(item);
- if (image != null) {
- return image;
- }
- }
- // If no delegate returned an image, use the default
- return getDefaultImage(item);
- }
-
- /**
- * @see IDebugModelPresentation#getText(Object)
- */
- public String getText(Object item) {
- IDebugModelPresentation lp= getConfiguredPresentation(item);
- if (lp != null) {
- return lp.getText(item);
- }
- return getDefaultText(item);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ISourcePresentation#getEditorInput(java.lang.Object)
- */
- public IEditorInput getEditorInput(Object item) {
- IDebugModelPresentation lp= getConfiguredPresentation(item);
- if (lp != null) {
- return lp.getEditorInput(item);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ISourcePresentation#getEditorId(org.eclipse.ui.IEditorInput, java.lang.Object)
- */
- public String getEditorId(IEditorInput input, Object objectInput) {
- IDebugModelPresentation lp= getConfiguredPresentation(objectInput);
- if (lp != null) {
- return lp.getEditorId(input, objectInput);
- }
- return null;
- }
-
-
- /**
- * Returns a default text label for the debug element
- */
- protected String getDefaultText(Object element) {
- return DebugUIPlugin.getDefaultLabelProvider().getText(element);
- }
-
- /**
- * Returns a default image for the debug element
- */
- protected Image getDefaultImage(Object element) {
- return DebugUIPlugin.getDefaultLabelProvider().getImage(element);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDebugModelPresentation#computeDetail(org.eclipse.debug.core.model.IValue, org.eclipse.debug.ui.IValueDetailListener)
- */
- public void computeDetail(IValue value, IValueDetailListener listener) {
- IDebugModelPresentation lp= getConfiguredPresentation(value);
- if (lp != null) {
- lp.computeDetail(value, listener);
- } else {
- listener.detailComputed(value, getText(value));
- }
- }
-
- /**
- * Delegate to all extensions.
- *
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener) {
- Iterator i= getLabelProviders().values().iterator();
- while (i.hasNext()) {
- ((ILabelProvider) i.next()).removeListener(listener);
- }
- }
-
- /**
- * Delegate to the appropriate label provider.
- *
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
- */
- public boolean isLabelProperty(Object element, String property) {
- if (element instanceof IDebugElement) {
- IDebugModelPresentation lp= getConfiguredPresentation(element);
- if (lp != null) {
- return lp.isLabelProperty(element, property);
- }
- }
-
- return true;
- }
-
- /**
- * Returns a configured model presentation for the given object,
- * or <code>null</code> if one is not registered.
- */
- protected IDebugModelPresentation getConfiguredPresentation(Object element) {
- String id= null;
- if (element instanceof IDebugElement) {
- IDebugElement de= (IDebugElement) element;
- id= de.getModelIdentifier();
- } else if (element instanceof IMarker) {
- IMarker m= (IMarker) element;
- IBreakpoint bp = DebugPlugin.getDefault().getBreakpointManager().getBreakpoint(m);
- if (bp != null) {
- id= bp.getModelIdentifier();
- }
- } else if (element instanceof IBreakpoint) {
- id = ((IBreakpoint)element).getModelIdentifier();
- }
- if (id != null) {
- return getPresentation(id);
- }
-
- return null;
- }
-
- /**
- * Returns the presentation registered for the given id, or <code>null</code>
- * of nothing is registered for the id.
- */
- public IDebugModelPresentation getPresentation(String id) {
- return (IDebugModelPresentation) getLabelProviders().get(id);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDebugModelPresentation#setAttribute(java.lang.String, java.lang.Object)
- */
- public void setAttribute(String id, Object value) {
- if (value == null) {
- return;
- }
- basicSetAttribute(id, value);
- Iterator presentations = fLabelProviders.values().iterator();
- while (presentations.hasNext()) {
- ((IDebugModelPresentation)presentations.next()).setAttribute(id, value);
- }
- }
-
- /**
- * Sets the value of the given attribute without setting in child presentations.
- *
- * @param id id
- * @param value value
- */
- protected void basicSetAttribute(String id, Object value) {
- getAttributes().put(id, value);
- }
-
- /**
- * Whether or not to show variable type names.
- * This option is configured per model presentation.
- * This allows this option to be set per view, for example.
- */
- protected boolean showVariableTypeNames() {
- Boolean show= (Boolean) fAttributes.get(DISPLAY_VARIABLE_TYPE_NAMES);
- show= show == null ? Boolean.FALSE : show;
- return show.booleanValue();
- }
-
- /**
- * Returns the raw attribute map
- * @return the raw attribute map
- */
- public HashMap getAttributes() {
- return fAttributes;
- }
-
- /**
- * Returns a copy of the attribute map for this presentation.
- *
- * @return a copy of the attribute map for this presentation
- * @since 3.0
- */
- public Map getAttributeMap() {
- return (Map) getAttributes().clone();
- }
-
- protected HashMap getLabelProviders() {
- return fLabelProviders;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
- */
- public Color getForeground(Object element) {
- IDebugModelPresentation presentation = getConfiguredPresentation(element);
- if (presentation instanceof IColorProvider) {
- IColorProvider colorProvider = (IColorProvider) presentation;
- return colorProvider.getForeground(element);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object)
- */
- public Color getBackground(Object element) {
- IDebugModelPresentation presentation = getConfiguredPresentation(element);
- if (presentation instanceof IColorProvider) {
- IColorProvider colorProvider = (IColorProvider) presentation;
- return colorProvider.getBackground(element);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IFontProvider#getFont(java.lang.Object)
- */
- public Font getFont(Object element) {
- IDebugModelPresentation presentation = getConfiguredPresentation(element);
- if (presentation instanceof IFontProvider) {
- IFontProvider fontProvider = (IFontProvider) presentation;
- return fontProvider.getFont(element);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IInstructionPointerPresentation#getInstructionPointerAnnotation(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
- */
- public Annotation getInstructionPointerAnnotation(IEditorPart editorPart, IStackFrame frame) {
- IDebugModelPresentation presentation = getConfiguredPresentation(frame);
- Annotation annotation = null;
- String id = null;
- Image image = null;
- String text = null;
- if (presentation instanceof IInstructionPointerPresentation) {
- // first check if an annotaion object is provided
- IInstructionPointerPresentation pointerPresentation = (IInstructionPointerPresentation) presentation;
- annotation = pointerPresentation.getInstructionPointerAnnotation(editorPart, frame);
- if (annotation == null) {
- // next check for a marker annotation specification extension
- id = pointerPresentation.getInstructionPointerAnnotationType(editorPart, frame);
- if (id == null) {
- // check for an image
- image = pointerPresentation.getInstructionPointerImage(editorPart, frame);
- }
- text = pointerPresentation.getInstructionPointerText(editorPart, frame);
- }
- }
- if (annotation == null) {
- boolean defaultAnnotation = id == null;
- if (id == null || text == null || (defaultAnnotation && image == null)) {
- IThread thread = frame.getThread();
- IStackFrame tos = null;
- boolean top = false;
- try {
- tos = thread.getTopStackFrame();
- top = frame.equals(tos);
- } catch (DebugException de) {
- }
- if (id == null) {
- if (top) {
- id = IDebugUIConstants.ANNOTATION_TYPE_INSTRUCTION_POINTER_CURRENT;
- } else {
- id = IDebugUIConstants.ANNOTATION_TYPE_INSTRUCTION_POINTER_SECONDARY;
- }
- }
- if (text == null) {
- if (top) {
- text = DebugUIMessages.InstructionPointerAnnotation_0;
- } else {
- text = DebugUIMessages.InstructionPointerAnnotation_1;
- }
- }
- if (defaultAnnotation && image == null) {
- if (top) {
- image = DebugUITools.getImage(IDebugUIConstants.IMG_OBJS_INSTRUCTION_POINTER_TOP);
- } else {
- image = DebugUITools.getImage(IDebugUIConstants.IMG_OBJS_INSTRUCTION_POINTER);
- }
- }
- }
- if (defaultAnnotation) {
- annotation = new InstructionPointerAnnotation(frame, id, text, image);
- } else {
- annotation = new DynamicInstructionPointerAnnotation(frame, id, text);
- }
- }
- return annotation;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IInstructionPointerPresentation#getMarkerAnnotationSpecificationId(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
- */
- public String getInstructionPointerAnnotationType(IEditorPart editorPart, IStackFrame frame) {
- IDebugModelPresentation presentation = getConfiguredPresentation(frame);
- if (presentation instanceof IInstructionPointerPresentation) {
- return ((IInstructionPointerPresentation)presentation).getInstructionPointerAnnotationType(editorPart, frame);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IInstructionPointerPresentation#getInstructionPointerImage(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
- */
- public Image getInstructionPointerImage(IEditorPart editorPart, IStackFrame frame) {
- IDebugModelPresentation presentation = getConfiguredPresentation(frame);
- if (presentation instanceof IInstructionPointerPresentation) {
- return ((IInstructionPointerPresentation)presentation).getInstructionPointerImage(editorPart, frame);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IInstructionPointerPresentation#getInstructionPointerText(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
- */
- public String getInstructionPointerText(IEditorPart editorPart, IStackFrame frame) {
- IDebugModelPresentation presentation = getConfiguredPresentation(frame);
- if (presentation instanceof IInstructionPointerPresentation) {
- return ((IInstructionPointerPresentation)presentation).getInstructionPointerText(editorPart, frame);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDebugModelPresentationExtension#requiresUIThread(java.lang.Object)
- */
- public boolean requiresUIThread(Object element) {
- IDebugModelPresentation presentation = getConfiguredPresentation(element);
- if (presentation == null) {
- // default label provider will be used
- return !DebugPluginImages.isInitialized();
- }
- if (presentation instanceof IDebugModelPresentationExtension) {
- return ((IDebugModelPresentationExtension)presentation).requiresUIThread(element);
- }
- return false;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DynamicInstructionPointerAnnotation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DynamicInstructionPointerAnnotation.java
deleted file mode 100644
index 6ca45c424..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DynamicInstructionPointerAnnotation.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.jface.text.source.Annotation;
-
-/**
- * Client specified instruction pointer annotation.
- */
-public class DynamicInstructionPointerAnnotation extends Annotation {
-
- /**
- * The frame for this instruction pointer annotation. This is necessary only so that
- * instances of this class can be distinguished by equals().
- */
- private IStackFrame fStackFrame;
-
- /**
- *
- * @param frame
- * @param markerAnnotationSpecificationId
- * @param text
- */
- public DynamicInstructionPointerAnnotation(IStackFrame frame, String markerAnnotationSpecificationId, String text) {
- super(markerAnnotationSpecificationId, false, text);
- fStackFrame = frame;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object other) {
- if (other instanceof DynamicInstructionPointerAnnotation) {
- return getStackFrame().equals(((DynamicInstructionPointerAnnotation)other).getStackFrame());
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return getStackFrame().hashCode();
- }
-
- /**
- * Returns the stack frame associated with this annotation
- *
- * @return the stack frame associated with this annotation
- */
- private IStackFrame getStackFrame() {
- return fStackFrame;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java
deleted file mode 100644
index ace7df94b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * QNX Software Systems - Mikhail Khodjaiants - Registers View (Bug 53640)
- * Wind River Systems - Pawel Piech - Added Modules view (bug 211158)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Help context ids for the debug ui.
- * <p>
- * This interface contains constants only; it is not intended to be implemented
- * or extended.
- * </p>
- *
- */
-public interface IDebugHelpContextIds {
-
- public static final String PREFIX = IDebugUIConstants.PLUGIN_ID + "."; //$NON-NLS-1$
-
- // Actions
- public static final String CHANGE_VALUE_ACTION = PREFIX + "change_value_action_context"; //$NON-NLS-1$
- public static final String OPEN_BREAKPOINT_ACTION = PREFIX + "open_breakpoint_action_context"; //$NON-NLS-1$
- public static final String RELAUNCH_HISTORY_ACTION = PREFIX + "relaunch_history_action_context"; //$NON-NLS-1$
- public static final String SHOW_BREAKPOINTS_FOR_MODEL_ACTION = PREFIX + "show_breakpoints_for_model_action_context"; //$NON-NLS-1$
- public static final String COPY_BREAKPOINTS_ACTION = PREFIX + "copy_breakpoints_action_context"; //$NON-NLS-1$
- public static final String PASTE_BREAKPOINTS_ACTION = PREFIX + "paste_breakpoints_action_context"; //$NON-NLS-1$
- public static final String SHOW_TYPES_ACTION = PREFIX + "show_types_action_context"; //$NON-NLS-1$
- public static final String VARIABLES_CONTENT_PROVIDERS_ACTION = PREFIX + "variables_content_providers_action_context"; //$NON-NLS-1$
- public static final String VARIABLES_SELECT_LOGICAL_STRUCTURE = PREFIX + "variables_select_logical_structure"; //$NON-NLS-1$
- public static final String VARIABLES_SELECT_DETAIL_PANE = PREFIX + "variables_select_detail_pane_action_context"; //$NON-NLS-1$
- public static final String VARIABLES_AUTO_EXPAND = PREFIX + "variables_auto_expand_action_context"; //$NON-NLS-1$
- public static final String SELECT_WORKING_SET_ACTION = PREFIX + "select_working_set_context"; //$NON-NLS-1$
- public static final String CLEAR_WORKING_SET_ACTION = PREFIX + "clear_working_set_context"; //$NON-NLS-1$
- public static final String EDIT_LAUNCH_CONFIGURATION_ACTION = PREFIX + "edit_launch_configuration_action_context"; //$NON-NLS-1$
- public static final String OPEN_LAUNCH_CONFIGURATION_ACTION = PREFIX + "open_launch_configuration_action_context"; //$NON-NLS-1$
- public static final String LINK_BREAKPOINTS_WITH_DEBUG_ACTION= PREFIX + "link_breakpoints_with_debug_context"; //$NON-NLS-1$
- public static final String EDIT_SOURCELOOKUP_ACTION = PREFIX + "edit_source_lookup_path_context";//$NON-NLS-1$
- public static final String LOOKUP_SOURCE_ACTION = PREFIX + "lookup_source_context";//$NON-NLS-1$
- public static final String SKIP_ALL_BREAKPOINT_ACTION = PREFIX + "skip_all_breakpoints_context"; //$NON-NLS-1$
- public static final String AUTO_MANAGE_VIEWS_ACTION = PREFIX + "auto_manage_views_context"; //$NON-NLS-1$
- public static final String FIND_ELEMENT_ACTION = PREFIX + "find_element_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE = PREFIX + "detail_pane_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE_ASSIGN_VALUE_ACTION = PREFIX + "detail_pane_assign_value_action_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE_CONTENT_ASSIST_ACTION = PREFIX + "detail_pane_content_assist_action_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE_CUT_ACTION = PREFIX + "detail_pane_cut_action_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE_COPY_ACTION = PREFIX + "detail_pane_copy_action_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE_PASTE_ACTION = PREFIX + "detail_pane_paste_action_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE_SELECT_ALL_ACTION = PREFIX + "detail_pane_select_all_action_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE_FIND_REPLACE_ACTION = PREFIX + "detail_pane_find_replace_action_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE_WORD_WRAP_ACTION = PREFIX + "detail_pane_word_wrap_action_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE_MAX_LENGTH_ACTION = PREFIX + "detail_pane_max_length_action_context"; //$NON-NLS-1$
- public static final String CONSOLE_TERMINATE_ACTION = PREFIX + "console_terminate_action_context"; //$NON-NLS-1$
- public static final String CONSOLE_REMOVE_ALL_TERMINATED = PREFIX + "console_remove_all_terminated_context"; //$NON-NLS-1$
- public static final String CONSOLE_REMOVE_LAUNCH = PREFIX + "console_remove_launch_context"; //$NON-NLS-1$;
- public static final String CONSOLE_SHOW_PREFERENCES = PREFIX + "console_show_preferences_action_context"; //$NON-NLS-1$
- public static final String SHOW_COLUMNS_ACTION = PREFIX + "show_columns_context"; //$NON-NLS-1$;
- public static final String CONFIGURE_COLUMNS_ACTION = PREFIX + "configure_columns_context"; //$NON-NLS-1$;
- public static final String MEMORY_VIEW_PANE_ORIENTATION_ACTION = PREFIX + "memory_view_pane_orientation_action_context"; //$NON-NLS-1$
- public static final String SHOW_WHEN_STDOUT_CHANGES_ACTION = PREFIX + "show_stdout_action_context"; //$NON-NLS-1$
- public static final String SHOW_WHEN_STDERR_CHANGES_ACTION = PREFIX + "show_stderr_action_context"; //$NON-NLS-1$
- public static final String HORIZONTAL_DETAIL_PANE_LAYOUT_ACTION = PREFIX + "horizontal_detail_pane_layout_action_context"; //$NON-NLS-1$
- public static final String VERTICAL_DETAIL_PANE_LAYOUT_ACTION = PREFIX + "vertical_detail_pane_layout_action_context"; //$NON-NLS-1$
- public static final String DETAIL_PANE_HIDDEN_LAYOUT_ACTION = PREFIX + "detail_pane_hidden_layout_action_context"; //$NON-NLS-1$
- public static final String DEBUG_VIEW_MODE_AUTO_ACTION = PREFIX + "debug_view_mode_auto_action_context"; //$NON-NLS-1$
- public static final String DEBUG_VIEW_MODE_FULL_ACTION = PREFIX + "debug_view_mode_full_action_context"; //$NON-NLS-1$
- public static final String DEBUG_VIEW_MODE_COMPACT_ACTION = PREFIX + "debug_view_mode_compact_action_context"; //$NON-NLS-1$
- public static final String DEBUG_VIEW_DROP_DOWN_AUTOEXPAND_ACTION = PREFIX + "debug_view_drop_down_autoexpand_action_context"; //$NON-NLS-1$
-
- // Views
- public static final String DEBUG_VIEW = PREFIX + "debug_view_context"; //$NON-NLS-1$
- public static final String VARIABLE_VIEW = PREFIX + "variable_view_context"; //$NON-NLS-1$
- public static final String BREAKPOINT_VIEW = PREFIX + "breakpoint_view_context"; //$NON-NLS-1$
- public static final String EXPRESSION_VIEW = PREFIX + "expression_view_context"; //$NON-NLS-1$
- public static final String LAUNCH_CONFIGURATION_VIEW = PREFIX + "launch_configuration_view_context"; //$NON-NLS-1$
- public static final String REGISTERS_VIEW = PREFIX + "registers_view_context"; //$NON-NLS-1$
- public static final String PROCESS_CONSOLE = PREFIX + "process_console_context"; //$NON-NLS-1$
- public static final String MODULES_VIEW = PREFIX + "modules_view_context"; //$NON-NLS-1$
-
- // Preference pages
- public static final String DEBUG_PREFERENCE_PAGE = PREFIX + "debug_preference_page_context"; //$NON-NLS-1$
- public static final String CONSOLE_PREFERENCE_PAGE = PREFIX + "console_preference_page_context"; //$NON-NLS-1$
- public static final String SIMPLE_VARIABLE_PREFERENCE_PAGE = PREFIX + "simple_variable_preference_page_context"; //$NON-NLS-1$
- public static final String PERSPECTIVE_PREFERENCE_PAGE = PREFIX + "perspective_preference_page_context"; //$NON-NLS-1$
- public static final String LAUNCHING_PREFERENCE_PAGE = PREFIX + "launching_preference_page_context"; //$NON-NLS-1$
- public static final String LAUNCH_CONFIGURATION_PREFERENCE_PAGE = PREFIX + "launch_configuration_preference_page_context"; //$NON-NLS-1$
- public static final String VIEW_MANAGEMENT_PREFERENCE_PAGE = PREFIX + "view_management_preference_page_context"; //$NON-NLS-1$
- public static final String LAUNCH_DELEGATES_PREFERENCE_PAGE = PREFIX + "launch_delegate_preference_page_context"; //$NON-NLS-1$
-
- // Dialogs
- public static final String LAUNCH_CONFIGURATION_DIALOG = PREFIX + "launch_configuration_dialog"; //$NON-NLS-1$
- public static final String LAUNCH_CONFIGURATION_PROPERTIES_DIALOG = PREFIX + "launch_configuration_properties_dialog"; //$NON-NLS-1$
- public static final String SINGLE_LAUNCH_CONFIGURATION_DIALOG = PREFIX + "single_launch_configuration_dialog"; //$NON-NLS-1$
- public static final String VARIABLE_SELECTION_DIALOG = PREFIX + "variable_selection_dialog_context"; //$NON-NLS-1$
- public static final String EDIT_SOURCELOOKUP_DIALOG = PREFIX + "edit_source_lookup_path_dialog";//$NON-NLS-1$
- public static final String SOURCELOOKUP_TAB = PREFIX + "launch_configuration_dialog_source_tab";//$NON-NLS-1$
- public static final String ADD_SOURCE_CONTAINER_DIALOG = PREFIX + "add_source_container_dialog";//$NON-NLS-1$
- public static final String ADD_PROJECT_CONTAINER_DIALOG = PREFIX + "project_source_container_dialog";//$NON-NLS-1$
- public static final String ADD_FOLDER_CONTAINER_DIALOG = PREFIX + "folder_source_container_dialog";//$NON-NLS-1$
- public static final String ADD_ARCHIVE_CONTAINER_DIALOG = PREFIX + "archive_source_container_dialog";//$NON-NLS-1$
- public static final String MULTIPLE_SOURCE_DIALOG = PREFIX + "multiple_source_selection_dialog";//$NON-NLS-1$
- public static final String ADD_WATCH_EXPRESSION_DIALOG= PREFIX + "add_watch_expression_dialog_context"; //$NON-NLS-1$
- public static final String EDIT_WATCH_EXPRESSION_DIALOG = PREFIX + "edit_watch_expression_dialog_context"; //$NON-NLS-1$
- public static final String FIND_ELEMENT_DIALOG = PREFIX + "find_element_dialog_context"; //$NON-NLS-1$
- public static final String CONFIGURE_COLUMNS_DIALOG = PREFIX + "configure_columns_dialog_context"; //$NON-NLS-1$;
- public static final String GROUP_BREAKPOINTS_DIALOG = PREFIX + "group_breakpoints_dialog_context"; //$NON-NLS-1$
- public static final String ORGANIZE_FAVORITES_DIALOG = PREFIX + "organize_favorites_dialog_context"; //$NON-NLS-1$
- public static final String SELECT_DEFAULT_WORKINGSET_DIALOG = PREFIX + "select_breakpoint_workingset_dialog"; //$NON-NLS-1$
- public static final String DELETE_ASSOCIATED_LAUNCH_CONFIGS_DIALOG = PREFIX + "delete_associated_launch_configs_dialog"; //$NON-NLS-1$
- public static final String SELECT_LAUNCH_MODES_DIALOG = PREFIX + "select_launch_modes_dialog"; //$NON-NLS-1$
- public static final String SELECT_LAUNCHERS_DIALOG = PREFIX + "select_launchers_dialog"; //$NON-NLS-1$
- public static final String SELECT_RESOURCES_TO_SAVE_DIALOG = PREFIX + "select_resources_to_save_dialog"; //$NON-NLS-1$
- public static final String SELECT_LAUNCH_METHOD_DIALOG = PREFIX + "select_launch_method_dialog"; //$NON-NLS-1$
- public static final String SELECT_LAUNCH_CONFIGURATION_DIALOG = PREFIX + "select_launch_configuration_dialog"; //$NON-NLS-1$
- public static final String SELECT_DIRECTORY_SOURCE_CONTAINER_DIALOG = PREFIX + "select_directory_source_container_dialog"; //$NON-NLS-1$
- public static final String SELECT_CONFIGURATION_TYPE_DIALOG = PREFIX + "select_configuration_type_dialog"; //$NON-NLS-1$
- public static final String SELECT_FAVORITES_DIALOG = PREFIX + "select_favorites_dialog"; //$NON-NLS-1$
- public static final String SELECT_NATIVE_ENVIRONMENT_DIALOG = PREFIX + "select_native_environment_dialog"; //$NON-NLS-1$
- public static final String SELECT_LAUNCH_CONFIGURATION_MIGRATION_DIALOG = PREFIX + "select_launch_configuration_migration_dialog"; //$NON-NLS-1$
-
- // Property pages
- public static final String PROCESS_PROPERTY_PAGE = PREFIX + "process_property_page_context"; //$NON-NLS-1$
- public static final String PROCESS_PAGE_RUN_AT = PREFIX + "process_page_run_at_time_widget"; //$NON-NLS-1$
- public static final String RUN_DEBUG_RESOURCE_PROPERTY_PAGE = PREFIX + "run_debug_resource_property_page"; //$NON-NLS-1$
-
- // Launch configuration dialog pages
- public static final String LAUNCH_CONFIGURATION_DIALOG_COMMON_TAB = PREFIX + "launch_configuration_dialog_common_tab"; //$NON-NLS-1$
- public static final String LAUNCH_CONFIGURATION_DIALOG_PERSPECTIVE_TAB = PREFIX + "launch_configuration_dialog_perspective_tab"; //$NON-NLS-1$
- public static final String LAUNCH_CONFIGURATION_DIALOG_REFRESH_TAB = PREFIX + "launch_configuration_dialog_refresh_tab"; //$NON-NLS-1$
- public static final String LAUNCH_CONFIGURATION_DIALOG_ENVIRONMENT_TAB = PREFIX + "launch_configuration_dialog_environment_tab"; //$NON-NLS-1$
-
- // Working set page
- public static final String WORKING_SET_PAGE = PREFIX + "working_set_page_context"; //$NON-NLS-1$
-
- //Wizards
- public static final String IMPORT_BREAKPOINTS_WIZARD_PAGE = PREFIX + "import_breakpoints_wizard_page_context"; //$NON-NLS-1$
- public static final String EXPORT_BREAKPOINTS_WIZARD_PAGE = PREFIX + "export_breakpoints_wizard_page_context"; //$NON-NLS-1$
- public static final String IMPORT_LAUNCH_CONFIGURATIONS_PAGE = PREFIX + "import_launch_configurations_context"; //$NON-NLS-1$
- public static final String EXPORT_LAUNCH_CONFIGURATIONS_PAGE = PREFIX + "export_launch_configurations_context"; //$NON-NLS-1$
-
- //Editor
- public static final String NO_SOURCE_EDITOR = PREFIX + "debugger_editor_no_source_common";//$NON-NLS-1$
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java
deleted file mode 100644
index ccaf43bf6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java
+++ /dev/null
@@ -1,430 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * QNX Software Systems - Mikhail Khodjaiants - Bug 114664
- * Wind River Systems - Pawel Piech - Added Modules view (bug 211158)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-import org.eclipse.debug.internal.ui.views.memory.MemoryBlocksTreeViewPane;
-import org.eclipse.debug.internal.ui.views.memory.RenderingViewPane;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-
-public interface IInternalDebugUIConstants {
-
- public static final String DIALOGSTORE_LASTEXTJAR= "org.eclipse.debug.ui.lastextjar"; //$NON-NLS-1$
-
- //Folders
- public static final String ID_NAVIGATOR_FOLDER_VIEW= "org.eclipse.debug.internal.ui.NavigatorFolderView"; //$NON-NLS-1$
- public static final String ID_TOOLS_FOLDER_VIEW= "org.eclipse.debug.internal.ui.ToolsFolderView"; //$NON-NLS-1$
- public static final String ID_CONSOLE_FOLDER_VIEW= "org.eclipse.debug.internal.ui.ConsoleFolderView"; //$NON-NLS-1$
- public static final String ID_OUTLINE_FOLDER_VIEW= "org.eclipse.debug.internal.ui.OutlineFolderView"; //$NON-NLS-1$
-
- // tool images
- public static final String IMG_LCL_COLLAPSE_ALL = "IMG_LCL_COLLAPSE_ALL"; //$NON-NLS-1$
- public static final String IMG_LCL_TERMINATE = "IMG_LCL_TERMINATE"; //$NON-NLS-1$
- public static final String IMG_LCL_SHOW_LOGICAL_STRUCTURE = "IMG_LCL_SHOW_LOGICAL_STRUCTURE"; //$NON-NLS-1$
- public static final String IMG_LCL_RUN_TO_LINE= "IMG_LCL_RUN_TO_LINE"; //$NON-NLS-1$
- public static final String IMG_SRC_LOOKUP_MENU = "IMG_SRC_LOOKUP_MENU"; //$NON-NLS-1$
- public static final String IMG_LCL_MONITOR_EXPRESSION= "IMG_LCL_MONITOR_EXPRESSION"; //$NON-NLS-1$
- public static final String IMG_LCL_REMOVE_MEMORY= "IMG_LCL_REMOVE_MEMORY"; //$NON-NLS-1$
- public static final String IMG_LCL_RESET_MEMORY= "IMG_LCL_RESET_MEMORY";//$NON-NLS-1$
- public static final String IMG_LCL_COPY_VIEW_TO_CLIPBOARD = "IMG_LCL_COPY_VIEW_TO_CLIPBOARD"; //$NON-NLS-1$
- public static final String IMG_LCL_PRINT_TOP_VIEW_TAB = "IMG_LCL_PRINT_TOP_VIEW_TAB"; //$NON-NLS-1$
-
- // disabled local tool images
- public static final String IMG_DLCL_LOCK= "IMG_DLCL_LOCK"; //$NON-NLS-1$
- public static final String IMG_DLCL_DETAIL_PANE= "IMG_DLCL_DETAIL_PANE"; //$NON-NLS-1$
- public static final String IMG_DLCL_CHANGE_VARIABLE_VALUE= "IMG_DLCL_CHANGE_VARIABLE_VALUE"; //$NON-NLS-1$
- public static final String IMG_DLCL_TYPE_NAMES= "IMG_DLCL_TYPE_NAMES"; //$NON-NLS-1$
- public static final String IMG_DLCL_SHOW_LOGICAL_STRUCTURE= "IMG_DLCL_SHOW_LOGICAL_STRUCTURE"; //$NON-NLS-1$
- public static final String IMG_DLCL_DETAIL_PANE_UNDER= "IMG_DLCL_DETAIL_PANE_UNDER"; //$NON-NLS-1$
- public static final String IMG_DLCL_DETAIL_PANE_RIGHT= "IMG_DLCL_DETAIL_PANE_RIGHT"; //$NON-NLS-1$
- public static final String IMG_DLCL_DETAIL_PANE_HIDE= "IMG_DLCL_DETAIL_PANE_HIDE"; //$NON-NLS-1$
- public static final String IMG_DLCL_COLLAPSE_ALL = "IMG_DLCL_COLLAPSE_ALL"; //$NON-NLS-1$
- public static final String IMG_DLCL_TERMINATE = "IMG_DLCL_TERMINATE"; //$NON-NLS-1$
- public static final String IMG_DLCL_REMOVE_ALL = "IMG_DLCL_REMOVE_ALL"; //$NON-NLS-1$
- public static final String IMG_DLCL_REMOVE = "IMG_DLCL_REMOVE"; //$NON-NLS-1$
- public static final String IMG_DLCL_RUN_TO_LINE= "IMG_DLCL_RUN_TO_LINE"; //$NON-NLS-1$
- public static final String IMG_SRC_LOOKUP_MENU_DLCL = "IMG_SRC_LOOKUP_MENU_DISABLED"; //$NON-NLS-1$
- public static final String IMG_DLCL_MONITOR_EXPRESSION= "IMG_DLCL_MONITOR_EXPRESSION"; //$NON-NLS-1$
- public static final String IMG_DLCL_REMOVE_MEMORY= "IMG_DLCL_REMOVE_MEMORY"; //$NON-NLS-1$
- public static final String IMG_DLCL_RESET_MEMORY= "IMG_DLCL_RESET_MEMORY"; //$NON-NLS-1$
- public static final String IMG_DLCL_COPY_VIEW_TO_CLIPBOARD= "IMG_DLCL_COPY_VIEW_TO_CLIPBOARD"; //$NON-NLS-1$
- public static final String IMG_DLCL_PRINT_TOP_VIEW_TAB= "IMG_DLCL_PRINT_TOP_VIEW_TAB"; //$NON-NLS-1$
- public static final String IMG_DLCL_NEW_CONFIG = "IMG_DLCL_NEW_CONFIG"; //$NON-NLS-1$
- public static final String IMG_DLCL_DUPLICATE_CONFIG = "IMG_DLCL_DUPLICATE_CONFIG"; //$NON-NLS-1$
- public static final String IMG_DLCL_DELETE_CONFIG = "IMG_DLCL_DELETE_CONFIG"; //$NON-NLS-1$
- public static final String IMG_DLCL_FILTER_CONFIGS = "IMG_DLCL_FILTER_CONFIGS"; //$NON-NLS-1$
- public static final String IMG_DLCL_SUSPEND = "IMG_DLCL_SUSPEND"; //$NON-NLS-1$
- public static final String IMG_DLCL_RESUME = "IMG_DLCL_RESUME"; //$NON-NLS-1$
- public static final String IMG_DLCL_STEP_RETURN = "IMG_DLCL_STEP_RETURN"; //$NON-NLS-1$
- public static final String IMG_DLCL_STEP_OVER = "IMG_DLCL_STEP_OVER"; //$NON-NLS-1$
- public static final String IMG_DLCL_STEP_INTO = "IMG_DLCL_STEP_INTO"; //$NON-NLS-1$
- public static final String IMG_DLCL_TERMINATE_AND_REMOVE = "IMG_DLCL_TERMINATE_AND_REMOVE"; //$NON-NLS-1$
- public static final String IMG_DLCL_TERMINATE_ALL = "IMG_DLCL_TERMINATE_ALL"; //$NON-NLS-1$
- public static final String IMG_DLCL_TERMINATE_AND_RELAUNCH = "IMG_DLCL_TERMINATE_AND_RELAUNCH"; //$NON-NLS-1$
- public static final String IMG_DLCL_TOGGLE_STEP_FILTERS = "IMG_DLCL_TOGGLE_STEP_FILTERS"; //$NON-NLS-1$
- public static final String IMG_DLCL_NEXT_THREAD = "IMG_DLCL_NEXT_THREAD"; //$NON-NLS-1$
- public static final String IMG_DLCL_PREVIOUS_THREAD = "IMG_DLCL_PREVIOUS_THREAD"; //$NON-NLS-1$
- public static final String IMG_DLCL_RESTART = "IMG_DLCL_RESTART"; //$NON-NLS-1$
-
- //TODO: Move this IDebugUIConstants. Created too late in 3.2 cycle to add API.
- //The enabled icon is already API.
- public static final String IMG_DLCL_DISCONNECT= "IMG_DLCL_DISCONNECT"; //$NON-NLS-1$
-
- // enabled local tool images
- public static final String IMG_ELCL_LOCK= "IMG_ELCL_LOCK"; //$NON-NLS-1$
- public static final String IMG_ELCL_DETAIL_PANE= "IMG_ELCL_DETAIL_PANE"; //$NON-NLS-1$
- public static final String IMG_ELCL_CHANGE_VARIABLE_VALUE= "IMG_ELCL_CHANGE_VARIABLE_VALUE"; //$NON-NLS-1$
- public static final String IMG_ELCL_TYPE_NAMES= "IMG_ELCL_TYPE_NAMES"; //$NON-NLS-1$
- public static final String IMG_ELCL_SHOW_LOGICAL_STRUCTURE= "IMG_ELCL_SHOW_LOGICAL_STRUCTURE"; //$NON-NLS-1$
- public static final String IMG_ELCL_DETAIL_PANE_UNDER= "IMG_ELCL_DETAIL_PANE_UNDER"; //$NON-NLS-1$
- public static final String IMG_ELCL_DETAIL_PANE_RIGHT= "IMG_ELCL_DETAIL_PANE_RIGHT"; //$NON-NLS-1$
- public static final String IMG_ELCL_DETAIL_PANE_HIDE= "IMG_ELCL_DETAIL_PANE_HIDE"; //$NON-NLS-1$
- public static final String IMG_ELCL_COLLAPSE_ALL = "IMG_ELCL_COLLAPSE_ALL"; //$NON-NLS-1$
- public static final String IMG_ELCL_TERMINATE = "IMG_ELCL_TERMINATE"; //$NON-NLS-1$
- public static final String IMG_SRC_LOOKUP_MENU_ELCL = "IMG_SRC_LOOKUP_MENU_ENABLED"; //$NON-NLS-1$
- public static final String IMG_ELCL_MONITOR_EXPRESSION= "IMG_ELCL_MONITOR_EXPRESSION"; //$NON-NLS-1$
- public static final String IMG_ELCL_REMOVE_MEMORY= "IMG_ELCL_REMOVE_MEMORY"; //$NON-NLS-1$
- public static final String IMG_ELCL_RESET_MEMORY= "IMG_ELCL_RESET_MEMORY"; //$NON-NLS-1$
- public static final String IMG_ELCL_COPY_VIEW_TO_CLIPBOARD= "IMG_ELCL_COPY_VIEW_TO_CLIPBOARD"; //$NON-NLS-1$
- public static final String IMG_ELCL_PRINT_TOP_VIEW_TAB= "IMG_ELCL_PRINT_TOP_VIEW_TAB"; //$NON-NLS-1$
- public static final String IMG_ELCL_REMOVE_ALL = "IMG_ELCL_REMOVE_ALL"; //$NON-NLS-1$
- public static final String IMG_ELCL_REMOVE = "IMG_ELCL_REMOVE"; //$NON-NLS-1$
- public static final String IMG_ELCL_HIERARCHICAL = "IMG_ELCL_HIERARCHICAL"; //$NON-NLS-1$
- public static final String IMG_ELCL_HELP = "IMG_ELCL_HELP"; //$NON-NLS-1$
- public static final String IMG_ELCL_NEW_CONFIG = "IMG_ELCL_NEW_CONFIG"; //$NON-NLS-1$
- public static final String IMG_ELCL_DELETE_CONFIG = "IMG_ELCL_DELETE_CONFIG"; //$NON-NLS-1$
- public static final String IMG_ELCL_FILTER_CONFIGS = "IMG_ELCL_FILTER_CONFIGS"; //$NON-NLS-1$
- public static final String IMG_ELCL_DUPLICATE_CONFIG = "IMG_ELCL_DUPLICATE_CONFIG"; //$NON-NLS-1$
- public static final String IMG_ELCL_SUSPEND = "IMG_ELCL_SUSPEND"; //$NON-NLS-1$
- public static final String IMG_ELCL_RESUME = "IMG_ELCL_RESUME"; //$NON-NLS-1$
- public static final String IMG_ELCL_STEP_RETURN = "IMG_ELCL_STEP_RETURN"; //$NON-NLS-1$
- public static final String IMG_ELCL_STEP_OVER = "IMG_ELCL_STEP_OVER"; //$NON-NLS-1$
- public static final String IMG_ELCL_STEP_INTO = "IMG_ELCL_STEP_INTO"; //$NON-NLS-1$
- public static final String IMG_ELCL_DROP_TO_FRAME = "IMG_ELCL_DROP_TO_FRAME"; //$NON-NLS-1$
- public static final String IMG_ELCL_TERMINATE_AND_REMOVE = "IMG_ELCL_TERMINATE_AND_REMOVE"; //$NON-NLS-1$
- public static final String IMG_ELCL_TERMINATE_ALL = "IMG_ELCL_TERMINATE_ALL"; //$NON-NLS-1$
- public static final String IMG_ELCL_TERMINATE_AND_RELAUNCH = "IMG_ELCL_TERMINATE_AND_RELAUNCH"; //$NON-NLS-1$
- public static final String IMG_ELCL_TOGGLE_STEP_FILTERS = "IMG_ELCL_TOGGLE_STEP_FILTERS"; //$NON-NLS-1$
- public static final String IMG_ELCL_STANDARD_OUT = "IMG_ELCL_STANDARD_OUT"; //$NON-NLS-1$
- public static final String IMG_ELCL_STANDARD_ERR = "IMG_ELCL_STANDARD_ERR"; //$NON-NLS-1$
- public static final String IMG_ELCL_NEXT_THREAD = "IMG_ELCL_NEXT_THREAD"; //$NON-NLS-1$
- public static final String IMG_ELCL_PREVIOUS_THREAD = "IMG_ELCL_PREVIOUS_THREAD"; //$NON-NLS-1$
- public static final String IMG_ELCL_RESTART = "IMG_ELCL_RESTART"; //$NON-NLS-1$
-
- public static final String IMG_OBJS_COMMON_TAB = "IMG_OBJS_COMMON_TAB"; //$NON-NLS-1$
- public static final String IMG_OBJS_REFRESH_TAB = "IMG_OBJS_REFRESH_TAB"; //$NON-NLS-1$
- public static final String IMG_OBJS_PERSPECTIVE_TAB = "IMG_OBJS_PERSPECTIVE_TAB"; //$NON-NLS-1$
- public static final String IMG_OBJS_ARRAY_PARTITION = "IMG_OBJS_ARRAY_PARTITION"; //$NON-NLS-1$
- public static final String IMG_SRC_LOOKUP_TAB = "IMG_SRC_LOOKUP_TAB"; //$NON-NLS-1$
- public static final String IMG_OBJECT_MEMORY_CHANGED="IMG_OBJECT_MEMORY_CHANGED"; //$NON-NLS-1$
- public static final String IMG_OBJECT_MEMORY="IMG_OBJECT_MEMORY"; //$NON-NLS-1$
- public static final String IMG_OBJS_BREAKPOINT_TYPE="IMG_OBJ_BREAKPOINT_TYPE"; //$NON-NLS-1$
-
- // wizard images
- public static final String IMG_WIZBAN_IMPORT_BREAKPOINTS = "IMG_WIZBAN_IMPORT_BREAKPOINTS"; //$NON-NLS-1$
- public static final String IMG_WIZBAN_EXPORT_BREAKPOINTS = "IMG_WIZBAN_EXPORT_BREAKPOINTS"; //$NON-NLS-1$
- public static final String IMG_WIZBAN_IMPORT_CONFIGS = "IMG_WIZBAN_IMPORT_CONFIGS"; //$NON-NLS-1$
- public static final String IMG_WIZBAN_EXPORT_CONFIGS = "IMG_WIZBAN_EXPORT_CONFIGS"; //$NON-NLS-1$
- public static final String IMG_ADD_SRC_LOC_WIZ = "IMG_ADD_SRC_LOCATION"; //$NON-NLS-1$
- public static final String IMG_EDIT_SRC_LOC_WIZ = "IMG_EDIT_SRC_LOCATION"; //$NON-NLS-1$
- public static final String IMG_ADD_SRC_DIR_WIZ = "IMG_ADD_SRC_DIRECTORY"; //$NON-NLS-1$
- public static final String IMG_EDIT_SRC_DIR_WIZ = "IMG_EDIT_SRC_DIRECTORY"; //$NON-NLS-1$
-
- // internal preferences
- /**
- * XML for perspective settings - see PerspectiveManager.
- * @since 3.0
- */
- public static final String PREF_LAUNCH_PERSPECTIVES = IDebugUIConstants.PLUGIN_ID + ".PREF_LAUNCH_PERSPECTIVES"; //$NON-NLS-1$
-
- /**
- * Preference for enabling/disabling launch configuration filtering based on project accessibility status
- *
- * @since 3.2
- */
- public static final String PREF_FILTER_LAUNCH_CLOSED = IDebugUIConstants.PLUGIN_ID + ".PREF_FILTER_LAUNCH_CLOSED"; //$NON-NLS-1$
-
- /**
- * Preference for enabling/disabling launch configuration filtering based on project context
- *
- * @since 3.2
- */
- public static final String PREF_FILTER_LAUNCH_DELETED = IDebugUIConstants.PLUGIN_ID + ".PREF_FILTER_LAUNCH_DELETED"; //$NON-NLS-1$
-
- /**
- * Preference for enabling/disabling filtering based on selected items from the launch configuration type table
- * @since 3.2
- */
- public static final String PREF_FILTER_LAUNCH_TYPES = IDebugUIConstants.PLUGIN_ID + ".PREF_FILTER_LAUNCH_TYPES"; //$NON-NLS-1$
-
- /**
- * Preference that saves which launch configuration types have been checked on the Launch Configurations pref page
- * @since 3.2
- */
- public static final String PREF_FILTER_TYPE_LIST = IDebugUIConstants.PLUGIN_ID + ".PREF_FILTER_TYPE_LIST"; //$NON-NLS-1$
-
- /**
- * Preference for filtering launch configurations based on the currently active working sets
- * @since 3.2
- */
- public static final String PREF_FILTER_WORKING_SETS = IDebugUIConstants.PLUGIN_ID + ".PREF_FILTER_WORKING_SETS"; //$NON-NLS-1$
-
- /**
- * Transparent overlay image identifier.
- */
- public static final String IMG_OVR_TRANSPARENT = "IMG_OVR_TRANSPARENT"; //$NON-NLS-1$
-
- /**
- * Editor Id for the "Source Not Found" editor
- */
- public static final String ID_SOURCE_NOT_FOUND_EDITOR = "org.eclipse.debug.ui.NoSourceFoundEditor"; //$NON-NLS-1$
-
- /**
- * Boolean preference indicating if contextual launch options should be visible
- * to the user rather than the "run as" menu.
- *
- * @since 3.3.0
- * CONTEXTLAUNCHING
- */
- public static final String PREF_USE_CONTEXTUAL_LAUNCH = IDebugUIConstants.PLUGIN_ID + ".UseContextualLaunch"; //$NON-NLS-1$
-
- /**
- * Boolean preference indicating that if the selected resource is not launchable, then we should
- * launch the last configuration that was launched.
- *
- * @since 3.3.0
- * CONTEXTLAUNCHING
- */
- public static final String PREF_LAUNCH_LAST_IF_NOT_LAUNCHABLE = IDebugUIConstants.PLUGIN_ID + ".LaunchLastIfNotLaunchable"; //$NON-NLS-1$
-
- /**
- * Boolean preference indicating if we should always consider the parent project when
- * a selected context is not runnable
- *
- * @since 3.3.0
- * CONTEXTLAUNCHING
- */
- public static final String PREF_LAUNCH_PARENT_PROJECT = IDebugUIConstants.PLUGIN_ID + ".LaunchParentProject"; //$NON-NLS-1$
-
- /**
- * Boolean preference indicating if the user should be prompted prior to removing a launch configuration
- * from the launch history drop down
- *
- * @since 3.4
- */
- public static final String PREF_REMOVE_FROM_LAUNCH_HISTORY = IDebugUIConstants.PLUGIN_ID + ".RemoveFromLaunchHistory"; //$NON-NLS-1$
-
- /**
- * String preference controlling whether editors are saved before launching.
- * Valid values are either "always", "never", or "prompt".
- * If "always" or "never", launching will save editors (or not) automatically.
- * If "prompt", the user will be prompted each time.
- *
- * @since 3.0
- */
- public static final String PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH = IDebugUIConstants.PLUGIN_ID + ".save_dirty_editors_before_launch"; //$NON-NLS-1$
-
- /**
- * Preference specifying that all launches should be DEBUG_MODE if breakpoints exist in the workspace
- * @since 3.0
- */
- public static final String PREF_RELAUNCH_IN_DEBUG_MODE = IDebugUIConstants.PLUGIN_ID + ".relaunch_in_debug_mode"; //$NON-NLS-1$
-
- /**
- * Preference specifying that launches should continue when compile errors exist.
- * @since 3.0
- */
- public static final String PREF_CONTINUE_WITH_COMPILE_ERROR = IDebugUIConstants.PLUGIN_ID + ".cancel_launch_with_compile_errors"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling whether the debugger will force activate the debug
- * view when a breakpoint is hit.
- *
- * @since 3.0
- */
- public static final String PREF_ACTIVATE_DEBUG_VIEW= IDebugUIConstants.PLUGIN_ID + ".activate_debug_view"; //$NON-NLS-1$
-
- /**
- * String preference controlling whether the debugger switching to
- * the associated perspective when launching.
- * Valid values are either "always", "never", or "prompt".
- * If "always" or "never", launching will switch perspectives (or not) automatically.
- * If "prompt", the user will be prompted each time.
- *
- * @since 3.0
- */
- public static final String PREF_SWITCH_TO_PERSPECTIVE= IDebugUIConstants.PLUGIN_ID + ".switch_to_perspective"; //$NON-NLS-1$
-
- /**
- * String preference controlling whether the debugger switching to
- * the associated perspective when a launch suspends.
- * Valid values are either "always", "never", or "prompt".
- * If "always" or "never", suspension will switch perspectives (or not) automatically.
- * If "prompt", the user will be prompted each time.
- *
- * @since 3.0
- */
- public static final String PREF_SWITCH_PERSPECTIVE_ON_SUSPEND= IDebugUIConstants.PLUGIN_ID + ".switch_perspective_on_suspend"; //$NON-NLS-1$
-
- /**
- * String preference controlling whether the debugger waits for a currently
- * pending (running or waiting) background build to complete before launching.
- * Valid values are either "always", "never", or "prompt".
- * If "always" or "never", launching will wait for builds to finish (or not) automatically.
- * If "prompt", the user will be prompted each time.
- *
- * @since 3.0
- */
- public static final String PREF_WAIT_FOR_BUILD= IDebugUIConstants.PLUGIN_ID + ".wait_for_build"; //$NON-NLS-1$
-
- /**
- * Font for Memory View
- *
- * @since 3.0
- */
- public final static String FONT_NAME = IDebugUIConstants.PLUGIN_ID + ".MemoryViewTableFont"; //$NON-NLS-1$
-
- public final static int ADD_UNIT_PER_LINE = 16; // number of addressable unit per line
- public final static int CHAR_PER_BYTE = 2; // number of characters to represent one byte
-
- /**
- * Memory view's rendering view pane identifier (value <code>"org.eclipse.debug.ui.MemoryView.RenderingViewPane"</code>).
- * @since 3.1
- */
- public static String ID_RENDERING_VIEW_PANE = RenderingViewPane.RENDERING_VIEW_PANE_ID;
-
- /**
- * Memory view's memory block tree viewer's identifier. (value <code>"org.eclipse.debug.ui.MemoryView.MemoryBlocksTreeViewPane"</code>).
- * @since 3.1
- */
- public static String ID_MEMORY_BLOCK_TREE_VIEWER = MemoryBlocksTreeViewPane.PANE_ID;
-
- /**
- * Memory view image identifier
- *
- * @since 3.0
- * */
- public static final String IMG_CVIEW_MEMORY_VIEW= "IMG_CVIEW_MEMORY_VIEW"; //$NON-NLS-1$
-
-
- /**
- * Modules view image identifier
- *
- * @since 3.4
- * */
- public static final String IMG_CVIEW_MODULES_VIEW= "IMG_CVIEW_MODULES_VIEW"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling whether the debug view tracks
- * views as the user manually opens/closes them for the purpose
- * of not automatically opening/closing such views.
- *
- * @since 3.0
- */
- public static final String PREF_TRACK_VIEWS= IDebugUIConstants.PLUGIN_ID + ".track_views"; //$NON-NLS-1$
-
- /**
- * Comma separated list of view ids closed by the user, that have view context bindings.
- * @since 3.2
- */
- public static final String PREF_USER_VIEW_BINDINGS = IDebugUIConstants.PLUGIN_ID + ".user_view_bindings"; //$NON-NLS-1$
-
- /**
- * Preference storing memento for the default breakpoint working set in
- * the breakpoints view.
- *
- * @since 3.1
- */
- public static final String MEMENTO_BREAKPOINT_WORKING_SET_NAME = DebugUIPlugin.getUniqueIdentifier() + ".MEMENTO_BREAKPOINT_WORKING_SET_NAME"; //$NON-NLS-1$
-
- /**
- * Breakpoint working set identifier.
- *
- * @since 3.1
- * @deprecated There is an API equivalent constant that should be used, see
- * {@link IDebugUIConstants#BREAKPOINT_WORKINGSET_ID}
- */
- public static final String ID_BREAKPOINT_WORKINGSET = "org.eclipse.debug.ui.breakpointWorkingSet"; //$NON-NLS-1$
-
-
- /**
- * Address at the beginning of a page in a table rendering.
- * @since 3.1
- */
- public static final String PROPERTY_PAGE_START_ADDRESS = "pageStart"; //$NON-NLS-1$
-
-
- /**
- * This constant is used as a "quick-fix" for the issue of breakpoint to working set
- * persistence when the state of a project changes.
- *
- * @since 3.2
- */
- public static final String WORKING_SET_NAME = "workingset_name"; //$NON-NLS-1$
-
- /**
- * This constant is used as a "quick-fix" for the issue of breakpoint to working set
- * persistence when the state of a project changes.
- *
- * @since 3.2
- */
- public static final String WORKING_SET_ID = "workingset_id"; //$NON-NLS-1$
-
- /**
- * Annotation type identifier for annotation of the an instruction
- * pointer with a dynamic image. Value is <code>org.eclipse.debug.ui.dynamicIP</code>,
- * identifying a <code>org.eclipse.ui.editors.markerAnnotationSpecification</code>
- * extension.
- *
- * @since 3.2
- */
- public static final String ANNOTATION_TYPE_DYNAMIC_INSTRUCTION_POINTER = "org.eclipse.debug.ui.dynamicIP"; //$NON-NLS-1$
-
- /**
- * Identifier of the external tool builder launch category. Defined here since
- * external tools is actually a dependent plug-in.
- *
- * @since 3.4
- */
- public static final String ID_EXTERNAL_TOOL_BUILDER_LAUNCH_CATEGORY = "org.eclipse.ui.externaltools.builder"; //$NON-NLS-1$
-
- //themes
-
- /**
- * Theme color definition for process console background color.
- *
- * @since 3.4
- */
- public static final String THEME_CONSOLE_COLOR_BACKGROUND= "org.eclipse.debug.ui.console.background"; //$NON-NLS-1$
-
- /**
- * Theme color definition for process console standard out.
- *
- * @since 3.4
- */
- public static final String THEME_CONSOLE_COLOR_STD_OUT= "org.eclipse.debug.ui.console.stream.out"; //$NON-NLS-1$
-
- /**
- * Theme color definition for process console standard in.
- *
- * @since 3.4
- */
- public static final String THEME_CONSOLE_COLOR_STD_IN= "org.eclipse.debug.ui.console.stream.in"; //$NON-NLS-1$
-
- /**
- * Theme color definition for process console standard err.
- *
- * @since 3.4
- */
- public static final String THEME_CONSOLE_COLOR_STD_ERR= "org.eclipse.debug.ui.console.stream.err"; //$NON-NLS-1$
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ILaunchHistoryChangedListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ILaunchHistoryChangedListener.java
deleted file mode 100644
index 1156d2fea..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ILaunchHistoryChangedListener.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-
-/**
- * Implementors of this interface are notified whenever there is a change is
- * made to the launch history. This could be an addition or deletion from either
- * of the run or debug histories, a change to the last launched item, or a
- * change in favorites.
- */
-public interface ILaunchHistoryChangedListener {
-
- /**
- * Notification that the launch history has changed. Any of the run history, debug history
- * or last launched items could have changed. To examine the history items, retrieve them
- * from the <code>DebugUIPlugin</code>.
- */
- public void launchHistoryChanged();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ILaunchLabelChangedListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ILaunchLabelChangedListener.java
deleted file mode 100644
index fe3013466..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ILaunchLabelChangedListener.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-import org.eclipse.debug.ui.ILaunchGroup;
-
-/**
- * Implementors of this interface are notified when a changed has been made to
- * the cache of context sensitive labels stored in the <code>LaunchingResourceManager</code>.
- * A change can come from either a selection change, or from a change to the launch history(s).
- *
- * <p>
- * Clients are intended to implement this interface
- * </p>
- *
- * @since 3.3
- */
-public interface ILaunchLabelChangedListener {
-
- /**
- * This method is called back to by <code>LaunchingResourceManager</code> iff the cache of labels
- * for the current set of listeners has changed
- */
- public void labelChanged();
-
- /**
- * Returns the launch group that this listener is associated with.
- * @return the launch group that this listener is associated with, or <code>null</code> if none
- */
- public ILaunchGroup getLaunchGroup();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java
deleted file mode 100644
index 35be296ae..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * A registry that maps <code>ImageDescriptors</code> to <code>Image</code>.
- */
-public class ImageDescriptorRegistry {
-
- private HashMap fRegistry= new HashMap(10);
- private Display fDisplay;
-
- /**
- * Creates a new image descriptor registry for the current or default display,
- * respectively.
- */
- public ImageDescriptorRegistry() {
- this(DebugUIPlugin.getStandardDisplay());
- }
-
- /**
- * Creates a new image descriptor registry for the given display. All images
- * managed by this registry will be disposed when the display gets disposed.
- *
- * @param display the display the images managed by this registry are allocated for
- */
- public ImageDescriptorRegistry(Display display) {
- fDisplay= display;
- Assert.isNotNull(fDisplay);
- hookDisplay();
- }
-
- /**
- * Returns the image associated with the given image descriptor.
- *
- * @param descriptor the image descriptor for which the registry manages an image
- * @return the image associated with the image descriptor or <code>null</code>
- * if the image descriptor can't create the requested image.
- */
- public Image get(ImageDescriptor descriptor) {
- if (descriptor == null)
- descriptor= ImageDescriptor.getMissingImageDescriptor();
-
- Image result= (Image)fRegistry.get(descriptor);
- if (result != null)
- return result;
-
- Assert.isTrue(fDisplay == DebugUIPlugin.getStandardDisplay(), DebugUIMessages.ImageDescriptorRegistry_0);
- result= descriptor.createImage();
- if (result != null)
- fRegistry.put(descriptor, result);
- return result;
- }
-
- /**
- * Disposes all images managed by this registry.
- */
- public void dispose() {
- for (Iterator iter= fRegistry.values().iterator(); iter.hasNext(); ) {
- Image image= (Image)iter.next();
- image.dispose();
- }
- fRegistry.clear();
- }
-
- private void hookDisplay() {
- fDisplay.disposeExec(new Runnable() {
- public void run() {
- dispose();
- }
- });
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerAnnotation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerAnnotation.java
deleted file mode 100644
index 38443e0d9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerAnnotation.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Default instruction pointer annotation.
- */
-public class InstructionPointerAnnotation extends DynamicInstructionPointerAnnotation {
-
- /**
- * The image for this annotation.
- */
- private Image fImage;
-
- /**
- * Constructs an instruction pointer image.
- *
- * @param frame stack frame the instruction pointer is associated with
- * @param annotationType the type of annotation to display (annotation identifier)
- * @param text the message to display with the annotation as hover help
- * @param image the image used to display the annotation
- */
- public InstructionPointerAnnotation(IStackFrame frame, String annotationType, String text, Image image) {
- super(frame, annotationType, text);
- fImage = image;
- }
-
- /**
- * Returns this annotation's image.
- *
- * @return image
- */
- protected Image getImage() {
- return fImage;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerContext.java
deleted file mode 100644
index e7ca30e7f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerContext.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * Represents the context for a single instruction pointer. This is a convenience class
- * used to store the four objects that comprise an instruction pointer 'context' so it
- * can be stored in collections.
- */
-public class InstructionPointerContext {
-
- /**
- * The thread this context belongs to.
- */
- private IThread fThread;
-
- /**
- * The debug target this context belongs to.
- */
- private IDebugTarget fDebugTarget;
-
- /**
- * The editor that the annotation is being displayed in
- */
- private ITextEditor fEditor;
-
- /**
- * The vertical ruler annotation for this context.
- */
- private Annotation fAnnotation;
-
- public InstructionPointerContext(IDebugTarget target, IThread thread, ITextEditor editor, Annotation annotation) {
- fDebugTarget = target;
- fThread = thread;
- fEditor = editor;
- fAnnotation = annotation;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object other) {
- if (other instanceof InstructionPointerContext) {
- InstructionPointerContext otherContext = (InstructionPointerContext) other;
- if (getAnnotation().equals(otherContext.getAnnotation())){
- return getEditor().equals(otherContext.getEditor());
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return getAnnotation().hashCode() + getEditor().hashCode();
- }
-
- /**
- * @return the thread
- */
- public IThread getThread() {
- return fThread;
- }
-
- /**
- * @return the debug target
- */
- public IDebugTarget getDebugTarget() {
- return fDebugTarget;
- }
-
- /**
- * @return the editor
- */
- public ITextEditor getEditor() {
- return fEditor;
- }
-
- /**
- * @return the annotation
- */
- public Annotation getAnnotation() {
- return fAnnotation;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerImageProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerImageProvider.java
deleted file mode 100644
index 93a5ef7ee..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerImageProvider.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.texteditor.IAnnotationImageProvider;
-
-public class InstructionPointerImageProvider implements IAnnotationImageProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getManagedImage(org.eclipse.jface.text.source.Annotation)
- */
- public Image getManagedImage(Annotation annotation) {
- return ((InstructionPointerAnnotation)annotation).getImage();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getImageDescriptorId(org.eclipse.jface.text.source.Annotation)
- */
- public String getImageDescriptorId(Annotation annotation) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getImageDescriptor(java.lang.String)
- */
- public ImageDescriptor getImageDescriptor(String imageDescritporId) {
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerManager.java
deleted file mode 100644
index 51a6ab472..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerManager.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPageListener;
-import org.eclipse.ui.IPartListener2;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartReference;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * This class tracks instruction pointer contexts for all active debug targets and threads
- * in the current workbench. There should only ever be one instance of this class, obtained
- * via 'getDefault()'.
- */
-public class InstructionPointerManager{
-
- /**
- * The singleton instance of this class.
- */
- private static InstructionPointerManager fgDefault;
-
- /**
- * Set containing all instruction pointer contexts this class manages
- */
- private Set fIPCSet = new HashSet();
-
- /**
- * Maps ITextEditors to the set of instruction pointer contexts that are displayed in the editor
- */
- private Map fEditorMap = new HashMap();
-
- /**
- * Part listener added to editors that contain annotations. Allows instruction pointer contexts to
- * be removed when the editor they are displayed in is removed.
- */
- private IPartListener2 fPartListener;
-
- /**
- * Page listener added to the workbench window to remove part listeners when the page is closed.
- */
- private IPageListener fPageListener;
-
- /**
- * Clients must not instantiate this class.
- */
- private InstructionPointerManager() {
- }
-
- /**
- * Return the singleton instance of this class, creating it if necessary.
- */
- public static InstructionPointerManager getDefault() {
- if (fgDefault == null) {
- fgDefault = new InstructionPointerManager();
- }
- return fgDefault;
- }
-
- /**
- * Adds an instruction pointer annotation in the specified editor for the
- * specified stack frame.
- */
- public void addAnnotation(ITextEditor textEditor, IStackFrame frame, Annotation annotation) {
-
- IDocumentProvider docProvider = textEditor.getDocumentProvider();
- IEditorInput editorInput = textEditor.getEditorInput();
- // If there is no annotation model, there's nothing more to do
- IAnnotationModel annModel = docProvider.getAnnotationModel(editorInput);
- if (annModel == null) {
- return;
- }
-
- // Create the Position object that specifies a location for the annotation
- Position position = null;
- int charStart = -1;
- int length = -1;
- try {
- charStart = frame.getCharStart();
- length = frame.getCharEnd() - charStart;
- } catch (DebugException de) {
- }
- if (charStart < 0) {
- IDocument doc = docProvider.getDocument(editorInput);
- if (doc == null) {
- return;
- }
- try {
- int lineNumber = frame.getLineNumber() - 1;
- IRegion region = doc.getLineInformation(lineNumber);
- charStart = region.getOffset();
- length = region.getLength();
- } catch (BadLocationException ble) {
- return;
- } catch (DebugException de) {
- return;
- }
- }
- if (charStart < 0) {
- return;
- }
- position = new Position(charStart, length);
-
- if (frame.isTerminated()) {
- return;
- }
-
- synchronized (fIPCSet) {
-
- // Add the annotation at the position to the editor's annotation model.
- annModel.removeAnnotation(annotation);
- annModel.addAnnotation(annotation, position);
-
- // Create the instruction pointer context
- InstructionPointerContext ipc = new InstructionPointerContext(frame.getDebugTarget(), frame.getThread(), textEditor, annotation);
-
- // Add the IPC to the set and map
- Set editorIPCs = (Set)fEditorMap.get(textEditor);
- if (editorIPCs == null){
- editorIPCs = new HashSet();
- fEditorMap.put(textEditor, editorIPCs);
- } else {
- editorIPCs.remove(ipc);
- }
- editorIPCs.add(ipc);
- fIPCSet.remove(ipc);
- fIPCSet.add(ipc);
-
- // Add a listener to the editor so we can remove the IPC when the editor is closed
- textEditor.getSite().getPage().addPartListener(getPartListener());
- textEditor.getSite().getPage().getWorkbenchWindow().addPageListener(getPageListener());
- }
- }
-
- /**
- * Remove all annotations associated with the specified debug target that this class
- * is tracking.
- */
- public void removeAnnotations(IDebugTarget debugTarget) {
- synchronized (fIPCSet) {
- Iterator ipcIter = fIPCSet.iterator();
- while (ipcIter.hasNext()) {
- InstructionPointerContext currentIPC = (InstructionPointerContext) ipcIter.next();
- if (currentIPC.getDebugTarget().equals(debugTarget)){
- removeAnnotationFromModel(currentIPC);
- ipcIter.remove();
- removeAnnotationFromEditorMapping(currentIPC);
- }
- }
- }
- }
-
- /**
- * Remove all annotations associated with the specified thread that this class
- * is tracking.
- */
- public void removeAnnotations(IThread thread) {
- synchronized (fIPCSet) {
- Iterator ipcIter = fIPCSet.iterator();
- while (ipcIter.hasNext()) {
- InstructionPointerContext currentIPC = (InstructionPointerContext) ipcIter.next();
- if (currentIPC.getThread().equals(thread)){
- removeAnnotationFromModel(currentIPC);
- ipcIter.remove();
- removeAnnotationFromEditorMapping(currentIPC);
- }
- }
- }
- }
-
- /**
- * Remove all annotations associated with the specified editor that this class
- * is tracking.
- */
- public void removeAnnotations(ITextEditor editor) {
- synchronized (fIPCSet) {
- Set editorIPCs = (Set)fEditorMap.get(editor);
- if (editorIPCs != null){
- Iterator ipcIter = editorIPCs.iterator();
- while (ipcIter.hasNext()) {
- InstructionPointerContext currentIPC = (InstructionPointerContext) ipcIter.next();
- removeAnnotationFromModel(currentIPC);
- fIPCSet.remove(currentIPC);
- }
- fEditorMap.remove(editor);
- }
- }
- }
-
- /**
- * Remove the given ipc from the mapping of editors.
- */
- private void removeAnnotationFromEditorMapping(InstructionPointerContext ipc) {
- Set editorIPCs = (Set)fEditorMap.get(ipc.getEditor());
- if (editorIPCs != null){
- editorIPCs.remove(ipc);
- if (editorIPCs.isEmpty()){
- fEditorMap.remove(ipc.getEditor());
- }
- }
-
- }
-
- /**
- * Remove the annotation from the document model.
- */
- private void removeAnnotationFromModel(InstructionPointerContext ipc){
- IDocumentProvider docProvider = ipc.getEditor().getDocumentProvider();
- if (docProvider != null) {
- IAnnotationModel annotationModel = docProvider.getAnnotationModel(ipc.getEditor().getEditorInput());
- if (annotationModel != null) {
- annotationModel.removeAnnotation(ipc.getAnnotation());
- }
- }
- }
-
- /**
- * Returns the number of instruction pointers.
- * Used by the test suite.
- *
- * @return the number of instruction pointers
- * @since 3.2
- */
- public int getInstructionPointerCount() {
- return fIPCSet.size();
- }
-
- /**
- * Returns the number of keys in the editor to IPC mapping
- * Used by the test suite.
- *
- * @return the number of keys in the editor mapping
- * @since 3.3
- */
- public int getEditorMappingCount() {
- return fEditorMap.size();
- }
-
- /**
- * @return the page listener to add to workbench window.
- */
- private IPageListener getPageListener(){
- if (fPageListener == null){
- fPageListener = new PageListener();
- }
- return fPageListener;
- }
-
- /**
- * @return the part listener to add to editors.
- */
- private IPartListener2 getPartListener(){
- if (fPartListener == null){
- fPartListener = new PartListener();
- }
- return fPartListener;
- }
-
- /**
- * Part listener that is added to editors to track when the editor is no longer is displaying
- * the input containing instruction pointer annotations.
- */
- class PartListener implements IPartListener2{
- public void partActivated(IWorkbenchPartReference partRef) {}
- public void partDeactivated(IWorkbenchPartReference partRef) {}
- public void partHidden(IWorkbenchPartReference partRef) {}
- public void partOpened(IWorkbenchPartReference partRef) {}
- public void partVisible(IWorkbenchPartReference partRef) {}
- public void partBroughtToTop(IWorkbenchPartReference partRef) {}
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partClosed(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partClosed(IWorkbenchPartReference partRef) {
- IWorkbenchPart part = partRef.getPart(false);
- if (part instanceof ITextEditor){
- removeAnnotations((ITextEditor)part);
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partInputChanged(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partInputChanged(IWorkbenchPartReference partRef) {
- IWorkbenchPart part = partRef.getPart(false);
- if (part instanceof ITextEditor){
- removeAnnotations((ITextEditor)part);
- }
- }
- }
-
- /**
- * Page listener that is added to the workbench to remove the part listener when the page is closed.
- */
- class PageListener implements IPageListener{
-
- public void pageActivated(IWorkbenchPage page) {}
- public void pageOpened(IWorkbenchPage page) {}
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPageListener#pageClosed(org.eclipse.ui.IWorkbenchPage)
- */
- public void pageClosed(IWorkbenchPage page) {
- page.removePartListener(getPartListener());
- page.getWorkbenchWindow().removePageListener(getPageListener());
- }
-
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java
deleted file mode 100644
index fbede662f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.debug.internal.core.IConfigurationElementConstants;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-
-/**
- * Provides a proxy to a launchConfigurationTabs extension point
- *
- * @since 3.3
- */
-public final class LaunchConfigurationTabExtension {
-
- /**
- * The configuration element backing this proxy
- */
- IConfigurationElement fElement = null;
- private Set fDelegates = null;
-
- /**
- * Constructor
- * @param element the <code>IConfigurationElement</code> for this proxy
- */
- public LaunchConfigurationTabExtension(IConfigurationElement element) {
- fElement = element;
- }
-
- /**
- * Returns the unique id of the tab
- * @return the unique id of the tab
- */
- public String getIdentifier() {
- return fElement.getAttribute(IConfigurationElementConstants.ID);
- }
-
- /**
- * Returns the human readable name for the tab, not to be confused with the name that appears on the tab itself
- * @return the name of the tab
- */
- public String getName() {
- return fElement.getAttribute(IConfigurationElementConstants.NAME);
- }
-
- /**
- * Returns the instantiated class of this tab
- * @return the instantiated class of this tab
- */
- public ILaunchConfigurationTab getTab() {
- try {
- Object object = fElement.createExecutableExtension(IConfigurationElementConstants.CLASS);
- if(object instanceof ILaunchConfigurationTab) {
- return (ILaunchConfigurationTab) object;
- }
- } catch (CoreException e) {DebugUIPlugin.log(e);}
- return null;
- }
-
- /**
- * Returns the unique id of the <code>ILaunchConfigurationTabGroup</code> that this tab contributes to
- * @return the id of the <code>ILaunchConfigurationTabGroup</code> this tab contributes to
- */
- public String getTabGroupId() {
- return fElement.getAttribute(IConfigurationElementConstants.GROUP);
- }
-
- /**
- * This method returns the id of the tab that this tab should be placed immediately after.
- * @return the id of the relative tab or <code>null</code> if one has not been specified
- *
- */
- public String getRelativeTabId() {
- IConfigurationElement[] elems = fElement.getChildren(IConfigurationElementConstants.PLACEMENT);
- if(elems.length == 1) {
- return elems[0].getAttribute(IConfigurationElementConstants.AFTER);
- }
- return null;
- }
-
- /**
- * Returns the id of the plugin that contributed this tab extension
- * @return the id of the plugin tat contributed this tab
- */
- public String getPluginIdentifier() {
- return fElement.getContributor().getName();
- }
-
- /**
- * Returns a set of strings of the launch delegates that this tab contribution is associated with
- * @return the set of strings of the associated launch delegates, which can be an empty collection, never <code>null</code>.
- */
- public Set getDelegateSet() {
- if(fDelegates == null) {
- fDelegates = new HashSet();
- IConfigurationElement[] children = fElement.getChildren(IConfigurationElementConstants.ASSOCIATED_DELEGATE);
- String id = null;
- for(int i = 0; i < children.length; i++) {
- id = children[i].getAttribute(IConfigurationElementConstants.DELEGATE);
- if(id != null) {
- fDelegates.add(id);
- }
- }
- }
- return fDelegates;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java
deleted file mode 100644
index 7d33eb157..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java
+++ /dev/null
@@ -1,483 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.internal.ui.views.variables.IndexedVariablePartition;
-import org.eclipse.debug.ui.IDebugEditorPresentation;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IDebugModelPresentationExtension;
-import org.eclipse.debug.ui.IInstructionPointerPresentation;
-import org.eclipse.debug.ui.IValueDetailListener;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.jface.viewers.IFontProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * A proxy to an IDebugModelPresentation extension. Instantiates the extension
- * when it is needed.
- */
-
-public class LazyModelPresentation implements IDebugModelPresentation, IDebugEditorPresentation,
- IColorProvider, IFontProvider, IInstructionPointerPresentation, IDebugModelPresentationExtension {
-
- /**
- * A temporary mapping of attribute ids to their values
- * @see IDebugModelPresentation#setAttribute
- */
- protected HashMap fAttributes= new HashMap(3);
-
- /**
- * The config element that defines the extension
- */
- protected IConfigurationElement fConfig = null;
-
- /**
- * The actual presentation instance - null until called upon
- */
- protected IDebugModelPresentation fPresentation = null;
-
- /**
- * Temp holding for listeners - we do not add to presentation until
- * it needs to be instantiated.
- */
- protected ListenerList fListeners= new ListenerList();
-
- /**
- * Non-null when nested inside a delegating model presentation
- */
- private DelegatingModelPresentation fOwner = null;
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDebugEditorPresentation#removeAnntations(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IThread)
- */
- public void removeAnnotations(IEditorPart editorPart, IThread thread) {
- IDebugModelPresentation presentation = getPresentation();
- if (presentation instanceof IDebugEditorPresentation) {
- ((IDebugEditorPresentation)presentation).removeAnnotations(editorPart, thread);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDebugEditorPresentation#addAnnotations(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
- */
- public boolean addAnnotations(IEditorPart editorPart, IStackFrame frame) {
- IDebugModelPresentation presentation = getPresentation();
- if (presentation instanceof IDebugEditorPresentation) {
- return ((IDebugEditorPresentation)presentation).addAnnotations(editorPart, frame);
- }
- return false;
- }
-
- /**
- * Constructs a lazy presentation from the config element.
- */
- public LazyModelPresentation(IConfigurationElement configElement) {
- fConfig = configElement;
- }
-
- /**
- * Constructs a lazy presentation from the config element, owned by the specified
- * delegating model presentation.
- *
- * @param parent owning presentation
- * @param configElement XML configuration element
- */
- public LazyModelPresentation(DelegatingModelPresentation parent, IConfigurationElement configElement) {
- this(configElement);
- fOwner = parent;
- }
-
- /**
- * @see IDebugModelPresentation#getImage(Object)
- */
- public Image getImage(Object element) {
- initImageRegistry();
- Image image = getPresentation().getImage(element);
- if (image == null) {
- image = getDefaultImage(element);
- }
- if (image != null) {
- int flags= computeAdornmentFlags(element);
- if (flags > 0) {
- CompositeDebugImageDescriptor descriptor= new CompositeDebugImageDescriptor(image, flags);
- return DebugUIPlugin.getImageDescriptorRegistry().get(descriptor);
- }
- }
- return image;
- }
-
- /**
- * Initializes the image registry
- */
- private synchronized void initImageRegistry() {
- if (!DebugPluginImages.isInitialized()) {
- DebugUIPlugin.getDefault().getImageRegistry();
- }
- }
-
- /**
- * Computes and return common adornment flags for the given element.
- *
- * @param element
- * @return adornment flags defined in CompositeDebugImageDescriptor
- */
- private int computeAdornmentFlags(Object element) {
- if (element instanceof IBreakpoint) {
- if (!DebugPlugin.getDefault().getBreakpointManager().isEnabled()) {
- return CompositeDebugImageDescriptor.SKIP_BREAKPOINT;
- }
- }
- return 0;
- }
-
- /**
- * Returns a default text label for the debug element
- */
- protected String getDefaultText(Object element) {
- return DebugUIPlugin.getDefaultLabelProvider().getText(element);
- }
-
- /**
- * Returns a default image for the debug element
- */
- protected Image getDefaultImage(Object element) {
- return DebugUIPlugin.getDefaultLabelProvider().getImage(element);
- }
-
- /**
- * @see IDebugModelPresentation#getText(Object)
- */
- public String getText(Object element) {
- if (!(element instanceof IndexedVariablePartition)) {
- // Attempt to delegate
- String text = getPresentation().getText(element);
- if (text != null) {
- return text;
- }
- }
- // If no delegate returned a text label, use the default
- if (showVariableTypeNames()) {
- try {
- if (element instanceof IExpression) {
- StringBuffer buf = new StringBuffer();
- IValue value = ((IExpression)element).getValue();
- if (value != null) {
- buf.append(value.getReferenceTypeName());
- buf.append(' ');
- }
- buf.append(getDefaultText(element));
- return buf.toString();
- } else if (element instanceof IVariable) {
- return new StringBuffer(((IVariable)element).getValue().getReferenceTypeName()).append(' ').append(getDefaultText(element)).toString();
- }
- } catch (DebugException de) {
- DebugUIPlugin.log(de);
- }
- }
- return getDefaultText(element);
- }
-
- /**
- * Whether or not to show variable type names.
- * This option is configured per model presentation.
- * This allows this option to be set per view, for example.
- */
- protected boolean showVariableTypeNames() {
- Boolean show= (Boolean) fAttributes.get(DISPLAY_VARIABLE_TYPE_NAMES);
- show= show == null ? Boolean.FALSE : show;
- return show.booleanValue();
- }
-
- /**
- * @see IDebugModelPresentation#computeDetail(IValue, IValueDetailListener)
- */
- public void computeDetail(IValue value, IValueDetailListener listener) {
- getPresentation().computeDetail(value, listener);
- }
-
- /**
- * @see ISourcePresentation#getEditorInput(Object)
- */
- public IEditorInput getEditorInput(Object element) {
- return getPresentation().getEditorInput(element);
- }
-
- /**
- * @see ISourcePresentation#getEditorId(IEditorInput, Object)
- */
- public String getEditorId(IEditorInput input, Object inputObject) {
- return getPresentation().getEditorId(input, inputObject);
- }
-
- /**
- * @see IBaseLabelProvider#addListener(ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener) {
- if (fPresentation != null) {
- getPresentation().addListener(listener);
- }
- fListeners.add(listener);
- }
-
- /**
- * @see IBaseLabelProvider#dispose()
- */
- public void dispose() {
- if (fPresentation != null) {
- getPresentation().dispose();
- }
- fListeners = null;
- }
-
- /**
- * @see IBaseLabelProvider#isLabelProperty(Object, String)
- */
- public boolean isLabelProperty(Object element, String property) {
- if (fPresentation != null) {
- return getPresentation().isLabelProperty(element, property);
- }
- return false;
- }
-
- /**
- * @see IBaseLabelProvider#removeListener(ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener) {
- if (fPresentation != null) {
- getPresentation().removeListener(listener);
- }
- ListenerList listeners = fListeners;
- if (listeners != null) {
- listeners.remove(listener);
- }
- }
-
- /**
- * Returns the real presentation, instantiating if required.
- */
- protected IDebugModelPresentation getPresentation() {
- if (fPresentation == null) {
- synchronized (this) {
- if (fPresentation != null) {
- // In the case that the synchronization is enforced, the "blocked" thread
- // should return the presentation configured by the "owning" thread.
- return fPresentation;
- }
- try {
- IDebugModelPresentation tempPresentation= (IDebugModelPresentation) DebugUIPlugin.createExtension(fConfig, "class"); //$NON-NLS-1$
- // configure it
- if (fListeners != null) {
- Object[] list = fListeners.getListeners();
- for (int i= 0; i < list.length; i++) {
- tempPresentation.addListener((ILabelProviderListener)list[i]);
- }
- }
- Iterator keys= fAttributes.keySet().iterator();
- while (keys.hasNext()) {
- String key= (String)keys.next();
- tempPresentation.setAttribute(key, fAttributes.get(key));
- }
- // Only assign to the instance variable after it's been configured. Otherwise,
- // the synchronization is defeated (a thread could return the presentation before
- // it's been configured).
- fPresentation= tempPresentation;
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- }
- return fPresentation;
- }
-
- /**
- * @see IDebugModelPresentation#setAttribute(String, Object)
- */
- public void setAttribute(String id, Object value) {
- if (value == null) {
- return;
- }
- if (fPresentation != null) {
- getPresentation().setAttribute(id, value);
- }
-
- fAttributes.put(id, value);
-
- if (fOwner != null) {
- fOwner.basicSetAttribute(id, value);
- }
- }
-
- /**
- * Returns the identifier of the debug model this
- * presentation is registered for.
- */
- public String getDebugModelIdentifier() {
- return fConfig.getAttribute("id"); //$NON-NLS-1$
- }
-
- /**
- * Returns a new source viewer configuration for the details
- * area of the variables view, or <code>null</code> if
- * unspecified.
- *
- * @return source viewer configuration or <code>null</code>
- * @exception CoreException if unable to create the specified
- * source viewer configuration
- */
- public SourceViewerConfiguration newDetailsViewerConfiguration() throws CoreException {
- String attr = fConfig.getAttribute("detailsViewerConfiguration"); //$NON-NLS-1$
- if (attr != null) {
- return (SourceViewerConfiguration)fConfig.createExecutableExtension("detailsViewerConfiguration"); //$NON-NLS-1$
- }
- return null;
- }
-
- /**
- * Returns a copy of the attributes in this model presentation.
- *
- * @return a copy of the attributes in this model presentation
- * @since 3.0
- */
- public Map getAttributeMap() {
- return (Map) fAttributes.clone();
- }
-
- /**
- * Returns the raw attribute map
- * @return the raw attribute map
- */
- public Map getAttributes() {
- return fAttributes;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
- */
- public Color getForeground(Object element) {
- IDebugModelPresentation presentation = getPresentation();
- if (presentation instanceof IColorProvider) {
- IColorProvider colorProvider = (IColorProvider) presentation;
- return colorProvider.getForeground(element);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object)
- */
- public Color getBackground(Object element) {
- IDebugModelPresentation presentation = getPresentation();
- if (presentation instanceof IColorProvider) {
- IColorProvider colorProvider = (IColorProvider) presentation;
- return colorProvider.getBackground(element);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IFontProvider#getFont(java.lang.Object)
- */
- public Font getFont(Object element) {
- IDebugModelPresentation presentation = getPresentation();
- if (presentation instanceof IFontProvider) {
- IFontProvider fontProvider = (IFontProvider) presentation;
- return fontProvider.getFont(element);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IInstructionPointerPresentation#getInstructionPointerAnnotation(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
- */
- public Annotation getInstructionPointerAnnotation(IEditorPart editorPart, IStackFrame frame) {
- IDebugModelPresentation presentation = getPresentation();
- if (presentation instanceof IInstructionPointerPresentation) {
- IInstructionPointerPresentation pointerPresentation = (IInstructionPointerPresentation) presentation;
- return pointerPresentation.getInstructionPointerAnnotation(editorPart, frame);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IInstructionPointerPresentation#getMarkerAnnotationSpecificationId(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
- */
- public String getInstructionPointerAnnotationType(IEditorPart editorPart, IStackFrame frame) {
- IDebugModelPresentation presentation = getPresentation();
- if (presentation instanceof IInstructionPointerPresentation) {
- IInstructionPointerPresentation pointerPresentation = (IInstructionPointerPresentation) presentation;
- return pointerPresentation.getInstructionPointerAnnotationType(editorPart, frame);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IInstructionPointerPresentation#getInstructionPointerImage(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
- */
- public Image getInstructionPointerImage(IEditorPart editorPart, IStackFrame frame) {
- IDebugModelPresentation presentation = getPresentation();
- if (presentation instanceof IInstructionPointerPresentation) {
- IInstructionPointerPresentation pointerPresentation = (IInstructionPointerPresentation) presentation;
- return pointerPresentation.getInstructionPointerImage(editorPart, frame);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IInstructionPointerPresentation#getInstructionPointerText(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
- */
- public String getInstructionPointerText(IEditorPart editorPart, IStackFrame frame) {
- IDebugModelPresentation presentation = getPresentation();
- if (presentation instanceof IInstructionPointerPresentation) {
- IInstructionPointerPresentation pointerPresentation = (IInstructionPointerPresentation) presentation;
- return pointerPresentation.getInstructionPointerText(editorPart, frame);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDebugModelPresentationExtension#requiresUIThread(java.lang.Object)
- */
- public boolean requiresUIThread(Object element) {
- if (!DebugPluginImages.isInitialized()) {
- // need UI thread for breakpoint adornment and default images
- return true;
- }
- IDebugModelPresentation presentation = getPresentation();
- if (presentation instanceof IDebugModelPresentationExtension) {
- return ((IDebugModelPresentationExtension) presentation).requiresUIThread(element);
- }
- return false;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java
deleted file mode 100644
index 51c6753b4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.ui.StringVariableSelectionDialog;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-public class MultipleInputDialog extends Dialog {
- protected static final String FIELD_NAME = "FIELD_NAME"; //$NON-NLS-1$
- protected static final int TEXT = 100;
- protected static final int BROWSE = 101;
- protected static final int VARIABLE = 102;
-
- protected Composite panel;
-
- protected List fieldList = new ArrayList();
- protected List controlList = new ArrayList();
- protected List validators = new ArrayList();
- protected Map valueMap = new HashMap();
-
- private String title;
-
-
-
- public MultipleInputDialog(Shell shell, String title) {
- super(shell);
- this.title = title;
- setShellStyle(getShellStyle() | SWT.RESIZE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
- */
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- if (title != null) {
- shell.setText(title);
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createButtonBar(org.eclipse.swt.widgets.Composite)
- */
- protected Control createButtonBar(Composite parent) {
- Control bar = super.createButtonBar(parent);
- validateFields();
- return bar;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- Composite container = (Composite)super.createDialogArea(parent);
- container.setLayout(new GridLayout(2, false));
- container.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- panel = new Composite(container, SWT.NONE);
- GridLayout layout = new GridLayout(2, false);
- panel.setLayout(layout);
- panel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- for (Iterator i = fieldList.iterator(); i.hasNext();) {
- FieldSummary field = (FieldSummary)i.next();
- switch(field.type) {
- case TEXT:
- createTextField(field.name, field.initialValue, field.allowsEmpty);
- break;
- case BROWSE:
- createBrowseField(field.name, field.initialValue, field.allowsEmpty);
- break;
- case VARIABLE:
- createVariablesField(field.name, field.initialValue, field.allowsEmpty);
- break;
- }
- }
-
- fieldList = null; // allow it to be gc'd
- Dialog.applyDialogFont(container);
- return container;
- }
-
- public void addBrowseField(String labelText, String initialValue, boolean allowsEmpty) {
- fieldList.add(new FieldSummary(BROWSE, labelText, initialValue, allowsEmpty));
- }
- public void addTextField(String labelText, String initialValue, boolean allowsEmpty) {
- fieldList.add(new FieldSummary(TEXT, labelText, initialValue, allowsEmpty));
- }
- public void addVariablesField(String labelText, String initialValue, boolean allowsEmpty) {
- fieldList.add(new FieldSummary(VARIABLE, labelText, initialValue, allowsEmpty));
- }
-
- protected void createTextField(String labelText, String initialValue, boolean allowEmpty) {
- Label label = new Label(panel, SWT.NONE);
- label.setText(labelText);
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- final Text text = new Text(panel, SWT.SINGLE | SWT.BORDER);
- text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- text.setData(FIELD_NAME, labelText);
-
- // make sure rows are the same height on both panels.
- label.setSize(label.getSize().x, text.getSize().y);
-
- if (initialValue != null) {
- text.setText(initialValue);
- }
-
- if (!allowEmpty) {
- validators.add(new Validator() {
- public boolean validate() {
- return !text.getText().equals(IInternalDebugCoreConstants.EMPTY_STRING);
- }
- });
- text.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validateFields();
- }
- });
- }
-
- controlList.add(text);
- }
-
- protected void createBrowseField(String labelText, String initialValue, boolean allowEmpty) {
- Label label = new Label(panel, SWT.NONE);
- label.setText(labelText);
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- Composite comp = new Composite(panel, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight=0;
- layout.marginWidth=0;
- comp.setLayout(layout);
- comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- final Text text = new Text(comp, SWT.SINGLE | SWT.BORDER);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.widthHint = 200;
- text.setLayoutData(data);
- text.setData(FIELD_NAME, labelText);
-
- // make sure rows are the same height on both panels.
- label.setSize(label.getSize().x, text.getSize().y);
-
- if (initialValue != null) {
- text.setText(initialValue);
- }
-
- if (!allowEmpty) {
- validators.add(new Validator() {
- public boolean validate() {
- return !text.getText().equals(IInternalDebugCoreConstants.EMPTY_STRING);
- }
- });
-
- text.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validateFields();
- }
- });
- }
-
- Button button = createButton(comp, IDialogConstants.IGNORE_ID, DebugUIMessages.MultipleInputDialog_6, false);
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- DirectoryDialog dialog = new DirectoryDialog(getShell());
- dialog.setMessage(DebugUIMessages.MultipleInputDialog_7);
- String currentWorkingDir = text.getText();
- if (!currentWorkingDir.trim().equals(IInternalDebugCoreConstants.EMPTY_STRING)) {
- File path = new File(currentWorkingDir);
- if (path.exists()) {
- dialog.setFilterPath(currentWorkingDir);
- }
- }
-
- String selectedDirectory = dialog.open();
- if (selectedDirectory != null) {
- text.setText(selectedDirectory);
- }
- }
- });
-
- controlList.add(text);
-
- }
-
-
- public void createVariablesField(String labelText, String initialValue, boolean allowEmpty) {
- Label label = new Label(panel, SWT.NONE);
- label.setText(labelText);
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- Composite comp = new Composite(panel, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight=0;
- layout.marginWidth=0;
- comp.setLayout(layout);
- comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- final Text text = new Text(comp, SWT.SINGLE | SWT.BORDER);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.widthHint = 200;
- text.setLayoutData(data);
- text.setData(FIELD_NAME, labelText);
-
- // make sure rows are the same height on both panels.
- label.setSize(label.getSize().x, text.getSize().y);
-
- if (initialValue != null) {
- text.setText(initialValue);
- }
-
- if (!allowEmpty) {
- validators.add(new Validator() {
- public boolean validate() {
- return !text.getText().equals(IInternalDebugCoreConstants.EMPTY_STRING);
- }
- });
-
- text.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validateFields();
- }
- });
- }
-
- Button button = createButton(comp, IDialogConstants.IGNORE_ID, DebugUIMessages.MultipleInputDialog_8, false);
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
- int code = dialog.open();
- if (code == IDialogConstants.OK_ID) {
- String variable = dialog.getVariableExpression();
- if (variable != null) {
- text.insert(variable);
- }
- }
- }
- });
-
- controlList.add(text);
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- for (Iterator i = controlList.iterator(); i.hasNext(); ) {
- Control control = (Control)i.next();
- if (control instanceof Text) {
- valueMap.put(control.getData(FIELD_NAME), ((Text)control).getText());
- }
- }
- controlList = null;
- super.okPressed();
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#open()
- */
- public int open() {
- applyDialogFont(panel);
- return super.open();
- }
-
- public Object getValue(String key) {
- return valueMap.get(key);
- }
-
- public String getStringValue(String key) {
- return (String) getValue(key);
- }
-
- public void validateFields() {
- for(Iterator i = validators.iterator(); i.hasNext(); ) {
- Validator validator = (Validator) i.next();
- if (!validator.validate()) {
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- return;
- }
- }
- getButton(IDialogConstants.OK_ID).setEnabled(true);
- }
-
- protected class FieldSummary {
- int type;
- String name;
- String initialValue;
- boolean allowsEmpty;
-
- public FieldSummary(int type, String name, String initialValue, boolean allowsEmpty) {
- this.type = type;
- this.name = name;
- this.initialValue = initialValue;
- this.allowsEmpty = allowsEmpty;
- }
- }
-
- protected class Validator {
- boolean validate() {
- return true;
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/Pair.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/Pair.java
deleted file mode 100644
index 69a6bf324..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/Pair.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-/**
- * Pair is a basic tuple of two with classic first and second members.
- * Since Java is non-polymorphic, we use Object(s) for the pair elements
- * and cast our brains out.
- */
-public class Pair {
- public Object fFirst = null;
- public Object fSecond = null;
- public Pair(Object first, Object second) {
- fFirst = first;
- fSecond = second;
- }
- /*
- * String accessors
- */
- public String firstAsString() {
- return (String) fFirst;
- }
- public String secondAsString() {
- return (String) fSecond;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ResourceExtender.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ResourceExtender.java
deleted file mode 100644
index fca1043e4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ResourceExtender.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.regex.Pattern;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.ui.IPathEditorInput;
-
-/**
- * ResourceExtender provides property testers for the XML expression language
- * evaluation. We provide a copy in Debug so that launch shortcuts can add
- * contextual launch enablement that does not require their plugins to be
- * loaded. Copied from
- * org.eclipse.jdt.internal.corext.refactoring.participants.xml.ResourceExtender
- */
-public class ResourceExtender extends PropertyTester {
-
- private static final String PROPERTY_MATCHES_PATTERN = "matchesPattern"; //$NON-NLS-1$
-
- private static final String PROJECT_NATURE = "projectNature"; //$NON-NLS-1$
-
- private static final String PROPERTY_MATCHES_CONTENT_TYPE = "matchesContentType"; //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
- */
- public boolean test(Object receiver, String method, Object[] args, Object expectedValue) {
- IResource resource = (IResource) ((IAdaptable) receiver).getAdapter(IResource.class);
- if (resource == null) {
- if (PROPERTY_MATCHES_CONTENT_TYPE.equals(method)) {
- IPathEditorInput editorInput = (IPathEditorInput) ((IAdaptable) receiver).getAdapter(IPathEditorInput.class);
- if (editorInput != null) {
- IPath path= editorInput.getPath();
- File file= path.toFile();
- if (file.exists()) {
- try {
- FileReader reader= new FileReader(file);
- IContentType contentType= Platform.getContentTypeManager().getContentType((String)expectedValue);
- IContentDescription description= contentType.getDescriptionFor(reader, IContentDescription.ALL);
- reader.close();
- if (description != null) {
- return matchesContentType(description.getContentType(), (String)expectedValue);
- }
- } catch (FileNotFoundException e) {
- return false;
- } catch (IOException e) {
- return false;
- }
- }
- }
- }
- } else {
- if (PROPERTY_MATCHES_PATTERN.equals(method)) {
- String fileName = resource.getName();
- String expected = (String) expectedValue;
- expected = expected.replaceAll("\\.", "\\\\."); //$NON-NLS-1$//$NON-NLS-2$
- expected = expected.replaceAll("\\*", "\\.\\*"); //$NON-NLS-1$//$NON-NLS-2$
- Pattern pattern = Pattern.compile(expected);
- boolean retVal = pattern.matcher(fileName).find();
- return retVal;
- } else if (PROJECT_NATURE.equals(method)) {
- try {
- IProject proj = resource.getProject();
- return proj != null && proj.isAccessible() && proj.hasNature((String) expectedValue);
- } catch (CoreException e) {
- return false;
- }
- } else if (PROPERTY_MATCHES_CONTENT_TYPE.equals(method)) {
- return matchesContentType(resource, (String) expectedValue);
- }
- }
- return false;
- }
-
- /**
- * Returns whether the given type or one of its base types matches the
- * given content type identifier.
- *
- * @param type content type or <code>null</code>
- * @param typeId content type identifier
- * @return
- */
- private boolean matchesContentType(IContentType type, String typeId) {
- while (type != null) {
- if (typeId.equals(type.getId())) {
- return true;
- }
- type = type.getBaseType();
- }
- return false;
- }
-
- /**
- * Returns whether or not the given file's content type matches the
- * specified content type.
- *
- * Content types are looked up in the content type registry.
- *
- * @return whether or not the given resource has the given content type
- */
- private boolean matchesContentType(IResource resource, String contentType) {
- if (resource == null || !(resource instanceof IFile) || !resource.exists()) {
- return false;
- }
- IFile file = (IFile) resource;
- IContentDescription description;
- try {
- description = file.getContentDescription();
- } catch (CoreException e) {
- return false;
- }
- if (description != null) {
- return matchesContentType(description.getContentType(), contentType);
- }
- return false;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/SWTFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/SWTFactory.java
deleted file mode 100755
index f33cd446e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/SWTFactory.java
+++ /dev/null
@@ -1,520 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.layout.PixelConverter;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-
-/**
- * Factory class to create some SWT resources.
- */
-public class SWTFactory {
-
- /**
- * Returns a width hint for a button control.
- */
- public static int getButtonWidthHint(Button button) {
- button.setFont(JFaceResources.getDialogFont());
- PixelConverter converter= new PixelConverter(button);
- int widthHint= converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
- return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
- }
-
- /**
- * Sets width and height hint for the button control.
- * <b>Note:</b> This is a NOP if the button's layout data is not
- * an instance of <code>GridData</code>.
- *
- * @param the button for which to set the dimension hint
- */
- public static void setButtonDimensionHint(Button button) {
- Assert.isNotNull(button);
- Object gd= button.getLayoutData();
- if (gd instanceof GridData) {
- ((GridData)gd).widthHint= getButtonWidthHint(button);
- ((GridData)gd).horizontalAlignment = GridData.FILL;
- }
- }
-
- /**
- * Creates a check box button using the parents' font
- * @param parent the parent to add the button to
- * @param label the label for the button
- * @param image the image for the button
- * @param checked the initial checked state of the button
- * @param hspan the horizontal span to take up in the parent composite
- * @return a new checked button set to the initial checked state
- * @since 3.3
- */
- public static Button createCheckButton(Composite parent, String label, Image image, boolean checked, int hspan) {
- Button button = new Button(parent, SWT.CHECK);
- button.setFont(parent.getFont());
- button.setSelection(checked);
- if(image != null) {
- button.setImage(image);
- }
- if(label != null) {
- button.setText(label);
- }
- GridData gd = new GridData();
- gd.horizontalSpan = hspan;
- button.setLayoutData(gd);
- setButtonDimensionHint(button);
- return button;
- }
-
- /**
- * Creates and returns a new push button with the given
- * label and/or image.
- *
- * @param parent parent control
- * @param label button label or <code>null</code>
- * @param image image of <code>null</code>
- *
- * @return a new push button
- */
- public static Button createPushButton(Composite parent, String label, Image image) {
- Button button = new Button(parent, SWT.PUSH);
- button.setFont(parent.getFont());
- if (image != null) {
- button.setImage(image);
- }
- if (label != null) {
- button.setText(label);
- }
- GridData gd = new GridData();
- button.setLayoutData(gd);
- SWTFactory.setButtonDimensionHint(button);
- return button;
- }
-
- /**
- * Creates and returns a new push button with the given
- * label and/or image.
- *
- * @param parent parent control
- * @param label button label or <code>null</code>
- * @param image image of <code>null</code>
- * @param fill the alignment for the new button
- *
- * @return a new push button
- * @since 3.4
- */
- public static Button createPushButton(Composite parent, String label, Image image, int fill) {
- Button button = new Button(parent, SWT.PUSH);
- button.setFont(parent.getFont());
- if (image != null) {
- button.setImage(image);
- }
- if (label != null) {
- button.setText(label);
- }
- GridData gd = new GridData(fill);
- button.setLayoutData(gd);
- SWTFactory.setButtonDimensionHint(button);
- return button;
- }
-
- /**
- * Creates and returns a new radio button with the given
- * label.
- *
- * @param parent parent control
- * @param label button label or <code>null</code>
- *
- * @return a new radio button
- */
- public static Button createRadioButton(Composite parent, String label) {
- Button button = new Button(parent, SWT.RADIO);
- button.setFont(parent.getFont());
- if (label != null) {
- button.setText(label);
- }
- GridData gd = new GridData();
- button.setLayoutData(gd);
- SWTFactory.setButtonDimensionHint(button);
- return button;
- }
-
- /**
- * Creates a new label widget
- * @param parent the parent composite to add this label widget to
- * @param text the text for the label
- * @param hspan the horizontal span to take up in the parent composite
- * @return the new label
- * @since 3.2
- *
- */
- public static Label createLabel(Composite parent, String text, int hspan) {
- Label l = new Label(parent, SWT.NONE);
- l.setFont(parent.getFont());
- l.setText(text);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = hspan;
- gd.grabExcessHorizontalSpace = false;
- l.setLayoutData(gd);
- return l;
- }
-
- /**
- * Creates a new label widget
- * @param parent the parent composite to add this label widget to
- * @param text the text for the label
- * @param font the font for the label
- * @param hspan the horizontal span to take up in the parent composite
- * @return the new label
- * @since 3.3
- */
- public static Label createLabel(Composite parent, String text, Font font, int hspan) {
- Label l = new Label(parent, SWT.NONE);
- l.setFont(font);
- l.setText(text);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = hspan;
- l.setLayoutData(gd);
- return l;
- }
-
- /**
- * Creates a wrapping label
- * @param parent the parent composite to add this label to
- * @param text the text to be displayed in the label
- * @param hspan the horizontal span that label should take up in the parent composite
- * @param wrapwidth the width hint that the label should wrap at
- * @return a new label that wraps at a specified width
- * @since 3.3
- */
- public static Label createWrapLabel(Composite parent, String text, int hspan, int wrapwidth) {
- Label l = new Label(parent, SWT.NONE | SWT.WRAP);
- l.setFont(parent.getFont());
- l.setText(text);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = hspan;
- gd.widthHint = wrapwidth;
- l.setLayoutData(gd);
- return l;
- }
-
- /**
- * Creates a new <code>CLabel</code> that will wrap at the specified width and has the specified image
- * @param parent the parent to add this label to
- * @param text the text for the label
- * @param image the image for the label
- * @param hspan the h span to take up in the parent
- * @param wrapwidth the with to wrap at
- * @return a new <code>CLabel</code>
- * @since 3.3
- */
- public static CLabel createWrapCLabel(Composite parent, String text, Image image, int hspan, int wrapwidth) {
- CLabel label = new CLabel(parent, SWT.NONE | SWT.WRAP);
- label.setFont(parent.getFont());
- if(text != null) {
- label.setText(text);
- }
- if(image != null) {
- label.setImage(image);
- }
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = hspan;
- gd.widthHint = wrapwidth;
- label.setLayoutData(gd);
- return label;
- }
-
- /**
- * Creates a wrapping label
- * @param parent the parent composite to add this label to
- * @param text the text to be displayed in the label
- * @param hspan the horizontal span that label should take up in the parent composite
- * @return a new label that wraps at a specified width
- * @since 3.3
- */
- public static Label createWrapLabel(Composite parent, String text, int hspan) {
- Label l = new Label(parent, SWT.NONE | SWT.WRAP);
- l.setFont(parent.getFont());
- l.setText(text);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = hspan;
- l.setLayoutData(gd);
- return l;
- }
-
- /**
- * Creates a new text widget
- * @param parent the parent composite to add this text widget to
- * @param hspan the horizontal span to take up on the parent composite
- * @return the new text widget
- * @since 3.2
- *
- */
- public static Text createSingleText(Composite parent, int hspan) {
- Text t = new Text(parent, SWT.SINGLE | SWT.BORDER);
- t.setFont(parent.getFont());
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = hspan;
- t.setLayoutData(gd);
- return t;
- }
-
- /**
- * Creates a new text widget
- * @param parent the parent composite to add this text widget to
- * @param style the style bits for the text widget
- * @param hspan the horizontal span to take up on the parent composite
- * @param fill the fill for the grid layout
- * @return the new text widget
- * @since 3.3
- */
- public static Text createText(Composite parent, int style, int hspan, int fill) {
- Text t = new Text(parent, style);
- t.setFont(parent.getFont());
- GridData gd = new GridData(fill);
- gd.horizontalSpan = hspan;
- t.setLayoutData(gd);
- return t;
- }
-
- /**
- * Creates a new text widget
- * @param parent the parent composite to add this text widget to
- * @param style the style bits for the text widget
- * @param hspan the horizontal span to take up on the parent composite
- * @return the new text widget
- * @since 3.3
- */
- public static Text createText(Composite parent, int style, int hspan) {
- Text t = new Text(parent, style);
- t.setFont(parent.getFont());
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = hspan;
- t.setLayoutData(gd);
- return t;
- }
-
- /**
- * Creates a new text widget
- * @param parent the parent composite to add this text widget to
- * @param style the style bits for the text widget
- * @param hspan the horizontal span to take up on the parent composite
- * @param width the desired width of the text widget
- * @param height the desired height of the text widget
- * @param fill the fill style for the widget
- * @return the new text widget
- * @since 3.3
- */
- public static Text createText(Composite parent, int style, int hspan, int width, int height, int fill) {
- Text t = new Text(parent, style);
- t.setFont(parent.getFont());
- GridData gd = new GridData(fill);
- gd.horizontalSpan = hspan;
- gd.widthHint = width;
- gd.heightHint = height;
- t.setLayoutData(gd);
- return t;
- }
-
- /**
- * Creates a Group widget
- * @param parent the parent composite to add this group to
- * @param text the text for the heading of the group
- * @param columns the number of columns within the group
- * @param hspan the horizontal span the group should take up on the parent
- * @param fill the style for how this composite should fill into its parent
- * @return the new group
- * @since 3.2
- *
- */
- public static Group createGroup(Composite parent, String text, int columns, int hspan, int fill) {
- Group g = new Group(parent, SWT.NONE);
- g.setLayout(new GridLayout(columns, false));
- g.setText(text);
- g.setFont(parent.getFont());
- GridData gd = new GridData(fill);
- gd.horizontalSpan = hspan;
- g.setLayoutData(gd);
- return g;
- }
-
- /**
- * Creates a Composite widget
- * @param parent the parent composite to add this composite to
- * @param font the font to set on the control
- * @param columns the number of columns within the composite
- * @param hspan the horizontal span the composite should take up on the parent
- * @param fill the style for how this composite should fill into its parent
- * @return the new group
- * @since 3.3
- */
- public static Composite createComposite(Composite parent, Font font, int columns, int hspan, int fill) {
- Composite g = new Composite(parent, SWT.NONE);
- g.setLayout(new GridLayout(columns, false));
- g.setFont(font);
- GridData gd = new GridData(fill);
- gd.horizontalSpan = hspan;
- g.setLayoutData(gd);
- return g;
- }
-
- /**
- * Creates a composite that uses the parent's font and has a grid layout
- * @param parent the parent to add the composite to
- * @param columns the number of columns the composite should have
- * @param hspan the horizontal span the new composite should take up in the parent
- * @param fill the fill style of the composite {@link GridData}
- * @return a new composite with a grid layout
- *
- * @since 3.3
- */
- public static Composite createComposite(Composite parent, int columns, int hspan, int fill) {
- Composite g = new Composite(parent, SWT.NONE);
- g.setLayout(new GridLayout(columns, false));
- g.setFont(parent.getFont());
- GridData gd = new GridData(fill);
- gd.horizontalSpan = hspan;
- g.setLayoutData(gd);
- return g;
- }
-
- /**
- * Creates a vertical spacer for separating components. If applied to a
- * <code>GridLayout</code>, this method will automatically span all of the columns of the parent
- * to make vertical space
- *
- * @param parent the parent composite to add this spacer to
- * @param numlines the number of vertical lines to make as space
- * @since 3.3
- */
- public static void createVerticalSpacer(Composite parent, int numlines) {
- Label lbl = new Label(parent, SWT.NONE);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- Layout layout = parent.getLayout();
- if(layout instanceof GridLayout) {
- gd.horizontalSpan = ((GridLayout)parent.getLayout()).numColumns;
- }
- gd.heightHint = numlines;
- lbl.setLayoutData(gd);
- }
-
- /**
- * creates a horizontal spacer for separating components
- * @param comp
- * @param numlines
- * @since 3.3
- */
- public static void createHorizontalSpacer(Composite comp, int numlines) {
- Label lbl = new Label(comp, SWT.NONE);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = numlines;
- lbl.setLayoutData(gd);
- }
-
- /**
- * Creates a Composite widget
- * @param parent the parent composite to add this composite to
- * @param font the font to set on the control
- * @param columns the number of columns within the composite
- * @param hspan the horizontal span the composite should take up on the parent
- * @param fill the style for how this composite should fill into its parent
- * @param marginwidth the width of the margin to place on the sides of the composite (default is 5, specified by GridLayout)
- * @param marginheight the height of the margin to place o the top and bottom of the composite
- * @return the new composite
- * @since 3.3
- */
- public static Composite createComposite(Composite parent, Font font, int columns, int hspan, int fill, int marginwidth, int marginheight) {
- Composite g = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout(columns, false);
- layout.marginWidth = marginwidth;
- layout.marginHeight = marginheight;
- g.setLayout(layout);
- g.setFont(font);
- GridData gd = new GridData(fill);
- gd.horizontalSpan = hspan;
- g.setLayoutData(gd);
- return g;
- }
-
- /**
- * This method is used to make a combo box
- * @param parent the parent composite to add the new combo to
- * @param style the style for the Combo
- * @param hspan the horizontal span to take up on the parent composite
- * @param fill how the combo will fill into the composite
- * Can be one of <code>GridData.FILL_HORIZONAL</code>, <code>GridData.FILL_BOTH</code> or <code>GridData.FILL_VERTICAL</code>
- * @param items the item to put into the combo
- * @return a new Combo instance
- * @since 3.3
- */
- public static Combo createCombo(Composite parent, int style, int hspan, int fill, String[] items) {
- Combo c = new Combo(parent, style);
- c.setFont(parent.getFont());
- GridData gd = new GridData(fill);
- gd.horizontalSpan = hspan;
- c.setLayoutData(gd);
- if (items != null){
- c.setItems(items);
- }
- // Some platforms open up combos in bad sizes without this, see bug 245569
- c.setVisibleItemCount(30);
- c.select(0);
- return c;
- }
-
- /**
- * This method is used to make a combo box with a default fill style of GridData.FILL_HORIZONTAL
- * @param parent the parent composite to add the new combo to
- * @param style the style for the Combo
- * @param hspan the horizontal span to take up on the parent composite
- * @param items the item to put into the combo
- * @return a new Combo instance
- * @since 3.3
- */
- public static Combo createCombo(Composite parent, int style, int hspan, String[] items) {
- Combo c = new Combo(parent, style);
- c.setFont(parent.getFont());
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = hspan;
- c.setLayoutData(gd);
- if (items != null){
- c.setItems(items);
- }
- // Some platforms open up combos in bad sizes without this, see bug 245569
- c.setVisibleItemCount(30);
- c.select(0);
- return c;
- }
-
- /**
- * This method allows us to open the preference dialog on the specific page, in this case the perspective page
- * @param id the id of preference page to show
- * @param page the actual page to show
- * @since 3.2
- */
- public static void showPreferencePage(String id) {
- PreferencesUtil.createPreferenceDialogOn(DebugUIPlugin.getShell(), id, new String[] {id}, null).open();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariableValueEditorManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariableValueEditorManager.java
deleted file mode 100644
index c02ac4d54..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariableValueEditorManager.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.actions.IVariableValueEditor;
-
-/**
- * Manager which provides the variable value editors contributed
- * via the org.eclipse.debug.ui.variableValueEditors extension
- * point.
- *
- * @see org.eclipse.debug.ui.actions.IVariableValueEditor
- * @since 3.1
- */
-public class VariableValueEditorManager {
-
- /**
- * Mapping of debug model identifiers to variable value editors.
- * The keys in this map are always Strings (model ids).
- * The values in the map are IConfigurationElements at startup,
- * which are replaced by IVariableValueEditors as the editors
- * are instantiated (editors are loaded lazily, then cached).
- */
- private Map fEditorMap= new HashMap();
-
- /**
- * The singleton instance of this manager.
- */
- private static VariableValueEditorManager fgManager;
-
- /**
- * Creates a new variable value editor manager. Clients
- * should access the singleton instance of this manager
- * by calling getDefault()
- */
- private VariableValueEditorManager() {
- loadVariableEditors();
- }
-
- /**
- * Returns the singleton instance of this manager.
- * @return the singleton instance of this manager
- */
- public static VariableValueEditorManager getDefault() {
- if (fgManager == null) {
- fgManager= new VariableValueEditorManager();
- }
- return fgManager;
- }
-
- /**
- * Returns the variable value editor associated with the given debug
- * model identifier or <code>null</code> if no editor has been supplied
- * for the given debug model.
- * @param modelIdentifier the debug model identifier
- * @return the variable value editor associated with the given debug model
- * identifier or <code>null</code>
- */
- public IVariableValueEditor getVariableValueEditor(String modelIdentifier) {
- Object object = fEditorMap.get(modelIdentifier);
- IVariableValueEditor editor= null;
- if (object instanceof IVariableValueEditor) {
- editor= (IVariableValueEditor) object;
- } else if (object instanceof IConfigurationElement) {
- try {
- editor = (IVariableValueEditor) ((IConfigurationElement) object).createExecutableExtension("class"); //$NON-NLS-1$
- fEditorMap.put(modelIdentifier, editor);
- } catch (CoreException e) {
- // If an exception occurs, loading the extension, just log it and
- // return null.
- DebugUIPlugin.log(e);
- }
- }
- return editor;
- }
-
- /**
- * Loads contributors to the org.eclipse.debug.ui.variableValueEditors extension point,
- * for use when the user runs this action.
- */
- private void loadVariableEditors() {
- IExtensionPoint ep = Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_VARIABLE_VALUE_EDITORS);
- IConfigurationElement[] elements = ep.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- IConfigurationElement element = elements[i];
- String modelId = element.getAttribute("modelId"); //$NON-NLS-1$
- if (modelId != null) {
- fEditorMap.put(modelId, element);
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariablesViewModelPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariablesViewModelPresentation.java
deleted file mode 100644
index 2084afc7d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariablesViewModelPresentation.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-
-import java.util.StringTokenizer;
-
-public class VariablesViewModelPresentation extends DelegatingModelPresentation {
-
- /**
- * @see DelegatingModelPresentation#getText(Object)
- *
- * Strips out control characters and replaces them with string representations
- */
- public String getText(Object element) {
- StringBuffer string= new StringBuffer();
- StringTokenizer tokenizer= new StringTokenizer(super.getText(element), "\b\f\n\r\t\\", true); //$NON-NLS-1$
- String token;
- while (tokenizer.hasMoreTokens()) {
- token= tokenizer.nextToken();
- if (token.length() > 1) {
- string.append(token);
- } else {
- switch (token.charAt(0)) {
- case '\b':
- string.append("\\b"); //$NON-NLS-1$
- break;
- case '\f':
- string.append("\\f"); //$NON-NLS-1$
- break;
- case '\n':
- string.append("\\n"); //$NON-NLS-1$
- break;
- case '\r':
- string.append("\\r"); //$NON-NLS-1$
- break;
- case '\t':
- string.append("\\t"); //$NON-NLS-1$
- break;
- case '\\':
- string.append("\\\\"); //$NON-NLS-1$
- break;
- default:
- string.append(token);
- }
- }
- }
- return string.toString();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/WorkingDirectoryStatusHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/WorkingDirectoryStatusHandler.java
deleted file mode 100644
index 8b257588d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/WorkingDirectoryStatusHandler.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui;
-
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.core.IStatusHandler;
-import org.eclipse.jface.dialogs.MessageDialog;
-
-/**
- * Prompts the user to re-launch when a working directory
- * is not supported by the Eclipse runtime.
- */
-public class WorkingDirectoryStatusHandler implements IStatusHandler {
-
- /**
- * @see IStatusHandler#handleStatus(IStatus, Object)
- */
- public Object handleStatus(IStatus status, Object source) {
- final boolean[] result = new boolean[1];
- DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
- public void run() {
- String title= DebugUIMessages.WorkingDirectoryStatusHandler_Eclipse_Runtime_1;
- String message= DebugUIMessages.WorkingDirectoryStatusHandler_0;
- result[0]= (MessageDialog.openQuestion(DebugUIPlugin.getShell(), title, message));
- }
- });
- return Boolean.valueOf(result[0]);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java
deleted file mode 100644
index a9ff6c2ce..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * This class is an abstract implementation of common features for a debug <code>IViewActionDelegate</code>
- *
- * This class is intended to be extended by clients
- * @see {@link IViewActionDelegate}
- * @see {@link IActionDelegate2}
- */
-public abstract class AbstractDebugActionDelegate implements IViewActionDelegate, IActionDelegate2 {
-
- /**
- * The underlying action for this delegate
- */
- private IAction fAction;
- /**
- * This action's view part, or <code>null</code>
- * if not installed in a view.
- */
- private IViewPart fViewPart;
-
- /**
- * Cache of the most recent selection
- */
- private IStructuredSelection fSelection = StructuredSelection.EMPTY;
-
- /**
- * Whether this delegate has been initialized
- */
- private boolean fInitialized = false;
-
- /**
- * It's crucial that delegate actions have a zero-argument constructor so that
- * they can be reflected into existence when referenced in an action set
- * in the plugin's plugin.xml file.
- */
- public AbstractDebugActionDelegate() {}
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose(){
- fSelection= null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action){
- if (action.isEnabled()) {
- IStructuredSelection selection = getSelection();
- // disable the action so it cannot be run again until an event or selection change
- // updates the enablement
- action.setEnabled(false);
- runInForeground(selection);
- }
- }
-
- /**
- * Runs this action in the UI thread.
- */
- private void runInForeground(final IStructuredSelection selection) {
- final MultiStatus status=
- new MultiStatus(DebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, getStatusMessage(), null);
- BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
- public void run() {
- Iterator selectionIter = selection.iterator();
- while (selectionIter.hasNext()) {
- Object element= selectionIter.next();
- try {
- // Action's enablement could have been changed since
- // it was last enabled. Check that the action is still
- // enabled before running the action.
- if (isEnabledFor(element))
- doAction(element);
- } catch (DebugException e) {
- status.merge(e.getStatus());
- }
- }
- }
- });
- reportErrors(status);
- }
-
- /**
- * Reports the specified <code>MultiStatus</code> in an error dialog
- * @param ms the specified <code>MultiStatus</code>
- */
- private void reportErrors(final MultiStatus ms) {
- if (!ms.isOK()) {
- IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- DebugUIPlugin.errorDialog(window.getShell(), ActionMessages.AbstractDebugActionDelegate_0, getErrorDialogMessage(), ms);
- } else {
- DebugUIPlugin.log(ms);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection s) {
- boolean wasInitialized= initialize(action, s);
- if (!wasInitialized) {
- if (getView() != null) {
- update(action, s);
- }
- }
- }
-
- /**
- * Updates the specified selection based on the selection, as well as setting the selection
- * for this action
- * @param action the action to update
- * @param s the selection
- */
- protected void update(IAction action, ISelection s) {
- if (s instanceof IStructuredSelection) {
- IStructuredSelection ss = getTargetSelection((IStructuredSelection)s);
- action.setEnabled(getEnableStateForSelection(ss));
- setSelection(ss);
- } else {
- action.setEnabled(false);
- setSelection(StructuredSelection.EMPTY);
- }
- }
-
- /**
- * Returns a selection this operation should act on based on the given selection.
- * Provides an opportunity for actions to translate the selection/targets of the
- * operation.
- * <p>
- * By default, the original selection is returned. Subclasses may override.
- * </p>
- * @param s selection
- * @return selection to operate on
- * @since 3.6
- */
- protected IStructuredSelection getTargetSelection(IStructuredSelection s) {
- return s;
- }
-
- /**
- * Performs the specific action on this element.
- */
- protected abstract void doAction(Object element) throws DebugException;
-
- /**
- * Returns the String to use as an error dialog message for
- * a failed action. This message appears as the "Message:" in
- * the error dialog for this action.
- * Default is to return null.
- */
- protected String getErrorDialogMessage(){
- return null;
- }
- /**
- * Returns the String to use as a status message for
- * a failed action. This message appears as the "Reason:"
- * in the error dialog for this action.
- * Default is to return the empty String.
- */
- protected String getStatusMessage(){
- return IInternalDebugCoreConstants.EMPTY_STRING;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- fViewPart = view;
- }
-
- /**
- * Returns this action's view part, or <code>null</code>
- * if not installed in a view.
- *
- * @return view part or <code>null</code>
- */
- protected IViewPart getView() {
- return fViewPart;
- }
-
- /**
- * Initialize this delegate, updating this delegate's
- * presentation.
- * As well, all of the flavors of AbstractDebugActionDelegates need to
- * have the initial enabled state set with a call to update(IAction, ISelection).
- *
- * @param action the presentation for this action
- * @return whether the action was initialized
- */
- protected boolean initialize(IAction action, ISelection selection) {
- if (!isInitialized()) {
- setAction(action);
- update(action, selection);
- setInitialized(true);
- return true;
- }
- return false;
- }
-
- /**
- * Returns the most recent selection
- *
- * @return structured selection
- */
- protected IStructuredSelection getSelection() {
- return fSelection;
- }
-
- /**
- * Sets the most recent selection
- *
- * @parm selection structured selection
- */
- private void setSelection(IStructuredSelection selection) {
- fSelection = selection;
- }
-
- /**
- * Allows the underlying <code>IAction</code> to be set to the specified <code>IAction</code>
- * @param action the action to set
- */
- protected void setAction(IAction action) {
- fAction = action;
- }
-
- /**
- * Allows access to the underlying <code>IAction</code>
- * @return the underlying <code>IAction</code>
- */
- protected IAction getAction() {
- return fAction;
- }
-
- /**
- * Returns if this action has been initialized or not
- * @return if this action has been initialized or not
- */
- protected boolean isInitialized() {
- return fInitialized;
- }
-
- /**
- * Sets the initialized state of this action to the specified boolean value
- * @param initialized the value to set the initialized state to
- */
- protected void setInitialized(boolean initialized) {
- fInitialized = initialized;
- }
-
- /**
- * Return whether the action should be enabled or not based on the given selection.
- */
- protected boolean getEnableStateForSelection(IStructuredSelection selection) {
- if (selection.size() == 0) {
- return false;
- }
- Iterator itr= selection.iterator();
- while (itr.hasNext()) {
- Object element= itr.next();
- if (!isEnabledFor(element)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Returns if this action is enabled for the specified object context
- * @param element the context
- * @return true if it is, false otherwise
- */
- protected boolean isEnabledFor(Object element) {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- fAction = action;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveActionDelegate.java
deleted file mode 100644
index f804e9b18..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveActionDelegate.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.debug.ui.IDebugView;
-import org.eclipse.ui.IViewPart;
-
-/**
- * Base implementation of the 'remove' action for a debug view
- *
- * This class is intended to be extended by clients
- * @see {@link AbstractSelectionActionDelegate}
- * @see {@link org.eclipse.ui.IViewActionDelegate}
- * @see {@link org.eclipse.ui.IActionDelegate2}
- *
- */
-public abstract class AbstractRemoveActionDelegate extends AbstractSelectionActionDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.selection.AbstractSelectionActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- super.init(view);
- IDebugView debugView= (IDebugView)getView().getAdapter(IDebugView.class);
- if (debugView != null) {
- debugView.setAction(IDebugView.REMOVE_ACTION, getAction());
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveAllActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveAllActionDelegate.java
deleted file mode 100644
index 62f80191e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveAllActionDelegate.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-/**
- * This class is a base implementation of a 'remove all' debug action
- *
- * This class is intended to be extended by clients
- * @see {@link IViewActionDelegate}
- * @see {@link IActionDelegate2}}
- * @see {@link IWorkbenchWindowActionDelegate}
- */
-public abstract class AbstractRemoveAllActionDelegate implements IViewActionDelegate, IActionDelegate2, IWorkbenchWindowActionDelegate {
-
- /**
- * The underlying <code>IAction</code>
- */
- private IAction fAction;
-
- /**
- * Needed for reflective creation
- */
- public AbstractRemoveAllActionDelegate() {}
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#dispose()
- */
- public void dispose() {
- fAction = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- fAction = action;
- }
-
- /**
- * Returns this delegate's action.
- *
- * @return the underlying <code>IAction</code>
- */
- protected IAction getAction() {
- return fAction;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- initialize();
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
- initialize();
- update();
- }
-
- /**
- * Initializes any listeners, etc.
- */
- protected abstract void initialize();
-
- /**
- * Update enablement.
- */
- protected void update() {
- IAction action = getAction();
- if (action != null) {
- action.setEnabled(isEnabled());
- }
- }
-
- /**
- * Returns whether this action is enabled
- *
- * @return true if this action is enabled, false otherwise
- */
- protected abstract boolean isEnabled();
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection s) {
- // do nothing
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractSelectionActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractSelectionActionDelegate.java
deleted file mode 100644
index e77dca8c8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractSelectionActionDelegate.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
-
-/**
- * This class provides a base implementation of a selection action delegate, more specifically a delegate
- * that uses a selection context to update its underlying <code>IAction</code>.
- *
- * This class is intended to be extended by clients
- *
- * @see {@link IViewActionDelegate}
- * @see {@link IActionDelegate2}
- *
- */
-public abstract class AbstractSelectionActionDelegate implements IViewActionDelegate, IActionDelegate2 {
-
- /**
- * The underlying action for this delegate
- */
- private IAction fAction;
-
- /**
- * This action's view part, or <code>null</code> if not installed in a
- * view.
- */
- private IViewPart fViewPart;
-
- /**
- * Cache of the most recent selection
- */
- private IStructuredSelection fSelection = StructuredSelection.EMPTY;
-
- /**
- * Used to schedule jobs, or <code>null</code> if none
- */
- private IWorkbenchSiteProgressService fProgressService = null;
-
- /**
- * It's crucial that delegate actions have a zero-arg constructor so that
- * they can be reflected into existence when referenced in an action set in
- * the plugin's plugin.xml file.
- */
- public AbstractSelectionActionDelegate() {}
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {
- fSelection = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection s) {
- if (s instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) s;
- action.setEnabled(getEnableStateForSelection(ss));
- setSelection(ss);
- } else {
- action.setEnabled(false);
- setSelection(StructuredSelection.EMPTY);
- }
- }
-
- /**
- * Returns the String to use as an error dialog message for a failed action.
- * This message appears as the "Message:" in the error dialog for this
- * action. Default is to return null.
- *
- * @return the message for the error dialog
- */
- protected String getErrorDialogMessage() {
- return null;
- }
-
- /**
- * Returns the String to use as a status message for a failed action. This
- * message appears as the "Reason:" in the error dialog for this action.
- * Default is to return the empty String.
- *
- * @return the status message
- */
- protected String getStatusMessage() {
- return IInternalDebugCoreConstants.EMPTY_STRING;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- setView(view);
- fProgressService = (IWorkbenchSiteProgressService) view.getAdapter(IWorkbenchSiteProgressService.class);
- }
-
- /**
- * Returns this action's view part, or <code>null</code> if not installed
- * in a view.
- *
- * @return the underlying <code>IViewPart</code> or <code>null</code>
- */
- protected IViewPart getView() {
- return fViewPart;
- }
-
- /**
- * Returns the most recent selection
- *
- * @return structured selection
- */
- protected IStructuredSelection getSelection() {
- return fSelection;
- }
-
- /**
- * Sets the most recent selection
- *
- * @parm selection structured selection
- */
- private void setSelection(IStructuredSelection context) {
- fSelection = context;
- }
-
- /**
- * Allows the underlying <code>IAction</code> to be set to the specified one
- * @param action the action to set
- */
- protected void setAction(IAction action) {
- fAction = action;
- }
-
- /**
- * Allows access to the underlying <code>IAction</code>
- * @return the underlying <code>IAction</code>
- */
- protected IAction getAction() {
- return fAction;
- }
-
- /**
- * Allows the underlying <code>IViewPart</code> to be set
- * @param viewPart the <code>IViewPart</code> to set
- */
- protected void setView(IViewPart viewPart) {
- fViewPart = viewPart;
- }
-
- /**
- * Return whether the action should be enabled or not based on the given
- * selection.
- *
- * @return true if the action should be enabled for the specified selection context
- * false otherwise
- */
- protected boolean getEnableStateForSelection(IStructuredSelection selection) {
- if (selection.size() == 0) {
- return false;
- }
- Iterator itr = selection.iterator();
- while (itr.hasNext()) {
- Object element = itr.next();
- if (!isEnabledFor(element)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Returns if the action should be enabled for the specified object context
- * @param element the object context
- * @return true if the action should be enabled for the specified object context
- * false otherwise
- */
- protected boolean isEnabledFor(Object element) {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- setAction(action);
- }
-
- /**
- * Schedules the given job with this action's progress service
- *
- * @param job
- */
- protected void schedule(Job job) {
- if (fProgressService == null) {
- job.schedule();
- } else {
- fProgressService.schedule(job);
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java
deleted file mode 100644
index 56b9aa620..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-import org.eclipse.osgi.util.NLS;
-
-public class ActionMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.actions.ActionMessages";//$NON-NLS-1$
-
- public static String AbstractLaunchHistoryAction_0;
- public static String AbstractLaunchHistoryAction_1;
- public static String AbstractLaunchHistoryAction_2;
- public static String AbstractLaunchHistoryAction_3;
- public static String AbstractLaunchHistoryAction_4;
-
- public static String AbstractLaunchHistoryAction_5;
-
- public static String AbstractLaunchHistoryAction_6;
-
- public static String AddToFavoritesAction_1;
- public static String AddToFavoritesAction_2;
- public static String AddToFavoritesAction_3;
-
- public static String ChangeVariableValue_errorDialogMessage;
- public static String ChangeVariableValue_errorDialogTitle;
- public static String ChangeVariableValue_title;
- public static String ChangeVariableValue_toolTipText;
- public static String ChangeVariableValue_1;
- public static String ChangeVariableValue_2;
- public static String ChangeVariableValue_3;
- public static String ChangeVariableValue_4;
-
- public static String CollapseAllAction_0;
-
- public static String ConfigureColumnsAction_0;
- public static String ConfigureColumnsAction_1;
- public static String ConfigureColumnsAction_2;
-
- public static String CopyToClipboardActionDelegate_Problem_Copying_to_Clipboard_1;
- public static String CopyToClipboardActionDelegate_There_was_a_problem_when_accessing_the_system_clipboard__Retry__2;
-
- public static String DebugLastAction_0;
-
- public static String DebugLastAction_1;
- public static String DebugLastAction_2;
- public static String DebugLastAction_3;
-
- public static String DetailPaneAssignValueAction_0;
- public static String DetailPaneAssignValueAction_1;
- public static String DetailPaneAssignValueAction_2;
- public static String DetailPaneAssignValueAction_3;
- public static String DetailPaneAssignValueAction_4;
- public static String DetailPaneWordWrapAction_0;
- public static String DetailPaneMaxLengthAction_0;
-
- public static String EditLaunchConfigurationAction_1;
-
- public static String EnableBreakpointAction_Enable_breakpoint_s__failed_2;
- public static String EnableBreakpointAction_Enabling_breakpoints_3;
- public static String EnableBreakpointAction_Exceptions_occurred_enabling_the_breakpoint_s___4;
-
- public static String LaunchConfigurationAction_0;
-
- public static String OpenBreakpointMarkerAction__Go_to_File_1;
- public static String OpenBreakpointMarkerAction_Exceptions_occurred_attempting_to_open_the_editor_for_the_breakpoint_resource_2;
- public static String OpenBreakpointMarkerAction_Go_to_Breakpoint_1;
- public static String OpenBreakpointMarkerAction_Go_to_File_for_Breakpoint_2;
-
- public static String OpenLaunchDialogAction_1;
-
- public static String PasteWatchExpressionsAction_0;
-
- public static String ProfileLastAction_0;
-
- public static String ProfileLastAction_1;
- public static String ProfileLastAction_2;
- public static String ProfileLastAction_3;
-
- public static String RelaunchActionDelegate_An_exception_occurred_while_launching_2;
- public static String RelaunchActionDelegate_Launch_Failed_1;
- public static String RelaunchLastAction_Cannot_relaunch_1;
- public static String RelaunchLastAction_Cannot_relaunch___0___because_it_does_not_support__2__mode_2;
- public static String RelaunchLastAction_Error_relaunching_3;
- public static String RelaunchLastAction_Error_encountered_attempting_to_relaunch_4;
-
- public static String RemoveAllBreakpointsAction_0;
- public static String RemoveAllBreakpointsAction_1;
- public static String RemoveAllBreakpointsAction_2;
- public static String RemoveAllBreakpointsAction_3;
- public static String RemoveBreakpointAction_0;
- public static String RemoveBreakpointAction_1;
- public static String RemoveBreakpointAction_2;
- public static String RemoveBreakpointAction_3;
- public static String RemoveBreakpointAction_4;
- public static String RemoveBreakpointAction_5;
- public static String RemoveBreakpointAction_6;
- public static String RemoveBreakpointAction_Exceptions_occurred_attempting_to_remove_a_breakpoint__5;
- public static String RemoveBreakpointAction_Removing_a_breakpoint_4;
-
- public static String RetargetRunToLineAction_0;
-
- public static String RunLastAction_0;
-
- public static String RunLastAction_1;
- public static String RunLastAction_2;
- public static String RunLastAction_3;
-
- public static String ShowSupportedBreakpointsAction_Show_For_Selected;
- public static String ShowSupportedBreakpointsAction_tooltip;
-
- public static String ShowTypesAction_Show__Type_Names_1;
- public static String ShowTypesAction_Show_Type_Names;
-
- public static String SkipAllBreakpointsAction_0;
- public static String SkipAllBreakpointsAction_2;
-
- public static String TerminateAndRelaunchAction_0;
- public static String TerminateAndRelaunchAction_3;
- public static String TerminateAndRelaunchAction_4;
- public static String TerminateAndRemoveAction_0;
- public static String TerminateAndRemoveAction_3;
-
- public static String ToggleDetailPaneAction_1;
- public static String ToggleDetailPaneAction_2;
- public static String ToggleDetailPaneAction_3;
- public static String ToggleDetailPaneAction_4;
- public static String ToggleDetailPaneAction_5;
- public static String ToggleDetailPaneAction_6;
- public static String ToggleDetailPaneAction_8;
- public static String ToggleDetailPaneAction_9;
- public static String ToggleBreakpointAction_0;
- public static String ToggleBreakpointAction_1;
- public static String ToggleBreakpointAction_2;
- public static String ToggleStepFiltersAction_0;
- public static String ToggleStepFiltersAction_1;
-
- public static String WatchExpressionDialog_0;
- public static String WatchExpressionDialog_1;
- public static String WatchExpressionDialog_2;
- public static String WatchExpressionDialog_3;
- public static String WatchExpressionDialog_4;
- public static String WatchExpressionDialogMenu_0;
- public static String WatchExpressionDialogMenu_1;
- public static String WatchExpressionDialogMenu_2;
- public static String WatchAction_0;
- public static String WatchAction_1;
-
- public static String RunToLineAction_0;
- public static String RunToLineAction_1;
- public static String RunToLineHandler_0;
- public static String RunToLineActionDelegate_4;
-
- public static String RetargetAction_2;
- public static String RetargetAction_3;
- public static String ModifyWatchpointAction_0;
- public static String ModifyWatchpointAction_1;
- public static String RemoveAllExpressionsAction_0;
- public static String RemoveAllExpressionsAction_1;
- public static String LaunchShortcutsAction_1;
- public static String FindDialog_1;
- public static String FindDialog_3;
- public static String FindAction_0;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, ActionMessages.class);
- }
-
- public static String AbstractDebugActionDelegate_0;
-
- public static String RetargetAddMemoryBlockAction_0;
- public static String RetargetAddMemoryBlockAction_1;
- public static String AddMemoryRenderingActionDelegate_0;
- public static String AddMemoryRenderingActionDelegate_1;
- public static String AddMemoryRenderingActionDelegate_2;
-
- public static String RulerEnableDisableBreakpointAction_0;
- public static String RulerEnableDisableBreakpointAction_1;
- public static String RulerEnableDisableBreakpointAction_2;
- public static String RulerEnableDisableBreakpointAction_3;
-
- public static String DisconnectAction_0;
- public static String DisconnectAction_3;
- public static String DropToFrameAction_0;
- public static String DropToFrameAction_3;
- public static String LaunchAction_0;
-
- public static String LaunchAction_1;
-
- public static String LaunchAction_2;
-
- public static String RestartCommandAction__text;
-
- public static String RestartCommandAction_tooltip;
-
- public static String ResumeAction_0;
- public static String ResumeAction_3;
- public static String StepIntoAction_0;
- public static String StepIntoAction_3;
- public static String StepOverAction_0;
- public static String StepOverAction_3;
- public static String StepReturnAction_2;
- public static String StepReturnAction_3;
- public static String SuspendAction_0;
- public static String SuspendAction_3;
- public static String TerminateAction_0;
- public static String TerminateAction_3;
- public static String TerminateAllAction_2;
- public static String TerminateAllAction_3;
-
- public static String DeleteWorkingsetsMessageDialog_0;
- public static String DeleteWorkingsetsMessageDialog_1;
-
- public static String ShowTypesAction_0;
-
- public static String VirtualFindAction_0;
-
- public static String VirtualFindAction_1;
-
- public static String ToggleBreakpointsTargetManager_defaultToggleTarget_name;
- public static String ToggleBreakpointsTargetManager_defaultToggleTarget_description;
-
- public static String NextThreadNavAction_name;
- public static String PreviousThreadNavAction_name;
-} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties
deleted file mode 100644
index 827e59d3e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties
+++ /dev/null
@@ -1,215 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2009 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-AddToFavoritesAction_1=Add to {0} &Favorites
-AddToFavoritesAction_2=Error
-AddToFavoritesAction_3=Unable to add to favorites.
-
-ChangeVariableValue_errorDialogMessage=Setting the value failed.
-ChangeVariableValue_errorDialogTitle=Setting Value
-ChangeVariableValue_title=&Change Value...
-ChangeVariableValue_toolTipText=Change the Value of the Selected Variable or Register
-ChangeVariableValue_1=Set Value
-ChangeVariableValue_2=Enter a new value for {0}:
-ChangeVariableValue_3=An exception occurred
-ChangeVariableValue_4=Invalid value
-
-
-CollapseAllAction_0=Collapse All
-
-CopyToClipboardActionDelegate_Problem_Copying_to_Clipboard_1=Problem Copying to Clipboard
-CopyToClipboardActionDelegate_There_was_a_problem_when_accessing_the_system_clipboard__Retry__2=There was a problem when accessing the system clipboard. Retry?
-
-EditLaunchConfigurationAction_1=Edit {0}...
-
-EnableBreakpointAction_Enable_breakpoint_s__failed_2=Enable/Disable breakpoint(s) failed
-EnableBreakpointAction_Enabling_breakpoints_3=Enabling/disabling breakpoints
-EnableBreakpointAction_Exceptions_occurred_enabling_the_breakpoint_s___4=Exceptions occurred enabling/disabling the breakpoint(s).
-
-OpenBreakpointMarkerAction__Go_to_File_1=&Go to File
-OpenBreakpointMarkerAction_Exceptions_occurred_attempting_to_open_the_editor_for_the_breakpoint_resource_2=Exceptions occurred attempting to open the editor for the breakpoint resource
-OpenBreakpointMarkerAction_Go_to_Breakpoint_1=Go to File
-OpenBreakpointMarkerAction_Go_to_File_for_Breakpoint_2=Go to File for Breakpoint
-
-RelaunchActionDelegate_An_exception_occurred_while_launching_2=An exception occurred while launching
-RelaunchActionDelegate_Launch_Failed_1=Launch Failed
-
-RemoveAllBreakpointsAction_0=Remove All Breakpoints
-RemoveAllBreakpointsAction_1=Are you sure you want to remove all breakpoints?
-RemoveAllBreakpointsAction_2=Remove Breakpoints
-RemoveAllBreakpointsAction_3=&Do not ask me again.
-RemoveAllExpressionsAction_0=Remove All Expressions
-RemoveAllExpressionsAction_1=Are you sure you want to remove all expressions?
-
-RemoveBreakpointAction_0=Delete Breakpoints
-RemoveBreakpointAction_1=Delete all breakpoints in the selected group(s)?
-RemoveBreakpointAction_2=Remove Breakpoints
-RemoveBreakpointAction_3=Remove Items
-RemoveBreakpointAction_4=Which item(s) would you like to remove?
-RemoveBreakpointAction_5=OK
-RemoveBreakpointAction_6=Cancel
-RemoveBreakpointAction_Exceptions_occurred_attempting_to_remove_a_breakpoint__5=An exception occurred attempting to remove breakpoint(s).
-RemoveBreakpointAction_Removing_a_breakpoint_4=Removing a breakpoint
-DeleteWorkingsetsMessageDialog_0=&Selected working set(s).
-DeleteWorkingsetsMessageDialog_1=&All breakpoints contained in selected working set(s).
-
-ShowSupportedBreakpointsAction_Show_For_Selected=Show Supported &Breakpoints
-ShowSupportedBreakpointsAction_tooltip=Show Breakpoints Supported by Selected Target
-
-ShowTypesAction_Show__Type_Names_1=Show &Type Names
-ShowTypesAction_Show_Type_Names=Show Type Names
-ShowTypesAction_0='Show Type Names' unavailable when columns are displayed.\nConfigure columns to display type names.
-
-RelaunchLastAction_Cannot_relaunch_1=Cannot relaunch
-RelaunchLastAction_Cannot_relaunch___0___because_it_does_not_support__2__mode_2=Cannot relaunch [{0}] because it does not support {1} mode
-RelaunchLastAction_Error_relaunching_3=Error relaunching
-RelaunchLastAction_Error_encountered_attempting_to_relaunch_4=Error encountered attempting to relaunch
-
-##
-# @see Bug 105733 TVT 3.1 - TCT 531 - Poor grammar in "Run Eclipse Application" and "Profile Eclipse Application"
-# - the following string is used to display the tooltip for run/debug/profile buttons and is
-# the concatenation of "{mode} {configuration name}", for example "Run HelloWorld". In some languages
-# this may need to be reversed to be translated properly.
-##
-AbstractLaunchHistoryAction_0={0} {1}
-AbstractLaunchHistoryAction_1=Run
-AbstractLaunchHistoryAction_2=Debug
-AbstractLaunchHistoryAction_3=Profile
-AbstractLaunchHistoryAction_4=Launch
-##
-# The following string is used to display the tooltip for run/debug/profile buttons in the
-# event there is no configuration name to concatenate (as mentioned for AbstractLaunchHistoryAction_0)
-# For example "Run" or "External Tools".
-##
-AbstractLaunchHistoryAction_5={0}
-AbstractLaunchHistoryAction_6=(no launch history)
-AbstractDebugActionDelegate_0=Error
-
-ToggleDetailPaneAction_1=Vertical
-ToggleDetailPaneAction_2=Place the Detail Pane Underneath the Main Tree View
-ToggleDetailPaneAction_3=Place the Detail Pane Underneath the Main Tree View
-ToggleDetailPaneAction_4=Horizontal
-ToggleDetailPaneAction_5=Place the Detail Pane on the Right of the Main Tree View
-ToggleDetailPaneAction_6=Place the Detail Pane on the Right of the Main Tree View
-ToggleDetailPaneAction_8=Hide the Detail Pane so that only the Main Tree View is Visible
-ToggleDetailPaneAction_9=Hide the Detail Pane so that only the Main Tree View is Visible
-ToggleBreakpointAction_0=Toggle Brea&kpoint
-ToggleBreakpointAction_1=Error
-ToggleBreakpointAction_2=Unable to toggle breakpoint
-
-ToggleStepFiltersAction_0=Use Step Filters
-ToggleStepFiltersAction_1=&Use Step Filters
-
-WatchExpressionDialog_0=Edit Watch Expression
-WatchExpressionDialog_1=Add Watch Expression
-WatchExpressionDialog_2=E&xpression:
-WatchExpressionDialog_3=&Enable
-WatchExpressionDialog_4=Expression must not be empty
-WatchExpressionDialogMenu_0=Cut
-WatchExpressionDialogMenu_1=Copy
-WatchExpressionDialogMenu_2=Paste
-WatchAction_0=Error creating watch
-WatchAction_1=An exception occurred while attempting to create watch item.
-SkipAllBreakpointsAction_0=Skip All Breakpoints
-SkipAllBreakpointsAction_2=Skip all breakpoints, whether they are enabled or not
-DetailPaneAssignValueAction_1=Assign Value
-DetailPaneAssignValueAction_2=Invalid Value
-DetailPaneAssignValueAction_3=The value {0} cannot be assigned to {1}
-DetailPaneAssignValueAction_4=Invalid Value
-DetailPaneAssignValueAction_0=Error Setting Value
-DetailPaneWordWrapAction_0=&Wrap Text
-DetailPaneMaxLengthAction_0=&Max Length...
-
-RunToLineAction_0=Error
-RunToLineAction_1=Run to line failed
-RunToLineHandler_0=Run To Line
-RunToLineActionDelegate_4=Run to &Line
-
-RetargetAction_2=Error
-RetargetAction_3=Operation failed
-ModifyWatchpointAction_0=Error
-ModifyWatchpointAction_1=Failed to modify watchpoint
-LaunchShortcutsAction_1=(none applicable)
-##
-# The following string is used to display launch histories using an integer mnemonic - i.e.
-# "{number} {configuration name}". For example "1 HelloWorld".
-##
-LaunchConfigurationAction_0=&{0} {1}
-FindDialog_1=&Specify an element to select (? = any character, * = any String):
-FindDialog_3=Find
-FindAction_0=&Find...
-RetargetAddMemoryBlockAction_0=Add Memory Monitor Failed.
-RetargetAddMemoryBlockAction_1=Unable to add memory monitor.
-RetargetRunToLineAction_0=The operation is unavailable on the current selection. Please place the cursor on valid line to run to.
-AddMemoryRenderingActionDelegate_0=Add Memory Rendering Failed
-AddMemoryRenderingActionDelegate_1=Unable to add the selected rendering.
-AddMemoryRenderingActionDelegate_2=Add Memory Rendering
-RulerEnableDisableBreakpointAction_0=Error
-RulerEnableDisableBreakpointAction_1=Failed to toggle breakpoint enablement
-RulerEnableDisableBreakpointAction_2=&Disable Breakpoint
-RulerEnableDisableBreakpointAction_3=&Enable Breakpoint
-TerminateAndRelaunchAction_0=org.eclipse.debug.ui.commands.TerminateAndRelaunch
-TerminateAndRelaunchAction_3=Terminate and Relaunch
-TerminateAndRelaunchAction_4=Terminate and Relaunch
-TerminateAndRemoveAction_0=Terminate and Remo&ve
-TerminateAndRemoveAction_3=Terminate and Remove
-TerminateAllAction_2=Termi&nate/Disconnect All
-TerminateAllAction_3=Terminate/Disconnect All
-TerminateAction_0=&Terminate
-TerminateAction_3=Terminate
-StepReturnAction_2=Step Return
-StepReturnAction_3=Step Ret&urn
-StepIntoAction_0=Step &Into
-StepIntoAction_3=Step Into
-StepOverAction_0=Step &Over
-StepOverAction_3=Step Over
-LaunchAction_0=Remove Configuration
-LaunchAction_1=Are you sure you want to remove {0} from the launch history?
-LaunchAction_2=&Do not ask me again.
-RestartCommandAction__text=Restart
-RestartCommandAction_tooltip=Restart
-ResumeAction_0=Resu&me
-ResumeAction_3=Resume
-DisconnectAction_0=Disconn&ect
-DisconnectAction_3=Disconnect
-DropToFrameAction_0=Drop To Frame
-DropToFrameAction_3=Drop To Frame
-SuspendAction_0=&Suspend
-SuspendAction_3=Suspend
-ConfigureColumnsAction_0=Select &Columns...
-ConfigureColumnsAction_1=Select the &columns to display:
-ConfigureColumnsAction_2=Select Columns
-PasteWatchExpressionsAction_0=&Paste
-ProfileLastAction_0=Profi&le Last Launched
-ProfileLastAction_1=Profi&le
-ProfileLastAction_2=Profile the selected resource or active editor
-ProfileLastAction_3=Profile the previously launched application
-DebugLastAction_0=&Debug Last Launched
-DebugLastAction_1=&Debug
-DebugLastAction_2=Debug the selected resource or active editor
-DebugLastAction_3=Debug the previously launched application
-RunLastAction_0=&Run Last Launched
-RunLastAction_1=&Run
-RunLastAction_2=Run the selected resource or active editor
-RunLastAction_3=Run the previously launched application
-##
-# The following string is used to display actions to open the launch dialog for
-# a specific mode - for example "Debug Configurations..."
-##
-OpenLaunchDialogAction_1={0} Configurations...
-VirtualFindAction_0=Error
-VirtualFindAction_1=Unable to locate {0} in viewer
-
-ToggleBreakpointsTargetManager_defaultToggleTarget_name = Default
-ToggleBreakpointsTargetManager_defaultToggleTarget_description = Default
-
-NextThreadNavAction_name=Ne&xt Thread
-PreviousThreadNavAction_name=Pre&vious Thread \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java
deleted file mode 100644
index df87bd40d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import com.ibm.icu.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.SelectionListenerAction;
-
-/**
- * Adds the selected launch configuration to the launch favorites.
- */
-public class AddToFavoritesAction extends SelectionListenerAction {
-
- private ILaunchConfiguration fConfiguration = null;
- private String fMode =null;
- private ILaunchGroup fGroup = null;
-
- /**
- * Constructs a new action.
- */
- public AddToFavoritesAction() {
- super(IInternalDebugCoreConstants.EMPTY_STRING);
- setEnabled(false);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.EDIT_LAUNCH_CONFIGURATION_ACTION);
- }
-
- /**
- * @see org.eclipse.ui.actions.SelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- setLaunchConfiguration(null);
- setMode(null);
- setGroup(null);
- if (selection.size() == 1) {
- Object object = selection.getFirstElement();
- ILaunch launch = null;
- if (object instanceof IAdaptable) {
- launch = (ILaunch)((IAdaptable)object).getAdapter(ILaunch.class);
- }
- if (launch == null) {
- if (object instanceof ILaunch) {
- launch = (ILaunch)object;
- } else if (object instanceof IDebugElement) {
- launch = ((IDebugElement)object).getLaunch();
- } else if (object instanceof IProcess) {
- launch = ((IProcess)object).getLaunch();
- }
- }
- if (launch != null) {
- ILaunchConfiguration configuration = launch.getLaunchConfiguration();
- if (configuration != null) {
- ILaunchGroup group= DebugUITools.getLaunchGroup(configuration, getMode());
- if (group == null) {
- return false;
- }
- setGroup(group);
- setLaunchConfiguration(configuration);
- setMode(launch.getLaunchMode());
- setText(MessageFormat.format(ActionMessages.AddToFavoritesAction_1, new String[]{DebugUIPlugin.removeAccelerators(getGroup().getLabel())}));
- }
- }
- }
-
- // Disable the action if the launch config is private
- ILaunchConfiguration config = getLaunchConfiguration();
- if (config == null) {
- return false;
- }
- if (DebugUITools.isPrivate(config)) {
- return false;
- }
-
- if (getGroup() != null) {
- try {
- List groups = config.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List)null);
- if (groups != null) {
- return !groups.contains(getGroup().getIdentifier());
- }
- return true;
- } catch (CoreException e) {
- }
-
- }
-
- return false;
- }
-
- /**
- * Allows the underlying <code>ILaunchConfiguration</code> to be set
- * @param configuration the new configuration to set
- */
- protected void setLaunchConfiguration(ILaunchConfiguration configuration) {
- fConfiguration = configuration;
- }
-
- /**
- * Returns the underlying <code>ILaunchConfiguration</code>
- * @return the underlying <code>ILaunchConfiguration</code>
- */
- protected ILaunchConfiguration getLaunchConfiguration() {
- return fConfiguration;
- }
-
- /**
- * Sets the mode this action applies to
- * @param mode the modes to set
- */
- protected void setMode(String mode) {
- fMode = mode;
- }
-
- /**
- * Returns the mode this action applies to
- * @return
- */
- protected String getMode() {
- return fMode;
- }
-
- /**
- * Sets the <code>ILaunchGroup</code> this action applies to
- * @param group the new <code>ILaunchGroup</code>
- */
- protected void setGroup(ILaunchGroup group) {
- fGroup = group;
- }
-
- /**
- * Returns the underlying <code>ILaunchGroup</code>
- * @return the underlying <code>ILaunchGroup</code>
- */
- protected ILaunchGroup getGroup() {
- return fGroup;
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- final CoreException[] ex = new CoreException[1];
- BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), new Runnable() {
- public void run() {
- try {
- List list = getLaunchConfiguration().getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List)null);
- if (list == null) {
- list = new ArrayList();
- }
- list.add(getGroup().getIdentifier());
- ILaunchConfigurationWorkingCopy copy = getLaunchConfiguration().getWorkingCopy();
- copy.setAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, list);
- copy.doSave();
- setEnabled(false);
- } catch (CoreException e) {
- ex[0] = e;
- }
- }
- });
- if (ex[0] != null) {
- DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), ActionMessages.AddToFavoritesAction_2, ActionMessages.AddToFavoritesAction_3, ex[0].getStatus()); //
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CollapseAllAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CollapseAllAction.java
deleted file mode 100644
index 8e90c65a4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CollapseAllAction.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.ui.handlers.CollapseAllHandler;
-
-/**
- * CollapseAllAction
- */
-public class CollapseAllAction extends Action {
-
- private TreeViewer fViewer;
-
- public CollapseAllAction(TreeViewer viewer) {
- super(ActionMessages.CollapseAllAction_0, DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_COLLAPSE_ALL));
- setToolTipText(ActionMessages.CollapseAllAction_0);
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_COLLAPSE_ALL));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_COLLAPSE_ALL));
- setActionDefinitionId(CollapseAllHandler.COMMAND_ID);
- fViewer = viewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- fViewer.collapseAll();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ConfigureColumnsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ConfigureColumnsAction.java
deleted file mode 100644
index 61161732c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ConfigureColumnsAction.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ListSelectionDialog;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * Configures visible columns in an asynch tree viewer/
- *
- * @since 3.2
- */
-public class ConfigureColumnsAction extends Action implements IUpdate {
-
- private TreeModelViewer fViewer;
-
- class ColumnContentProvider implements IStructuredContentProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object inputElement) {
- return ((IColumnPresentation)inputElement).getAvailableColumns();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- }
-
- class ColumnLabelProvider extends LabelProvider {
-
- private Map fImages = new HashMap();
-
- public Image getImage(Object element) {
- ImageDescriptor imageDescriptor = fViewer.getColumnPresentation().getImageDescriptor((String)element);
- if (imageDescriptor != null) {
- Image image = (Image) fImages.get(imageDescriptor);
- if (image == null) {
- image = imageDescriptor.createImage();
- fImages.put(imageDescriptor, image);
- }
- return image;
- }
- return null;
- }
-
- public String getText(Object element) {
- return fViewer.getColumnPresentation().getHeader((String)element);
- }
-
- public void dispose() {
- super.dispose();
- Iterator iterator = fImages.values().iterator();
- while (iterator.hasNext()) {
- Image image = (Image) iterator.next();
- image.dispose();
- }
- fImages.clear();
- }
-
-
-
- }
-
- public ConfigureColumnsAction(TreeModelViewer viewer) {
- setText(ActionMessages.ConfigureColumnsAction_0);
- setId(DebugUIPlugin.getUniqueIdentifier() + ".ConfigureColumnsAction"); //$NON-NLS-1$
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.CONFIGURE_COLUMNS_ACTION);
- fViewer = viewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
- public void update() {
- setEnabled(fViewer.isShowColumns());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- ListSelectionDialog dialog = new ListSelectionDialog(
- fViewer.getControl().getShell(),
- fViewer.getColumnPresentation(),
- new ColumnContentProvider(),
- new ColumnLabelProvider(),
- ActionMessages.ConfigureColumnsAction_1);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.CONFIGURE_COLUMNS_DIALOG);
- String[] visibleColumns = fViewer.getVisibleColumns();
- List initialSelection = new ArrayList(visibleColumns.length);
- for (int i = 0; i < visibleColumns.length; i++) {
- initialSelection.add(visibleColumns[i]);
- }
- dialog.setTitle(ActionMessages.ConfigureColumnsAction_2);
- dialog.setInitialElementSelections(initialSelection);
- if (dialog.open() == Window.OK) {
- Object[] result = dialog.getResult();
- if (result.length == 0) {
- fViewer.setShowColumns(false);
- } else {
- String[] ids = new String[result.length];
- System.arraycopy(result, 0, ids, 0, result.length);
- fViewer.resetColumnSizes(ids);
- fViewer.setVisibleColumns(ids);
- }
- }
-
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugAsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugAsAction.java
deleted file mode 100644
index 9a870f6be..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugAsAction.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.actions.LaunchShortcutsAction;
-
-/**
- * "Debug As" action in the top level "Run" menu.
- */
-public class DebugAsAction extends LaunchShortcutsAction {
-
- public DebugAsAction() {
- super(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugContextualLaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugContextualLaunchAction.java
deleted file mode 100644
index d114aabbd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugContextualLaunchAction.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.ui.actions.ContextualLaunchAction;
-
-/**
- * Specialization of <code>ContextualLaunchAction</code> for the debug mode
- *
- * @see {@link ContextualLaunchAction}
- */
-public class DebugContextualLaunchAction extends ContextualLaunchAction {
-
- /**
- * Constructor
- */
- public DebugContextualLaunchAction() {
- super(ILaunchManager.DEBUG_MODE);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugHistoryMenuAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugHistoryMenuAction.java
deleted file mode 100644
index 496a5e344..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugHistoryMenuAction.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction;
-
-/**
- * Debug history menu in the top-level "Run" menu.
- */
-public class DebugHistoryMenuAction extends AbstractLaunchHistoryAction {
-
- public DebugHistoryMenuAction() {
- super(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugLastAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugLastAction.java
deleted file mode 100644
index 0dbd235bc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugLastAction.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Relaunches the last debug-mode launch
- *
- * This menu item appears in the main 'Run' menu
- *
- * @see RelaunchLastAction
- * @see RunLastAction
- * @see ProfileLastAction
- */
-public class DebugLastAction extends RelaunchLastAction {
-
- /**
- * @see RelaunchLastAction#getMode()
- */
- public String getMode() {
- return ILaunchManager.DEBUG_MODE;
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.actions.LaunchDropDownAction#getLaunchGroupId()
- */
- public String getLaunchGroupId() {
- return IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP;
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getText()
- */
- protected String getText() {
- if(LaunchingResourceManager.isContextLaunchEnabled()) {
- return ActionMessages.DebugLastAction_1;
- }
- else {
- return ActionMessages.DebugLastAction_0;
- }
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getTooltipText()
- */
- protected String getTooltipText() {
- return IInternalDebugCoreConstants.EMPTY_STRING;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getCommandId()
- */
- protected String getCommandId() {
- return "org.eclipse.debug.ui.commands.DebugLast"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getDescription()
- */
- protected String getDescription() {
- if(LaunchingResourceManager.isContextLaunchEnabled()) {
- return ActionMessages.DebugLastAction_2;
- }
- else {
- return ActionMessages.DebugLastAction_3;
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugToolbarAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugToolbarAction.java
deleted file mode 100644
index 6e8152fc0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugToolbarAction.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.actions.AbstractLaunchToolbarAction;
-
-/**
- * Debug drop-down history/favorites action.
- */
-public class DebugToolbarAction extends AbstractLaunchToolbarAction {
-
- public DebugToolbarAction() {
- super(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EditLaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EditLaunchConfigurationAction.java
deleted file mode 100644
index 8edf58c1a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EditLaunchConfigurationAction.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import com.ibm.icu.text.MessageFormat;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.SelectionListenerAction;
-
-/**
- * Opens the launch configuration dialog on a single launch configuration, based
- * on the the launch associated with the selected element.
- */
-public class EditLaunchConfigurationAction extends SelectionListenerAction {
-
- private ILaunchConfiguration fConfiguration = null;
- private String fMode = null;
- private boolean fTerminated = false;
-
- /**
- * Constructs a new action.
- */
- public EditLaunchConfigurationAction() {
- super(IInternalDebugCoreConstants.EMPTY_STRING);
- setEnabled(false);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.EDIT_LAUNCH_CONFIGURATION_ACTION);
- }
-
- /**
- * @see org.eclipse.ui.actions.SelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- setLaunchConfiguration(null);
- setMode(null);
- if (selection.size() == 1) {
- Object object = selection.getFirstElement();
- ILaunch launch = null;
- if (object instanceof IAdaptable) {
- launch = (ILaunch)((IAdaptable)object).getAdapter(ILaunch.class);
- }
- if (launch == null) {
- if (object instanceof ILaunch) {
- launch = (ILaunch)object;
- } else if (object instanceof IDebugElement) {
- launch = ((IDebugElement)object).getLaunch();
- } else if (object instanceof IProcess) {
- launch = ((IProcess)object).getLaunch();
- }
- }
- if (launch != null) {
- ILaunchConfiguration configuration = launch.getLaunchConfiguration();
- if (configuration != null) {
- try {
- // The DebugUIPlugin creates stand-in launches with copied configurations
- // while a launch is waiting for a build. These copied configurations
- // have an attribute that points to the config that the user is really
- // launching.
- String underlyingHandle = configuration.getAttribute(DebugUIPlugin.ATTR_LAUNCHING_CONFIG_HANDLE, IInternalDebugCoreConstants.EMPTY_STRING);
- if (underlyingHandle.length() > 0) {
- ILaunchConfiguration underlyingConfig = DebugPlugin.getDefault().getLaunchManager().getLaunchConfiguration(underlyingHandle);
- if (underlyingConfig != null) {
- configuration = underlyingConfig;
- }
- }
- } catch (CoreException e1) {
- }
- setLaunchConfiguration(configuration);
- setMode(launch.getLaunchMode());
- setIsTerminated(launch.isTerminated());
- setText(MessageFormat.format(ActionMessages.EditLaunchConfigurationAction_1, new String[]{configuration.getName()}));
- ImageDescriptor descriptor = null;
- try {
- descriptor = DebugPluginImages.getImageDescriptor(configuration.getType().getIdentifier());
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- setImageDescriptor(descriptor);
- }
- }
- }
-
- // Disable the action if the launch config is private
- ILaunchConfiguration config = getLaunchConfiguration();
- if (config == null) {
- return false;
- }
- return !DebugUITools.isPrivate(config);
- }
-
- protected void setLaunchConfiguration(ILaunchConfiguration configuration) {
- fConfiguration = configuration;
- }
-
- protected ILaunchConfiguration getLaunchConfiguration() {
- return fConfiguration;
- }
-
- protected void setMode(String mode) {
- fMode = mode;
- }
-
- protected String getMode() {
- return fMode;
- }
-
- protected boolean isTerminated() {
- return fTerminated;
- }
-
- protected void setIsTerminated(boolean terminated) {
- fTerminated = terminated;
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- ILaunchGroup group = DebugUITools.getLaunchGroup(getLaunchConfiguration(), getMode());
- if (group != null) {
- if(isTerminated()) {
- DebugUITools.openLaunchConfigurationDialog(
- DebugUIPlugin.getShell(), getLaunchConfiguration(),
- group.getIdentifier(), null);
- }
- else {
- DebugUIPlugin.openLaunchConfigurationEditDialog(
- DebugUIPlugin.getShell(), getLaunchConfiguration(),
- group.getIdentifier(), null, false);
- }
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ExecutionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ExecutionAction.java
deleted file mode 100644
index 8ffc08db5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ExecutionAction.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * This is the super class of the Run & Debug actions which appears in the desktop menu and toolbar.
- */
-public abstract class ExecutionAction implements IActionDelegate2 {
-
- private String fLaunchGroupIdentifier;
-
- public ExecutionAction(String launchGroupIdentifier) {
- fLaunchGroupIdentifier = launchGroupIdentifier;
- }
-
- /**
- * @see IActionDelegate2#runWithEvent(IAction, Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- /**
- * Open the launch configuration dialog, passing in the current workbench selection.
- */
- private void openLaunchConfigurationDialog() {
- IWorkbenchWindow dwindow= DebugUIPlugin.getActiveWorkbenchWindow();
- if (dwindow == null) {
- return;
- }
- DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUIPlugin.getShell(), new StructuredSelection(), fLaunchGroupIdentifier);
- }
-
- protected LaunchConfigurationManager getLaunchConfigurationManager() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager();
- }
-
- /**
- * Returns the mode of a launcher to use for this action
- */
- protected abstract String getMode();
-
- /**
- * @see org.eclipse.ui.IActionDelegate2#dispose()
- */
- public void dispose() {
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- ILaunchConfiguration configuration = getLaunchConfigurationManager().getLastLaunch(fLaunchGroupIdentifier);
- if (configuration == null) {
- openLaunchConfigurationDialog();
- } else {
- DebugUITools.launch(configuration, getMode());
- }
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/IToggleBreakpointsTargetManagerListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/IToggleBreakpointsTargetManagerListener.java
deleted file mode 100644
index ba0ca5f40..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/IToggleBreakpointsTargetManagerListener.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-/**
- * Listener for changes in the preferred toggle targets in the toggle
- * breakpoints target manager. This interface allows toggle breakpoint
- * actions to update their enablement when the user changes the preferred
- * toggle target settings.
- *
- * @see ToggleBreakpointsTargetManager
- * @see IToggleBreakpointsTargetFactory
- * @since 3.5
- */
-public interface IToggleBreakpointsTargetManagerListener {
-
- /**
- * Called when the preferred toggle targets have changed.
- */
- public void preferredTargetsChanged();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchConfigurationAction.java
deleted file mode 100644
index 2eb957e54..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchConfigurationAction.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Event;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * This class provides an action wrapper for adding launch configuration actions to the context menu
- * of the Run->... menu item
- *
- * @since 3.3
- */
-public class LaunchConfigurationAction extends Action {
-
- private ILaunchConfiguration fConfig;
- private String fMode;
-
- /**
- * Constructor
- * @param mode
- * @param text the text for the action
- * @param image the image for the action
- */
- public LaunchConfigurationAction(ILaunchConfiguration config, String mode, String text, ImageDescriptor image, int accelerator) {
- super(MessageFormat.format(ActionMessages.LaunchConfigurationAction_0, new String[] {Integer.toString(accelerator), text}), image);
- fConfig = config;
- fMode = mode;
- }
-
- /**
- * Allows access to the launch configuration associated with the action
- * @return the associated launch configuration
- */
- public ILaunchConfiguration getLaunchConfiguration() {
- return fConfig;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- DebugUITools.launch(fConfig, fMode);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#runWithEvent(org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(Event event) {
- if ((event.stateMask & SWT.MOD1) > 0) {
- try {
- ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(fConfig.getType(), fMode);
- if(group != null) {
- DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUIPlugin.getShell(), new StructuredSelection(fConfig), group.getIdentifier());
- }
- else {
- run();
- }
- }
- catch(CoreException ce) {}
- }
- else {
- run();
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchShortcutAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchShortcutAction.java
deleted file mode 100644
index 77946cf41..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchShortcutAction.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.expressions.EvaluationContext;
-import org.eclipse.core.expressions.Expression;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension;
-import org.eclipse.debug.internal.ui.stringsubstitution.SelectedResourceManager;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * Launch shortcut action (proxy to a launch shortcut extension)
- */
-public class LaunchShortcutAction extends Action {
-
- private String fMode;
- private LaunchShortcutExtension fShortcut;
-
- /**
- * Constructor
- * @param groupid the id of the launch group
- * @param mode the mode to launch in
- * @param shortcut the underlying shortcut
- */
- public LaunchShortcutAction(String mode, LaunchShortcutExtension shortcut) {
- super(shortcut.getLabel(), shortcut.getImageDescriptor());
- fShortcut = shortcut;
- fMode = mode;
- updateEnablement();
- }
-
- /**
- * Runs with either the active editor or workbench selection.
- *
- * @see IAction#run()
- */
- public void run() {
- IStructuredSelection ss = SelectedResourceManager.getDefault().getCurrentSelection();
- Object o = ss.getFirstElement();
- if(o instanceof IEditorPart) {
- fShortcut.launch((IEditorPart) o, fMode);
- }
- else {
- fShortcut.launch(ss, fMode);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#runWithEvent(org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(Event event) {
- if ((event.stateMask & SWT.MOD1) > 0) {
- Set types = fShortcut.getAssociatedConfigurationTypes();
- if(!types.isEmpty()) {
- LaunchingResourceManager lrm = DebugUIPlugin.getDefault().getLaunchingResourceManager();
- IStructuredSelection selection = SelectedResourceManager.getDefault().getCurrentSelection();
- ArrayList shortcuts = new ArrayList();
- shortcuts.add(fShortcut);
- IResource resource = SelectedResourceManager.getDefault().getSelectedResource();
- if(resource == null) {
- resource = lrm.getLaunchableResource(shortcuts, selection);
- }
- List configs = lrm.getParticipatingLaunchConfigurations(selection, resource, shortcuts, fMode);
- LaunchConfigurationManager lcm = DebugUIPlugin.getDefault().getLaunchConfigurationManager();
- ILaunchConfigurationType type = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType((String) types.toArray()[0]);
- String groupid = null;
- ILaunchGroup group = lcm.getLaunchGroup(type, fMode);
- if(group != null) {
- groupid = group.getIdentifier();
- }
- ILaunchConfiguration config = lcm.getMRUConfiguration(configs, group, resource);
- if(config == null) {
- if(configs.size() > 0) {
- config = (ILaunchConfiguration) configs.get(0);
- }
- }
- if(config != null) {
- selection = new StructuredSelection(config);
- }
- else {
- if(type != null) {
- selection = new StructuredSelection(type);
- }
- }
- DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUIPlugin.getShell(), selection, groupid);
- }
- else {
- run();
- }
- }
- else {
- run();
- }
- }
-
- /**
- * Since these actions are re-created each time the run/debug as menu is
- * filled, the enablement of this action is static.
- */
- private void updateEnablement() {
- boolean enabled = false;
- IStructuredSelection ss = SelectedResourceManager.getDefault().getCurrentSelection();
- Object o = ss.getFirstElement();
- if(o instanceof IEditorPart) {
- enabled = true;
- }
- else {
- try {
- // check enablement logic, if any
- Expression expression = fShortcut.getShortcutEnablementExpression();
- if (expression == null) {
- enabled = !ss.isEmpty();
- } else {
- List list = ss.toList();
- IEvaluationContext context = new EvaluationContext(null, list);
- context.addVariable("selection", list); //$NON-NLS-1$
- enabled = fShortcut.evalEnablementExpression(context, expression);
- }
- } catch (CoreException e) {}
- }
- setEnabled(enabled);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchablePropertyTester.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchablePropertyTester.java
deleted file mode 100644
index 6a28f7d3f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchablePropertyTester.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.ui.actions.ILaunchable;
-
-/**
- * Tests if an object is launchable.
- */
-public class LaunchablePropertyTester extends PropertyTester {
-
- /**
- * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
- */
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if ("launchable".equals(property)) { //$NON-NLS-1$
- if (DebugUIPlugin.getDefault().getLaunchConfigurationManager().launchModeAvailable((String)expectedValue)) {
- return Platform.getAdapterManager().hasAdapter(receiver, ILaunchable.class.getName());
- }
- }
- if("contextlaunch".equals(property)) { //$NON-NLS-1$
- if(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_USE_CONTEXTUAL_LAUNCH)) {
- IResource res = getResource(receiver);
- if(res != null) {
- return res.isAccessible() && getLaunchConfigurationManager().getLaunchShortcuts(getResource(receiver)).size() > 0 && getLaunchConfigurationManager().isSharedConfig(receiver) == null;
- }
- return false;
- }
- }
- return false;
- }
-
- /**
- * Returns the launch configuration manager
- * @return the launch configuration manager
- */
- protected LaunchConfigurationManager getLaunchConfigurationManager() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager();
- }
-
- /**
- * Returns the resource this property page is open on.
- *
- * @return resource
- */
- protected IResource getResource(Object element) {
- IResource resource = null;
- if (element instanceof IResource) {
- resource = (IResource) element;
- } else if (element instanceof IAdaptable) {
- resource = (IResource) ((IAdaptable)element).getAdapter(IResource.class);
- }
- return resource;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenDebugConfigurations.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenDebugConfigurations.java
deleted file mode 100644
index 4445eee01..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenDebugConfigurations.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.actions.OpenLaunchDialogAction;
-
-/**
- * Opens the launch config dialog on the debug launch group.
- */
-public class OpenDebugConfigurations extends OpenLaunchDialogAction {
-
- public OpenDebugConfigurations() {
- super(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenProfileConfigurations.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenProfileConfigurations.java
deleted file mode 100644
index 51e62eefe..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenProfileConfigurations.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.actions.OpenLaunchDialogAction;
-
-/**
- * Opens the launch config dialog on the run launch group.
- */
-public class OpenProfileConfigurations extends OpenLaunchDialogAction {
-
- public OpenProfileConfigurations() {
- super(IDebugUIConstants.ID_PROFILE_LAUNCH_GROUP);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenRunConfigurations.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenRunConfigurations.java
deleted file mode 100644
index b84d91291..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/OpenRunConfigurations.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.actions.OpenLaunchDialogAction;
-
-/**
- * Opens the launch config dialog on the run launch group.
- */
-public class OpenRunConfigurations extends OpenLaunchDialogAction {
-
- public OpenRunConfigurations() {
- super(IDebugUIConstants.ID_RUN_LAUNCH_GROUP);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileAsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileAsAction.java
deleted file mode 100644
index 321d03cfa..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileAsAction.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.actions.LaunchShortcutsAction;
-
-/**
- * "Profile As" action in the top level "Run" menu.
- */
-public class ProfileAsAction extends LaunchShortcutsAction {
-
- public ProfileAsAction() {
- super(IDebugUIConstants.ID_PROFILE_LAUNCH_GROUP);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileContextualLaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileContextualLaunchAction.java
deleted file mode 100644
index 257eee5d1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileContextualLaunchAction.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.ui.actions.ContextualLaunchAction;
-
-/**
- * Specialization of <code>ContextualLaunchAction</code> for the profile mode
- *
- * @see {@link ContextualLaunchAction}
- */
-public class ProfileContextualLaunchAction extends ContextualLaunchAction {
-
- /**
- * Constructor
- */
- public ProfileContextualLaunchAction() {
- super(ILaunchManager.PROFILE_MODE);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileHistoryMenuAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileHistoryMenuAction.java
deleted file mode 100644
index 317ae7a64..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileHistoryMenuAction.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction;
-
-/**
- * Profile history menu in the top-level "Run" menu.
- */
-public class ProfileHistoryMenuAction extends AbstractLaunchHistoryAction {
-
- public ProfileHistoryMenuAction() {
- super(IDebugUIConstants.ID_PROFILE_LAUNCH_GROUP);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileLastAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileLastAction.java
deleted file mode 100644
index 66f14d815..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileLastAction.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Relaunches the last profile-mode launch
- *
- * This menu item appears in the main 'Run' menu
- *
- * @see RelaunchLastAction
- * @see RunLastAction
- * @see DebugLastAction
- *
- */
-public class ProfileLastAction extends RelaunchLastAction {
-
- /**
- * @see RelaunchLastAction#getMode()
- */
- public String getMode() {
- return ILaunchManager.PROFILE_MODE;
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.actions.LaunchDropDownAction#getLaunchGroupId()
- */
- public String getLaunchGroupId() {
- return IDebugUIConstants.ID_PROFILE_LAUNCH_GROUP;
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getText()
- */
- protected String getText() {
- if(LaunchingResourceManager.isContextLaunchEnabled()) {
- return ActionMessages.ProfileLastAction_1;
- }
- else {
- return ActionMessages.ProfileLastAction_0;
- }
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getTooltipText()
- */
- protected String getTooltipText() {
- return IInternalDebugCoreConstants.EMPTY_STRING;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getCommandId()
- */
- protected String getCommandId() {
- return "org.eclipse.debug.ui.commands.ProfileLast"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getDescription()
- */
- protected String getDescription() {
- if(LaunchingResourceManager.isContextLaunchEnabled()) {
- return ActionMessages.ProfileLastAction_2;
- }
- else {
- return ActionMessages.ProfileLastAction_3;
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileToolbarAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileToolbarAction.java
deleted file mode 100644
index 469f8fdbc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileToolbarAction.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.actions.AbstractLaunchToolbarAction;
-
-/**
- * Profile drop-down history/favorites action.
- */
-public class ProfileToolbarAction extends AbstractLaunchToolbarAction {
-
- public ProfileToolbarAction() {
- super(IDebugUIConstants.ID_PROFILE_LAUNCH_GROUP);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchActionDelegate.java
deleted file mode 100644
index ca18fc06b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchActionDelegate.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-public class RelaunchActionDelegate extends AbstractDebugActionDelegate {
-
- /**
- * @see AbstractDebugActionDelegate#doAction(Object)
- */
- protected void doAction(Object object) {
- ILaunch launch= DebugUIPlugin.getLaunch(object);
- if (launch != null) {
- relaunch(launch.getLaunchConfiguration(), launch.getLaunchMode());
- }
- }
-
- /**
- * Re-launches the given configuration in the specified mode.
- */
- public static void relaunch(ILaunchConfiguration config, String mode) {
- DebugUITools.launch(config, mode);
- }
-
- /**
- * @see AbstractDebugActionDelegate#isEnabledFor(Object)
- */
- protected boolean isEnabledFor(Object element) {
- ILaunch launch= DebugUIPlugin.getLaunch(element);
- return launch != null && launch.getLaunchConfiguration() != null && LaunchConfigurationManager.isVisible(launch.getLaunchConfiguration());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate#getTargetSelection(org.eclipse.jface.viewers.IStructuredSelection)
- */
- protected IStructuredSelection getTargetSelection(IStructuredSelection s) {
- if (s.isEmpty()) {
- return s;
- }
- Set dups = new LinkedHashSet();
- Iterator iterator = s.iterator();
- while (iterator.hasNext()) {
- Object object = iterator.next();
- ILaunch launch = DebugUIPlugin.getLaunch(object);
- if (launch == null) {
- return s;
- }
- dups.add(launch);
- }
- return new StructuredSelection(dups.toArray());
- }
-
- /**
- * @see AbstractDebugActionDelegate#getErrorDialogMessage()
- */
- protected String getErrorDialogMessage() {
- return ActionMessages.RelaunchActionDelegate_Launch_Failed_1;
- }
-
- /**
- * @see AbstractDebugActionDelegate#getStatusMessage()
- */
- protected String getStatusMessage() {
- return ActionMessages.RelaunchActionDelegate_An_exception_occurred_while_launching_2;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchLastAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchLastAction.java
deleted file mode 100644
index e257f4975..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchLastAction.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.core.commands.Command;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
-import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.contextlaunching.ContextRunner;
-import org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.commands.ICommandService;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Relaunches the last launch.
- *
- * @see ContextRunner
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager
- * @see ILaunchConfiguration
- * @see RunLastAction
- * @see DebugLastAction
- * @see ProfileLastAction
- *
- */
-public abstract class RelaunchLastAction implements IWorkbenchWindowActionDelegate, IPropertyChangeListener {
-
- private IWorkbenchWindow fWorkbenchWindow;
-
- private IAction fAction;
-
- /**
- * @see IWorkbenchWindowActionDelegate
- */
- public void dispose(){
- DebugUIPlugin.getDefault().getPluginPreferences().removePropertyChangeListener(this);
- }
-
- /**
- * @see IWorkbenchWindowActionDelegate
- */
- public void init(IWorkbenchWindow window){
- fWorkbenchWindow = window;
- DebugUIPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(this);
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action){
- if(LaunchingResourceManager.isContextLaunchEnabled()) {
- ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(getLaunchGroupId());
- ContextRunner.getDefault().launch(group);
- return;
- }
- try {
- final ILaunchConfiguration configuration = getLastLaunch();
- if (configuration != null) {
- if (configuration.supportsMode(getMode())) {
- DebugUITools.launch(configuration, getMode());
- } else {
- String configName = configuration.getName();
- String title = ActionMessages.RelaunchLastAction_Cannot_relaunch_1;
- String message = MessageFormat.format(ActionMessages.RelaunchLastAction_Cannot_relaunch___0___because_it_does_not_support__2__mode_2, new String[] {configName, getMode()});
- MessageDialog.openError(getShell(), title, message);
- }
- } else {
- // If the history is empty, just open the launch config dialog
- openLaunchConfigurationDialog();
- }
- } catch (CoreException ce) {
- DebugUIPlugin.errorDialog(getShell(), ActionMessages.RelaunchLastAction_Error_relaunching_3, ActionMessages.RelaunchLastAction_Error_encountered_attempting_to_relaunch_4, ce); //
- }
- }
-
- /**
- * Open the launch configuration dialog, passing in the current workbench selection.
- */
- private void openLaunchConfigurationDialog() {
- IWorkbenchWindow dwindow= DebugUIPlugin.getActiveWorkbenchWindow();
- if (dwindow == null) {
- return;
- }
- LaunchConfigurationsDialog dialog = new LaunchConfigurationsDialog(DebugUIPlugin.getShell(), DebugUIPlugin.getDefault().getLaunchConfigurationManager().getDefaultLaunchGroup(getMode()));
- dialog.setOpenMode(LaunchConfigurationsDialog.LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_LAST_LAUNCHED);
- dialog.open();
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection){
- if (fAction == null) {
- initialize(action);
- }
- }
-
- /**
- * Set the enabled state of the underlying action based on whether there are any
- * registered launch configuration types that understand how to launch in the
- * mode of this action.
- */
- private void initialize(IAction action) {
- fAction = action;
- if(fAction != null) {
- fAction.setEnabled(existsConfigTypesForMode());
- fAction.setText(getText());
- fAction.setToolTipText(getTooltipText());
- String commandId = getCommandId();
- ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
- if (service != null) {
- Command command = service.getCommand(commandId);
- command.undefine();
- command = service.getCommand(commandId);
- command.define(DebugUIPlugin.removeAccelerators(getText()), getDescription(), service.getCategory("org.eclipse.debug.ui.category.run")); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * Return whether there are any registered launch configuration types for
- * the mode of this action.
- *
- * @return whether there are any registered launch configuration types for
- * the mode of this action
- */
- private boolean existsConfigTypesForMode() {
- ILaunchConfigurationType[] configTypes = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes();
- for (int i = 0; i < configTypes.length; i++) {
- ILaunchConfigurationType configType = configTypes[i];
- if (configType.supportsMode(getMode())) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return the last launch that occurred in the workspace.
- */
- protected ILaunchConfiguration getLastLaunch() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getFilteredLastLaunch(getLaunchGroupId());
- }
-
- /**
- * Returns the parent shell for this menu item
- * @return the parent shell
- */
- protected Shell getShell() {
- return fWorkbenchWindow.getShell();
- }
-
- /**
- * @see org.eclipse.core.runtime.Preferences$IPropertyChangeListener#propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if(event.getProperty().equals(IInternalDebugUIConstants.PREF_USE_CONTEXTUAL_LAUNCH)) {
- initialize(fAction);
- }
- }
-
- /**
- * Returns the mode (run or debug) of this action.
- */
- public abstract String getMode();
-
- /**
- * Returns the launch group id of this action.
- */
- public abstract String getLaunchGroupId();
-
- /**
- * Returns the text to display on the menu item.
- * @return the text for the menu item
- *
- * @since 3.3
- */
- protected abstract String getText();
-
- /**
- * Returns the text to display in the menu item tooltip
- * @return the text for the tooltip
- *
- * @since 3.3
- */
- protected abstract String getTooltipText();
-
- /**
- * Returns the command id this action is associated with.
- *
- * @return command id
- * @since 3.3
- */
- protected abstract String getCommandId();
-
- /**
- * Returns a description for this action (to associate with command).
- *
- * @return command description
- * @since 3.3
- */
- protected abstract String getDescription();
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java
deleted file mode 100644
index 70a349337..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.ILaunchesListener2;
-import org.eclipse.jface.action.IAction;
-
-/**
- * Removes all terminated/detached launches from the
- * active debug view.
- */
-public class RemoveAllTerminatedAction extends AbstractRemoveAllActionDelegate implements ILaunchesListener2 {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#isEnabled()
- */
- protected boolean isEnabled() {
- ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
- if (launches != null) {
- for (int i= 0; i < launches.length; i++) {
- if (launches[i].isTerminated()) {
- return true;
- }
- }
- }
- return false;
- }
-
- public static void removeTerminatedLaunches(ILaunch[] elements) {
- List removed = new ArrayList();
- for (int i = 0; i < elements.length; i++) {
- ILaunch launch = elements[i];
- if (launch.isTerminated()) {
- removed.add(launch);
- }
- }
- if (!removed.isEmpty()) {
- ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
- manager.removeLaunches((ILaunch[])removed.toArray(new ILaunch[removed.size()]));
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#initialize()
- */
- protected void initialize() {
- DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#dispose()
- */
- public void dispose() {
- super.dispose();
- DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesAdded(ILaunch[] launches) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesChanged(ILaunch[] launches) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesRemoved(ILaunch[] launches) {
- IAction action = getAction();
- if (action != null) {
- if (action.isEnabled()) {
- update();
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesTerminated(ILaunch[] launches) {
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
- removeTerminatedLaunches(launches);
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetAction.java
deleted file mode 100644
index 2c79569a1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetAction.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - added support for IToggleBreakpointsTargetFactory
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IAdapterManager;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IPartService;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-/**
- * Global retargettable debug action.
- *
- * @since 3.0
- */
-public abstract class RetargetAction implements IWorkbenchWindowActionDelegate, IPartListener, IActionDelegate2 {
-
- protected IWorkbenchWindow fWindow = null;
- private IWorkbenchPart fActivePart = null;
- private Object fTargetAdapter = null;
- private IAction fAction = null;
- private static final ISelection EMPTY_SELECTION = new EmptySelection();
-
- static class EmptySelection implements ISelection {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelection#isEmpty()
- */
- public boolean isEmpty() {
- return true;
- }
- }
-
- /**
- * Returns the current selection in the active part, possibly
- * and empty selection, but never <code>null</code>.
- *
- * @return the selection in the active part, possibly empty
- */
- protected ISelection getTargetSelection() {
- if (fActivePart != null) {
- ISelectionProvider selectionProvider = fActivePart.getSite().getSelectionProvider();
- if (selectionProvider != null) {
- return selectionProvider.getSelection();
- }
- }
- return EMPTY_SELECTION;
- }
-
- protected IWorkbenchPart getActivePart() {
- return fActivePart;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {
- fWindow.getPartService().removePartListener(this);
- fActivePart = null;
- fTargetAdapter = null;
-
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
- this.fWindow = window;
- IPartService partService = window.getPartService();
- partService.addPartListener(this);
- IWorkbenchPart part = partService.getActivePart();
- if (part != null) {
- partActivated(part);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- if (fTargetAdapter != null) {
- try {
- if (isTargetEnabled()) {
- performAction(fTargetAdapter, getTargetSelection(), fActivePart);
- } else {
- String message = getOperationUnavailableMessage();
- IStatus status = new Status(IStatus.INFO, DebugUIPlugin.getUniqueIdentifier(), message);
- DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), DebugUIPlugin.removeAccelerators(action.getText()), message, status);
- }
- } catch (CoreException e) {
- DebugUIPlugin.errorDialog(fWindow.getShell(), ActionMessages.RetargetAction_2, ActionMessages.RetargetAction_3, e.getStatus()); //
- }
- }
- }
-
- /**
- * Returns a message to display when we find that the operation is not enabled
- * when invoked in an editor (we check enabled state before running in this case,
- * rather than updating on each selection change - see bug 180441).
- *
- * @return information message when unavailable
- */
- protected abstract String getOperationUnavailableMessage();
-
- /**
- * Performs the specific breakpoint toggling.
- *
- * @param selection selection in the active part
- * @param part active part
- * @throws CoreException if an exception occurs
- */
- protected abstract void performAction(Object target, ISelection selection, IWorkbenchPart part) throws CoreException;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- // if the active part did not provide an adapter, see if the selection does
- if (fTargetAdapter == null && selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- if (!ss.isEmpty()) {
- Object object = ss.getFirstElement();
- if (object instanceof IAdaptable) {
- fTargetAdapter = getAdapter((IAdaptable) object);
- }
- }
- }
- boolean enabled = fTargetAdapter != null;
- if (selection instanceof IStructuredSelection) {
- enabled = isTargetEnabled();
- }
- action.setEnabled(enabled);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener#partActivated(org.eclipse.ui.IWorkbenchPart)
- */
- public void partActivated(IWorkbenchPart part) {
- fActivePart = part;
- IResource resource = (IResource) part.getAdapter(IResource.class);
- if (resource == null && part instanceof IEditorPart) {
- resource = (IResource) ((IEditorPart)part).getEditorInput().getAdapter(IResource.class);
- }
- if (resource != null) {
- fTargetAdapter = getAdapter(resource);
- }
- if (fTargetAdapter == null) {
- fTargetAdapter = getAdapter(part);
- }
- if (fAction != null) {
- fAction.setEnabled(fTargetAdapter != null);
- }
- }
-
- protected Object getAdapter(IAdaptable adaptable) {
- Object adapter = adaptable.getAdapter(getAdapterClass());
- if (adapter == null) {
- IAdapterManager adapterManager = Platform.getAdapterManager();
- if (adapterManager.hasAdapter(adaptable, getAdapterClass().getName())) {
- adapter = adapterManager.loadAdapter(adaptable, getAdapterClass().getName());
- }
- }
- return adapter;
- }
-
- /**
- * Returns the type of adapter (target) this action works on.
- *
- * @return the type of adapter this action works on
- */
- protected abstract Class getAdapterClass();
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener#partBroughtToTop(org.eclipse.ui.IWorkbenchPart)
- */
- public void partBroughtToTop(IWorkbenchPart part) {
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener#partClosed(org.eclipse.ui.IWorkbenchPart)
- */
- public void partClosed(IWorkbenchPart part) {
- clearPart(part);
- }
-
- /**
- * Clears reference to active part and adapter when a relevant part
- * is closed or no longer active.
- *
- * @param part workbench part that has been closed or no longer active
- */
- protected void clearPart(IWorkbenchPart part) {
- if (part.equals(fActivePart)) {
- fActivePart = null;
- fTargetAdapter = null;
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener#partDeactivated(org.eclipse.ui.IWorkbenchPart)
- */
- public void partDeactivated(IWorkbenchPart part) {
- clearPart(part);
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener#partOpened(org.eclipse.ui.IWorkbenchPart)
- */
- public void partOpened(IWorkbenchPart part) {
- }
-
- /**
- * Returns whether the target adapter is enabled
- *
- * @return whether target adapter is enabled
- */
- protected boolean isTargetEnabled() {
- if (fTargetAdapter != null) {
- if (fActivePart != null) {
- return canPerformAction(fTargetAdapter, getTargetSelection(), fActivePart);
- }
- }
- return false;
- }
-
- /**
- * Returns whether the specific operation is supported.
- *
- * @param target the target adapter
- * @param selection the selection to verify the operation on
- * @param part the part the operation has been requested on
- * @return whether the operation can be performed
- */
- protected abstract boolean canPerformAction(Object target, ISelection selection, IWorkbenchPart part);
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- fAction = action;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- /**
- * Returns the proxy to this action delegate or <code>null</code>
- *
- * @return action proxy or <code>null</code>
- */
- protected IAction getAction() {
- return fAction;
- }
-
- /**
- * Returns whether there is currently a target adapter for this action.
- *
- * @return whether the action has a target adapter.
- */
- protected boolean hasTargetAdapter() {
- return fTargetAdapter != null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetRunToLineAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetRunToLineAction.java
deleted file mode 100644
index d62459817..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetRunToLineAction.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River - Pawel Piech - Added use of adapters to support non-standard models (bug 213074)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.ISuspendResume;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.actions.IRunToLineTarget;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextService;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * Global retargettable run to line action.
- *
- * @since 3.0
- */
-public class RetargetRunToLineAction extends RetargetAction {
-
- private DebugContextListener fContextListener = new DebugContextListener();
- private ISuspendResume fTargetElement = null;
-
- class DebugContextListener implements IDebugContextListener {
-
- protected void contextActivated(ISelection selection) {
- fTargetElement = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- if (ss.size() == 1) {
- fTargetElement = (ISuspendResume)
- DebugPlugin.getAdapter(ss.getFirstElement(), ISuspendResume.class);
- }
- }
- IAction action = getAction();
- if (action != null) {
- action.setEnabled(fTargetElement != null && hasTargetAdapter());
- }
- }
-
- public void debugContextChanged(DebugContextEvent event) {
- contextActivated(event.getContext());
- }
-
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {
- DebugUITools.getDebugContextManager().getContextService(fWindow).removeDebugContextListener(fContextListener);
- super.dispose();
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
- super.init(window);
- IDebugContextService service = DebugUITools.getDebugContextManager().getContextService(window);
- service.addDebugContextListener(fContextListener);
- ISelection activeContext = service.getActiveContext();
- fContextListener.contextActivated(activeContext);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RetargetAction#canPerformAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
- */
- protected boolean canPerformAction(Object target, ISelection selection, IWorkbenchPart part) {
- return fTargetElement != null &&
- ((IRunToLineTarget)target).canRunToLine(part, selection, fTargetElement);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RetargetAction#getAdapterClass()
- */
- protected Class getAdapterClass() {
- return IRunToLineTarget.class;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RetargetAction#performAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
- */
- protected void performAction(Object target, ISelection selection, IWorkbenchPart part) throws CoreException {
- ((IRunToLineTarget)target).runToLine(part, selection, fTargetElement);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RetargetAction#getOperationUnavailableMessage()
- */
- protected String getOperationUnavailableMessage() {
- return ActionMessages.RetargetRunToLineAction_0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- if (fTargetElement == null) {
- action.setEnabled(false);
- } else {
- super.selectionChanged(action, selection);
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunAsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunAsAction.java
deleted file mode 100644
index efbd37503..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunAsAction.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.actions.LaunchShortcutsAction;
-
-/**
- * "Run As" action in the top level "Run" menu.
- */
-public class RunAsAction extends LaunchShortcutsAction {
-
- public RunAsAction() {
- super(IDebugUIConstants.ID_RUN_LAUNCH_GROUP);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunContextualLaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunContextualLaunchAction.java
deleted file mode 100644
index 25b996484..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunContextualLaunchAction.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.ui.actions.ContextualLaunchAction;
-
-/**
- * Specialization of <code>ContextualLaunchAction</code> for the run mode
- *
- * @see {@link ContextualLaunchAction}
- */
-public class RunContextualLaunchAction extends ContextualLaunchAction {
-
- /**
- * Constructor
- */
- public RunContextualLaunchAction() {
- super(ILaunchManager.RUN_MODE);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunHistoryMenuAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunHistoryMenuAction.java
deleted file mode 100644
index fedfecc8e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunHistoryMenuAction.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction;
-
-/**
- * Run history menu in the top-level "Run" menu.
- */
-public class RunHistoryMenuAction extends AbstractLaunchHistoryAction {
-
- public RunHistoryMenuAction() {
- super(IDebugUIConstants.ID_RUN_LAUNCH_GROUP);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunLastAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunLastAction.java
deleted file mode 100644
index 17fa319a1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunLastAction.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Relaunches the last run-mode launch
- *
- * This menu item appears in the main 'Run' menu
- *
- * @see RelaunchLastAction
- * @see DebugLastAction
- * @see ProfileLastAction
- */
-public class RunLastAction extends RelaunchLastAction {
-
- /**
- * @see RelaunchLastAction#getMode()
- */
- public String getMode() {
- return ILaunchManager.RUN_MODE;
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.actions.LaunchDropDownAction#getLaunchGroupId()
- */
- public String getLaunchGroupId() {
- return IDebugUIConstants.ID_RUN_LAUNCH_GROUP;
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getText()
- */
- protected String getText() {
- if(LaunchingResourceManager.isContextLaunchEnabled()) {
- return ActionMessages.RunLastAction_1;
- }
- else {
- return ActionMessages.RunLastAction_0;
- }
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getTooltipText()
- */
- protected String getTooltipText() {
- return IInternalDebugCoreConstants.EMPTY_STRING;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getCommandId()
- */
- protected String getCommandId() {
- return "org.eclipse.debug.ui.commands.RunLast"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getDescription()
- */
- protected String getDescription() {
- if(LaunchingResourceManager.isContextLaunchEnabled()) {
- return ActionMessages.RunLastAction_2;
- }
- else {
- return ActionMessages.RunLastAction_3;
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunToolbarAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunToolbarAction.java
deleted file mode 100644
index 353cc1927..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunToolbarAction.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.actions.AbstractLaunchToolbarAction;
-
-/**
- * Run drop-down history/favorites action.
- */
-public class RunToolbarAction extends AbstractLaunchToolbarAction {
-
- public RunToolbarAction() {
- super(IDebugUIConstants.ID_RUN_LAUNCH_GROUP);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java
deleted file mode 100644
index 466aa55e7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.debug.ui.IDebugView;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.IViewPart;
-
-public abstract class SelectAllAction extends AbstractRemoveAllActionDelegate {
-
- private IViewPart fView;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.selection.AbstractSelectionActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- fView = view;
- IDebugView debugView = (IDebugView) getView().getAdapter(IDebugView.class);
- if (debugView != null) {
- debugView.setAction(getActionId(), getAction());
- }
- super.init(view);
- }
-
- protected IViewPart getView() {
- return fView;
- }
-
- protected abstract String getActionId();
-
- private void collectExpandedAndVisible(TreeItem[] items, List result) {
- for (int i= 0; i < items.length; i++) {
- TreeItem item= items[i];
- result.add(item);
- if (item.getExpanded()) {
- collectExpandedAndVisible(item.getItems(), result);
- }
- }
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action){
- if (!(getView() instanceof IDebugView)) {
- return;
- }
- Viewer viewer = ((IDebugView) getView()).getViewer();
- if (viewer instanceof TreeViewer) {
- ArrayList allVisible= new ArrayList();
- Tree tree= ((TreeViewer) viewer).getTree();
- collectExpandedAndVisible(tree.getItems(), allVisible);
- tree.setSelection((TreeItem[]) allVisible.toArray(new TreeItem[allVisible.size()]));
- // force viewer selection change
- viewer.setSelection(viewer.getSelection());
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StatusInfo.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StatusInfo.java
deleted file mode 100644
index 6263e6d98..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StatusInfo.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-
-/**
- * A settable IStatus.
- * Can be an error, warning, info or ok. For error, info and warning states,
- * a message describes the problem.
- */
-public class StatusInfo implements IStatus {
-
- private String fStatusMessage;
- private int fSeverity;
-
- /**
- * Creates a status set to OK (no message)
- */
- public StatusInfo() {
- this(OK, null);
- }
-
- /**
- * Creates a status .
- * @param severity The status severity: ERROR, WARNING, INFO and OK.
- * @param message The message of the status. Applies only for ERROR,
- * WARNING and INFO.
- */
- public StatusInfo(int severity, String message) {
- fStatusMessage= message;
- fSeverity= severity;
- }
-
- /**
- * Returns if the status' severity is OK.
- */
- public boolean isOK() {
- return fSeverity == IStatus.OK;
- }
-
- /**
- * Returns if the status' severity is WARNING.
- */
- public boolean isWarning() {
- return fSeverity == IStatus.WARNING;
- }
-
- /**
- * Returns if the status' severity is INFO.
- */
- public boolean isInfo() {
- return fSeverity == IStatus.INFO;
- }
-
- /**
- * Returns if the status' severity is ERROR.
- */
- public boolean isError() {
- return fSeverity == IStatus.ERROR;
- }
-
- /**
- * @see IStatus#getMessage
- */
- public String getMessage() {
- return fStatusMessage;
- }
-
- /**
- * Sets the status to ERROR.
- * @param The error message (can be empty, but not null)
- */
- public void setError(String errorMessage) {
- Assert.isNotNull(errorMessage);
- fStatusMessage= errorMessage;
- fSeverity= IStatus.ERROR;
- }
-
- /**
- * Sets the status to WARNING.
- * @param The warning message (can be empty, but not null)
- */
- public void setWarning(String warningMessage) {
- Assert.isNotNull(warningMessage);
- fStatusMessage= warningMessage;
- fSeverity= IStatus.WARNING;
- }
-
- /**
- * Sets the status to INFO.
- * @param The info message (can be empty, but not null)
- */
- public void setInfo(String infoMessage) {
- Assert.isNotNull(infoMessage);
- fStatusMessage= infoMessage;
- fSeverity= IStatus.INFO;
- }
-
- /**
- * Sets the status to OK.
- */
- public void setOK() {
- fStatusMessage= null;
- fSeverity= IStatus.OK;
- }
-
- /*
- * @see IStatus#matches(int)
- */
- public boolean matches(int severityMask) {
- return (fSeverity & severityMask) != 0;
- }
-
- /**
- * Returns always <code>false</code>.
- * @see IStatus#isMultiStatus()
- */
- public boolean isMultiStatus() {
- return false;
- }
-
- /*
- * @see IStatus#getSeverity()
- */
- public int getSeverity() {
- return fSeverity;
- }
-
- /*
- * @see IStatus#getPlugin()
- */
- public String getPlugin() {
- return DebugUIPlugin.getUniqueIdentifier();
- }
-
- /**
- * Returns always <code>null</code>.
- * @see IStatus#getException()
- */
- public Throwable getException() {
- return null;
- }
-
- /**
- * Returns always the error severity.
- * @see IStatus#getCode()
- */
- public int getCode() {
- return fSeverity;
- }
-
- /**
- * Returns always <code>null</code>.
- * @see IStatus#getChildren()
- */
- public IStatus[] getChildren() {
- return new IStatus[0];
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java
deleted file mode 100644
index 8bd624fb1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java
+++ /dev/null
@@ -1,724 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - adapted to use with IToggleBreakpiontsTargetFactory extension
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.Map.Entry;
-
-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.ExpressionTagNames;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IAdapterManager;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.internal.core.IConfigurationElementConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
-import org.eclipse.debug.ui.actions.IToggleBreakpointsTargetFactory;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.services.IEvaluationService;
-
-/**
- * Organizes the toggle breakpoints target factories contributed through the
- * extension point and keeps track of the toggle breakpoints target that
- * the factories produce. The manager is accessed as a singleton through
- * the <code>getDefault()</code> method.
- * <p>
- * The adapter mechanism for obtaining a toggle breakpoints target is
- * still supported through a specialized toggle target factory. Targets
- * contributed through this mechanism are labeled as "Default" in the UI.
- * </p>
- *
- * @see IToggleBreakpointsTargetFactory
- * @see IToggleBreakpointsTarget
- * @see IToggleBreakpointsTargetExtension
- * @since 3.5
- */
-public class ToggleBreakpointsTargetManager {
-
- /**
- * Toggle breakpoints target ID which refers to a target contributed
- * through the legacy adapter mechanism.
- */
- public static String DEFAULT_TOGGLE_TARGET_ID = "default"; //$NON-NLS-1$
-
- private static Set DEFAULT_TOGGLE_TARGET_ID_SET = new HashSet();
- static {
- DEFAULT_TOGGLE_TARGET_ID_SET.add(DEFAULT_TOGGLE_TARGET_ID);
- }
-
- /**
- * Acts as a proxy between the toggle breakpoints target manager and the factories
- * contributed to the extension point. Only loads information from the plug-in xml
- * and only instantiates the specified factory if required (lazy loading).
- */
- private static class ToggleTargetFactory implements IToggleBreakpointsTargetFactory {
-
- private IConfigurationElement fConfigElement;
- private IToggleBreakpointsTargetFactory fFactory;
- private Expression fEnablementExpression;
-
- public ToggleTargetFactory(IConfigurationElement configElement){
- fConfigElement = configElement;
- }
-
- /**
- * Returns the instantiated factory specified by the class property.
- */
- private IToggleBreakpointsTargetFactory getFactory() {
- if (fFactory != null) return fFactory;
- try{
- Object obj = fConfigElement.createExecutableExtension(IConfigurationElementConstants.CLASS);
- if(obj instanceof IToggleBreakpointsTargetFactory) {
- fFactory = (IToggleBreakpointsTargetFactory)obj;
- } else {
- throw new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR, "org.eclipse.debug.ui.toggleBreakpointsTargetFactories extension failed to load breakpoint toggle target because the specified class does not implement org.eclipse.debug.ui.actions.IToggleBreakpointsTargetFactory. Class specified was: " + obj, null)); //$NON-NLS-1$
- }
- } catch (CoreException e){
- DebugUIPlugin.log(e.getStatus());
- fFactory = null;
- }
- return fFactory;
- }
-
- /**
- * Checks if the enablement expression for the factory evaluates to true for the
- * given part and selection.
- */
- public boolean isEnabled(IWorkbenchPart part, ISelection selection) {
- boolean enabled = false;
- Expression expression = getEnablementExpression();
- if (expression != null) {
- enabled = evalEnablementExpression(part, selection, expression);
- } else {
- enabled = true;
- }
- return enabled;
- }
-
- /**
- * Returns the active debug context given the active part. It is used
- * in creating the evaluation context for the factories' enablement expression.
- * @param part active part
- * @return current active debug context
- */
- private IStructuredSelection getDebugContext(IWorkbenchPart part) {
- ISelection selection = DebugUITools.getDebugContextManager().
- getContextService(part.getSite().getWorkbenchWindow()).getActiveContext();
- if (selection instanceof IStructuredSelection) {
- return (IStructuredSelection)selection;
- }
- return StructuredSelection.EMPTY;
- }
-
- /**
- * Evaluate the given expression within the given context and return
- * the result. Returns <code>true</code> iff result is either TRUE.
- *
- * @param exp the enablement expression to evaluate or <code>null</code>
- * @param context the context of the evaluation. Usually, the
- * user's selection.
- * @return the result of evaluating the expression
- */
- private boolean evalEnablementExpression(IWorkbenchPart part, ISelection selection, Expression exp) {
- if (exp != null){
- IEvaluationContext parentContext = null;
- IEvaluationService evaluationService = (IEvaluationService)PlatformUI.getWorkbench().getService(IEvaluationService.class);
- if (evaluationService != null) {
- parentContext = evaluationService.getCurrentState();
- }
- IEvaluationContext context = new EvaluationContext(parentContext, part);
-
- List debugContextList = getDebugContext(part).toList();
- context.addVariable(IConfigurationElementConstants.DEBUG_CONTEXT, debugContextList);
-
- if (selection instanceof IStructuredSelection) {
- List selectionList = ((IStructuredSelection)selection).toList();
- context.addVariable(IConfigurationElementConstants.SELECTION, selectionList);
- }
-
- if (part instanceof IEditorPart) {
- context.addVariable(IConfigurationElementConstants.EDITOR_INPUT, ((IEditorPart)part).getEditorInput());
- }
-
- try{
- EvaluationResult result = exp.evaluate(context);
- if (result == EvaluationResult.TRUE){
- return true;
- }
- } catch (CoreException e){
- // Evaluation failed
- }
- }
- return false;
- }
-
- /**
- * Returns an expression that represents the enablement logic for the
- * breakpiont toggle target.
- */
- private Expression getEnablementExpression(){
- if (fEnablementExpression == null) {
- try{
- IConfigurationElement[] elements = fConfigElement.getChildren(ExpressionTagNames.ENABLEMENT);
- IConfigurationElement enablement = elements.length > 0 ? elements[0] : null;
- if (enablement != null) {
- fEnablementExpression = ExpressionConverter.getDefault().perform(enablement);
- }
- } catch (CoreException e){
- DebugUIPlugin.log(e.getStatus());
- fEnablementExpression = null;
- }
- }
- return fEnablementExpression;
- }
-
- /**
- * Instantiates the factory and asks it to produce the IToggleBreakpointsTarget
- * for the given ID
- */
- public IToggleBreakpointsTarget createToggleTarget(String targetID) {
- IToggleBreakpointsTargetFactory factory = getFactory();
- if (factory != null) {
- return factory.createToggleTarget(targetID);
- }
- return null;
- }
-
- /**
- * Instantiates the factory and asks it for the set of toggle target
- * IDs that the factory can produce for the given part and selection.
- */
- public Set getToggleTargets(IWorkbenchPart part, ISelection selection) {
- IToggleBreakpointsTargetFactory factory = getFactory();
- if (factory != null) {
- return factory.getToggleTargets(part, selection);
- }
- return Collections.EMPTY_SET;
- }
-
- /**
- * Instantiates the factory and asks it to produce the name of the toggle target
- * for the given ID.
- */
- public String getToggleTargetName(String targetID) {
- IToggleBreakpointsTargetFactory factory = getFactory();
- if (factory != null) {
- return factory.getToggleTargetName(targetID);
- }
- return null;
- }
-
- /**
- * Instantiates the factory and asks it to produce the description of the toggle
- * target for the given ID.
- */
- public String getToggleTargetDescription(String targetID) {
- IToggleBreakpointsTargetFactory factory = getFactory();
- if (factory != null) {
- return factory.getToggleTargetDescription(targetID);
- }
- return null;
- }
-
- /**
- * Instantiates the factory and asks it for the toggle tareget ID that
- * the factory considers the default for the given part and selection.
- */
- public String getDefaultToggleTarget(IWorkbenchPart part, ISelection selection) {
- IToggleBreakpointsTargetFactory factory = getFactory();
- if (factory != null) {
- return factory.getDefaultToggleTarget(part, selection);
- }
- return null;
- }
- }
-
-
- /**
- * Factory for toggle breakpoints targets contributed through the
- * adapter mechanism.
- */
- private static class ToggleBreakpointsTargetAdapterFactory implements IToggleBreakpointsTargetFactory {
-
- private IAdaptable getAdaptable(IWorkbenchPart part, ISelection selection) {
- IAdaptable adaptable = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection)selection;
- if (ss.getFirstElement() instanceof IAdaptable) {
- adaptable = (IAdaptable) ss.getFirstElement();
- }
- } else {
- adaptable = part;
- }
- return adaptable;
- }
-
- private boolean canGetToggleBreakpointsTarget(IAdaptable adaptable) {
- if (adaptable != null) {
- IToggleBreakpointsTarget adapter = (IToggleBreakpointsTarget)
- adaptable.getAdapter(IToggleBreakpointsTarget.class);
- if (adapter == null) {
- IAdapterManager adapterManager = Platform.getAdapterManager();
- if (adapterManager.hasAdapter(adaptable, IToggleBreakpointsTarget.class.getName())) {
- return true;
- }
- } else {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Finds the toggle breakpoints target for the active part and selection.
- * It first looks for the target using the factories registered using an
- * extension point. If not found it uses the <code>IAdaptable</code>
- * mechanism.
- * @param part active part
- * @param selection active selection in part
- * @return The toggle breakpoints target, or <code>null</code> if not found.
- */
- private IToggleBreakpointsTarget getToggleBreakpointsTarget(IAdaptable adaptable) {
- if (adaptable != null) {
- IToggleBreakpointsTarget adapter = (IToggleBreakpointsTarget)
- adaptable.getAdapter(IToggleBreakpointsTarget.class);
- if (adapter == null) {
- // attempt to force load adapter
- IAdapterManager adapterManager = Platform.getAdapterManager();
- if (adapterManager.hasAdapter(adaptable, IToggleBreakpointsTarget.class.getName())) {
- adapter = (IToggleBreakpointsTarget)
- adapterManager.loadAdapter(adaptable, IToggleBreakpointsTarget.class.getName());
- }
- }
- return adapter;
- }
- return null;
- }
-
- /**
- * Checks if there is an adaptable object for the given part and
- * selection, and if there is, it checks whether an
- * <code>IToggleBreakpointsTarget</code> can be obtained as an adapter.
- */
- public boolean isEnabled(IWorkbenchPart part, ISelection selection) {
- IAdaptable adaptable = getAdaptable(part, selection);
- return adaptable != null && canGetToggleBreakpointsTarget(adaptable);
- }
-
- /**
- * Not implemented use {@link #createDefaultToggleTarget(IWorkbenchPart, ISelection)}
- * instead.
- */
- public IToggleBreakpointsTarget createToggleTarget(String targetID) {
- return null;
- }
-
- /**
- * Returns a toggle target for the given part and selection, obtained
- * through the adapter mechanism.
- */
- public IToggleBreakpointsTarget createDefaultToggleTarget(IWorkbenchPart part, ISelection selection) {
- IAdaptable adaptable = getAdaptable(part, selection);
- return getToggleBreakpointsTarget(adaptable);
- }
-
- public Set getToggleTargets(IWorkbenchPart part, ISelection selection) {
- IAdaptable adaptable = getAdaptable(part, selection);
- if (canGetToggleBreakpointsTarget(adaptable)) {
- return DEFAULT_TOGGLE_TARGET_ID_SET;
- }
- return Collections.EMPTY_SET;
- }
-
- public String getToggleTargetName(String targetID) {
- return ActionMessages.ToggleBreakpointsTargetManager_defaultToggleTarget_name;
- }
-
- public String getToggleTargetDescription(String targetID) {
- return ActionMessages.ToggleBreakpointsTargetManager_defaultToggleTarget_description;
- }
-
- public String getDefaultToggleTarget(IWorkbenchPart part, ISelection selection) {
- return DEFAULT_TOGGLE_TARGET_ID;
- }
- }
-
-
- /**
- * Preference key for storing the preferred targets map.
- * @see {@link #storePreferredTargets()}
- * @see {@link #loadPreferredTargets()}
- */
- public static final String PREF_TARGETS = "preferredTargets"; //$NON-NLS-1$
-
-
- /**
- * There should only ever be once instance of this manager for the workbench.
- */
- private static ToggleBreakpointsTargetManager fgSingleton;
-
- public static ToggleBreakpointsTargetManager getDefault(){
- if (fgSingleton == null) fgSingleton = new ToggleBreakpointsTargetManager();
- return fgSingleton;
- }
-
- /**
- * Maps the IDs of toggle breakpoint targets to their instances. The target
- * IDs must be unique.
- */
- private Map fKnownFactories;
-
- /**
- * Maps a Set of target id's to the one target id that is preferred.
- */
- private Map fPreferredTargets;
-
- /**
- * Maps the IDs of toggle targets to the factory that can create them.
- * There can currently only be one factory for a given toggle target.
- */
- private Map fFactoriesByTargetID = new HashMap();
-
- /**
- * List of listeners to changes in the preferred toggle targets list.
- */
- private ListenerList fChangedListners = new ListenerList();
-
- /**
- * Initializes the collection of known factories from extension point contributions.
- */
- private void initializeFactories() {
- fKnownFactories = new LinkedHashMap();
- fKnownFactories.put(DEFAULT_TOGGLE_TARGET_ID, new ToggleBreakpointsTargetAdapterFactory());
- IExtensionPoint ep = Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_TOGGLE_BREAKPOINTS_TARGET_FACTORIES);
- IConfigurationElement[] elements = ep.getConfigurationElements();
- for (int i= 0; i < elements.length; i++) {
- String id = elements[i].getAttribute(IConfigurationElementConstants.ID);
- if (id != null && id.length() != 0) {
- if (fKnownFactories.containsKey(id)) {
- DebugUIPlugin.log(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR, "org.eclipse.debug.ui.toggleBreakpointsTargetFactory extension failed to load breakpoint toggle target because the specified id is already registered. Specified ID is: " + id, null)); //$NON-NLS-1$
- } else {
- fKnownFactories.put(id, new ToggleTargetFactory(elements[i]));
- }
- } else {
- DebugUIPlugin.log(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR, "org.eclipse.debug.ui.toggleBreakpointsTargetFactory extension failed to load breakpoint toggle target because the specified id is empty.", null)); //$NON-NLS-1$
- }
- }
-
- // If there are any factories contributed through the extension point,
- // set a system property for use in enabling actions.
- System.setProperty(IDebugUIConstants.SYS_PROP_BREAKPOINT_TOGGLE_FACTORIES_USED,
- fKnownFactories.size() > 1 ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Returns the set of IToggleBreakpointsTargetFactory objects (they will be
- * ToggleTargetFactory) that were contributed to the extension point and
- * are enabled for the given part and selection (enabled if the factory
- * does not have an enablement expression or if the enablement expression
- * evaluates to true).
- *
- * @param part active part
- * @param selection active selection in part
- * @return The factories enabled for the part and selection or an empty
- * collection.
- */
- private Set getEnabledFactories(IWorkbenchPart part, ISelection selection) {
- if (fKnownFactories == null) initializeFactories();
-
- Set set = new LinkedHashSet();
- for (Iterator itr = fKnownFactories.keySet().iterator(); itr.hasNext(); ) {
- String id = (String)itr.next();
- IToggleBreakpointsTargetFactory factory = (IToggleBreakpointsTargetFactory)fKnownFactories.get(id);
- if (factory instanceof ToggleTargetFactory &&
- ((ToggleTargetFactory)factory).isEnabled(part, selection)) {
- set.add(factory);
- } else if (factory instanceof ToggleBreakpointsTargetAdapterFactory &&
- ((ToggleBreakpointsTargetAdapterFactory)factory).isEnabled(part, selection)) {
- set.add(factory);
- }
- }
- return set;
- }
-
- /**
- * Produces the set of IDs for all possible toggle targets that can be used for
- * the given part and selection.
- *
- * @param factoriesToQuery The collection of factories to check
- * @param part active part
- * @param selection active selection in part
- * @return Set of toggle target IDs or an empty set
- */
- private Set getEnabledTargetIDs(Collection factoriesToQuery, IWorkbenchPart part, ISelection selection){
- Set idsForSelection = new LinkedHashSet();
- Iterator factoriesItr = factoriesToQuery.iterator();
- while (factoriesItr.hasNext()) {
- IToggleBreakpointsTargetFactory factory = (IToggleBreakpointsTargetFactory) factoriesItr.next();
- Iterator targetIDsItr = factory.getToggleTargets(part, selection).iterator();
- while (targetIDsItr.hasNext()) {
- String targetID = (String) targetIDsItr.next();
- fFactoriesByTargetID.put(targetID, factory);
- idsForSelection.add(targetID);
- }
- }
- return idsForSelection;
- }
-
- /**
- * Returns the set of <code>String</code> IDs of toggle breakpoint targets,
- * which are enabled for the given active part and selection. The IDs can be used
- * to create the {@link IToggleBreakpointsTarget} instance.
- * @param part active part
- * @param selection active selection in part
- * @return Set of toggle target IDs or an empty set
- */
- public Set getEnabledToggleBreakpointsTargetIDs(IWorkbenchPart part, ISelection selection) {
- return getEnabledTargetIDs(getEnabledFactories(part, selection), part, selection);
- }
-
- /**
- * Returns the ID of the calculated preferred toggle breakpoints target for the
- * given active part and selection. The returned ID is chosen based on factory
- * enablement, whether the target is a default one, and on user choice.
- * @param part active part
- * @param selection active selection in part
- * @return The toggle target IDs or null if none.
- */
- public String getPreferredToggleBreakpointsTargetID(IWorkbenchPart part, ISelection selection) {
- Set factories = getEnabledFactories(part, selection);
- Set possibleIDs = getEnabledTargetIDs(factories, part, selection);
- return chooseToggleTargetIDInSet(possibleIDs, factories, part, selection);
- }
-
- /**
- * Given the ID of toggle breakpoint target, this method will try to find the factory
- * that creates it and return an instance of it.
- *
- * @param ID The ID of the requested toggle breakpoint target.
- * @return The instantiated target or null
- */
- public IToggleBreakpointsTarget getToggleBreakpointsTarget(IWorkbenchPart part, ISelection selection) {
- String id = getPreferredToggleBreakpointsTargetID(part, selection);
- IToggleBreakpointsTargetFactory factory = (IToggleBreakpointsTargetFactory)fFactoriesByTargetID.get(id);
- if (factory != null) {
- if (DEFAULT_TOGGLE_TARGET_ID.equals(id)) {
- return ((ToggleBreakpointsTargetAdapterFactory)factory).createDefaultToggleTarget(part, selection);
- } else {
- return factory.createToggleTarget(id);
- }
- }
- return null;
- }
-
- /**
- * Given the ID of a toggle breakpoints target, this method will try
- * to find the factory that creates it and ask it for the name of it.
- *
- * @param ID The ID of the requested toggle breakpoint target.
- * @return The name of the target.
- */
- public String getToggleBreakpointsTargetName(String id) {
- IToggleBreakpointsTargetFactory factory = (IToggleBreakpointsTargetFactory)fFactoriesByTargetID.get(id);
- if (factory != null) {
- return factory.getToggleTargetName(id);
- }
- return null;
- }
-
- /**
- * Given the ID of a toggle breakpoints target, this method will try
- * to find the factory that creates it and ask it for the description of it.
- *
- * @param ID The ID of the requested toggle breakpoint target.
- * @return The description of the target or null.
- */
- public String getToggleBreakpointsTargetDescription(String id) {
- IToggleBreakpointsTargetFactory factory = (IToggleBreakpointsTargetFactory)fFactoriesByTargetID.get(id);
- if (factory != null) {
- return factory.getToggleTargetDescription(id);
- }
- return null;
- }
-
- /**
- * Adds the given listener to the list of listeners notified when the preferred
- * toggle breakpoints targets change.
- * @param listener The listener to add.
- */
- public void addChangedListener(IToggleBreakpointsTargetManagerListener listener) {
- fChangedListners.add(listener);
- }
-
- /**
- * Removes the given listener from the list of listeners notified when the preferred
- * toggle breakpoints targets change.
- * @param listener The listener to add.
- */
- public void removeChangedListener(IToggleBreakpointsTargetManagerListener listener) {
- fChangedListners.remove(listener);
- }
-
- /**
- * Stores the map of preferred target IDs to the preference store in the format:
- *
- * Key1A,Key1B:Value1|Key2A,Key2B,Key2C:Value2|
- *
- * Where the sub keys (Key1A, Key1B, etc.) are the elements of the set used at the
- * key in the mapping and the values are the associated String value in the mapping.
- */
- private void storePreferredTargets() {
- StringBuffer buffer= new StringBuffer();
- Iterator iter = fPreferredTargets.entrySet().iterator();
- while (iter.hasNext()) {
- Entry entry = (Entry) iter.next();
- Iterator setIter = ((Set)entry.getKey()).iterator();
- while (setIter.hasNext()) {
- String currentID = (String) setIter.next();
- buffer.append(currentID);
- buffer.append(',');
- }
- buffer.deleteCharAt(buffer.length()-1);
- buffer.append(':');
- buffer.append(entry.getValue());
- buffer.append('|');
- }
- DebugUIPlugin.getDefault().getPluginPreferences().setValue(PREF_TARGETS, buffer.toString());
- }
-
- /**
- * Loads the map of preferred target IDs from the preference store.
- *
- * @see #storePreferredTargets()
- */
- private void loadPreferredTargets() {
- fPreferredTargets = new HashMap();
- String preferenceValue = DebugUIPlugin.getDefault().getPluginPreferences().getString(PREF_TARGETS);
- StringTokenizer entryTokenizer = new StringTokenizer(preferenceValue,"|"); //$NON-NLS-1$
- while (entryTokenizer.hasMoreTokens()){
- String token = entryTokenizer.nextToken();
- int valueStart = token.indexOf(':');
- StringTokenizer keyTokenizer = new StringTokenizer(token.substring(0,valueStart),","); //$NON-NLS-1$
- Set keys = new LinkedHashSet();
- while (keyTokenizer.hasMoreTokens()){
- keys.add(keyTokenizer.nextToken());
- }
- fPreferredTargets.put(keys, token.substring(valueStart+1));
- }
- }
-
- /**
- * Adds or updates the mapping to set which target ID is preferred for a certain
- * set of possible IDs.
- *
- * @param possibleIDs The set of possible IDs
- * @param preferredID The preferred ID in the set.
- */
- public void setPreferredTarget(Set possibleIDs, String preferredID) {
- if (possibleIDs == null) return;
-
- if (fKnownFactories == null) initializeFactories();
-
- if (fPreferredTargets == null){
- loadPreferredTargets();
- }
- String currentKey = (String)fPreferredTargets.get(possibleIDs);
- if (currentKey == null || !currentKey.equals(preferredID)){
- fPreferredTargets.put(possibleIDs, preferredID);
- storePreferredTargets();
- firePreferredTargetsChanged();
- }
- }
-
- /**
- * Returns the preferred pane ID from the given set if the mapping has been set.
- *
- * @param possibleDetailsAreaIDs Set of possible pane IDs
- * @return The preferred ID or null
- */
- private String getUserPreferredTarget(Set possibleTargetIDs){
- if (fPreferredTargets == null){
- loadPreferredTargets();
- }
- return (String)fPreferredTargets.get(possibleTargetIDs);
- }
-
- /**
- * Given a set of possible detail pane IDs, this method will determine which pane is
- * preferred and should be used to display the selection. This method chooses a pane
- * by storing previous choices and can be set using a context menu.
- *
- * @param possiblePaneIDs The set of possible detail pane IDs
- * @return The preferred detail pane ID or null
- */
- private String chooseToggleTargetIDInSet(Set possibleTargetIDs, Collection enabledFactories, IWorkbenchPart part, ISelection selection){
- if (possibleTargetIDs == null || possibleTargetIDs.isEmpty()){
- return null;
- }
-
- String preferredID = getUserPreferredTarget(possibleTargetIDs);
-
- if (preferredID == null){
- // If there is no preferred pane already set, check the factories to see there is a default target
- Iterator factoryIterator = enabledFactories.iterator();
- while (preferredID == null && factoryIterator.hasNext()) {
- IToggleBreakpointsTargetFactory currentFactory = (IToggleBreakpointsTargetFactory) factoryIterator.next();
- preferredID = currentFactory.getDefaultToggleTarget(part, selection);
- }
- // If the factories don't have a default, just pick the first one.
- if (preferredID == null) {
- preferredID= (String)possibleTargetIDs.iterator().next();
- }
- setPreferredTarget(possibleTargetIDs, preferredID);
- }
-
- return preferredID;
- }
-
- /**
- * Notifies the change listeners that the preferred targets changed.
- */
- private void firePreferredTargetsChanged() {
- Object[] listeners = fChangedListners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- ((IToggleBreakpointsTargetManagerListener)listeners[i]).preferredTargetsChanged();
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java
deleted file mode 100644
index b2ba81cd0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.custom.BusyIndicator;
-
-/**
- * A generic Toggle filter action, meant to be subclassed to provide
- * a specific filter.
- */
-public abstract class ToggleFilterAction extends Action {
-
- /**
- * The viewer that this action works for
- */
- private StructuredViewer fViewer;
-
- /**
- * The filter this action applies to the viewer
- */
- private ViewerFilter fViewerFilter;
-
- public void run() {
- valueChanged(isChecked());
- }
- /**
- * Adds or removes the viewer filter depending
- * on the value of the parameter.
- */
- protected void valueChanged(final boolean on) {
- if (getViewer().getControl().isDisposed()) {
- return;
- }
- BusyIndicator.showWhile(getViewer().getControl().getDisplay(), new Runnable() {
- public void run() {
- if (on) {
- ViewerFilter filter= getViewerFilter();
- ViewerFilter[] filters= getViewer().getFilters();
- boolean alreadyAdded= false;
- for (int i= 0; i < filters.length; i++) {
- ViewerFilter addedFilter= filters[i];
- if (addedFilter.equals(filter)) {
- alreadyAdded= true;
- break;
- }
- }
- if (!alreadyAdded) {
- getViewer().addFilter(filter);
- }
-
- } else {
- getViewer().removeFilter(getViewerFilter());
- }
- }
- });
- }
-
- /**
- * Returns the <code>ViewerFilter</code> that this action
- * will add/remove from the viewer, or <code>null</code>
- * if no filter is involved.
- */
- protected ViewerFilter getViewerFilter() {
- return fViewerFilter;
- }
-
- protected void setViewerFilter(ViewerFilter filter) {
- fViewerFilter= filter;
- }
-
- protected StructuredViewer getViewer() {
- return fViewer;
- }
-
- protected void setViewer(StructuredViewer viewer) {
- fViewer = viewer;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ViewManagementAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ViewManagementAction.java
deleted file mode 100644
index 7bd91d627..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ViewManagementAction.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions;
-
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.actions.ActionDelegate;
-
-/**
- * An action which opens the view management preference page.
- */
-public class ViewManagementAction extends ActionDelegate implements IViewActionDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- SWTFactory.showPreferencePage("org.eclipse.debug.ui.ViewManagementPreferencePage"); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractBreakpointsViewAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractBreakpointsViewAction.java
deleted file mode 100644
index b396f7922..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractBreakpointsViewAction.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
-/**
- * Abstract implementation of an action contributed to the breakpoints view.
- */
-public abstract class AbstractBreakpointsViewAction implements IViewActionDelegate, IActionDelegate2 {
-
- /**
- * The breakpoints view that this action has been contributed to.
- */
- protected BreakpointsView fView;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- fView= (BreakpointsView) view;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#dispose()
- */
- public void dispose() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AdvancedGroupBreakpointsByAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AdvancedGroupBreakpointsByAction.java
deleted file mode 100644
index 243c140bb..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AdvancedGroupBreakpointsByAction.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.Window;
-
-/**
- * Action that opens a dialog to select which breakpoint
- * container factories should be applies to the breakpoints
- * view.
- */
-public class AdvancedGroupBreakpointsByAction extends Action {
-
- private BreakpointsView fView;
-
- public AdvancedGroupBreakpointsByAction(BreakpointsView view) {
- super(IInternalDebugCoreConstants.EMPTY_STRING, IAction.AS_RADIO_BUTTON);
- fView= view;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- if (isChecked()) {
- GroupBreakpointsByDialog dialog = new GroupBreakpointsByDialog(fView);
- if (dialog.open() == Window.OK) {
- fView.setBreakpointOrganizers(dialog.getOrganizers());
- }
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointGroupMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointGroupMessages.java
deleted file mode 100644
index a9e8955d3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointGroupMessages.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import org.eclipse.osgi.util.NLS;
-
-public class BreakpointGroupMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.actions.breakpointGroups.BreakpointGroupMessages";//$NON-NLS-1$
- //
- // Copyright (c) 2004, 2005 IBM Corporation and others.
- // All rights reserved. This program and the accompanying materials
- // are made available under the terms of the Eclipse Public License v1.0
- // which accompanies this distribution, and is available at
- // http://www.eclipse.org/legal/epl-v10.html
- //
- // Contributors:
- // IBM Corporation - initial API and implementation
- //
-
- public static String GroupBreakpointsByAction_0;
- public static String GroupBreakpointsByAction_1;
- public static String GroupBreakpointsByDialog_0;
- public static String GroupBreakpointsByDialog_1;
- public static String GroupBreakpointsByDialog_2;
- public static String GroupBreakpointsByDialog_3;
- public static String GroupBreakpointsByDialog_4;
- public static String GroupBreakpointsByDialog_5;
- public static String GroupBreakpointsByDialog_6;
- public static String GroupBreakpointsByDialog_7;
- public static String CopyBreakpointsAction_0;
- public static String CopyBreakpointsAction_1;
- public static String CopyBreakpointsAction_2;
- public static String CopyBreakpointsAction_3;
- public static String PasteBreakpointsAction_0;
- public static String PasteBreakpointsAction_1;
- public static String RemoveFromWorkingSetAction_0;
-
- public static String SelectBreakpointWorkingsetDialog_0;
-
- public static String SetDefaultBreakpointGroupAction_0;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, BreakpointGroupMessages.class);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointGroupMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointGroupMessages.properties
deleted file mode 100644
index 4fa9d6cfd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointGroupMessages.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-###############################################################################
-# Copyright (c) 2004, 2009 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-GroupBreakpointsByAction_0=Breakpoints
-GroupBreakpointsByAction_1=Advanced...
-GroupBreakpointsByDialog_0=Specify nested groupings for the Breakpoints view.
-GroupBreakpointsByDialog_1=A&vailable Groups:
-GroupBreakpointsByDialog_2=&Add -->
-GroupBreakpointsByDialog_3=&Selected Groups:
-GroupBreakpointsByDialog_4=<-- &Remove
-GroupBreakpointsByDialog_5=Move &Up
-GroupBreakpointsByDialog_6=Move &Down
-GroupBreakpointsByDialog_7=Group Breakpoints
-CopyBreakpointsAction_0=&Copy
-CopyBreakpointsAction_1=Copy Breakpoints
-CopyBreakpointsAction_2=Problem Copying to Clipboard
-CopyBreakpointsAction_3=There was a problem when accessing the system clipboard. Retry?
-PasteBreakpointsAction_0=&Paste
-PasteBreakpointsAction_1=Paste Breakpoints
-RemoveFromWorkingSetAction_0=Remove from &Working Set
-SetDefaultBreakpointGroupAction_0=Select Default Working Set
-SelectBreakpointWorkingsetDialog_0=Select &default working set:
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointSelectionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointSelectionAction.java
deleted file mode 100644
index a1c90fb6f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointSelectionAction.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView;
-import org.eclipse.ui.actions.SelectionListenerAction;
-
-/**
- * A selection listener action for the breakpoints view.
- */
-public abstract class BreakpointSelectionAction extends SelectionListenerAction {
-
- private BreakpointsView fView;
-
- /**
- * Constructs an action for the breakpoints view.
- *
- * @param text action name
- * @param view breakpoints view
- */
- public BreakpointSelectionAction(String text, BreakpointsView view) {
- super(text);
- fView = view;
- }
-
- /**
- * Returns the breakpoints view.
- *
- * @return breakpoints view
- */
- protected BreakpointsView getBreakpointsView() {
- return fView;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointWorkingSetAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointWorkingSetAction.java
deleted file mode 100644
index 1ed2fff7b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointWorkingSetAction.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IViewPart;
-
-/**
- * An action which clears (sets the null) the default breakpoint group.
- * @see org.eclipse.debug.core.IBreakpointManager#setAutoGroup(String)
- */
-public abstract class BreakpointWorkingSetAction extends AbstractBreakpointsViewAction implements IPropertyChangeListener {
-
- protected IAction fAction;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- super.init(view);
- DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#dispose()
- */
- public void dispose() {
- DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
- super.dispose();
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- fAction = action;
- super.init(action);
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(IInternalDebugUIConstants.MEMENTO_BREAKPOINT_WORKING_SET_NAME)) {
- update();
- }
-
- }
- protected abstract void update();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ClearDefaultBreakpointGroupAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ClearDefaultBreakpointGroupAction.java
deleted file mode 100644
index f6d50a804..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ClearDefaultBreakpointGroupAction.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointSetOrganizer;
-import org.eclipse.jface.action.IAction;
-
-/**
- * An action which clears (sets the null) the default breakpoint group.
- * @see org.eclipse.debug.core.IBreakpointManager#setAutoGroup(String)
- */
-public class ClearDefaultBreakpointGroupAction extends BreakpointWorkingSetAction {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- BreakpointSetOrganizer.setDefaultWorkingSet(null);
- }
-
- protected void update() {
- fAction.setEnabled(BreakpointSetOrganizer.getDefaultWorkingSet() != null);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/CopyBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/CopyBreakpointsAction.java
deleted file mode 100644
index 3ee9a6476..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/CopyBreakpointsAction.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.SWTError;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
-
-/**
- * Action for copying the currently selected breakpoints to the clipboard.
- */
-public class CopyBreakpointsAction extends BreakpointSelectionAction {
-
- /**
- * System clipboard
- */
- private Clipboard clipboard;
-
- /**
- * Associated paste action. May be <code>null</code>
- */
- private PasteBreakpointsAction pasteAction;
-
- /**
- * Creates a new action.
- *
- * @param shell the shell for any dialogs
- * @param clipboard a platform clipboard
- */
- public CopyBreakpointsAction(BreakpointsView view, Clipboard clipboard) {
- super(BreakpointGroupMessages.CopyBreakpointsAction_0, view);
- Assert.isNotNull(clipboard);
- this.clipboard = clipboard;
- setToolTipText(BreakpointGroupMessages.CopyBreakpointsAction_1);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.COPY_BREAKPOINTS_ACTION);
- }
-
- /**
- * Creates a new action.
- *
- * @param shell the shell for any dialogs
- * @param clipboard a platform clipboard
- * @param pasteAction a paste action
- */
- public CopyBreakpointsAction(BreakpointsView view, Clipboard clipboard, PasteBreakpointsAction pasteAction) {
- this(view, clipboard);
- this.pasteAction = pasteAction;
- }
-
- /**
- * The <code>CopyAction</code> implementation of this method defined
- * on <code>IAction</code> copies the selected resources to the
- * clipboard.
- */
- public void run() {
- IStructuredSelection selection = getStructuredSelection();
- Object[] objects = selection.toArray();
- StringBuffer buffer = new StringBuffer();
- ILabelProvider labelProvider = (ILabelProvider) ((StructuredViewer)getBreakpointsView().getViewer()).getLabelProvider();
- for (int i = 0; i < objects.length; i++) {
- Object object = objects[i];
- if (i > 0) {
- buffer.append("\n"); //$NON-NLS-1$
- }
- buffer.append(labelProvider.getText(object));
- }
- setClipboard(selection, buffer.toString());
-
- // update the enablement of the paste action
- // workaround since the clipboard does not suppot callbacks
- if (pasteAction != null && pasteAction.getStructuredSelection() != null)
- pasteAction.selectionChanged(pasteAction.getStructuredSelection());
- }
-
- /**
- * Set the clipboard contents. Prompt to retry if clipboard is busy.
- *
- * @param selection the selection to copy to the clipboard
- */
- private void setClipboard(ISelection selection, String text) {
- try {
- LocalSelectionTransfer.getInstance().setSelection(selection);
- LocalSelectionTransfer.getInstance().setSelectionSetTime(System.currentTimeMillis());
- clipboard.setContents(new Object[] {selection, text}, new Transfer[] {LocalSelectionTransfer.getInstance(), TextTransfer.getInstance()});
- } catch (SWTError e) {
- if (e.code != DND.ERROR_CANNOT_SET_CLIPBOARD)
- throw e;
- if (MessageDialog.openQuestion(
- getBreakpointsView().getSite().getShell(), BreakpointGroupMessages.CopyBreakpointsAction_2,
- BreakpointGroupMessages.CopyBreakpointsAction_3)) {
- setClipboard(selection, text);
- }
- }
- }
-
- /**
- * Enables if one or more breakpoints are selected.
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- if (selection.isEmpty()) {
- return false;
- }
- Iterator iterator = selection.iterator();
- while (iterator.hasNext()) {
- if (!(iterator.next() instanceof IBreakpoint)) {
- return false;
- }
- }
- return true;
- }
-
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/EditBreakpointGroupAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/EditBreakpointGroupAction.java
deleted file mode 100644
index d8225fcff..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/EditBreakpointGroupAction.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointContainer;
-import org.eclipse.debug.internal.ui.views.breakpoints.WorkingSetCategory;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.IWorkingSetEditWizard;
-
-/**
- * An action to edit a breakpoint working set.
- */
-public class EditBreakpointGroupAction extends AbstractBreakpointsViewAction {
-
- /**
- * The currently selected breakpoints
- */
- private IWorkingSet fSet = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- IWorkingSetEditWizard editWizard = PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetEditWizard(fSet);
- WizardDialog dialog = new WizardDialog(DebugUIPlugin.getShell(), editWizard);
- dialog.open();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection sel) {
- IStructuredSelection selection= (IStructuredSelection) sel;
- fSet = null;
- if (selection.size() == 1) {
- Object element = selection.getFirstElement();
- if (element instanceof BreakpointContainer) {
- BreakpointContainer container = (BreakpointContainer)element;
- IAdaptable category = container.getCategory();
- if (category instanceof WorkingSetCategory) {
- IWorkingSet set = ((WorkingSetCategory)category).getWorkingSet();
- action.setEnabled(true);
- fSet = set;
- return;
- }
- }
- }
- action.setEnabled(false);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsAction.java
deleted file mode 100644
index c53ab9ab8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsAction.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView;
-import org.eclipse.debug.internal.ui.views.breakpoints.IBreakpointOrganizer;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-
-/**
- * An action which sets the breakpoint factory on a breakpoint view,
- * effectively telling the view to group breakpoints according to
- * some criteria (as determined by the factory).
- */
-public class GroupBreakpointsAction extends Action {
-
- private IBreakpointOrganizer fOrganzier;
- private BreakpointsView fView;
-
- /**
- * Creates a new action which will group breakpoints in the given
- * breakpoint view using the given breakpoint container factory
- * @param factory the factory that will be applied to the given view
- * when this action is run
- * @param view the breakpoints view
- */
- public GroupBreakpointsAction(IBreakpointOrganizer organizer, BreakpointsView view) {
- super(IInternalDebugCoreConstants.EMPTY_STRING, IAction.AS_RADIO_BUTTON);
- fOrganzier= organizer;
- fView= view;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- if (isChecked()) {
- if (fOrganzier == null) {
- fView.setBreakpointOrganizers(null);
- } else {
- fView.setBreakpointOrganizers(new IBreakpointOrganizer[]{fOrganzier});
- }
- }
- }
-
- /**
- * Returns this action's organizer.
- *
- * @return breakpoint organizer
- */
- public IBreakpointOrganizer getOrganizer() {
- return fOrganzier;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByAction.java
deleted file mode 100644
index 4ebf6be86..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByAction.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointOrganizerManager;
-import org.eclipse.debug.internal.ui.views.breakpoints.IBreakpointOrganizer;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-
-/**
- *
- */
-public class GroupBreakpointsByAction extends AbstractBreakpointsViewAction implements IMenuCreator {
-
- private IAction fAction= null;
-
- public GroupBreakpointsByAction() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#dispose()
- */
- public void dispose() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
- */
- public Menu getMenu(Control parent) {
- // Never called
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
- */
- public Menu getMenu(Menu parent) {
- Menu menu = new Menu(parent);
- menu.addMenuListener(new MenuAdapter() {
- public void menuShown(MenuEvent e) {
- Menu m = (Menu)e.widget;
- MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
- }
- fillMenu(m);
- }
- });
- return menu;
- }
-
- /**
- * Fill pull down menu with the "group by" options
- */
- private void fillMenu(Menu menu) {
- // determine which item should be checked
- IBreakpointOrganizer[] organizers = fView.getBreakpointOrganizers();
- boolean none = false;
- boolean advanced = false;
- IBreakpointOrganizer organizer = null;
- if (organizers == null || organizers.length == 0) {
- none = true;
- } else if (organizers.length > 1) {
- advanced = true;
- } else {
- organizer = organizers[0];
- }
-
- int accel = 1;
- // Add hard-coded action for flat breakpoints list
- IAction action = new GroupBreakpointsAction(null, fView);
- addAccel(accel, action, BreakpointGroupMessages.GroupBreakpointsByAction_0);
- accel++;
- action.setImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_VIEW_BREAKPOINTS));
- action.setChecked(none);
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(menu, -1);
-
- // Add actions for each contributed organizer
- List actions = getActions(accel);
- accel = accel + actions.size();
- Iterator actionIter = actions.iterator();
- while (actionIter.hasNext()) {
- GroupBreakpointsAction bpAction = (GroupBreakpointsAction) actionIter.next();
- bpAction.setChecked(bpAction.getOrganizer().equals(organizer));
- item= new ActionContributionItem(bpAction);
- item.fill(menu, -1);
- }
-
- // advanced action
- AdvancedGroupBreakpointsByAction advancedAction = new AdvancedGroupBreakpointsByAction(fView);
- addAccel(accel, advancedAction,BreakpointGroupMessages.GroupBreakpointsByAction_1);
- advancedAction.setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_HIERARCHICAL));
- advancedAction.setChecked(advanced);
- item= new ActionContributionItem(advancedAction);
- item.fill(menu, -1);
- }
-
- public List getActions(int accel) {
- List actions= new ArrayList();
- IBreakpointOrganizer[] organizers = BreakpointOrganizerManager.getDefault().getOrganizers();
- for (int i = 0; i < organizers.length; i++) {
- IBreakpointOrganizer organizer = organizers[i];
- IAction action = new GroupBreakpointsAction(organizer, fView);
- addAccel(accel, action, organizer.getLabel());
- accel++;
- action.setImageDescriptor(organizer.getImageDescriptor());
- actions.add(action);
- }
- return actions;
- }
-
- private void addAccel(int accel, IAction action, String label) {
- StringBuffer actionLabel= new StringBuffer();
- if (accel != 10) {
- if (accel < 10) {
- // add the numerical accelerators 1 through 9
- actionLabel.append('&');
- }
- actionLabel.append(accel);
- } else {
- actionLabel.append("1&0"); //$NON-NLS-1$
- }
- accel++;
- actionLabel.append(' ');
- actionLabel.append(label);
- action.setText(actionLabel.toString());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- if (action != fAction) {
- action.setMenuCreator(this);
- fAction= action;
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java
deleted file mode 100644
index a261c78af..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java
+++ /dev/null
@@ -1,534 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointOrganizerManager;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView;
-import org.eclipse.debug.internal.ui.views.breakpoints.IBreakpointOrganizer;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.TrayDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Dialog which presents available breakpoint groupings to
- * the user and allows them to specify which they'd like
- * to use and in what order they should be applied.
- */
-public class GroupBreakpointsByDialog extends TrayDialog {
-
- private BreakpointsView fView;
-
- // Table viewer that presents available containers
- private TableViewer fAvailableViewer;
- private AvailableOrganizersProvider fAvailableOrganizersProvider= new AvailableOrganizersProvider();
-
- // Tree viewer that presents selected containers
- private TreeViewer fSelectedViewer;
- private SelectedOrganizerProvider fSelectedOrganizersProvider= new SelectedOrganizerProvider();
-
- private List fResult= new ArrayList();
-
- private Button fAddButton;
- private Button fRemoveButton;
- private Button fMoveUpButton;
- private Button fMoveDownButton;
-
- /**
- * Selection listener that listens to selection from all buttons in this
- * dialog.
- */
- private SelectionAdapter fSelectionListener= new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- Object source= e.getSource();
- if (source == fAddButton) {
- handleAddPressed();
- } else if (source == fRemoveButton) {
- handleRemovePressed();
- } else if (source == fMoveUpButton) {
- handleMoveUpPressed();
- } else if (source == fMoveDownButton) {
- handleMoveDownPressed();
- }
- }
- };
-
- protected GroupBreakpointsByDialog(BreakpointsView view) {
- super(view.getSite().getShell());
- fView= view;
- setShellStyle(getShellStyle() | SWT.RESIZE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- ILabelProvider labelProvider= new BreakpointOrganzierLabelProvider();
-
- Composite parentComposite= (Composite) super.createDialogArea(parent);
- parentComposite.setFont(parent.getFont());
- Composite composite= new Composite(parentComposite, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- composite.setLayout(layout);
- GridData data= new GridData(GridData.FILL_BOTH);
- data.heightHint= 400;
- composite.setLayoutData(data);
- composite.setFont(parent.getFont());
-
- Label label= new Label(composite, SWT.WRAP);
- label.setText(BreakpointGroupMessages.GroupBreakpointsByDialog_0);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.horizontalSpan = 3;
- label.setLayoutData(gridData);
-
- createAvailableViewer(composite, labelProvider);
- createButtons(composite);
- createSelectedViewer(composite, labelProvider);
-
- initializeContent();
- updateViewers();
- Dialog.applyDialogFont(parentComposite);
- return parentComposite;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Control contents = super.createContents(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getDialogArea(), IDebugHelpContextIds.GROUP_BREAKPOINTS_DIALOG);
- return contents;
- }
-
- /**
- * Divides the available breakpoint container factories into the
- * appropriate viewers ("available" or "selected").
- */
- private void initializeContent() {
- IBreakpointOrganizer[] organizers= BreakpointOrganizerManager.getDefault().getOrganizers();
- for (int i = 0; i < organizers.length; i++) {
- fAvailableOrganizersProvider.addAvailable(organizers[i]);
- }
- organizers = fView.getBreakpointOrganizers();
- if (organizers != null) {
- for (int i = 0; i < organizers.length; i++) {
- fSelectedOrganizersProvider.addSelected(organizers[i]);
- }
- }
- }
-
- /**
- * Creates and configured the viewer that shows the available (not currently selected)
- * breakpoint container factories.
- */
- private void createAvailableViewer(Composite parent, ILabelProvider labelProvider) {
- Composite availableComposite= new Composite(parent, SWT.NONE);
- availableComposite.setFont(parent.getFont());
- GridLayout layout = new GridLayout();
- layout.marginHeight=0;
- layout.marginWidth=0;
- availableComposite.setLayout(layout);
- GridData gridData= new GridData(GridData.FILL_BOTH);
- gridData.widthHint= 225;
- availableComposite.setLayoutData(gridData);
-
- Label label= new Label(availableComposite, SWT.WRAP);
- label.setText(BreakpointGroupMessages.GroupBreakpointsByDialog_1);
- gridData = new GridData(GridData.FILL_HORIZONTAL);
- label.setLayoutData(gridData);
-
- fAvailableViewer= new TableViewer(availableComposite);
- fAvailableViewer.setContentProvider(fAvailableOrganizersProvider);
- fAvailableViewer.setLabelProvider(labelProvider);
- fAvailableViewer.setInput(new Object());
- Table table = fAvailableViewer.getTable();
- table.setLayoutData(new GridData(GridData.FILL_BOTH));
- table.setFont(parent.getFont());
- fAvailableViewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- handleAddPressed();
- }
- });
- fAvailableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateAddButton();
- }
- });
- }
-
- /**
- * Creates and configures the viewer that shows the currently selected
- * breakpoint container factories.
- */
- private void createSelectedViewer(Composite parent, ILabelProvider labelProvider) {
- Composite selectedComposite= new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight=0;
- layout.marginWidth=0;
- layout.numColumns= 2;
- selectedComposite.setLayout(layout);
- GridData gridData= new GridData(GridData.FILL_BOTH);
- gridData.widthHint= 225;
- selectedComposite.setLayoutData(gridData);
- selectedComposite.setFont(parent.getFont());
-
- Label label= new Label(selectedComposite, SWT.WRAP);
- label.setText(BreakpointGroupMessages.GroupBreakpointsByDialog_3);
- gridData = new GridData();
- gridData.horizontalSpan = 2;
- label.setLayoutData(gridData);
-
- fSelectedViewer= new TreeViewer(selectedComposite);
- fSelectedViewer.setContentProvider(fSelectedOrganizersProvider);
- fSelectedViewer.setLabelProvider(labelProvider);
- fSelectedViewer.setInput(new Object());
- Tree tree = fSelectedViewer.getTree();
- tree.setLayoutData(new GridData(GridData.FILL_BOTH));
- tree.setFont(parent.getFont());
- fSelectedViewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- handleRemovePressed();
- }
- });
- fSelectedViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateSelectedButtons();
- }
- });
- }
-
- public void createButtons(Composite parent) {
- Composite buttonComposite= new Composite(parent, SWT.NONE);
- buttonComposite.setLayout(new GridLayout());
- buttonComposite.setLayoutData(new GridData());
- buttonComposite.setFont(parent.getFont());
-
- fAddButton= SWTFactory.createPushButton(buttonComposite, BreakpointGroupMessages.GroupBreakpointsByDialog_2, null);
- fAddButton.addSelectionListener(fSelectionListener);
-
- fRemoveButton= SWTFactory.createPushButton(buttonComposite, BreakpointGroupMessages.GroupBreakpointsByDialog_4, null);
- fRemoveButton.addSelectionListener(fSelectionListener);
-
- fMoveUpButton= SWTFactory.createPushButton(buttonComposite, BreakpointGroupMessages.GroupBreakpointsByDialog_5, null);
- fMoveUpButton.addSelectionListener(fSelectionListener);
-
- fMoveDownButton= SWTFactory.createPushButton(buttonComposite, BreakpointGroupMessages.GroupBreakpointsByDialog_6, null);
- fMoveDownButton.addSelectionListener(fSelectionListener);
-
- }
-
- /**
- * Returns the organizers chosen by the user. The order
- * of the list is the order that the organizers should be displayed
- * in the breakpoints view.
- * @return the breakpoint organizers chosen by the user
- */
- public IBreakpointOrganizer[] getOrganizers() {
- return (IBreakpointOrganizer[]) fResult.toArray(new IBreakpointOrganizer[fResult.size()]);
- }
-
- /**
- * When the user presses OK, convert the tree selection into a list.
- */
- protected void okPressed() {
- Object[] factories= fSelectedOrganizersProvider.getElements(null);
- while (factories.length > 0) {
- Object factory= factories[0];
- fResult.add(factory);
- factories= fSelectedOrganizersProvider.getChildren(factory);
- }
- super.okPressed();
- }
-
- /**
- * Moves the selected item from the list of "available" factories
- * to the tree of "selected" factories.
- */
- public void handleAddPressed() {
- IStructuredSelection selection= (IStructuredSelection) fAvailableViewer.getSelection();
- if (selection.size() < 1) {
- return;
- }
- Iterator iter= selection.iterator();
- while (iter.hasNext()) {
- fSelectedOrganizersProvider.addSelected((IBreakpointOrganizer) iter.next());
- }
- updateViewers();
- }
-
- /**
- * Moves the selected item from the tree of "selected" factories
- * to the list of "available" factories.
- */
- public void handleRemovePressed() {
- IStructuredSelection selection= (IStructuredSelection) fSelectedViewer.getSelection();
- if (selection.size() < 1) {
- return;
- }
- Iterator iter= selection.iterator();
- while (iter.hasNext()) {
- fAvailableOrganizersProvider.addAvailable((IBreakpointOrganizer) iter.next());
- }
- updateViewers();
- }
-
- /**
- * Moves each selected item up in the tree of selected containers
- */
- public void handleMoveUpPressed() {
- IStructuredSelection selection = (IStructuredSelection) fSelectedViewer.getSelection();
- Iterator iter = selection.iterator();
- while (iter.hasNext()) {
- fSelectedOrganizersProvider.moveUp(iter.next());
- }
- updateViewers();
- }
-
- /**
- * Moves each selected item down in the tree of selected containers
- */
- public void handleMoveDownPressed() {
- IStructuredSelection selection = (IStructuredSelection) fSelectedViewer.getSelection();
- Object[] elements= selection.toArray();
- for (int i= elements.length - 1; i >= 0; i--) {
- fSelectedOrganizersProvider.moveDown(elements[i]);
- }
- updateViewers();
- }
-
- /**
- * Fully refreshes and updates all viewers and buttons.
- */
- public void updateViewers() {
- fAvailableViewer.refresh();
- fSelectedViewer.refresh();
- fSelectedViewer.expandAll();
- updateAddButton();
- updateSelectedButtons();
- }
-
- /**
- * Updates all buttons associated with the tree of selected containers.
- */
- public void updateSelectedButtons() {
- updateRemoveButton();
- updateMoveUpButton();
- updateMoveDownButton();
- }
-
- public void updateAddButton() {
- IStructuredSelection selection = (IStructuredSelection) fAvailableViewer.getSelection();
- fAddButton.setEnabled(selection.size() > 0);
- }
-
- public void updateRemoveButton() {
- IStructuredSelection selection = (IStructuredSelection) fSelectedViewer.getSelection();
- fRemoveButton.setEnabled(selection.size() > 0);
- }
-
- public void updateMoveUpButton() {
- boolean enabled= true;
- IStructuredSelection selection = (IStructuredSelection) fSelectedViewer.getSelection();
- if (selection.size() == 0) {
- enabled= false;
- } else {
- Object firstSelected= selection.getFirstElement();
- Object parent= fSelectedOrganizersProvider.getParent(firstSelected);
- if (!(parent instanceof IBreakpointOrganizer)) {
- enabled= false;
- }
- }
- fMoveUpButton.setEnabled(enabled);
- }
-
- public void updateMoveDownButton() {
- boolean enabled= true;
- IStructuredSelection selection = (IStructuredSelection) fSelectedViewer.getSelection();
- if (selection.size() == 0) {
- enabled= false;
- } else {
- Object lastSelected= selection.toList().get(selection.size() - 1);
- Object[] children= fSelectedOrganizersProvider.getChildren(lastSelected);
- if (children.length < 1) {
- enabled= false;
- }
- }
- fMoveDownButton.setEnabled(enabled);
- }
-
- /**
- * Content provider that provides the list of breakpoint organaisers
- * that are available but not currently selected.
- */
- private class AvailableOrganizersProvider implements IStructuredContentProvider {
- protected List availableOrganziers= new ArrayList();
-
- public void addAvailable(IBreakpointOrganizer organizer) {
- availableOrganziers.add(organizer);
- fSelectedOrganizersProvider.selectedOrganizers.remove(organizer);
- }
-
- public Object[] getElements(Object inputElement) {
- return availableOrganziers.toArray();
- }
-
- public void dispose() {
- }
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- }
-
- /**
- * Content provider that returns the selected breakpoint organizers
- * as a tree. This tree shows the list of organzizers as they will
- * appear in the breakpoints view.
- */
- private class SelectedOrganizerProvider implements ITreeContentProvider {
- protected List selectedOrganizers= new ArrayList();
-
- public void addSelected(IBreakpointOrganizer organizer) {
- selectedOrganizers.add(organizer);
- fAvailableOrganizersProvider.availableOrganziers.remove(organizer);
- }
-
- public void moveUp(Object object) {
- int index = selectedOrganizers.indexOf(object);
- if (index > 0) {
- selectedOrganizers.remove(object);
- selectedOrganizers.add(index - 1, object);
- }
- }
-
- public void moveDown(Object object) {
- int index = selectedOrganizers.indexOf(object);
- if (index < selectedOrganizers.size() - 1) {
- selectedOrganizers.remove(object);
- selectedOrganizers.add(index + 1, object);
- }
- }
-
- public Object[] getChildren(Object parentElement) {
- // A factory's "child" is the next factory in the list
- int index = selectedOrganizers.indexOf(parentElement);
- if (index < selectedOrganizers.size() - 1) {
- return new Object[] { selectedOrganizers.get(index + 1) };
- }
- return new Object[0];
- }
-
- public Object getParent(Object element) {
- // A factory's "parent" is the factory before it
- int index = selectedOrganizers.indexOf(element);
- if (index <= 0 || selectedOrganizers.size() <= 1) {
- return null;
- }
- return selectedOrganizers.get(index - 1);
- }
-
- public boolean hasChildren(Object element) {
- // A factory has "children" if there are more
- // factories after it.
- int index = selectedOrganizers.indexOf(element);
- return index != -1 && index < selectedOrganizers.size() - 1;
- }
-
- public Object[] getElements(Object inputElement) {
- if (selectedOrganizers.size() > 0) {
- return new Object[] { selectedOrganizers.get(0) };
- }
- return new Object[0];
- }
- public void dispose() {
- }
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- }
-
- /**
- * Label provider which provides text and images for breakpoint container factories
- */
- private class BreakpointOrganzierLabelProvider extends LabelProvider {
- private HashMap fImageCache= new HashMap();
-
- public String getText(Object element) {
- if (element instanceof IBreakpointOrganizer) {
- return ((IBreakpointOrganizer) element).getLabel();
- }
- return super.getText(element);
- }
- public Image getImage(Object element) {
- if (element instanceof IBreakpointOrganizer) {
- ImageDescriptor imageDescriptor = ((IBreakpointOrganizer) element).getImageDescriptor();
- if (imageDescriptor != null) {
- Image image = (Image) fImageCache.get(imageDescriptor);
- if (image == null) {
- image= imageDescriptor.createImage();
- if (image != null) {
- fImageCache.put(imageDescriptor, image);
- }
- }
- return image;
- }
- }
- return super.getImage(element);
- }
- public void dispose() {
- Iterator imageIter = fImageCache.values().iterator();
- while (imageIter.hasNext()) {
- ((Image) imageIter.next()).dispose();
- }
- super.dispose();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
- */
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(BreakpointGroupMessages.GroupBreakpointsByDialog_7);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/PasteBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/PasteBreakpointsAction.java
deleted file mode 100644
index db5fca697..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/PasteBreakpointsAction.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import java.util.List;
-
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointContainer;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView;
-import org.eclipse.debug.internal.ui.views.breakpoints.OtherBreakpointCategory;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
-
-/**
- * Standard action for pasting resources on the clipboard to the selected resource's location.
- * <p>
- * This class may be instantiated; it is not intended to be subclassed.
- * </p>
- *
- * @since 2.0
- */
-public class PasteBreakpointsAction extends BreakpointSelectionAction {
-
- /**
- * Creates a new action.
- *
- * @param view the view of this action
- */
- public PasteBreakpointsAction(BreakpointsView view) {
- super(BreakpointGroupMessages.PasteBreakpointsAction_0, view);
- setToolTipText(BreakpointGroupMessages.PasteBreakpointsAction_1);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.PASTE_BREAKPOINTS_ACTION);
- }
-
- /**
- * Returns the actual target of the paste action. Returns null
- * if no valid target is selected.
- *
- * @return the actual target of the paste action
- */
- private Object getTarget() {
- List selectedNonResources = getSelectedNonResources();
- if (selectedNonResources.size() == 1) {
- Object target = selectedNonResources.get(0);
- if (target instanceof BreakpointContainer) {
- return target;
- }
- }
- return null;
- }
-
- /**
- * Implementation of method defined on <code>IAction</code>.
- */
- public void run() {
- if (getBreakpointsView().canPaste(getTarget(), LocalSelectionTransfer.getInstance().getSelection())) {
- getBreakpointsView().performPaste(getTarget(), LocalSelectionTransfer.getInstance().getSelection());
- }
- }
-
- /**
- * Returns whether this action should be enabled based on the selection
- * in the clipboard. Only updates when the breakpoints view has focus.
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- // can't paste into "Others" (only move)
- Object target = getTarget();
- if (target instanceof BreakpointContainer) {
- BreakpointContainer container = (BreakpointContainer) target;
- if (container.getCategory() instanceof OtherBreakpointCategory) {
- return false;
- }
- return true;
- }
- // don't access clipboard - causes Hang -see bug 84870
- return false;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/RemoveFromWorkingSetAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/RemoveFromWorkingSetAction.java
deleted file mode 100644
index 9835ba0c1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/RemoveFromWorkingSetAction.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointContainer;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsViewer;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Item;
-
-/**
- * Removes a breakpoint from a breakpoint working set.
- */
-public class RemoveFromWorkingSetAction extends BreakpointSelectionAction {
-
- /**
- * Constructs action to remove breakpoints from a category.
- *
- * @param view
- */
- public RemoveFromWorkingSetAction(BreakpointsView view) {
- super(BreakpointGroupMessages.RemoveFromWorkingSetAction_0, view);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- BreakpointsViewer viewer = (BreakpointsViewer) getBreakpointsView().getViewer();
- Item[] items = viewer.getSelectedItems();
- IBreakpoint breakpoint = null;
- BreakpointContainer container = null;
- for(int i = 0; i < items.length; i++) {
- if(items[i].getData() instanceof IBreakpoint) {
- breakpoint = (IBreakpoint) items[i].getData();
- container = viewer.getRemovableContainer(items[i]);
- if(container != null) {
- container.getOrganizer().removeBreakpoint(breakpoint, container.getCategory());
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.BaseSelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- Object element = selection.getFirstElement();
- if(element instanceof BreakpointContainer) {
- return ((BreakpointContainer) element).getCategory().equals(IDebugUIConstants.BREAKPOINT_WORKINGSET_ID);
- }
- return false;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java
deleted file mode 100644
index a0ea4f275..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import java.util.ArrayList;
-
-import org.eclipse.debug.internal.ui.AbstractDebugCheckboxSelectionDialog;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Dialog to allow the selection of working sets without all of the overhead of the
- * platform UI working set dialog
- *
- * @since 3.3
- */
-public class SelectBreakpointWorkingsetDialog extends AbstractDebugCheckboxSelectionDialog {
-
- private static final String SETTINGS_ID = DebugUIPlugin.getUniqueIdentifier() + ".DELETE_ASSOCIATED_CONFIGS_DIALOG"; //$NON-NLS-1$
- private IWorkingSet[] fWorkingSetList = null;
-
- /**
- * Constructor
- * @param parentShell the parent to open this dialog on
- */
- protected SelectBreakpointWorkingsetDialog(Shell parentShell) {
- super(parentShell);
- fWorkingSetList = getBreakpointWorkingSets();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugCheckboxSelectionDialog#addViewerListeners(org.eclipse.jface.viewers.StructuredViewer)
- */
- protected void addViewerListeners(StructuredViewer viewer) {
- CheckboxTableViewer checkViewer = getCheckBoxTableViewer();
- if (checkViewer != null){
- checkViewer.addCheckStateListener(new ICheckStateListener(){
- public void checkStateChanged(CheckStateChangedEvent event) {
- getCheckBoxTableViewer().setCheckedElements(new Object[] {event.getElement()});
- getButton(IDialogConstants.OK_ID).setEnabled(true);
- }
- });
- }
- }
-
- /**
- * Returns the current listing of breakpoint <code>IWorkingSet</code>s
- * @return an array of the current breakpoint <code>IWorkingSet</code>s
- */
- private IWorkingSet[] getBreakpointWorkingSets() {
- IWorkingSet[] ws = PlatformUI.getWorkbench().getWorkingSetManager().getAllWorkingSets();
- ArrayList list = new ArrayList();
- for(int i = 0; i < ws.length; i++) {
- if(IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(ws[i].getId())) {
- list.add(ws[i]);
- }
- }
- return (IWorkingSet[]) list.toArray(new IWorkingSet[list.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
- */
- protected Object getViewerInput() {
- return fWorkingSetList;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
- */
- protected String getDialogSettingsId() {
- return SETTINGS_ID;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.SELECT_DEFAULT_WORKINGSET_DIALOG;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
- */
- protected String getViewerLabel() {
- return BreakpointGroupMessages.SelectBreakpointWorkingsetDialog_0;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SetDefaultBreakpointGroupAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SetDefaultBreakpointGroupAction.java
deleted file mode 100644
index f30a8cefb..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SetDefaultBreakpointGroupAction.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointSetOrganizer;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IWorkingSet;
-
-/**
- * Action which prompts the user to set a default breakpoint group.
- */
-public class SetDefaultBreakpointGroupAction extends AbstractBreakpointsViewAction {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- SelectBreakpointWorkingsetDialog sbwsd = new SelectBreakpointWorkingsetDialog(DebugUIPlugin.getShell());
- sbwsd.setTitle(BreakpointGroupMessages.SetDefaultBreakpointGroupAction_0);
- IWorkingSet workingSet = BreakpointSetOrganizer.getDefaultWorkingSet();
- if (workingSet != null){
- sbwsd.setInitialSelections(new Object[]{workingSet});
- }
- if(sbwsd.open() == Window.OK) {
- BreakpointSetOrganizer.setDefaultWorkingSet((IWorkingSet) sbwsd.getResult()[0]);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {}
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ToggleDefaultGroupAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ToggleDefaultGroupAction.java
deleted file mode 100644
index 7b777f266..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ToggleDefaultGroupAction.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointContainer;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointSetOrganizer;
-import org.eclipse.debug.internal.ui.views.breakpoints.WorkingSetCategory;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkingSet;
-
-/**
- * Toggles the default breakpoint group based on selection.
- */
-public class ToggleDefaultGroupAction extends AbstractBreakpointsViewAction {
-
- private IWorkingSet fSelectedSet;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- IWorkingSet defaultWorkingSet = BreakpointSetOrganizer.getDefaultWorkingSet();
- IWorkingSet set = null;
- if (!fSelectedSet.equals(defaultWorkingSet)) {
- set = fSelectedSet;
- }
- BreakpointSetOrganizer.setDefaultWorkingSet(set);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection sel) {
- fSelectedSet = null;
- if (sel instanceof IStructuredSelection) {
- IStructuredSelection selection = (IStructuredSelection) sel;
- if (selection.size() == 1) {
- Object firstElement = selection.getFirstElement();
- if (firstElement instanceof BreakpointContainer) {
- BreakpointContainer container = (BreakpointContainer) firstElement;
- if (container.getCategory() instanceof WorkingSetCategory) {
- WorkingSetCategory category = (WorkingSetCategory)container.getCategory();
- if (IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(category.getWorkingSet().getId())) {
- IWorkingSet set = category.getWorkingSet();
- action.setEnabled(true);
- boolean isDefault = set == BreakpointSetOrganizer.getDefaultWorkingSet();
- action.setChecked(isDefault);
- fSelectedSet = set;
- return;
- }
- }
- }
- }
- }
- action.setEnabled(false);
- action.setChecked(false);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/WorkingSetsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/WorkingSetsAction.java
deleted file mode 100644
index 341770534..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/WorkingSetsAction.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog;
-
-/**
- * Allows the user to manage working sets.
- */
-public class WorkingSetsAction extends AbstractBreakpointsViewAction {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- IWorkingSetSelectionDialog selectionDialog = PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetSelectionDialog(
- DebugUIPlugin.getShell(),
- false,
- new String[] {IDebugUIConstants.BREAKPOINT_WORKINGSET_ID});
- selectionDialog.open();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/AccessWatchpointToggleAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/AccessWatchpointToggleAction.java
deleted file mode 100644
index 64b98f929..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/AccessWatchpointToggleAction.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IWatchpoint;
-
-/**
- * Toggles access attribute of a watchpoint.
- */
-public class AccessWatchpointToggleAction extends ModifyWatchpointAction {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.ModifyWatchpointAction#isEnabled(org.eclipse.debug.core.model.IWatchpoint)
- */
- protected boolean isEnabled(IWatchpoint watchpoint) {
- return watchpoint.supportsAccess();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.ModifyWatchpointAction#toggleWatchpoint(org.eclipse.debug.core.model.IWatchpoint, boolean)
- */
- protected void toggleWatchpoint(IWatchpoint watchpoint, boolean b) throws CoreException {
- watchpoint.setAccess(b);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.ModifyWatchpointAction#isChecked(org.eclipse.debug.core.model.IWatchpoint)
- */
- protected boolean isChecked(IWatchpoint watchpoint) {
- try {
- return watchpoint.isAccess();
- } catch (CoreException e) {
- }
- return false;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointTypesContribution.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointTypesContribution.java
deleted file mode 100644
index 4fa2d566a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointTypesContribution.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.debug.internal.ui.actions.ToggleBreakpointsTargetManager;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.ContributionItem;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IPartService;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.actions.CompoundContributionItem;
-import org.eclipse.ui.menus.IWorkbenchContribution;
-import org.eclipse.ui.services.IServiceLocator;
-
-/**
- * Dynamic menu contribution that shows available breakpoint types from
- * toggleBreakpointsTargetFactories extension point.
- *
- * @since 3.5
- */
-public class BreakpointTypesContribution extends CompoundContributionItem implements IWorkbenchContribution {
-
- private class SelectTargetAction extends Action {
- private final Set fPossibleIDs;
- private final String fID;
- SelectTargetAction(String name, Set possibleIDs, String ID) {
- super(name, AS_RADIO_BUTTON);
- fID = ID;
- fPossibleIDs = possibleIDs;
- }
-
- public void run() {
- if (isChecked()) {
- ToggleBreakpointsTargetManager.getDefault().setPreferredTarget(fPossibleIDs, fID);
- }
- }
- }
-
- private IServiceLocator fServiceLocator;
-
- private static IContributionItem[] NO_BREAKPOINT_TYPES_CONTRIBUTION_ITEMS = new IContributionItem[] {
- new ContributionItem() {
- public void fill(Menu menu, int index) {
- MenuItem item = new MenuItem(menu, SWT.NONE);
- item.setEnabled(false);
- item.setText(Messages.BreakpointTypesContribution_0);
- }
-
- public boolean isEnabled() {
- return false;
- }
- }
- };
-
- protected IContributionItem[] getContributionItems() {
- IWorkbenchPart part = null;
- ISelection selection = null;
-
- ISelectionService selectionService =
- (ISelectionService)fServiceLocator.getService(ISelectionService.class);
- if (selectionService != null) {
- selection = selectionService.getSelection();
- }
- IPartService partService = (IPartService)fServiceLocator.getService(IPartService.class);
- if (partService != null) {
- part = partService.getActivePart();
- }
-
- // If no part or selection, disable all.
- if (part == null || selection == null) {
- return NO_BREAKPOINT_TYPES_CONTRIBUTION_ITEMS;
- }
-
- // Get breakpoint toggle target IDs.
- ToggleBreakpointsTargetManager manager = ToggleBreakpointsTargetManager.getDefault();
- Set enabledIDs = manager.getEnabledToggleBreakpointsTargetIDs(part, selection);
- String preferredId = manager.getPreferredToggleBreakpointsTargetID(part, selection);
-
- List actions = new ArrayList(enabledIDs.size());
- for (Iterator i = enabledIDs.iterator(); i.hasNext();) {
- String id = (String) i.next();
- Action action = new SelectTargetAction(manager.getToggleBreakpointsTargetName(id), enabledIDs, id);
- if (id.equals(preferredId)) {
- action.setChecked(true);
- }
- actions.add(action);
- }
-
- if ( enabledIDs.isEmpty() ) {
- return NO_BREAKPOINT_TYPES_CONTRIBUTION_ITEMS;
- }
-
- IContributionItem[] items = new IContributionItem[enabledIDs.size()];
- for (int i = 0; i < actions.size(); i++) {
- items[i] = new ActionContributionItem((Action) actions.get(i));
- }
- return items;
- }
-
- public void initialize(IServiceLocator serviceLocator) {
- fServiceLocator = serviceLocator;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsCollapseAllAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsCollapseAllAction.java
deleted file mode 100644
index 03e9c96d0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsCollapseAllAction.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.commands.ActionHandler;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.handlers.CollapseAllHandler;
-import org.eclipse.ui.handlers.IHandlerService;
-
-/**
- *
- */
-public class BreakpointsCollapseAllAction implements IViewActionDelegate, IActionDelegate2 {
-
- private BreakpointsView fView;
-
- private IAction fAction;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- fView= (BreakpointsView) view;
- IHandlerService hs = (IHandlerService) view.getSite().getService(IHandlerService.class);
- if (hs != null) {
- hs.activateHandler(CollapseAllHandler.COMMAND_ID, new ActionHandler(fAction));
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- fView.getCheckboxViewer().collapseAll();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#dispose()
- */
- public void dispose() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- fAction = action;
- action.setActionDefinitionId(CollapseAllHandler.COMMAND_ID);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsExpandAllAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsExpandAllAction.java
deleted file mode 100644
index e3c91aa9b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsExpandAllAction.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
-/**
- * Action which fully expands the tree in the breakpoints view.
- */
-public class BreakpointsExpandAllAction implements IViewActionDelegate {
-
- private BreakpointsView fView;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- fView= (BreakpointsView) view;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- fView.getCheckboxViewer().expandAll();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DeleteWorkingsetsMessageDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DeleteWorkingsetsMessageDialog.java
deleted file mode 100644
index 90b1748ab..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DeleteWorkingsetsMessageDialog.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Allows the user to specify if they want to delete the working set, all the breakpoints in the working
- * set or both
- * @since 3.2
- */
-public class DeleteWorkingsetsMessageDialog extends MessageDialog {
-
- /**
- * to determine if we should delete the working set as well
- */
- private boolean fDeleteWorkingsets = false;
-
- /**
- * to determine if we should delete all the breakpoints in the set.
- * to maintain backward compatibility this is by default true
- */
- private boolean fDeleteBreakpoints = true;
-
- //widgets
- private Button fDeleteWS;
- private Button fDeleteBPS;
-
- // dialog settings
- private final static String DIALOG_SETTINGS = "DeleteBreakpointsDialogSettings"; //$NON-NLS-1$
- private static final String DELETE_BREAKPOINTS = "DeleteBreakpoints"; //$NON-NLS-1$
- private static final String DELETE_WORKINGSETS = "DeleteWorkingSets"; //$NON-NLS-1$
-
- public DeleteWorkingsetsMessageDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage, int dialogImageType, String[] dialogButtonLabels, int defaultIndex) {
- super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
- IDialogSettings section = getDialogSettings();
- fDeleteBreakpoints = section.getBoolean(DELETE_BREAKPOINTS);
- fDeleteWorkingsets = section.getBoolean(DELETE_WORKINGSETS);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.MessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createCustomArea(Composite parent) {
- Composite comp = new Composite(parent, SWT.NONE);
- comp.setLayout(new GridLayout());
- Font font = parent.getFont();
- fDeleteWS = new Button(comp, SWT.CHECK);
- fDeleteWS.setText(ActionMessages.DeleteWorkingsetsMessageDialog_0);
- fDeleteWS.setFont(font);
- fDeleteWS.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- getButton(0).setEnabled(fDeleteWS.getSelection() || fDeleteBPS.getSelection());
- }
- });
-
- fDeleteBPS = new Button(comp, SWT.CHECK);
- fDeleteBPS.setText(ActionMessages.DeleteWorkingsetsMessageDialog_1);
- fDeleteBPS.setFont(font);
- fDeleteBPS.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- getButton(0).setEnabled(fDeleteWS.getSelection() || fDeleteBPS.getSelection());
- }
- });
-
- fDeleteWS.setSelection(fDeleteWorkingsets);
- fDeleteBPS.setSelection(fDeleteBreakpoints);
- return comp;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.MessageDialog#buttonPressed(int)
- */
- protected void buttonPressed(int buttonId) {
- if(buttonId == OK) {
- fDeleteBreakpoints = fDeleteBPS.getSelection();
- fDeleteWorkingsets = fDeleteWS.getSelection();
- IDialogSettings dialogSettings = getDialogSettings();
- dialogSettings.put(DELETE_BREAKPOINTS, fDeleteBreakpoints);
- dialogSettings.put(DELETE_WORKINGSETS, fDeleteWorkingsets);
- }
- super.buttonPressed(buttonId);
- }
-
- /**
- * return the checked value of the delete working set check box
- * @return the checked state of the delete working set check box
- */
- public boolean deleteWorkingset() {
- return fDeleteWorkingsets;
- }
-
- /**
- * returns the checked state of the delete all breakpoints in working set check box
- * @return the checked state of the delete all breakpoints... check box
- */
- public boolean deleteAllBreakpoints() {
- return fDeleteBreakpoints;
- }
-
- /**
- * Returns the dialog settings for this dialog.
- *
- * @return dialog settings
- */
- protected IDialogSettings getDialogSettings() {
- DebugUIPlugin plugin = DebugUIPlugin.getDefault();
- IDialogSettings workbenchSettings = plugin.getDialogSettings();
- IDialogSettings section = workbenchSettings.getSection(DIALOG_SETTINGS);
- if (section == null) {
- section = workbenchSettings.addNewSection(DIALOG_SETTINGS);
- section.put(DELETE_BREAKPOINTS, true);
- section.put(DELETE_WORKINGSETS, false);
- }
- return section;
- }
-
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DisableBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DisableBreakpointsAction.java
deleted file mode 100644
index 0af9112d1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DisableBreakpointsAction.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-
-public class DisableBreakpointsAction extends EnableBreakpointsAction {
-
- /**
- * This action disables breakpoints.
- */
- protected boolean isEnableAction() {
- return false;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java
deleted file mode 100644
index 35cd2a1e7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IMarkerDelta;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointsListener;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointContainer;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-
-public class EnableBreakpointsAction implements IViewActionDelegate, IPartListener, IBreakpointsListener {
-
- private IViewPart fView;
- private IAction fAction;
-
- public EnableBreakpointsAction() {
- }
-
- protected IViewPart getView() {
- return fView;
- }
-
- protected void setView(IViewPart view) {
- fView = view;
- }
-
- /**
- * @see IViewActionDelegate#init(IViewPart)
- */
- public void init(IViewPart view) {
- setView(view);
- DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
- view.getViewSite().getPage().addPartListener(this);
- }
-
- protected void update() {
- selectionChanged(getAction(), getView().getViewSite().getSelectionProvider().getSelection());
- }
-
- /**
- * This action enables breakpoints.
- */
- protected boolean isEnableAction() {
- return true;
- }
-
- /**
- * @see IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- IStructuredSelection selection= getSelection();
- final int size= selection.size();
- if (size == 0) {
- return;
- }
-
- final Iterator itr= selection.iterator();
- final MultiStatus ms= new MultiStatus(DebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, ActionMessages.EnableBreakpointAction_Enable_breakpoint_s__failed_2, null);
- IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) {
- while (itr.hasNext()) {
- Object element= itr.next();
- try {
- IBreakpoint[] breakpoints= null;
- if (element instanceof IBreakpoint) {
- breakpoints= new IBreakpoint[] { (IBreakpoint) element };
- } else if (element instanceof BreakpointContainer) {
- breakpoints= ((BreakpointContainer) element).getBreakpoints();
- }
- if (breakpoints != null) {
- setEnabled(breakpoints);
- }
- } catch (CoreException e) {
- ms.merge(e.getStatus());
- }
- }
- }
- public void setEnabled(IBreakpoint[] breakpoints) throws CoreException {
- boolean enable= isEnableAction();
- for (int i = 0; i < breakpoints.length; i++) {
- breakpoints[i].setEnabled(enable);
- }
- }
- };
-
- try {
- ResourcesPlugin.getWorkspace().run(runnable, null, 0, new NullProgressMonitor());
- } catch (CoreException e) {
- // Exceptions are handled by runnable
- }
-
- if (!ms.isOK()) {
- IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- DebugUIPlugin.errorDialog(window.getShell(), ActionMessages.EnableBreakpointAction_Enabling_breakpoints_3, ActionMessages.EnableBreakpointAction_Exceptions_occurred_enabling_the_breakpoint_s___4, ms); //
- } else {
- DebugUIPlugin.log(ms);
- }
- }
- }
-
- private IStructuredSelection getSelection() {
- return (IStructuredSelection)getView().getViewSite().getSelectionProvider().getSelection();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- setAction(action);
- if (!(selection instanceof IStructuredSelection)) {
- return;
- }
- IStructuredSelection sel= (IStructuredSelection)selection;
-
- Iterator itr= sel.iterator();
- boolean allEnabled= true;
- boolean allDisabled= true;
- while (itr.hasNext()) {
- Object selected= itr.next();
- if (selected instanceof BreakpointContainer) {
- IBreakpoint[] breakpoints = ((BreakpointContainer) selected).getBreakpoints();
- for (int i = 0; i < breakpoints.length; i++) {
- try {
- if (breakpoints[i].isEnabled()) {
- allDisabled= false;
- } else {
- allEnabled= false;
- }
- } catch (CoreException ce) {
- handleException(ce);
- }
- }
- } else if (selected instanceof IBreakpoint) {
- IBreakpoint bp= (IBreakpoint)selected;
- try {
- if (bp.isEnabled()) {
- allDisabled= false;
- } else {
- allEnabled= false;
- }
- } catch (CoreException ce) {
- handleException(ce);
- }
- } else {
- return;
- }
-
- }
-
- if (isEnableAction()) {
- action.setEnabled(!allEnabled);
- } else {
- action.setEnabled(!allDisabled);
- }
- }
-
- private void handleException(CoreException ce) {
- IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- DebugUIPlugin.errorDialog(window.getShell(), ActionMessages.EnableBreakpointAction_Enabling_breakpoints_3, ActionMessages.EnableBreakpointAction_Exceptions_occurred_enabling_the_breakpoint_s___4, ce); //
- } else {
- DebugUIPlugin.log(ce);
- }
- }
-
-
- /**
- * Removes this action as a breakpoint and part listener.
- */
- public void dispose() {
- DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
- getView().getViewSite().getPage().removePartListener(this);
- }
-
- /**
- * @see IBreakpointsListener#breakpointsAdded(IBreakpoint[])
- */
- public void breakpointsAdded(IBreakpoint[] breakpoints) {
- }
-
- /**
- * @see IBreakpointsListener#breakpointsRemoved(IBreakpoint[], IMarkerDelta[])
- */
- public void breakpointsRemoved(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
- asynchUpdate();
- }
-
- /**
- * @see IBreakpointsListener#breakpointsChanged(IBreakpoint[], IMarkerDelta[])
- */
- public void breakpointsChanged(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
- asynchUpdate();
- }
-
- protected void asynchUpdate() {
- if (getAction() == null) {
- return;
- }
- IWorkbenchWindow window= getView().getViewSite().getPage().getWorkbenchWindow();
- if (window == null) {
- return;
- }
- Shell shell= window.getShell();
- if (shell == null || shell.isDisposed()) {
- return;
- }
- Runnable r= new Runnable() {
- public void run() {
- IWorkbenchWindow ww= getView().getViewSite().getPage().getWorkbenchWindow();
- if (ww == null) {
- return;
- }
- Shell s= ww.getShell();
- if (s == null || s.isDisposed()) {
- return;
- }
- update();
- }
- };
-
- shell.getDisplay().asyncExec(r);
- }
-
- protected IAction getAction() {
- return fAction;
- }
-
- protected void setAction(IAction action) {
- fAction = action;
- }
- /**
- * @see IPartListener#partActivated(IWorkbenchPart)
- */
- public void partActivated(IWorkbenchPart part) {
- }
-
- /**
- * @see IPartListener#partBroughtToTop(IWorkbenchPart)
- */
- public void partBroughtToTop(IWorkbenchPart part) {
- }
-
- /**
- * @see IPartListener#partClosed(IWorkbenchPart)
- */
- public void partClosed(IWorkbenchPart part) {
- if (part.equals(getView())) {
- dispose();
- }
- }
-
- /**
- * @see IPartListener#partDeactivated(IWorkbenchPart)
- */
- public void partDeactivated(IWorkbenchPart part) {
- }
-
- /**
- * @see IPartListener#partOpened(IWorkbenchPart)
- */
- public void partOpened(IWorkbenchPart part) {
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/LinkBreakpointsWithDebugViewAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/LinkBreakpointsWithDebugViewAction.java
deleted file mode 100644
index e7b5454c8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/LinkBreakpointsWithDebugViewAction.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
-/**
- * An action which toggles the "Link with Debug View" preference on a
- * breakpoints view.
- */
-public class LinkBreakpointsWithDebugViewAction implements IViewActionDelegate {
-
- private BreakpointsView fView;
- private IAction fAction= null;
-
- public LinkBreakpointsWithDebugViewAction() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- fView= (BreakpointsView) view;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- fView.setTrackSelection(action.isChecked());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- if (fAction == null) {
- action.setChecked(fView.isTrackingSelection());
- fAction= action;
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/Messages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/Messages.java
deleted file mode 100644
index aae625048..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/Messages.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- *
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.actions.breakpoints.Messages"; //$NON-NLS-1$
- public static String RetargetMethodBreakpointAction_0;
- public static String RetargetToggleBreakpointAction_0;
- public static String RetargetToggleLineBreakpointAction_0;
- public static String RetargetWatchpointAction_0;
- public static String BreakpointTypesContribution_0;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/Messages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/Messages.properties
deleted file mode 100644
index 2316854c2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/Messages.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-###############################################################################
-# Copyright (c) 2007, 2009 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-RetargetMethodBreakpointAction_0=The operation is unavailable on the current selection. Please place the cursor inside a method.
-RetargetToggleBreakpointAction_0=The operation is unavailable on the current selection. Please place the cursor in a valid location for a breakpoint.
-RetargetWatchpointAction_0=The operation is unavailable on the current selection. Please select or place the cursor on a field.
-RetargetToggleLineBreakpointAction_0=The operation is unavailable on the current selection. Please place the cursor on a valid line.
-BreakpointTypesContribution_0=None Available \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModificationWatchpointToggleAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModificationWatchpointToggleAction.java
deleted file mode 100644
index 632590e69..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModificationWatchpointToggleAction.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IWatchpoint;
-
-/**
- * Toggles access attribute of a watchpoint.
- */
-public class ModificationWatchpointToggleAction extends ModifyWatchpointAction {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.ModifyWatchpointAction#isEnabled(org.eclipse.debug.core.model.IWatchpoint)
- */
- protected boolean isEnabled(IWatchpoint watchpoint) {
- return watchpoint.supportsModification();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.ModifyWatchpointAction#toggleWatchpoint(org.eclipse.debug.core.model.IWatchpoint, boolean)
- */
- protected void toggleWatchpoint(IWatchpoint watchpoint, boolean b) throws CoreException {
- watchpoint.setModification(b);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.ModifyWatchpointAction#isChecked(org.eclipse.debug.core.model.IWatchpoint)
- */
- protected boolean isChecked(IWatchpoint watchpoint) {
- try {
- return watchpoint.isModification();
- } catch (CoreException e) {
- }
- return false;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModifyWatchpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModifyWatchpointAction.java
deleted file mode 100644
index c7ea345f6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModifyWatchpointAction.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IWatchpoint;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Action that modifies a watchpoint's access/modification attributes
- */
-public abstract class ModifyWatchpointAction implements IObjectActionDelegate, IActionDelegate2 {
-
- private IStructuredSelection fWatchpoints = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- try {
- if (fWatchpoints != null) {
- Iterator iterator = fWatchpoints.iterator();
- while (iterator.hasNext()) {
- IWatchpoint watchpoint = (IWatchpoint)iterator.next();
- toggleWatchpoint(watchpoint, action.isChecked());
- }
- }
- } catch (CoreException e) {
- DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), ActionMessages.ModifyWatchpointAction_0, ActionMessages.ModifyWatchpointAction_1, e.getStatus()); //
- }
-
- }
-
- /**
- * Toggles the watch point attribute to the given value.
- *
- * @param watchpoint
- * @param b on or off
- */
- protected abstract void toggleWatchpoint(IWatchpoint watchpoint, boolean b) throws CoreException;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- fWatchpoints = (IStructuredSelection) selection;
- if (!selection.isEmpty()) {
- Iterator iterator = fWatchpoints.iterator();
- while (iterator.hasNext()) {
- Object next = iterator.next();
- if (next instanceof IWatchpoint) {
- IWatchpoint watchpoint = (IWatchpoint) next;
- action.setChecked(isChecked(watchpoint));
- if (!isEnabled(watchpoint)) {
- action.setEnabled(false);
- return;
- }
- }
- }
- action.setEnabled(true);
- return;
- }
- }
- action.setEnabled(false);
- }
-
- /**
- * Returns whether the action should be checke for the current selection
- *
- * @param watchpoint selected watchpoint
- * @return whether the action should be checke for the current selection
- */
- protected abstract boolean isChecked(IWatchpoint watchpoint);
-
- /**
- * Returns whether this action is enabled for the given watchpoint.
- *
- * @param watchpoint
- * @return whether this action is enabled for the given watchpoint
- */
- protected abstract boolean isEnabled(IWatchpoint watchpoint);
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#dispose()
- */
- public void dispose() {
- fWatchpoints = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/OpenBreakpointMarkerAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/OpenBreakpointMarkerAction.java
deleted file mode 100644
index b292f4c63..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/OpenBreakpointMarkerAction.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.SelectionProviderAction;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-public class OpenBreakpointMarkerAction extends SelectionProviderAction {
-
- protected static DelegatingModelPresentation fgPresentation = new DelegatingModelPresentation();
- private IBreakpoint breakpoint;
- private IEditorInput input;
-
- public OpenBreakpointMarkerAction(ISelectionProvider selectionProvider) {
- super(selectionProvider, ActionMessages.OpenBreakpointMarkerAction__Go_to_File_1);
- setToolTipText(ActionMessages.OpenBreakpointMarkerAction_Go_to_File_for_Breakpoint_2);
- setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.ui.ide", "icons/full/elcl16/gotoobj_tsk.gif")); //$NON-NLS-1$ //$NON-NLS-2$
- setDisabledImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.ui.ide", "icons/full/dlcl16/gotoobj_tsk.gif")); //$NON-NLS-1$ //$NON-NLS-2$
- PlatformUI.getWorkbench().getHelpSystem().setHelp(
- this,
- IDebugHelpContextIds.OPEN_BREAKPOINT_ACTION);
- setEnabled(false);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- IWorkbenchWindow dwindow= DebugUIPlugin.getActiveWorkbenchWindow();
- if (dwindow == null) {
- return;
- }
- IWorkbenchPage page= dwindow.getActivePage();
- if (page == null) {
- return;
- }
-
- IStructuredSelection selection= getStructuredSelection();
- if (selection.isEmpty()) {
- setEnabled(false);
- return;
- }
-
- IEditorPart part= null;
- if (input != null) {
- String editorId = fgPresentation.getEditorId(input, breakpoint);
- if (editorId != null) {
- try {
- part= page.openEditor(input, editorId);
- } catch (PartInitException e) {
- DebugUIPlugin.errorDialog(dwindow.getShell(), ActionMessages.OpenBreakpointMarkerAction_Go_to_Breakpoint_1, ActionMessages.OpenBreakpointMarkerAction_Exceptions_occurred_attempting_to_open_the_editor_for_the_breakpoint_resource_2, e); //
- }
- }
- }
- if (part != null) {
- part.setFocus();
- IDE.gotoMarker(part, breakpoint.getMarker());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.SelectionProviderAction#selectionChanged(org.eclipse.jface.viewers.IStructuredSelection)
- */
- public void selectionChanged(IStructuredSelection sel) {
- if (sel.size() == 1) {
- Object element = sel.getFirstElement();
- if (element instanceof IBreakpoint) {
- breakpoint= (IBreakpoint) element;
- input= fgPresentation.getEditorInput(breakpoint);
- if (input != null) {
- setEnabled(true);
- return;
- }
- }
- } else {
- breakpoint = null;
- input = null;
- }
- setEnabled(false);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveAllBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveAllBreakpointsAction.java
deleted file mode 100644
index dec17fb03..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveAllBreakpointsAction.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-
-import org.eclipse.core.resources.IMarkerDelta;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.IBreakpointsListener;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.AbstractRemoveAllActionDelegate;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * Removes all breakpoints from the source (markers) and remove all
- * breakpoints from processes
- */
-public class RemoveAllBreakpointsAction extends AbstractRemoveAllActionDelegate implements IBreakpointsListener {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#isEnabled()
- */
- protected boolean isEnabled() {
- return DebugPlugin.getDefault().getBreakpointManager().hasBreakpoints();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IBreakpointsListener#breakpointsAdded(org.eclipse.debug.core.model.IBreakpoint[])
- */
- public void breakpointsAdded(IBreakpoint[] breakpoints) {
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IBreakpointsListener#breakpointsChanged(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.resources.IMarkerDelta[])
- */
- public void breakpointsChanged(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IBreakpointsListener#breakpointsRemoved(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.resources.IMarkerDelta[])
- */
- public void breakpointsRemoved(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
- if (getAction() != null) {
- update();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#initialize()
- */
- protected void initialize() {
- DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {
- DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- final IBreakpointManager breakpointManager= DebugPlugin.getDefault().getBreakpointManager();
- final IBreakpoint[] breakpoints = breakpointManager.getBreakpoints();
- if (breakpoints.length < 1) {
- return;
- }
- IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
- if (window == null) {
- return;
- }
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- boolean prompt = store.getBoolean(IDebugPreferenceConstants.PREF_PROMPT_REMOVE_ALL_BREAKPOINTS);
- boolean proceed = true;
- if(prompt) {
- MessageDialogWithToggle mdwt = MessageDialogWithToggle.openYesNoQuestion(window.getShell(), ActionMessages.RemoveAllBreakpointsAction_0,
- ActionMessages.RemoveAllBreakpointsAction_1, ActionMessages.RemoveAllBreakpointsAction_3, !prompt, null, null);
- if(mdwt.getReturnCode() != IDialogConstants.YES_ID){
- proceed = false;
- }
- else {
- store.setValue(IDebugPreferenceConstants.PREF_PROMPT_REMOVE_ALL_BREAKPOINTS, !mdwt.getToggleState());
- }
- }
- if (proceed) {
- new Job(ActionMessages.RemoveAllBreakpointsAction_2) {
- protected IStatus run(IProgressMonitor monitor) {
- try {
- breakpointManager.removeBreakpoints(breakpoints, true);
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- return Status.CANCEL_STATUS;
- }
- return Status.OK_STATUS;
- }
- }.schedule();
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveBreakpointAction.java
deleted file mode 100644
index 6d9aa0982..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveBreakpointAction.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.AbstractRemoveActionDelegate;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointContainer;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView;
-import org.eclipse.debug.internal.ui.views.breakpoints.WorkingSetCategory;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.PlatformUI;
-
-public class RemoveBreakpointAction extends AbstractRemoveActionDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- IStructuredSelection selection = getSelection();
- if (selection.isEmpty()) {
- return;
- }
- final Iterator itr= selection.iterator();
- final CoreException[] exception= new CoreException[1];
- IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) {
- ArrayList breakpointsToDelete = new ArrayList();
- ArrayList groupsToDelete = new ArrayList();
- boolean deleteAll = false;
- boolean deleteContainer = false;
- boolean prompted = false;
- while (itr.hasNext()) {
- Object next= itr.next();
- if (next instanceof IBreakpoint) {
- breakpointsToDelete.add(next);
- } else if (next instanceof BreakpointContainer) {
- //the the container is a workingset, ask if they want to delete it as well
- BreakpointContainer bpc = (BreakpointContainer) next;
- if(bpc.getCategory() instanceof WorkingSetCategory) {
- IWorkingSet set = ((WorkingSetCategory)bpc.getCategory()).getWorkingSet();
- if(!prompted) {
- prompted = true;
- DeleteWorkingsetsMessageDialog dialog = new DeleteWorkingsetsMessageDialog(getView().getSite().getShell(),
- ActionMessages.RemoveBreakpointAction_3,
- null,
- ActionMessages.RemoveBreakpointAction_4,
- MessageDialog.QUESTION,
- new String[] {ActionMessages.RemoveBreakpointAction_5, ActionMessages.RemoveBreakpointAction_6},
- 0);
- if(dialog.open() == 0) {
- deleteAll = dialog.deleteAllBreakpoints();
- deleteContainer = dialog.deleteWorkingset();
- }
- }
- if(deleteContainer) {
- groupsToDelete.add(set);
- }
- }
- else {
- if(!prompted) {
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- prompted = store.getBoolean(IDebugPreferenceConstants.PREF_PROMPT_REMOVE_BREAKPOINTS_FROM_CONTAINER);
- if(prompted) {
- MessageDialogWithToggle mdwt = MessageDialogWithToggle.openYesNoQuestion(getView().getSite().getShell(), ActionMessages.RemoveBreakpointAction_0,
- ActionMessages.RemoveBreakpointAction_1, ActionMessages.RemoveAllBreakpointsAction_3, !prompted, null, null);
- if(mdwt.getReturnCode() == IDialogConstants.YES_ID) {
- store.setValue(IDebugPreferenceConstants.PREF_PROMPT_REMOVE_BREAKPOINTS_FROM_CONTAINER, !mdwt.getToggleState());
- deleteAll = true;
- }
- else {
- deleteAll = false;
- }
- }
- else {
- deleteAll = !prompted;
- }
- }
- }
- if(deleteAll) {
- IBreakpoint[] breakpoints = bpc.getBreakpoints();
- for (int i = 0; i < breakpoints.length; i++) {
- breakpointsToDelete.add(breakpoints[i]);
- }
- }
- }
- }
- final IBreakpoint[] breakpoints = (IBreakpoint[]) breakpointsToDelete.toArray(new IBreakpoint[0]);
- final IWorkingSet[] sets = (IWorkingSet[])groupsToDelete.toArray(new IWorkingSet[groupsToDelete.size()]);
- if(breakpoints.length > 0) {
- ((BreakpointsView)getView()).preserveSelection(getSelection());
- }
- new Job(ActionMessages.RemoveBreakpointAction_2) {
- protected IStatus run(IProgressMonitor pmonitor) {
- try {
- DebugPlugin.getDefault().getBreakpointManager().removeBreakpoints(breakpoints, true);
- for (int i = 0; i < sets.length; i++) {
- PlatformUI.getWorkbench().getWorkingSetManager().removeWorkingSet(sets[i]);
- }
- return Status.OK_STATUS;
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- return Status.CANCEL_STATUS;
- }
- }.schedule();
- }
- };
- try {
- ResourcesPlugin.getWorkspace().run(runnable, null, 0, null);
- } catch (CoreException ce) {
- exception[0]= ce;
- }
- if (exception[0] != null) {
- IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- DebugUIPlugin.errorDialog(window.getShell(), ActionMessages.RemoveBreakpointAction_Removing_a_breakpoint_4,ActionMessages.RemoveBreakpointAction_Exceptions_occurred_attempting_to_remove_a_breakpoint__5 , exception[0]);
- } else {
- DebugUIPlugin.log(exception[0]);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.AbstractSelectionActionDelegate#isEnabledFor(java.lang.Object)
- */
- protected boolean isEnabledFor(Object element) {
- if (element instanceof BreakpointContainer) {
- if(((BreakpointContainer)element).getCategory() instanceof WorkingSetCategory) {
- return true;
- }
- return ((BreakpointContainer)element).getChildren().length > 0;
- }
- return super.isEnabledFor(element);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetBreakpointAction.java
deleted file mode 100644
index ba626f833..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetBreakpointAction.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - added support for IToggleBreakpointsTargetFactory
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.internal.ui.actions.IToggleBreakpointsTargetManagerListener;
-import org.eclipse.debug.internal.ui.actions.RetargetAction;
-import org.eclipse.debug.internal.ui.actions.ToggleBreakpointsTargetManager;
-import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-
-
-/**
- * Retargettable breakpoint action.
- *
- * @since 3.0
- */
-public abstract class RetargetBreakpointAction extends RetargetAction implements IToggleBreakpointsTargetManagerListener {
-
- private IAction fAction;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RetargetAction#getAdapterClass()
- */
- protected Class getAdapterClass() {
- return IToggleBreakpointsTarget.class;
- }
-
- protected Object getAdapter(IAdaptable adaptable) {
- ToggleBreakpointsTargetManager manager = ToggleBreakpointsTargetManager.getDefault();
- return manager.getToggleBreakpointsTarget(getActivePart(), getTargetSelection());
- }
-
- public void init(IWorkbenchWindow window) {
- super.init(window);
- ToggleBreakpointsTargetManager.getDefault().addChangedListener(this);
- }
-
- public void init(IAction action) {
- super.init(action);
- ToggleBreakpointsTargetManager.getDefault().addChangedListener(this);
- }
-
- public void dispose() {
- ToggleBreakpointsTargetManager.getDefault().removeChangedListener(this);
- super.dispose();
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- fAction = action;
- super.selectionChanged(action, selection);
- }
-
- public void preferredTargetsChanged() {
- if (fAction != null) {
- IWorkbenchPart activePart = getActivePart();
- if (activePart != null) {
- ISelectionProvider provider = activePart.getSite().getSelectionProvider();
- if (provider != null) {
- ISelection selection = provider.getSelection();
- // Force the toggle target to be refreshed.
- super.clearPart(activePart);
- super.partActivated(activePart);
- super.selectionChanged(fAction, selection);
- }
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetMethodBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetMethodBreakpointAction.java
deleted file mode 100644
index 9c2e6ce8d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetMethodBreakpointAction.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-
-/**
- * Global retargettable toggle method breakpoint action.
- *
- * @since 3.0
- */
-public class RetargetMethodBreakpointAction extends RetargetBreakpointAction {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RetargetBreakpointAction#performAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
- */
- protected void performAction(Object target, ISelection selection, IWorkbenchPart part) throws CoreException {
- ((IToggleBreakpointsTarget)target).toggleMethodBreakpoints(part, selection);
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RetargetBreakpointAction#canPerformAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
- */
- protected boolean canPerformAction(Object target, ISelection selection, IWorkbenchPart part) {
- return ((IToggleBreakpointsTarget)target).canToggleMethodBreakpoints(part, selection);
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RetargetAction#getOperationUnavailableMessage()
- */
- protected String getOperationUnavailableMessage() {
- return Messages.RetargetMethodBreakpointAction_0;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleBreakpointAction.java
deleted file mode 100644
index 201b1c86b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleBreakpointAction.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
-import org.eclipse.debug.ui.actions.IToggleBreakpointsTargetExtension;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-
-/**
- * Global retargettable toggle breakpoint action.
- *
- * @since 3.3
- */
-public class RetargetToggleBreakpointAction extends RetargetBreakpointAction {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RetargetBreakpointAction#performAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
- */
- protected void performAction(Object target, ISelection selection, IWorkbenchPart part) throws CoreException {
- if (target instanceof IToggleBreakpointsTargetExtension) {
- IToggleBreakpointsTargetExtension ext = (IToggleBreakpointsTargetExtension) target;
- ext.toggleBreakpoints(part, selection);
- } else {
- ((IToggleBreakpointsTarget)target).toggleLineBreakpoints(part, selection);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RetargetBreakpointAction#canPerformAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
- */
- protected boolean canPerformAction(Object target, ISelection selection, IWorkbenchPart part) {
- if (target instanceof IToggleBreakpointsTargetExtension) {
- IToggleBreakpointsTargetExtension ext = (IToggleBreakpointsTargetExtension) target;
- return ext.canToggleBreakpoints(part, selection);
- } else {
- return ((IToggleBreakpointsTarget)target).canToggleLineBreakpoints(part, selection);
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RetargetAction#getOperationUnavailableMessage()
- */
- protected String getOperationUnavailableMessage() {
- return Messages.RetargetToggleBreakpointAction_0;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleLineBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleLineBreakpointAction.java
deleted file mode 100644
index a117419ed..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleLineBreakpointAction.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-
-/**
- * Global retargettable toggle line breakpoint action.
- *
- * @since 3.0
- */
-public class RetargetToggleLineBreakpointAction extends RetargetBreakpointAction {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RetargetBreakpointAction#performAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
- */
- protected void performAction(Object target, ISelection selection, IWorkbenchPart part) throws CoreException {
- ((IToggleBreakpointsTarget)target).toggleLineBreakpoints(part, selection);
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RetargetBreakpointAction#canPerformAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
- */
- protected boolean canPerformAction(Object target, ISelection selection, IWorkbenchPart part) {
- return ((IToggleBreakpointsTarget)target).canToggleLineBreakpoints(part, selection);
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RetargetAction#getOperationUnavailableMessage()
- */
- protected String getOperationUnavailableMessage() {
- return Messages.RetargetToggleLineBreakpointAction_0;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetWatchpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetWatchpointAction.java
deleted file mode 100644
index 38466f41b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetWatchpointAction.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-
-/**
- * Global retargettable toggle watchpoint action.
- *
- * @since 3.0
- */
-public class RetargetWatchpointAction extends RetargetBreakpointAction {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RetargetBreakpointAction#performAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
- */
- protected void performAction(Object target, ISelection selection, IWorkbenchPart part) throws CoreException {
- ((IToggleBreakpointsTarget)target).toggleWatchpoints(part, selection);
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RetargetBreakpointAction#canPerformAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
- */
- protected boolean canPerformAction(Object target, ISelection selection, IWorkbenchPart part) {
- return ((IToggleBreakpointsTarget)target).canToggleWatchpoints(part, selection);
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.RetargetAction#getOperationUnavailableMessage()
- */
- protected String getOperationUnavailableMessage() {
- return Messages.RetargetWatchpointAction_0;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RulerEnableDisableBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RulerEnableDisableBreakpointAction.java
deleted file mode 100644
index ff37aa448..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RulerEnableDisableBreakpointAction.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.actions.RulerBreakpointAction;
-import org.eclipse.jface.text.source.IVerticalRulerInfo;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * @since 3.2
- *
- */
-public class RulerEnableDisableBreakpointAction extends RulerBreakpointAction implements IUpdate {
-
- private IBreakpoint fBreakpoint;
-
- public RulerEnableDisableBreakpointAction(ITextEditor editor, IVerticalRulerInfo info) {
- super(editor, info);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- if (fBreakpoint != null) {
- try {
- fBreakpoint.setEnabled(!fBreakpoint.isEnabled());
- } catch (CoreException e) {
- DebugUIPlugin.errorDialog(getEditor().getSite().getShell(), ActionMessages.RulerEnableDisableBreakpointAction_0, ActionMessages.RulerEnableDisableBreakpointAction_1, e.getStatus());
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
- public void update() {
- fBreakpoint = getBreakpoint();
- setEnabled(fBreakpoint != null);
- if (fBreakpoint != null) {
- try {
- if (fBreakpoint.isEnabled()) {
- setText(ActionMessages.RulerEnableDisableBreakpointAction_2);
- } else {
- setText(ActionMessages.RulerEnableDisableBreakpointAction_3);
- }
- } catch (CoreException e) {
- }
- } else {
- setText(ActionMessages.RulerEnableDisableBreakpointAction_2);
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SelectAllBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SelectAllBreakpointsAction.java
deleted file mode 100644
index 5f1e29f5f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SelectAllBreakpointsAction.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-import org.eclipse.core.resources.IMarkerDelta;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointsListener;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.actions.SelectAllAction;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView;
-import org.eclipse.debug.ui.IDebugView;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-
-public class SelectAllBreakpointsAction extends SelectAllAction implements IBreakpointsListener {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#isEnabled()
- */
- protected boolean isEnabled() {
- return DebugPlugin.getDefault().getBreakpointManager().hasBreakpoints();
- }
-
- public void run(IAction action) {
- if (!(getView() instanceof BreakpointsView)) {
- return;
- }
- CheckboxTreeViewer viewer = ((BreakpointsView) getView()).getCheckboxViewer();
- viewer.getTree().selectAll();
- // ensure that the selection change callback is fired
- viewer.setSelection(viewer.getSelection());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IBreakpointsListener#breakpointsAdded(org.eclipse.debug.core.model.IBreakpoint[])
- */
- public void breakpointsAdded(IBreakpoint[] breakpoints) {
- if (getAction() != null && !getAction().isEnabled()) {
- update();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IBreakpointsListener#breakpointsChanged(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.resources.IMarkerDelta[])
- */
- public void breakpointsChanged(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IBreakpointsListener#breakpointsRemoved(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.resources.IMarkerDelta[])
- */
- public void breakpointsRemoved(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
- if (getAction() != null) {
- update();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#initialize()
- */
- protected void initialize() {
- DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#dispose()
- */
- public void dispose() {
- DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.selection.SelectAllAction#getActionId()
- */
- protected String getActionId() {
- return IDebugView.SELECT_ALL_ACTION;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.java
deleted file mode 100644
index 280986f31..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.actions.ToggleFilterAction;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointContainer;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * An view filter action that filters showing breakpoints based on whether
- * the IDebugTarget of the selected debug element in the launch view supports
- * the breakpoints.
- *
- * @see org.eclipse.debug.core.model.IDebugTarget#supportsBreakpoint(IBreakpoint)
- *
- */
-public class ShowSupportedBreakpointsAction extends ToggleFilterAction implements ISelectionListener {
-
- /**
- * The view associated with this action
- */
- private BreakpointsView fView;
-
- /**
- * The list of identifiers for the current state
- */
- private List fDebugTargets= new ArrayList(2);
-
- /**
- * A viewer filter that selects breakpoints that have
- * the same model identifier as the selected debug element
- */
- class BreakpointFilter extends ViewerFilter {
-
- /**
- * @see ViewerFilter#select(Viewer, Object, Object)
- */
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (element instanceof BreakpointContainer) {
- // Breakpoint containers are visible if any of their children are visible.
- IBreakpoint[] breakpoints = ((BreakpointContainer) element).getBreakpoints();
- for (int i = 0; i < breakpoints.length; i++) {
- if (select(viewer, element, breakpoints[i])) {
- return true;
- }
- }
- return false;
- }
- IBreakpoint breakpoint= (IBreakpoint)element;
- if (fDebugTargets.isEmpty()) {
- return true;
- }
- Iterator iterator= fDebugTargets.iterator();
- while (iterator.hasNext()) {
- IDebugTarget target = (IDebugTarget) iterator.next();
- if (target.supportsBreakpoint(breakpoint)) {
- return true;
- }
-
- }
- return false;
- }
-
- }
-
- public ShowSupportedBreakpointsAction(StructuredViewer viewer, IViewPart view) {
- super();
- setText(ActionMessages.ShowSupportedBreakpointsAction_Show_For_Selected);
- setToolTipText(ActionMessages.ShowSupportedBreakpointsAction_tooltip);
- setViewerFilter(new BreakpointFilter());
- setViewer(viewer);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_OBJS_DEBUG_TARGET));
- setChecked(false);
- setId(DebugUIPlugin.getUniqueIdentifier() + ".ShowSupportedBreakpointsAction"); //$NON-NLS-1$
-
- setView(view);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(
- this,
- IDebugHelpContextIds.SHOW_BREAKPOINTS_FOR_MODEL_ACTION);
-
- }
-
-
-
- public void dispose() {
- if (isChecked()) {
- getView().getSite().getPage().removeSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, this);
- }
- }
-
- /**
- * @see ISelectionListener#selectionChanged(IWorkbenchPart, ISelection)
- */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss= (IStructuredSelection)selection;
- List debugTargets= getDebugTargets(ss);
- if (!isChecked()) {
- fDebugTargets= debugTargets;
- return;
- }
- if (debugTargets.isEmpty()) {
- if(fDebugTargets.isEmpty()) {
- return;
- }
- reapplyFilters(debugTargets);
- return;
- }
- if (fDebugTargets.isEmpty()) {
- reapplyFilters(debugTargets);
- return;
- }
-
- if (debugTargets.size() == fDebugTargets.size()) {
- List copy= new ArrayList(debugTargets.size());
- Iterator iter= fDebugTargets.iterator();
- while (iter.hasNext()) {
- IDebugTarget target = (IDebugTarget) iter.next();
- Iterator newDebugTargets= debugTargets.iterator();
- while (newDebugTargets.hasNext()) {
- IDebugTarget newTarget= (IDebugTarget)newDebugTargets.next();
- copy.add(newTarget);
- if (target.equals(newTarget)) {
- newDebugTargets.remove();
- }
- }
- }
- //check for real change
- if (debugTargets.isEmpty()) {
- return;
- }
- reapplyFilters(copy);
- }
- }
- }
-
-
- /**
- * Selection has changed in the debug view
- * need to reapply the filters.
- */
- protected void reapplyFilters(List debugTargets) {
- fDebugTargets= debugTargets;
- getViewer().refresh();
- }
-
- protected IViewPart getView() {
- return fView;
- }
-
- protected void setView(IViewPart view) {
- fView = (BreakpointsView) view;
- }
-
- protected List getDebugTargets(IStructuredSelection ss) {
- List debugTargets= new ArrayList(2);
- Iterator i= ss.iterator();
- while (i.hasNext()) {
- Object next= i.next();
- if (next instanceof IDebugElement) {
- debugTargets.add(((IDebugElement)next).getDebugTarget());
- } else if (next instanceof ILaunch) {
- IDebugTarget[] targets= ((ILaunch)next).getDebugTargets();
- for (int j = 0; j < targets.length; j++) {
- debugTargets.add(targets[j]);
- }
- } else if (next instanceof IProcess) {
- IDebugTarget target= (IDebugTarget)((IProcess)next).getAdapter(IDebugTarget.class);
- if (target != null) {
- debugTargets.add(target);
- }
- }
- }
- return debugTargets;
- }
-
- /**
- * Adds or removes the viewer filter depending
- * on the value of the parameter.
- */
- protected void valueChanged(boolean on) {
- if (getViewer().getControl().isDisposed()) {
- return;
- }
- if (on) {
- getView().getSite().getPage().addSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, this);
- ISelection selection= getView().getSite().getPage().getSelection(IDebugUIConstants.ID_DEBUG_VIEW);
- selectionChanged(null, selection);
- } else {
- getView().getSite().getPage().removeSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, this);
- }
- super.valueChanged(on);
- fView.getViewer().refresh();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SkipAllBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SkipAllBreakpointsAction.java
deleted file mode 100644
index fe246aee6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SkipAllBreakpointsAction.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.IBreakpointManagerListener;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
-
-/**
- * An action which toggles the breakpoint manager's enablement.
- * This causes debug targets which honor the manager's enablement
- * to skip (not suspend for) all breakpoints.
- *
- * This class also implements the window action delegate for the action presented as
- * part of the "Breakpoints" group for the "Run" menu.
- */
-public class SkipAllBreakpointsAction extends Action implements IWorkbenchWindowActionDelegate, IBreakpointManagerListener {
-
- //The real action if this is an action delegate
- private IAction fAction;
-
- /**
- * Workbench part or <code>null</code> if not installed in a part
- */
- private IWorkbenchPart fPart = null;
-
- public SkipAllBreakpointsAction() {
- super(ActionMessages.SkipAllBreakpointsAction_0);
- setToolTipText(ActionMessages.SkipAllBreakpointsAction_0);
- setDescription(ActionMessages.SkipAllBreakpointsAction_2);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_SKIP_BREAKPOINTS));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.SKIP_ALL_BREAKPOINT_ACTION);
- updateActionCheckedState();
- }
-
- /**
- * Constructs an action in the given part.
- *
- * @param part
- */
- public SkipAllBreakpointsAction(IWorkbenchPart part) {
- this();
- fPart = part;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run(){
- IWorkbenchSiteProgressService progressService = null;
- if (fPart != null) {
- progressService = (IWorkbenchSiteProgressService)fPart.getSite().
- getAdapter(IWorkbenchSiteProgressService.class);
- }
- Job job = new Job(getText()) {
- protected IStatus run(IProgressMonitor monitor) {
- if (!monitor.isCanceled()) {
- IBreakpointManager bm = getBreakpointManager();
- bm.setEnabled(!bm.isEnabled());
- }
- return Status.OK_STATUS;
- }
- };
- if (progressService != null) {
- progressService.schedule(job);
- } else {
- job.schedule();
- }
- }
-
- /**
- * Updates the action's checked state to be opposite the enabled
- * state of the breakpoint manager.
- */
- public void updateActionCheckedState() {
- if (fAction != null) {
- fAction.setChecked(!getBreakpointManager().isEnabled());
- } else {
- setChecked(!getBreakpointManager().isEnabled());
- }
- }
-
- /**
- * Returns the global breakpoint manager.
- *
- * @return the global breakpoint manager
- */
- public static IBreakpointManager getBreakpointManager() {
- return DebugPlugin.getDefault().getBreakpointManager();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {
- getBreakpointManager().removeBreakpointManagerListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
- updateActionCheckedState();
- getBreakpointManager().addBreakpointManagerListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- run();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- fAction = action;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IBreakpointManagerListener#breakpointManagerEnablementChanged(boolean)
- */
- public void breakpointManagerEnablementChanged(boolean enabled) {
- if (fAction != null) {
- fAction.setChecked(!enabled);
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ToggleBreakpointObjectActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ToggleBreakpointObjectActionDelegate.java
deleted file mode 100644
index e60c65e1f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ToggleBreakpointObjectActionDelegate.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - added support for IToggleBreakpointsTargetFactory
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpoints;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.internal.ui.actions.ToggleBreakpointsTargetManager;
-import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * A toggle breakpoint action that can be contributed to an object. The action
- * will perform a toggle breakpoint operation for a selected object.
- *
- * <p>Clients may subclass this class.</p>
- *
- * @since 3.0
- */
-public abstract class ToggleBreakpointObjectActionDelegate implements IObjectActionDelegate, IActionDelegate2 {
-
- private IWorkbenchPart fPart;
- private IStructuredSelection fSelection;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- fPart = targetPart;
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- IToggleBreakpointsTarget target =
- ToggleBreakpointsTargetManager.getDefault().getToggleBreakpointsTarget(fPart, fSelection);
- if (target != null) {
- try {
- performAction(target, fPart, fSelection);
- } catch (CoreException e) {
- DebugPlugin.log(e);
- }
- }
- }
-
- /**
- * Performs the operation specific to this action.
- *
- * @param target adapter to toggle breakpoints
- * @param part the active part
- * @param selection the seleciton in the active part
- * @exception CoreException if an exception occurrs
- */
- protected abstract void performAction(IToggleBreakpointsTarget target, IWorkbenchPart part, ISelection selection) throws CoreException;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- boolean enabled = false;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- this.fSelection = ss;
- // selectionChagned() can sometimes be called before setActivePart().
- // Guard here against that possibility.
- if (fPart != null) {
- IToggleBreakpointsTarget target =
- ToggleBreakpointsTargetManager.getDefault().getToggleBreakpointsTarget(fPart, fSelection);
- enabled = target != null;
- }
- }
- action.setEnabled(enabled);
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#dispose()
- */
- public void dispose() {
- fSelection = null;
- fPart = null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/AddWatchExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/AddWatchExpressionAction.java
deleted file mode 100644
index a458d9e06..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/AddWatchExpressionAction.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.expressions;
-
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IWatchExpression;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
-/**
- * Open a watch expression dialog and add the created watch expression to the
- * expression view.
- */
-public class AddWatchExpressionAction extends WatchExpressionAction implements IViewActionDelegate {
-
- /**
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- // create a watch expression
- IWatchExpression watchExpression= DebugPlugin.getDefault().getExpressionManager().newWatchExpression(IInternalDebugCoreConstants.EMPTY_STRING);
- // open the watch expression dialog
- if (new WatchExpressionDialog(DebugUIPlugin.getShell(), watchExpression, false).open() == Window.OK) {
- // if OK is selected, add the expression to the expression view and try to evaluate the expression.
- DebugPlugin.getDefault().getExpressionManager().addExpression(watchExpression);
- watchExpression.setExpressionContext(getContext());
- }
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ConvertToWatchExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ConvertToWatchExpressionAction.java
deleted file mode 100644
index bfa6c941b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ConvertToWatchExpressionAction.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.expressions;
-
-
-import java.util.Iterator;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IExpressionManager;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.core.model.IWatchExpression;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * Convert one or more expressions to the equivalent watch expressions.
- * Refresh and re-evaluate the expressions if possible.
- */
-public class ConvertToWatchExpressionAction extends WatchExpressionAction {
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- IStructuredSelection selection= getCurrentSelection();
- IExpressionManager expressionManager= DebugPlugin.getDefault().getExpressionManager();
- for (Iterator iter= selection.iterator(); iter.hasNext();) {
- IExpression expression= (IExpression) iter.next();
- // create the new watch expression
- IWatchExpression watchExpression= expressionManager.newWatchExpression(expression.getExpressionText());
- expressionManager.removeExpression(expression);
- expressionManager.addExpression(watchExpression);
- // refresh and re-evaluate
- watchExpression.setExpressionContext(getContext());
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/DisableWatchExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/DisableWatchExpressionAction.java
deleted file mode 100644
index 0f0a291ea..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/DisableWatchExpressionAction.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.expressions;
-
-
-/**
- *
- */
-public class DisableWatchExpressionAction extends EnableWatchExpressionAction {
-
- public DisableWatchExpressionAction() {
- fEnable= false;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressionAction.java
deleted file mode 100644
index c858ca31c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressionAction.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - integration with non-standard debug models (Bug 209883)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.expressions;
-
-
-import org.eclipse.debug.core.model.IWatchExpression;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-
-/**
- * Open the watch expression dialog for the select watch expression.
- * Re-evaluate and refresh the watch expression is necessary.
- */
-public class EditWatchExpressionAction extends WatchExpressionAction {
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- IWatchExpression watchExpression= getSelectedExpressions()[0];
- // display the watch expression dialog for the currently selected watch expression
- new WatchExpressionDialog(DebugUIPlugin.getShell(), watchExpression, true).open();
- }
-
- public void selectionChanged(IAction action, ISelection sel) {
- action.setEnabled(getSelectedExpressions().length == 1);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java
deleted file mode 100644
index d398287dc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - integration with non-standard debug models (Bug 209883)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.expressions;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.model.IWatchExpression;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
-/**
- *
- */
-public class EnableWatchExpressionAction implements IViewActionDelegate, IActionDelegate2, IDebugEventSetListener {
-
- private ISelection fSelection;
- private IAction fAction;
- protected boolean fEnable= true;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- DebugPlugin.getDefault().addDebugEventListener(this);
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- if (fSelection instanceof IStructuredSelection) {
- Iterator iter= ((IStructuredSelection) fSelection).iterator();
- IWatchExpression expression;
- while (iter.hasNext()) {
- expression= getWatchExpression(iter.next());
- if (expression != null) {
- expression.setEnabled(fEnable);
- fireWatchExpressionChanged(expression);
- }
- }
- } else if (fSelection instanceof IWatchExpression) {
- IWatchExpression expression= ((IWatchExpression) fSelection);
- expression.setEnabled(fEnable);
- fireWatchExpressionChanged(expression);
- }
- }
-
- /**
- * @param expression
- */
- private void fireWatchExpressionChanged(IWatchExpression expression) {
- DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] {new DebugEvent(expression, DebugEvent.CHANGE)});
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- fSelection= selection;
- if (fSelection instanceof IStructuredSelection) {
- boolean enabled= false;
- Iterator iter= ((IStructuredSelection) selection).iterator();
- while (iter.hasNext()) {
- IWatchExpression expression = getWatchExpression(iter.next());
- if (expression != null && expression.isEnabled() != fEnable) {
- enabled= true;
- break;
- }
- }
- action.setEnabled(enabled);
- } else if (fSelection instanceof IWatchExpression) {
- action.setEnabled(((IWatchExpression) fSelection).isEnabled() != fEnable);
- } else {
- action.setEnabled(false);
- }
- }
-
- private IWatchExpression getWatchExpression(Object element) {
- if (element instanceof IWatchExpression) {
- return (IWatchExpression)element;
- } else if (element instanceof IAdaptable) {
- return (IWatchExpression)((IAdaptable)element).getAdapter(IWatchExpression.class);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#dispose()
- */
- public void dispose() {
- DebugPlugin.getDefault().removeDebugEventListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- fAction = action;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
- */
- public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- DebugEvent event = events[i];
- if (event.getSource() instanceof IWatchExpression) {
- if (event.getKind() == DebugEvent.CHANGE) {
- selectionChanged(fAction, fSelection);
- }
- }
- }
-
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/PasteWatchExpressionsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/PasteWatchExpressionsAction.java
deleted file mode 100644
index 36e8ad6b5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/PasteWatchExpressionsAction.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Adobe Systems, Inc. and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Adobe Systems, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.expressions;
-
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.views.expression.ExpressionView;
-import org.eclipse.ui.actions.SelectionListenerAction;
-
-/**
- * Paste a watch expression into the expressions view.
- */
-public class PasteWatchExpressionsAction extends SelectionListenerAction {
-
- private final ExpressionView fExpressionView;
-
- public PasteWatchExpressionsAction(ExpressionView expressionView) {
- super(ActionMessages.PasteWatchExpressionsAction_0);
- fExpressionView = expressionView;
-// setToolTipText(BreakpointGroupMessages.PasteWatchExpressionsAction_1);
-// PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.PASTE_WATCH_EXPRESSIONS_ACTION);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run() {
- if (fExpressionView.canPaste()) {
- fExpressionView.performPaste();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#isEnabled()
- */
- public boolean isEnabled() {
- return fExpressionView.canPaste();
- }
-
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ReevaluateWatchExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ReevaluateWatchExpressionAction.java
deleted file mode 100644
index c768367ad..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ReevaluateWatchExpressionAction.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - integration with non-standard debug models (Bug 209883)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.expressions;
-
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IWatchExpression;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Ask to re-evaluate one or more watch expressions in the context of the
- * currently selected thread.
- */
-public class ReevaluateWatchExpressionAction implements IObjectActionDelegate {
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- * Finds the currently selected context in the UI.
- */
- protected IDebugElement getContext() {
- IAdaptable object = DebugUITools.getDebugContext();
- IDebugElement context = null;
- if (object instanceof IDebugElement) {
- context = (IDebugElement) object;
- } else if (object instanceof ILaunch) {
- context = ((ILaunch) object).getDebugTarget();
- }
- return context;
- }
-
- protected IStructuredSelection getCurrentSelection() {
- IWorkbenchPage page = DebugUIPlugin.getActiveWorkbenchWindow().getActivePage();
- if (page != null) {
- ISelection selection = page.getSelection();
- if (selection instanceof IStructuredSelection) {
- return (IStructuredSelection) selection;
- }
- }
- return null;
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- IDebugElement context = getContext();
- for (Iterator iter= getCurrentSelection().iterator(); iter.hasNext();) {
- IWatchExpression expression= (IWatchExpression) iter.next();
- expression.setExpressionContext(context);
- if (!expression.isEnabled()) {
- // Force a reevaluation
- expression.evaluate();
- }
- }
- }
-
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- IDebugElement debugElement = getContext();
- if (debugElement == null) {
- action.setEnabled(false);
- } else {
- action.setEnabled(true);
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveAllExpressionsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveAllExpressionsAction.java
deleted file mode 100644
index 209de9dac..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveAllExpressionsAction.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.expressions;
-
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IExpressionManager;
-import org.eclipse.debug.core.IExpressionsListener;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.AbstractRemoveAllActionDelegate;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * Removes all expressions from the expressions view.
- */
-public class RemoveAllExpressionsAction extends AbstractRemoveAllActionDelegate implements IExpressionsListener {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- boolean prompt = store.getBoolean(IDebugPreferenceConstants.PREF_PROMPT_REMOVE_ALL_EXPRESSIONS);
- boolean proceed = true;
- if (prompt) {
- MessageDialogWithToggle mdwt = MessageDialogWithToggle.openYesNoQuestion(window.getShell(), ActionMessages.RemoveAllExpressionsAction_0,
- ActionMessages.RemoveAllExpressionsAction_1, ActionMessages.RemoveAllBreakpointsAction_3, !prompt, null, null);
- if(mdwt.getReturnCode() != IDialogConstants.YES_ID){
- proceed = false;
- }
- else {
- store.setValue(IDebugPreferenceConstants.PREF_PROMPT_REMOVE_ALL_EXPRESSIONS, !mdwt.getToggleState());
- }
- }
- if (proceed) {
- IExpressionManager manager = DebugPlugin.getDefault().getExpressionManager();
- IExpression[] expressions= manager.getExpressions();
- manager.removeExpressions(expressions);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#isEnabled()
- */
- protected boolean isEnabled() {
- return DebugPlugin.getDefault().getExpressionManager().hasExpressions();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#initialize()
- */
- protected void initialize() {
- DebugPlugin.getDefault().getExpressionManager().addExpressionListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#dispose()
- */
- public void dispose() {
- DebugPlugin.getDefault().getExpressionManager().removeExpressionListener(this);
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IExpressionsListener#expressionsAdded(org.eclipse.debug.core.model.IExpression[])
- */
- public void expressionsAdded(IExpression[] expressions) {
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IExpressionsListener#expressionsRemoved(org.eclipse.debug.core.model.IExpression[])
- */
- public void expressionsRemoved(IExpression[] expressions) {
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IExpressionsListener#expressionsChanged(org.eclipse.debug.core.model.IExpression[])
- */
- public void expressionsChanged(IExpression[] expressions) {}
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveExpressionAction.java
deleted file mode 100644
index 8ea98abc9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveExpressionAction.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - integration with non-standard debug models (Bug 209883)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.expressions;
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IExpressionManager;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.internal.ui.actions.AbstractRemoveActionDelegate;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.ui.progress.WorkbenchJob;
-
-public class RemoveExpressionAction extends AbstractRemoveActionDelegate {
-
- protected IExpression[] getExpressions() {
- TreeSelection selection = (TreeSelection) getSelection();
- TreePath[] paths = selection.getPaths();
- List expressions = new ArrayList();
- for (int i = paths.length-1; i >=0; i--) {
- TreePath path = paths[i];
- Object segment = path.getFirstSegment();
- if (segment instanceof IExpression) {
- expressions.add(segment);
- } else if (segment instanceof IAdaptable) {
- IExpression expression = (IExpression)((IAdaptable)segment).getAdapter(IExpression.class);
- if (expression != null) {
- expressions.add(expression);
- }
- }
- }
- return (IExpression[]) expressions.toArray(new IExpression[expressions.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- WorkbenchJob job = new WorkbenchJob("remove expression") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- IExpressionManager expManager = DebugPlugin.getDefault().getExpressionManager();
- IExpression[] exp = getExpressions();
- if (exp != null) {
- expManager.removeExpressions(exp);
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- schedule(job);
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/SelectAllExpressionsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/SelectAllExpressionsAction.java
deleted file mode 100644
index 2e9da1b1e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/SelectAllExpressionsAction.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.expressions;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IExpressionsListener;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.internal.ui.actions.SelectAllAction;
-import org.eclipse.debug.ui.IDebugView;
-
-public class SelectAllExpressionsAction extends SelectAllAction implements IExpressionsListener {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#isEnabled()
- */
- protected boolean isEnabled() {
- return DebugPlugin.getDefault().getExpressionManager().hasExpressions();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.SelectAllAction#getActionId()
- */
- protected String getActionId() {
- return IDebugView.SELECT_ALL_ACTION + ".Variables"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.AbstractRemoveAllActionDelegate#initialize()
- */
- protected void initialize() {
- DebugPlugin.getDefault().getExpressionManager().addExpressionListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IExpressionsListener#expressionsAdded(org.eclipse.debug.core.model.IExpression[])
- */
- public void expressionsAdded(IExpression[] expressions) {
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IExpressionsListener#expressionsRemoved(org.eclipse.debug.core.model.IExpression[])
- */
- public void expressionsRemoved(IExpression[] expressions) {
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IExpressionsListener#expressionsChanged(org.eclipse.debug.core.model.IExpression[])
- */
- public void expressionsChanged(IExpression[] expressions) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.AbstractRemoveAllActionDelegate#dispose()
- */
- public void dispose() {
- super.dispose();
- DebugPlugin.getDefault().getExpressionManager().removeExpressionListener(this);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionAction.java
deleted file mode 100644
index d835bfb4d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionAction.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - integration with non-standard debug models (Bug 209883)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.expressions;
-
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IWatchExpression;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Generic abstract class for the actions associated to the java watch
- * expressions.
- */
-public abstract class WatchExpressionAction implements IViewActionDelegate {
- IWorkbenchPart fPart = null;
-
- private static IWatchExpression[] EMPTY_EXPRESSION_ARRAY = new IWatchExpression[0];
-
- public void init(IViewPart view) {
- fPart = view;
- }
-
- /**
- * Finds the currently selected context in the UI.
- */
- protected IDebugElement getContext() {
- IAdaptable object = DebugUITools.getDebugContext();
- IDebugElement context = null;
- if (object instanceof IDebugElement) {
- context = (IDebugElement) object;
- } else if (object instanceof ILaunch) {
- context = ((ILaunch) object).getDebugTarget();
- }
- return context;
- }
-
- protected IWatchExpression[] getSelectedExpressions() {
- List list = new LinkedList();
- IStructuredSelection currentSelection = getCurrentSelection();
- if (currentSelection == null) {
- return EMPTY_EXPRESSION_ARRAY;
- }
-
- for (Iterator iter= currentSelection.iterator(); iter.hasNext();) {
- Object element = iter.next();
- if (element instanceof IWatchExpression) {
- list.add(element);
- } else if (element instanceof IAdaptable) {
- IWatchExpression expr = (IWatchExpression)((IAdaptable)element).getAdapter(IWatchExpression.class);
- if (expr != null) {
- list.add(expr);
- } else {
- return EMPTY_EXPRESSION_ARRAY;
- }
- } else {
- return EMPTY_EXPRESSION_ARRAY;
- }
- }
-
- return (IWatchExpression[])list.toArray(new IWatchExpression[list.size()]);
- }
-
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection sel) {
- }
-
- protected IStructuredSelection getCurrentSelection() {
- IWorkbenchPage page = DebugUIPlugin.getActiveWorkbenchWindow().getActivePage();
- if (page != null) {
- ISelection selection = page.getSelection();
- if (selection instanceof IStructuredSelection) {
- return (IStructuredSelection) selection;
- }
- }
- return null;
- }
-
- /**
- * Displays the given error message in the status line.
- *
- * @param message
- */
- protected void showErrorMessage(String message) {
- if (fPart instanceof IViewPart) {
- IViewSite viewSite = ((IViewPart) fPart).getViewSite();
- IStatusLineManager manager = viewSite.getActionBars().getStatusLineManager();
- manager.setErrorMessage(message);
- Display.getCurrent().beep();
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java
deleted file mode 100644
index bf994e59d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.expressions;
-
-
-import org.eclipse.debug.core.model.IWatchExpression;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.actions.StatusInfo;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.dialogs.StatusDialog;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.ITextOperationTarget;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.console.actions.TextViewerAction;
-
-/**
- * Dialog for edit watch expression.
- */
-public class WatchExpressionDialog extends StatusDialog {
-
- /**
- * The detail formatter to edit.
- */
- private IWatchExpression fWatchExpression;
-
- // widgets
- private SourceViewer fSnippetViewer;
- private Button fCheckBox;
-
- public WatchExpressionDialog(Shell parent, IWatchExpression watchExpression, boolean editDialog) {
- super(parent);
- fWatchExpression= watchExpression;
- setShellStyle(getShellStyle() | SWT.MAX | SWT.RESIZE);
- String helpContextId = null;
- if (editDialog) {
- setTitle(ActionMessages.WatchExpressionDialog_0);
- helpContextId = IDebugHelpContextIds.EDIT_WATCH_EXPRESSION_DIALOG;
- } else {
- setTitle(ActionMessages.WatchExpressionDialog_1);
- helpContextId = IDebugHelpContextIds.ADD_WATCH_EXPRESSION_DIALOG;
- }
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, helpContextId);
- }
-
- /**
- * Create the dialog area.
- *
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(Composite)
- */
- protected Control createDialogArea(Composite parent) {
- Font font = parent.getFont();
-
- Composite container = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- container.setLayout(layout);
- GridData gd= new GridData(GridData.FILL_BOTH);
- container.setLayoutData(gd);
-
- // snippet label
- Label label = new Label(container, SWT.NONE);
- label.setText(ActionMessages.WatchExpressionDialog_2);
- gd= new GridData(GridData.BEGINNING);
- label.setLayoutData(gd);
- label.setFont(font);
-
- fSnippetViewer = new SourceViewer(container, null, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.LEFT_TO_RIGHT);
- fSnippetViewer.setInput(this);
-
- IDocument document = new Document();
- fSnippetViewer.configure(new SourceViewerConfiguration());
- fSnippetViewer.setEditable(true);
- fSnippetViewer.setDocument(document);
- document.addDocumentListener(new IDocumentListener() {
- public void documentAboutToBeChanged(DocumentEvent event) {
- }
- public void documentChanged(DocumentEvent event) {
- checkValues();
- }
- });
-
- fSnippetViewer.getTextWidget().setFont(JFaceResources.getTextFont());
-
- Control control= fSnippetViewer.getControl();
- gd= new GridData(GridData.FILL_BOTH);
- gd.heightHint= convertHeightInCharsToPixels(10);
- gd.widthHint= convertWidthInCharsToPixels(80);
- control.setLayoutData(gd);
- fSnippetViewer.getDocument().set(fWatchExpression.getExpressionText());
-
- // actions
- final TextViewerAction cutAction = new TextViewerAction(fSnippetViewer, ITextOperationTarget.CUT);
- cutAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_CUT));
- cutAction.setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_CUT_DISABLED));
- cutAction.setText(ActionMessages.WatchExpressionDialogMenu_0);
- final TextViewerAction copyAction = new TextViewerAction(fSnippetViewer, ITextOperationTarget.COPY);
- copyAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
- copyAction.setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));
- copyAction.setText(ActionMessages.WatchExpressionDialogMenu_1);
- final TextViewerAction pasteAction = new TextViewerAction(fSnippetViewer, ITextOperationTarget.PASTE);
- pasteAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
- pasteAction.setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED));
- pasteAction.setText(ActionMessages.WatchExpressionDialogMenu_2);
-
- // context menu
- MenuManager menuManager = new MenuManager();
- menuManager.add(cutAction);
- menuManager.add(copyAction);
- menuManager.add(pasteAction);
- menuManager.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- cutAction.update();
- copyAction.update();
- pasteAction.update();
- }
- });
- Menu menu = menuManager.createContextMenu(fSnippetViewer.getTextWidget());
- fSnippetViewer.getTextWidget().setMenu(menu);
-
- // enable checkbox
- fCheckBox= new Button(container, SWT.CHECK | SWT.LEFT);
- fCheckBox.setText(ActionMessages.WatchExpressionDialog_3);
- fCheckBox.setSelection(fWatchExpression.isEnabled());
- fCheckBox.setFont(font);
-
- applyDialogFont(container);
- fSnippetViewer.getControl().setFocus();
- return container;
- }
-
- /**
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- fWatchExpression.setEnabled(fCheckBox.getSelection());
- fWatchExpression.setExpressionText(fSnippetViewer.getDocument().get());
- super.okPressed();
- }
-
- /**
- * Check the field values and display a message in the status if needed.
- */
- private void checkValues() {
- StatusInfo status= new StatusInfo();
- if (fSnippetViewer.getDocument().get().trim().length() == 0) {
- status.setError(ActionMessages.WatchExpressionDialog_4);
- }
- updateStatus(status);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionFactoryTester.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionFactoryTester.java
deleted file mode 100644
index 6f300f4e3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionFactoryTester.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.expressions;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.ui.actions.IWatchExpressionFactoryAdapter;
-import org.eclipse.debug.ui.actions.IWatchExpressionFactoryAdapter2;
-import org.eclipse.debug.ui.actions.IWatchExpressionFactoryAdapterExtension;
-
-/**
- * This class is used to check whether a given element can be used to create
- * a watch expression. A single property can be tested
- * "canCreateWatchExpression". Test for this property ignores the value and
- * always returns a boolean.
- *
- * @since 3.4
- */
-public class WatchExpressionFactoryTester extends PropertyTester {
-
- public static final String CAN_CREATE_WATCH_EXPRESSION_PROPERTY = "canCreateWatchExpression"; //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.core.expressions.PropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
- */
- public boolean test(Object element, String property, Object[] args, Object expectedValue) {
- if (CAN_CREATE_WATCH_EXPRESSION_PROPERTY.equals(property)){
- if (element instanceof IVariable) {
- IVariable variable = (IVariable)element;
- if (DebugPlugin.getDefault().getExpressionManager().hasWatchExpressionDelegate(variable.getModelIdentifier())) {
- IWatchExpressionFactoryAdapter factory = WatchHandler.getFactory(variable);
- if (factory instanceof IWatchExpressionFactoryAdapterExtension) {
- IWatchExpressionFactoryAdapterExtension ext = (IWatchExpressionFactoryAdapterExtension) factory;
- return ext.canCreateWatchExpression(variable);
- }
- return true;
- }
- } else {
- IWatchExpressionFactoryAdapter2 factory2 = WatchHandler.getFactory2(element);
- if (factory2 != null) {
- return factory2.canCreateWatchExpression(element);
- }
- }
- }
- return false;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchHandler.java
deleted file mode 100644
index 8fbd74b21..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchHandler.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.expressions;
-
-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.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.core.model.IWatchExpression;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.actions.IWatchExpressionFactoryAdapter;
-import org.eclipse.debug.ui.actions.IWatchExpressionFactoryAdapter2;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Handler for creating a watch expression.
- *
- * @since 3.4
- */
-public class WatchHandler extends AbstractHandler {
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- ISelection selection = HandlerUtil.getCurrentSelection(event);
- if (selection instanceof IStructuredSelection) {
- Iterator iter = ((IStructuredSelection)selection).iterator();
- while (iter.hasNext()) {
- Object element = iter.next();
- createExpression(element);
- }
- }
- return null;
- }
-
-
- private void showExpressionsView() {
- IWorkbenchPage page = DebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IViewPart part = page.findView(IDebugUIConstants.ID_EXPRESSION_VIEW);
- if (part == null) {
- try {
- page.showView(IDebugUIConstants.ID_EXPRESSION_VIEW);
- } catch (PartInitException e) {
- }
- } else {
- page.bringToTop(part);
- }
-
- }
-
- private void createExpression(Object element) {
- String expressionString;
- try {
- if (element instanceof IVariable) {
- IVariable variable = (IVariable)element;
- IWatchExpressionFactoryAdapter factory = getFactory(variable);
- expressionString = variable.getName();
- if (factory != null) {
- expressionString = factory.createWatchExpression(variable);
- }
- } else {
- IWatchExpressionFactoryAdapter2 factory2 = getFactory2(element);
- if (factory2 != null) {
- expressionString = factory2.createWatchExpression(element);
- } else {
- // Action should not have been enabled
- return;
- }
- }
- } catch (CoreException e) {
- DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), ActionMessages.WatchAction_0, ActionMessages.WatchAction_1, e); //
- return;
- }
-
- IWatchExpression expression;
- expression = DebugPlugin.getDefault().getExpressionManager().newWatchExpression(expressionString);
- DebugPlugin.getDefault().getExpressionManager().addExpression(expression);
- IAdaptable object = DebugUITools.getDebugContext();
- IDebugElement context = null;
- if (object instanceof IDebugElement) {
- context = (IDebugElement) object;
- } else if (object instanceof ILaunch) {
- context = ((ILaunch) object).getDebugTarget();
- }
- expression.setExpressionContext(context);
- showExpressionsView();
- }
-
-
- /**
- * Returns the factory adapter for the given variable or <code>null</code> if none.
- *
- * @param variable
- * @return factory or <code>null</code>
- */
- static IWatchExpressionFactoryAdapter getFactory(IVariable variable) {
- return (IWatchExpressionFactoryAdapter) variable.getAdapter(IWatchExpressionFactoryAdapter.class);
- }
-
- /**
- * Returns the factory adapter for the given variable or <code>null</code> if none.
- *
- * @param variable
- * @return factory or <code>null</code>
- */
- static IWatchExpressionFactoryAdapter2 getFactory2(Object element) {
- if (element instanceof IAdaptable) {
- return (IWatchExpressionFactoryAdapter2)((IAdaptable)element).getAdapter(IWatchExpressionFactoryAdapter2.class);
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java
deleted file mode 100644
index c1a5fab94..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.variables;
-
-
-import com.ibm.icu.text.MessageFormat;
-import java.util.Iterator;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IValueModification;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.VariableValueEditorManager;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.views.variables.VariablesView;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.actions.IVariableValueEditor;
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.SelectionProviderAction;
-
-/**
- * Action for changing the value of primitives and <code>String</code> variables.
- * This action will attempt to delegate the editing operation to a registered
- * variable value editor, if any is provided for the variable's debug model.
- * @see org.eclipse.debug.ui.actions.VariableValueEditorManager
- */
-public class ChangeVariableValueAction extends SelectionProviderAction {
-
- protected IVariable fVariable;
- private VariablesView fView;
- private boolean fEditing= false;
-
- /**
- * Creates a new ChangeVariableValueAction for the given variables view
- * @param view the variables view in which this action will appear
- */
- public ChangeVariableValueAction(VariablesView view) {
- super(view.getViewer(), ActionMessages.ChangeVariableValue_title);
- setDescription(ActionMessages.ChangeVariableValue_toolTipText);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_CHANGE_VARIABLE_VALUE));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_CHANGE_VARIABLE_VALUE));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_CHANGE_VARIABLE_VALUE));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(
- this,
- IDebugHelpContextIds.CHANGE_VALUE_ACTION);
- fView= view;
- }
-
- /**
- * Edit the variable value with an in-line text editor.
- */
- protected void doActionPerformed(final IVariable variable) {
- Shell shell = fView.getViewSite().getShell();
- // If a previous edit is still in progress, don't start another
- if (fEditing) {
- return;
- }
- fEditing= true;
- fVariable = variable;
- if (!delegateEdit(shell)) {
- doDefaultEdit(shell);
- }
- fEditing= false;
- }
-
- /**
- * Attempts to edit the variable by delegating to anyone who's
- * contributed a variable value editor via extension. Returns
- * <code>true</code> if a delegate handled the edit, <code>false</code>
- * if the variable still needs to be edited.
- *
- * @param shell a shell for prompting the user
- * @return whether or not a delegate attempted to edit the variable
- */
- private boolean delegateEdit(Shell shell) {
- String modelIdentifier = fVariable.getModelIdentifier();
- IVariableValueEditor editor= VariableValueEditorManager.getDefault().getVariableValueEditor(modelIdentifier);
- if (editor != null) {
- return editor.editVariable(fVariable, shell);
- }
- return false;
- }
-
- /**
- * Edits the variable using the default variable editor
- * @param shell a shell for prompting the user
- */
- protected void doDefaultEdit(Shell shell) {
- String name= IInternalDebugCoreConstants.EMPTY_STRING;
- String value= IInternalDebugCoreConstants.EMPTY_STRING;
- try {
- name= fVariable.getName();
- value= fVariable.getValue().getValueString();
- } catch (DebugException exception) {
- DebugUIPlugin.errorDialog(shell, ActionMessages.ChangeVariableValue_errorDialogTitle,ActionMessages.ChangeVariableValue_errorDialogMessage, exception); //
- return;
- }
- ChangeVariableValueInputDialog inputDialog= new ChangeVariableValueInputDialog(shell, ActionMessages.ChangeVariableValue_1, MessageFormat.format(ActionMessages.ChangeVariableValue_2, new String[] {name}), value, new IInputValidator() { //
- /**
- * Returns an error string if the input is invalid
- */
- public String isValid(String input) {
- try {
- if (fVariable.verifyValue(input)) {
- return null; // null means valid
- }
- } catch (DebugException exception) {
- return ActionMessages.ChangeVariableValue_3;
- }
- return ActionMessages.ChangeVariableValue_4;
- }
- });
-
- inputDialog.open();
- String newValue= inputDialog.getValue();
- if (newValue != null) {
- // null value means cancel was pressed
- try {
- fVariable.setValue(newValue);
- getSelectionProvider().setSelection(new StructuredSelection(fVariable));
- } catch (DebugException de) {
- DebugUIPlugin.errorDialog(shell, ActionMessages.ChangeVariableValue_errorDialogTitle,ActionMessages.ChangeVariableValue_errorDialogMessage, de); //
- }
- }
- }
-
- /**
- * Updates the enabled state of this action based
- * on the selection
- */
- protected void update(IStructuredSelection sel) {
- Iterator iter= sel.iterator();
- if (iter.hasNext()) {
- Object object= iter.next();
- if (object instanceof IValueModification) {
- IValueModification varMod= (IValueModification)object;
- if (!varMod.supportsValueModification()) {
- setEnabled(false);
- return;
- }
- setEnabled(!iter.hasNext());
- return;
- }
- }
- setEnabled(false);
- }
-
- /**
- * @see IAction#run()
- */
- public void run() {
- Iterator iterator= getStructuredSelection().iterator();
- doActionPerformed((IVariable)iterator.next());
- }
-
- /**
- * @see SelectionProviderAction#selectionChanged(org.eclipse.jface.viewers.IStructuredSelection)
- */
- public void selectionChanged(IStructuredSelection sel) {
- update(sel);
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java
deleted file mode 100644
index a5aeb7119..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.variables;
-
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.dialogs.TrayDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * A simple input dialog for soliciting an input string
- * from the user.
- * <p>
- * This concrete dialog class can be instantiated as is,
- * or further subclassed as required.
- * </p>
- */
-public class ChangeVariableValueInputDialog extends TrayDialog {
-
-
- /**
- * The title of the dialog.
- */
- private String title;
-
- /**
- * The message to display, or <code>null</code> if none.
- */
- private String message;
-
- /**
- * The input value; the empty string by default.
- */
- private String value= IInternalDebugCoreConstants.EMPTY_STRING;
-
- /**
- * The input validator, or <code>null</code> if none.
- */
- private IInputValidator validator;
-
- /**
- * Ok button widget.
- */
- private Button okButton;
-
- /**
- * Input text widget.
- */
- private Text text;
-
- /**
- * Error message label widget.
- */
- private Label errorMessageLabel;
- /**
- * Creates an input dialog with OK and Cancel buttons.
- * Note that the dialog will have no visual representation (no widgets)
- * until it is told to open.
- * <p>
- * Note that the <code>open</code> method blocks for input dialogs.
- * </p>
- *
- * @param parentShell the parent shell
- * @param dialogTitle the dialog title, or <code>null</code> if none
- * @param dialogMessage the dialog message, or <code>null</code> if none
- * @param initialValue the initial input value, or <code>null</code> if none
- * (equivalent to the empty string)
- * @param validator an input validator, or <code>null</code> if none
- */
- public ChangeVariableValueInputDialog(Shell parentShell, String dialogTitle, String dialogMessage, String initialValue, IInputValidator validator) {
- super(parentShell);
- this.title = dialogTitle;
- message = dialogMessage;
- if (initialValue == null)
- value = IInternalDebugCoreConstants.EMPTY_STRING;
- else
- value = initialValue;
- this.validator = validator;
-
- setShellStyle(getShellStyle() | SWT.RESIZE);
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected void buttonPressed(int buttonId) {
- if (buttonId == IDialogConstants.OK_ID) {
- value= text.getText();
- } else {
- value= null;
- }
- super.buttonPressed(buttonId);
- }
- /* (non-Javadoc)
- * Method declared in Window.
- */
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- if (title != null)
- shell.setText(title);
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected void createButtonsForButtonBar(Composite parent) {
- // create OK and Cancel buttons by default
- okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
-
- //do this here because setting the text will set enablement on the ok button
- text.setFocus();
- if (value != null) {
- text.setText(value);
- text.selectAll();
- }
- }
- /* (non-Javadoc)
- * Method declared on Dialog.
- */
- protected Control createDialogArea(Composite parent) {
- Font font = parent.getFont();
- // create composite
- Composite composite = (Composite)super.createDialogArea(parent);
-
- // create message
- if (message != null) {
- Label label = new Label(composite, SWT.WRAP);
- label.setText(message);
- GridData data = new GridData(
- GridData.GRAB_HORIZONTAL |
- GridData.HORIZONTAL_ALIGN_FILL |
- GridData.VERTICAL_ALIGN_CENTER);
- data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
- label.setLayoutData(data);
- label.setFont(font);
- }
-
- text= new Text(composite, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL| SWT.H_SCROLL);
-
- GridData gridData= new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL);
- gridData.heightHint = 50;
- gridData.widthHint = 100;
- text.setLayoutData(gridData);
- text.setFont(font);
- text.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (okButton.isEnabled()) {
- return;
- }
- errorMessageLabel.setText(IInternalDebugCoreConstants.EMPTY_STRING);
- errorMessageLabel.getParent().update();
- okButton.setEnabled(true);
- }
- }
- );
-
- errorMessageLabel = new Label(composite, SWT.NONE);
- errorMessageLabel.setLayoutData(new GridData(
- GridData.GRAB_HORIZONTAL |
- GridData.HORIZONTAL_ALIGN_FILL));
- errorMessageLabel.setFont(font);
- return composite;
- }
- /**
- * Returns the error message label.
- *
- * @return the error message label
- */
- protected Label getErrorMessageLabel() {
- return errorMessageLabel;
- }
- /**
- * Returns the ok button.
- *
- * @return the ok button
- */
- protected Button getOkButton() {
- return okButton;
- }
- /**
- * Returns the text area.
- *
- * @return the text area
- */
- protected Text getText() {
- return text;
- }
- /**
- * Returns the validator.
- *
- * @return the validator
- */
- protected IInputValidator getValidator() {
- return validator;
- }
- /**
- * Returns the string typed into this input dialog.
- *
- * @return the input string
- */
- public String getValue() {
- return value;
- }
- /**
- * Validates the input.
- * <p>
- * The default implementation of this framework method
- * delegates the request to the supplied input validator object;
- * if it finds the input invalid, the error message is displayed
- * in the dialog's message line.
- * This hook method is called whenever the text changes in the
- * input field.
- * </p>
- */
- protected void validateInput() {
-
- String errorMessage = null;
-
- if (validator != null) {
- errorMessage = validator.isValid(text.getText());
- }
-
- // Bug 16256: important not to treat empty string (blank error) the same as null (no error)
- errorMessageLabel.setText(errorMessage == null ? IInternalDebugCoreConstants.EMPTY_STRING : errorMessage);
- okButton.setEnabled(errorMessage == null);
-
- errorMessageLabel.getParent().update();
- }
- protected void okPressed() {
- validateInput();
- if (okButton.isEnabled()) {
- super.okPressed();
- }
- }
-
- /**
- * Returns the name of the section that this dialog stores its settings in
- *
- * @return String
- */
- protected String getDialogSettingsSectionName() {
- return IDebugUIConstants.PLUGIN_ID + ".CHANGE_VARIABLE_VALUE_DIALOG_SECTION"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
- */
- protected IDialogSettings getDialogBoundsSettings() {
- IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(getDialogSettingsSectionName());
- if (section == null) {
- section = settings.addNewSection(getDialogSettingsSectionName());
- }
- return section;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#handleShellCloseEvent()
- */
- protected void handleShellCloseEvent() {
- value= null;
- super.handleShellCloseEvent();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/SelectAllVariablesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/SelectAllVariablesAction.java
deleted file mode 100644
index dc228a629..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/SelectAllVariablesAction.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.variables;
-
-import org.eclipse.debug.internal.ui.actions.SelectAllAction;
-import org.eclipse.debug.ui.IDebugView;
-
-public class SelectAllVariablesAction extends SelectAllAction {
-
-
- protected String getActionId() {
- return IDebugView.SELECT_ALL_ACTION + ".Variables"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#initialize()
- */
- protected void initialize() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#isEnabled()
- */
- protected boolean isEnabled() {
- // TODO: only enable when stuff present
- return true;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java
deleted file mode 100644
index b62df1001..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * WindRiver - Bug 272367: "Show Type Names" attribute is not available in the IPresentationContext properties
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.variables;
-
-
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.IDebugView;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * An action that toggles the state of a viewer to
- * show/hide type names of variables.
- * Only viewers that use a <code>VariableLabelProvider</code> to render its
- * elements are effected.
- */
-public class ShowTypesAction extends Action {
-
- private IDebugView fView;
-
- public ShowTypesAction(IDebugView view) {
- super(ActionMessages.ShowTypesAction_Show__Type_Names_1, IAction.AS_CHECK_BOX);
- setView(view);
- setToolTipText(ActionMessages.ShowTypesAction_Show_Type_Names);
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_TYPE_NAMES));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TYPE_NAMES));
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TYPE_NAMES));
- setId(DebugUIPlugin.getUniqueIdentifier() + ".ShowTypesAction"); //$NON-NLS-1$
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.SHOW_TYPES_ACTION);
- }
-
- /**
- * @see Action#run()
- */
- public void run() {
- valueChanged(isChecked());
- }
-
- private void valueChanged(boolean on) {
- final Viewer viewer = getView().getViewer();
- if (viewer.getControl().isDisposed()) {
- return;
- }
-
- IDebugModelPresentation debugLabelProvider= (IDebugModelPresentation)getView().getAdapter(IDebugModelPresentation.class);
- if (debugLabelProvider != null) {
- Boolean typesStatus = on ? Boolean.TRUE : Boolean.FALSE;
- debugLabelProvider.setAttribute(IDebugModelPresentation.DISPLAY_VARIABLE_TYPE_NAMES, typesStatus);
- if (viewer instanceof TreeModelViewer) {
- TreeModelViewer treeViewer = (TreeModelViewer) viewer;
- treeViewer.getPresentationContext().setProperty(IDebugModelPresentation.DISPLAY_VARIABLE_TYPE_NAMES, typesStatus);
- }
- BusyIndicator.showWhile(viewer.getControl().getDisplay(), new Runnable() {
- public void run() {
- viewer.refresh();
- }
- });
- }
- }
-
- protected IDebugView getView() {
- return fView;
- }
-
- protected void setView(IDebugView view) {
- fView = view;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#setEnabled(boolean)
- */
- public void setEnabled(boolean enabled) {
- super.setEnabled(enabled);
- if (enabled) {
- setToolTipText(ActionMessages.ShowTypesAction_Show_Type_Names);
- } else {
- setToolTipText(ActionMessages.ShowTypesAction_0);
- }
- }
-
-
-}
-
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ToggleDetailPaneAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ToggleDetailPaneAction.java
deleted file mode 100644
index ccbf5d064..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ToggleDetailPaneAction.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.variables;
-
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.internal.ui.views.variables.VariablesView;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.Action;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Action that controls the appearance of the details pane in debug views such
- * as the VariablesView and the ExpressionsView. Instances of this class can be
- * created to show the detail pane underneath the main tree, to the right of the
- * main tree, or not shown at all.
- *
- * @since 3.0
- */
-public class ToggleDetailPaneAction extends Action {
-
- private VariablesView fVariablesView;
-
- private String fOrientation;
-
- public ToggleDetailPaneAction(VariablesView view, String orientation, String hiddenLabel) {
- super(IInternalDebugCoreConstants.EMPTY_STRING, AS_RADIO_BUTTON);
- setVariablesView(view);
- setOrientation(orientation);
-
- if (orientation == IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_UNDERNEATH) {
- setText(ActionMessages.ToggleDetailPaneAction_1);
- setToolTipText(ActionMessages.ToggleDetailPaneAction_2);
- setDescription(ActionMessages.ToggleDetailPaneAction_3);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_UNDER));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE_UNDER));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DETAIL_PANE_UNDER));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.VERTICAL_DETAIL_PANE_LAYOUT_ACTION);
- } else if (orientation == IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_RIGHT) {
- setText(ActionMessages.ToggleDetailPaneAction_4);
- setToolTipText(ActionMessages.ToggleDetailPaneAction_5);
- setDescription(ActionMessages.ToggleDetailPaneAction_6);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_RIGHT));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE_RIGHT));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DETAIL_PANE_RIGHT));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.HORIZONTAL_DETAIL_PANE_LAYOUT_ACTION);
- } else {
- setText(hiddenLabel);
- setToolTipText(ActionMessages.ToggleDetailPaneAction_8);
- setDescription(ActionMessages.ToggleDetailPaneAction_9);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_HIDE));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE_HIDE));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DETAIL_PANE_HIDE));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DETAIL_PANE_HIDDEN_LAYOUT_ACTION);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- getVariablesView().setDetailPaneOrientation(getOrientation());
- }
-
- private VariablesView getVariablesView() {
- return fVariablesView;
- }
-
- private void setVariablesView(VariablesView variablesView) {
- fVariablesView = variablesView;
- }
-
- private void setOrientation(String orientation) {
- fOrientation = orientation;
- }
-
- public String getOrientation() {
- return fOrientation;
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneAssignValueAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneAssignValueAction.java
deleted file mode 100644
index 81eff77e9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneAssignValueAction.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.variables.details;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IValueModification;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.VariableValueEditorManager;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.actions.StatusInfo;
-import org.eclipse.debug.ui.actions.IVariableValueEditor;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.commands.ActionHandler;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchCommandConstants;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.handlers.IHandlerActivation;
-import org.eclipse.ui.handlers.IHandlerService;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Action which assigns a value to a variable from the detail pane
- * of the variables view.
- */
-public class DetailPaneAssignValueAction extends Action{
-
- private IHandlerActivation fHandlerActivation;
- private IViewSite fViewSite;
- private ITextViewer fTextViewer;
- private IStructuredSelection fCurrentSelection;
-
- /**
- * Attempts to evaluate the given string expression and assign the resulting value to the
- * specified variable. Displays error dialogs to the user if a problem is encountered.
- *
- * @see DetailPaneAssignValueAction
- * @see org.eclipse.debug.internal.ui.elements.adapters.DefaultVariableCellModifier
- *
- * @param shell the shell to use to open dialogs
- * @param variable the variable that is getting a new value
- * @param newValueExpression the expression to evaluate and set as the new value
- * @since 3.3.0
- */
- public static void assignValue(Shell shell, IVariable variable, String newValueExpression){
- String modelIdentifier = variable.getModelIdentifier();
- IVariableValueEditor editor = VariableValueEditorManager.getDefault().getVariableValueEditor(modelIdentifier);
- if (editor != null) {
- if (editor.saveVariable(variable, newValueExpression, shell)) {
- // If we successfully delegate to an editor which performs the save,
- // don't do any more work.
- return;
- }
- }
-
- try {
- // If we failed to delegate to anyone, perform the default assignment.
- if (variable.verifyValue(newValueExpression)) {
- variable.setValue(newValueExpression);
- } else {
- if (shell != null) {
- DebugUIPlugin.errorDialog(shell, ActionMessages.DetailPaneAssignValueAction_2, MessageFormat.format(ActionMessages.DetailPaneAssignValueAction_3, new String[] {newValueExpression, variable.getName()}), new StatusInfo(IStatus.ERROR, ActionMessages.DetailPaneAssignValueAction_4)); //
- }
- }
- } catch (DebugException e) {
- MessageDialog.openError(shell, ActionMessages.DetailPaneAssignValueAction_0, e.getStatus().getMessage());
- }
- }
-
- public DetailPaneAssignValueAction(ITextViewer textViewer, IViewSite viewSite) {
- super(ActionMessages.DetailPaneAssignValueAction_1);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DETAIL_PANE_ASSIGN_VALUE_ACTION);
-
- fTextViewer = textViewer;
- fViewSite = viewSite;
-
- setEnabled(false);
- IHandlerService service = (IHandlerService) fViewSite.getService(IHandlerService.class);
- ActionHandler handler = new ActionHandler(this);
- fHandlerActivation = service.activateHandler(getActionDefinitionId(), handler);
- }
-
- public void dispose() {
- IHandlerService service = (IHandlerService) fViewSite.getService(IHandlerService.class);
- service.deactivateHandler(fHandlerActivation);
- }
-
- public void updateCurrentVariable(IStructuredSelection selection) {
- boolean enabled = false;
- if ((selection.size() == 1) && (selection.getFirstElement() instanceof IValueModification)) {
- IValueModification valMod = (IValueModification) selection.getFirstElement();
- if (valMod.supportsValueModification()) {
- fCurrentSelection = selection;
- enabled = true;
- }
- }
- setEnabled(enabled);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- IVariable variable = (IVariable) fCurrentSelection.getFirstElement();
-
- Point selection = fTextViewer.getSelectedRange();
- String value = null;
- if (selection.y == 0) {
- value = fTextViewer.getDocument().get();
- } else {
- try {
- value = fTextViewer.getDocument().get(selection.x, selection.y);
- } catch (BadLocationException e1) {
- }
- }
- IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
- Shell activeShell= null;
- if (window != null) {
- activeShell= window.getShell();
- }
-
- assignValue(activeShell, variable, value);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#getActionDefinitionId()
- */
- public String getActionDefinitionId() {
- return IWorkbenchCommandConstants.FILE_SAVE;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthAction.java
deleted file mode 100644
index 032958bd0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthAction.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.variables.details;
-
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.jface.action.Action;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Opens a dialog so that the user can enter the maximum length in characters that
- * the detail pane should display.
- *
- * @see DetailPaneMaxLengthDialog
- * @since 3.0
- */
-public class DetailPaneMaxLengthAction extends Action {
-
- private Shell fDialogShell;
-
- public DetailPaneMaxLengthAction(Shell dialogShell){
- super(ActionMessages.DetailPaneMaxLengthAction_0);
- fDialogShell = dialogShell;
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DETAIL_PANE_MAX_LENGTH_ACTION);
-
- }
-
- public void run() {
- DetailPaneMaxLengthDialog dialog = new DetailPaneMaxLengthDialog(fDialogShell);
- dialog.open();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthDialog.java
deleted file mode 100644
index 0bcee1b3d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthDialog.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.variables.details;
-
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.views.variables.VariablesViewMessages;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.dialogs.TrayDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Provides a dialog for changing the maximum length allowed in the detail pane
- *
- * @since 3.0
- */
-public class DetailPaneMaxLengthDialog extends TrayDialog {
-
- private static final String SETTINGS_ID = DebugUIPlugin.getUniqueIdentifier() + ".MAX_DETAILS_LENGTH_DIALOG"; //$NON-NLS-1$
-
- private Text fTextWidget;
- private Text fErrorTextWidget;
- private String fErrorMessage;
- private String fValue;
- private IInputValidator fValidator;
-
- /**
- * Constructs a new dialog on the given shell.
- *
- * @param parent shell
- */
- public DetailPaneMaxLengthDialog(Shell parent) {
- super(parent);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- fValue = Integer.toString(DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugUIConstants.PREF_MAX_DETAIL_LENGTH));
- fValidator = new IInputValidator() {
- public String isValid(String newText) {
- try {
- int num = Integer.parseInt(newText);
- if (num < 0) {
- return VariablesViewMessages.DetailPaneMaxLengthDialog_2;
- }
- } catch (NumberFormatException e) {
- return VariablesViewMessages.DetailPaneMaxLengthDialog_3;
- }
- return null;
- }
-
- };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.dialogs.SelectionDialog#getDialogBoundsSettings()
- */
- protected IDialogSettings getDialogBoundsSettings() {
- IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(SETTINGS_ID);
- if (section == null) {
- section = settings.addNewSection(SETTINGS_ID);
- }
- return section;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- getShell().setText(VariablesViewMessages.DetailPaneMaxLengthDialog_0);
- Control contents = super.createContents(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getDialogArea(), IDebugHelpContextIds.DETAIL_PANE_MAX_LENGTH_ACTION);
- return contents;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- Label label = new Label(composite, SWT.WRAP);
- label.setText(VariablesViewMessages.DetailPaneMaxLengthDialog_1);
- GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
- data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
- label.setLayoutData(data);
- label.setFont(parent.getFont());
- fTextWidget = new Text(composite, SWT.SINGLE | SWT.BORDER);
- fTextWidget.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
- fTextWidget.setText(fValue);
- fTextWidget.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validateInput();
- fValue = fTextWidget.getText();
- }
- });
- fErrorTextWidget = new Text(composite, SWT.READ_ONLY);
- fErrorTextWidget.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
- | GridData.HORIZONTAL_ALIGN_FILL));
- fErrorTextWidget.setBackground(fErrorTextWidget.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
- setErrorMessage(fErrorMessage);
- applyDialogFont(composite);
- return composite;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- String text = getValue();
- try {
- DebugUIPlugin.getDefault().getPreferenceStore().setValue(IDebugUIConstants.PREF_MAX_DETAIL_LENGTH, Integer.parseInt(text));
- }
- catch (NumberFormatException e) {
- DebugUIPlugin.log(e);
- }
- super.okPressed();
- }
-
- /**
- * Returns the string typed into this input dialog.
- *
- * @return the input string
- * @since 3.3
- */
- public String getValue() {
- return fValue;
- }
-
- /**
- * Validates the current input
- * @since 3.3
- */
- private void validateInput() {
- String errorMessage = null;
- if (fValidator != null) {
- errorMessage = fValidator.isValid(fTextWidget.getText());
- }
- setErrorMessage(errorMessage);
- }
-
- /**
- * Sets the current error message or none if null
- * @param errorMessage
- * @since 3.3
- */
- public void setErrorMessage(String errorMessage) {
- fErrorMessage = errorMessage;
- if (fErrorTextWidget != null && !fErrorTextWidget.isDisposed()) {
- fErrorTextWidget.setText(errorMessage == null ? IInternalDebugCoreConstants.EMPTY_STRING : errorMessage);
- fErrorTextWidget.getParent().update();
- // Access the ok button by id, in case clients have overridden button creation.
- // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=113643
- Control button = getButton(IDialogConstants.OK_ID);
- if (button != null) {
- button.setEnabled(errorMessage == null);
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneWordWrapAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneWordWrapAction.java
deleted file mode 100644
index 107ca9876..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneWordWrapAction.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.variables.details;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * An check box action that allows the word wrap property to be set, determining if the detail pane
- * should wrap text.
- */
-public class DetailPaneWordWrapAction extends Action {
-
- ITextViewer fTextViewer;
-
- public DetailPaneWordWrapAction(ITextViewer textViewer) {
- super(ActionMessages.DetailPaneWordWrapAction_0,IAction.AS_CHECK_BOX);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DETAIL_PANE_WORD_WRAP_ACTION);
-
- fTextViewer = textViewer;
- setEnabled(true);
-
- boolean prefSetting = DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DETAIL_PANE_WORD_WRAP);
- fTextViewer.getTextWidget().setWordWrap(prefSetting);
- setChecked(prefSetting);
-
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- fTextViewer.getTextWidget().setWordWrap(isChecked());
- DebugUIPlugin.getDefault().getPreferenceStore().setValue(IDebugPreferenceConstants.PREF_DETAIL_PANE_WORD_WRAP,isChecked());
- DebugUIPlugin.getDefault().savePluginPreferences();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/AbstractRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/AbstractRequestMonitor.java
deleted file mode 100644
index 2364d5655..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/AbstractRequestMonitor.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IStatusMonitor;
-
-/**
- * Common function for request monitors
- *
- * @since 3.3
- *
- */
-public abstract class AbstractRequestMonitor implements IStatusMonitor {
-
- private IStatus fStatus;
- private boolean fCancelled = false;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IStatusMonitor#setStatus(org.eclipse.core.runtime.IStatus)
- */
- public void setStatus(IStatus status) {
- fStatus = status;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IProgressMonitor#beginTask(java.lang.String, int)
- */
- public void beginTask(String name, int totalWork) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IProgressMonitor#internalWorked(double)
- */
- public void internalWorked(double work) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IProgressMonitor#isCanceled()
- */
- public boolean isCanceled() {
- return fCancelled;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IProgressMonitor#setCanceled(boolean)
- */
- public void setCanceled(boolean value) {
- fCancelled = value;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IProgressMonitor#setTaskName(java.lang.String)
- */
- public void setTaskName(String name) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IProgressMonitor#subTask(java.lang.String)
- */
- public void subTask(String name) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IProgressMonitor#worked(int)
- */
- public void worked(int work) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IStatusMonitor#getStatus()
- */
- public IStatus getStatus() {
- return fStatus;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionsUpdater.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionsUpdater.java
deleted file mode 100644
index fae69e01e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ActionsUpdater.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-
-/**
- * Collects votes from handler update requests.
- *
- * @since 3.3
- *
- */
-public class ActionsUpdater {
-
- private IEnabledTarget[] fActions;
- private int fNumVoters;
- private int fNumOfVotes = 0;
- private boolean fDone = false;
- private boolean fEnabled = true;
-
- public ActionsUpdater(IEnabledTarget[] actions, int numVoters) {
- fActions = actions;
- fNumVoters = numVoters;
- }
-
- public synchronized void setEnabled(boolean result) {
- fNumOfVotes++;
- if (fEnabled) {
- fEnabled = result;
- }
- done();
- }
-
- private synchronized void done() {
- if (!fDone) {
- if (!fEnabled || fNumOfVotes == fNumVoters) {
- fDone = true;
- for (int i = 0; i < fActions.length; i++) {
- fActions[i].setEnabled(fEnabled);
- }
- }
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandActionDelegate.java
deleted file mode 100644
index ce50c1338..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandActionDelegate.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.debug.ui.actions.DebugCommandAction;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-/**
- * Abstract base class for debug action delegates performing debug commands.
- *
- * @since 3.3.
- */
-public abstract class DebugCommandActionDelegate implements IWorkbenchWindowActionDelegate, IActionDelegate2 {
-
- /**
- *The real action for this delegate
- */
- private DebugCommandAction fDebugAction;
-
- protected void setAction(DebugCommandAction action) {
- fDebugAction = action;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {
- fDebugAction.dispose();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- fDebugAction.setActionProxy(action);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
- fDebugAction.init(window);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- fDebugAction.run();
- }
-
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection s) {
- // do nothing
- }
-
- protected DebugCommandAction getAction() {
- return fDebugAction;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandService.java
deleted file mode 100644
index ba69bd29e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandService.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.commands.IDebugCommandHandler;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextService;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWindowListener;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Updates commands for a window. Coalesces update requests by command type.
- *
- * @since 3.3
- */
-public class DebugCommandService implements IDebugContextListener {
-
- /**
- * Maps command types to actions to update
- */
- private Map fCommandUpdates = new HashMap();
-
- /**
- * Window this service is for.
- */
- private IWorkbenchWindow fWindow = null;
-
- /**
- * The context service for this command service.
- */
- private IDebugContextService fContextService = null;
-
- /**
- * Service per window
- */
- private static Map fgServices = new HashMap();
-
- /**
- * Returns the service for a window.
- *
- * @param window
- * @return service
- */
- public synchronized static DebugCommandService getService(IWorkbenchWindow window) {
- DebugCommandService service = (DebugCommandService) fgServices.get(window);
- if (service == null) {
- service = new DebugCommandService(window);
- fgServices.put(window, service);
- }
- return service;
- }
-
- public DebugCommandService(IWorkbenchWindow window) {
- fWindow = window;
- fContextService = DebugUITools.getDebugContextManager().getContextService(window);
- fContextService.addPostDebugContextListener(this);
- PlatformUI.getWorkbench().addWindowListener(new IWindowListener() {
-
- public void windowOpened(IWorkbenchWindow w) {
- }
-
- public void windowDeactivated(IWorkbenchWindow w) {
- }
-
- public void windowClosed(IWorkbenchWindow w) {
- if (fWindow == w) {
- dispose();
- }
- }
-
- public void windowActivated(IWorkbenchWindow w) {
- }
-
- });
- }
-
- private void dispose() {
- fContextService.removeDebugContextListener(this);
- fgServices.remove(fWindow);
- fCommandUpdates.clear();
- fWindow = null;
- }
-
- /**
- * Updates the given command type after the next context change.
- *
- * @param commandType
- * @param monitor
- */
- public void postUpdateCommand(Class commandType, IEnabledTarget action) {
- synchronized (fCommandUpdates) {
- Job.getJobManager().cancel(commandType);
- List actions = (List) fCommandUpdates.get(commandType);
- if (actions == null) {
- actions = new ArrayList();
- fCommandUpdates.put(commandType, actions);
- }
- actions.add(action);
- }
- }
-
- /**
- * Updates the given command type based on the active context.
- *
- * @param commandType
- * @param requestMonitor
- */
- public void updateCommand(Class commandType, IEnabledTarget action) {
- ISelection context = fContextService.getActiveContext();
- if (context instanceof IStructuredSelection && !context.isEmpty()) {
- Object[] elements = ((IStructuredSelection)context).toArray();
- updateCommand(commandType, elements, new IEnabledTarget[]{action});
- } else {
- action.setEnabled(false);
- }
- }
-
- private void postUpdate(ISelection context) {
- Map commands = null;
- synchronized (fCommandUpdates) {
- commands = fCommandUpdates;
- fCommandUpdates = new HashMap(commands.size());
- }
- if (context instanceof IStructuredSelection && !context.isEmpty()) {
- Object[] elements = ((IStructuredSelection)context).toArray();
- Iterator iterator = commands.entrySet().iterator();
- while (iterator.hasNext()) {
- Entry entry = (Entry) iterator.next();
- Class commandType = (Class)entry.getKey();
- List actions = (List) entry.getValue();
- updateCommand(commandType, elements, (IEnabledTarget[]) actions.toArray(new IEnabledTarget[actions.size()]));
- }
- } else {
- Iterator iterator = commands.values().iterator();
- while (iterator.hasNext()) {
- List actionList = (List) iterator.next();
- Iterator actions = actionList.iterator();
- while (actions.hasNext()) {
- ((IEnabledTarget)actions.next()).setEnabled(false);
- }
- }
- }
- commands.clear();
- }
-
- /**
- * Updates the given command type for the specified elements.
- *
- * @param commandType command class to update
- * @param elements elements to update for
- * @param monitor status monitor
- */
- private void updateCommand(Class handlerType, Object[] elements, IEnabledTarget[] actions) {
- if (elements.length == 1) {
- // usual case - one element
- Object element = elements[0];
- IDebugCommandHandler handler = getHandler(element, handlerType);
- if (handler != null) {
- UpdateActionsRequest request = new UpdateActionsRequest(elements, actions);
- handler.canExecute(request);
- return;
- }
- } else {
- Map map = collate(elements, handlerType);
- if (map != null) {
- ActionsUpdater updater = new ActionsUpdater(actions, map.size());
- Iterator entries = map.entrySet().iterator();
- while (entries.hasNext()) {
- Entry entry = (Entry) entries.next();
- IDebugCommandHandler handler = (IDebugCommandHandler) entry.getKey();
- List list = (List) entry.getValue();
- UpdateHandlerRequest request = new UpdateHandlerRequest(list.toArray(), updater);
- handler.canExecute(request);
- }
- return;
- }
- }
- // ABORT - no command processors
- for (int i = 0; i < actions.length; i++) {
- actions[i].setEnabled(false);
- }
- }
-
- /**
- * Updates the given command type for the specified elements.
- *
- * @param commandType command class to update
- * @param elements elements to update for
- * @param monitor status monitor
- */
- public boolean executeCommand(Class handlerType, Object[] elements, ICommandParticipant participant) {
- if (elements.length == 1) {
- // usual case - one element
- Object element = elements[0];
- IDebugCommandHandler handler = getHandler(element, handlerType);
- if (handler != null) {
- ExecuteActionRequest request = new ExecuteActionRequest(elements);
- request.setCommandParticipant(participant);
- return handler.execute(request);
- }
- } else {
- Map map = collate(elements, handlerType);
- if (map != null) {
- boolean enabled = true;
- Iterator entries = map.entrySet().iterator();
- while (entries.hasNext()) {
- Entry entry = (Entry) entries.next();
- IDebugCommandHandler handler = (IDebugCommandHandler) entry.getKey();
- List list = (List) entry.getValue();
- ExecuteActionRequest request = new ExecuteActionRequest(list.toArray());
- request.setCommandParticipant(participant);
- // specifically use & so handler is executed
- enabled = enabled & handler.execute(request);
- }
- return enabled;
- }
- }
- // ABORT - no command processors
- return false;
- }
-
- public void debugContextChanged(DebugContextEvent event) {
- postUpdate(event.getContext());
- }
-
- /**
- * Returns a map of command handlers to associated elements, or <code>null</code> if
- * one is missing.
- *
- * @param elements
- * @return map of command handlers to associated elements or <code>null</code>
- */
- private Map collate(Object[] elements, Class handlerType) {
- Map map = new HashMap();
- for (int i = 0; i < elements.length; i++) {
- Object element = elements[i];
- IDebugCommandHandler handler = getHandler(element, handlerType);
- if (handler == null) {
- return null;
- } else {
- List list = (List) map.get(handler);
- if (list == null) {
- list = new ArrayList();
- map.put(handler, list);
- }
- list.add(element);
- }
- }
- return map;
- }
-
- private IDebugCommandHandler getHandler(Object element, Class handlerType) {
- return (IDebugCommandHandler)DebugPlugin.getAdapter(element, handlerType);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandAction.java
deleted file mode 100644
index 033302434..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandAction.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.debug.core.commands.IDisconnectHandler;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.actions.DebugCommandAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-/**
- * Disconnect action.
- *
- * @since 3.3
- */
-public class DisconnectCommandAction extends DebugCommandAction{
-
- public String getText() {
- return ActionMessages.DisconnectAction_0;
- }
-
- public String getHelpContextId() {
- return "org.eclipse.debug.ui.disconnect_action_context"; //$NON-NLS-1$
- }
-
- public String getId() {
- return "org.eclipse.debug.ui.debugview.toolbar.disconnect"; //$NON-NLS-1$
- }
-
- public String getToolTipText() {
- return ActionMessages.DisconnectAction_3;
- }
-
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DISCONNECT);
- }
-
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DISCONNECT);
- }
-
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DISCONNECT);
- }
-
- protected Class getCommandType() {
- return IDisconnectHandler.class;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandAction.java
deleted file mode 100644
index 3693b0f8d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandAction.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.debug.core.commands.IDropToFrameHandler;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.actions.DebugCommandAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * Drop to frame action.
- *
- * @since 3.3
- */
-public class DropToFrameCommandAction extends DebugCommandAction {
-
- public String getText() {
- return ActionMessages.DropToFrameAction_0;
- }
-
- public String getHelpContextId() {
- return "org.eclipse.debug.ui.drop_to_frame_action_context"; //$NON-NLS-1$
- }
-
- public String getId() {
- return "org.eclipse.debug.ui.debugview.toolbar.dropToFrame"; //$NON-NLS-1$
- }
-
- public String getToolTipText() {
- return ActionMessages.DropToFrameAction_3;
- }
-
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DROP_TO_FRAME);
- }
-
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DROP_TO_FRAME);
- }
-
- public ImageDescriptor getDisabledImageDescriptor() {
- return null;
- }
-
- protected Class getCommandType() {
- return IDropToFrameHandler.class;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java
deleted file mode 100644
index b47715b2b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.internal.core.commands.DebugCommandRequest;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.dialogs.MessageDialog;
-
-/**
- * Plain status collector for actions. Has no result.
- *
- * @since 3.3
- *
- */
-public class ExecuteActionRequest extends DebugCommandRequest {
-
- private ICommandParticipant fParticipant = null;
-
- public ExecuteActionRequest(Object[] elements) {
- super(elements);
- }
-
- public void done() {
- if (fParticipant != null) {
- fParticipant.requestDone(this);
- fParticipant = null;
- }
- final IStatus status = getStatus();
- if (status != null) {
- switch (status.getSeverity()) {
- case IStatus.ERROR:
- DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
- MessageDialog.openError(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage());
- }
- });
- break;
- case IStatus.WARNING:
- DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
- MessageDialog.openWarning(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage());
- }
- });
- break;
- case IStatus.INFO:
- DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
- MessageDialog.openInformation(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage());
- }
- });
- break;
- }
- }
- }
-
- public void setCommandParticipant(ICommandParticipant participant) {
- fParticipant = participant;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ICommandParticipant.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ICommandParticipant.java
deleted file mode 100644
index 635396d41..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ICommandParticipant.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.debug.core.IRequest;
-
-/**
- * Adds function to a command on completion.
- *
- * @since 3.3.
- */
-public interface ICommandParticipant {
-
- public void requestDone(IRequest request);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/IEnabledTarget.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/IEnabledTarget.java
deleted file mode 100644
index cb6642328..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/IEnabledTarget.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-/**
- *
- */
-public interface IEnabledTarget {
- public void setEnabled(boolean enabled);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandAction.java
deleted file mode 100644
index e03affc91..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandAction.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.debug.core.commands.IRestartHandler;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.actions.DebugCommandAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * Handler for the
- *
- * @since 3.6
- */
-public class RestartCommandAction extends DebugCommandAction {
-
- protected Class getCommandType() {
- return IRestartHandler.class;
- }
-
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_RESTART);
- }
-
- public String getHelpContextId() {
- return "org.eclipse.debug.ui.restart_action_context"; //$NON-NLS-1$
- }
-
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_RESTART);
- }
-
- public String getId() {
- return "org.eclipse.debug.ui.actions.Restart"; //$NON-NLS-1$
- }
-
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_RESTART);
- }
-
- public String getText() {
- return ActionMessages.RestartCommandAction__text;
- }
-
- public String getToolTipText() {
- return ActionMessages.RestartCommandAction_tooltip;
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandActionDelegate.java
deleted file mode 100644
index 961b7cd85..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandActionDelegate.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.debug.ui.actions.DebugCommandAction;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-/**
- * Restart action delegate.
- *
- * @since 3.6
- */
-public class RestartCommandActionDelegate implements IWorkbenchWindowActionDelegate, IActionDelegate2 {
-
- private DebugCommandAction fDebugAction = new RestartCommandAction();
-
- public void dispose() {
- fDebugAction.dispose();
- }
-
- public void init(IWorkbenchWindow window) {
- fDebugAction.init(window);
- }
-
- public void run(IAction action) {
- fDebugAction.run();
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- // do nothing
- }
-
- public void init(IAction action) {
- fDebugAction.setActionProxy(action);
-
- }
-
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandAction.java
deleted file mode 100644
index f7f28abe5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandAction.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.debug.core.commands.IResumeHandler;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.actions.DebugCommandAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * Resume action.
- *
- * @since 3.3
- */
-public class ResumeCommandAction extends DebugCommandAction{
-
- public ResumeCommandAction() {
- setActionDefinitionId("org.eclipse.debug.ui.commands.Resume"); //$NON-NLS-1$
- }
-
- public String getText() {
- return ActionMessages.ResumeAction_0;
- }
-
- public String getHelpContextId() {
- return "org.eclipse.debug.ui.resume_action_context"; //$NON-NLS-1$
- }
-
- public String getId() {
- return "org.eclipse.debug.ui.debugview.toolbar.resume"; //$NON-NLS-1$
- }
-
- public String getToolTipText() {
- return ActionMessages.ResumeAction_3;
- }
-
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_RESUME);
- }
-
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_RESUME);
- }
-
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_RESUME);
- }
-
- protected Class getCommandType() {
- return IResumeHandler.class;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandActionDelegate.java
deleted file mode 100644
index 3a770a612..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandActionDelegate.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.debug.ui.actions.DebugCommandAction;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-/**
- * Resume action delegate.
- *
- * @since 3.3
- */
-public class ResumeCommandActionDelegate implements IWorkbenchWindowActionDelegate, IActionDelegate2 {
-
- private DebugCommandAction fDebugAction = new ResumeCommandAction();
-
- public void dispose() {
- fDebugAction.dispose();
- }
-
- public void init(IWorkbenchWindow window) {
- fDebugAction.init(window);
- }
-
- public void run(IAction action) {
- fDebugAction.run();
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- // do nothing
- }
-
- public void init(IAction action) {
- fDebugAction.setActionProxy(action);
-
- }
-
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandAction.java
deleted file mode 100644
index f42a2dd03..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandAction.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.debug.core.commands.IStepIntoHandler;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.actions.DebugCommandAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * Step into action
- *
- * @since 3.3
- */
-public class StepIntoCommandAction extends DebugCommandAction {
-
- public StepIntoCommandAction() {
- setActionDefinitionId("org.eclipse.debug.ui.commands.StepInto"); //$NON-NLS-1$
- }
-
- public String getText() {
- return ActionMessages.StepIntoAction_0;
- }
-
- public String getHelpContextId() {
- return "org.eclipse.debug.ui.step_into_action_context"; //$NON-NLS-1$
- }
-
- public String getId() {
- return "org.eclipse.debug.ui.debugview.toolbar.stepInto"; //$NON-NLS-1$
- }
-
- public String getToolTipText() {
- return ActionMessages.StepIntoAction_3;
- }
-
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_STEP_INTO);
- }
-
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_INTO);
- }
-
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_INTO);
- }
-
- protected Class getCommandType() {
- return IStepIntoHandler.class;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandActionDelegate.java
deleted file mode 100644
index 0364de6eb..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandActionDelegate.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.commands.actions;
-
-/**
- * Step into action delegate.
- *
- * @since 3.3
- */
-public class StepIntoCommandActionDelegate extends DebugCommandActionDelegate {
-
- public StepIntoCommandActionDelegate() {
- super();
- setAction(new StepIntoCommandAction());
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandAction.java
deleted file mode 100644
index 020e34d95..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandAction.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.debug.core.commands.IStepOverHandler;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.actions.DebugCommandAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * Step over action.
- *
- * @since 3.3
- */
-public class StepOverCommandAction extends DebugCommandAction {
-
- public StepOverCommandAction() {
- setActionDefinitionId("org.eclipse.debug.ui.commands.StepOver"); //$NON-NLS-1$
- }
-
- public String getText() {
- return ActionMessages.StepOverAction_0;
- }
-
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_STEP_OVER);
- }
-
- public String getHelpContextId() {
- return "org.eclipse.debug.ui.step_over_action_context"; //$NON-NLS-1$
- }
-
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_OVER);
- }
-
- public String getId() {
- return "org.eclipse.debug.ui.debugview.toolbar.stepOver"; //$NON-NLS-1$
- }
-
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_OVER);
- }
-
- public String getToolTipText() {
- return ActionMessages.StepOverAction_3;
- }
-
- protected Class getCommandType() {
- return IStepOverHandler.class;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandActionDelegate.java
deleted file mode 100644
index 71a20406d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandActionDelegate.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.commands.actions;
-
-/**
- * Step over action delegate.
- *
- * @since 3.3
- */
-public class StepOverCommandActionDelegate extends DebugCommandActionDelegate {
-
- public StepOverCommandActionDelegate() {
- super();
- setAction(new StepOverCommandAction());
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandAction.java
deleted file mode 100644
index 73aa93520..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandAction.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.debug.core.commands.IStepReturnHandler;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.actions.DebugCommandAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * Step return action.
- *
- * @since 3.3
- */
-public class StepReturnCommandAction extends DebugCommandAction {
-
-
- public StepReturnCommandAction() {
- setActionDefinitionId("org.eclipse.debug.ui.commands.StepReturn"); //$NON-NLS-1$
- }
-
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_STEP_RETURN);
- }
-
- public String getHelpContextId() {
- return "org.eclipse.debug.ui.step_return_action_context"; //$NON-NLS-1$
- }
-
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_RETURN);
- }
-
- public String getId() {
- return "org.eclipse.debug.ui.debugview.toolbar.stepReturn"; //$NON-NLS-1$
- }
-
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_RETURN);
- }
-
- public String getToolTipText() {
- return ActionMessages.StepReturnAction_2;
- }
-
- public String getText() {
- return ActionMessages.StepReturnAction_3;
- }
-
- protected Class getCommandType() {
- return IStepReturnHandler.class;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandActionDelegate.java
deleted file mode 100644
index 2f78cced1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandActionDelegate.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.commands.actions;
-
-/**
- * Step return action delegate.
- *
- * @since 3.3
- */
-public class StepReturnCommandActionDelegate extends DebugCommandActionDelegate {
-
- public StepReturnCommandActionDelegate() {
- super();
- setAction(new StepReturnCommandAction());
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandAction.java
deleted file mode 100644
index f6a47bfd9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandAction.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.debug.core.commands.ISuspendHandler;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.actions.DebugCommandAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * Suspend action.
- *
- * @since 3.3
- */
-public class SuspendCommandAction extends DebugCommandAction {
-
-
- public String getText() {
- return ActionMessages.SuspendAction_0;
- }
-
- public String getHelpContextId() {
- return "org.eclipse.debug.ui.suspend_action_context"; //$NON-NLS-1$
- }
-
- public String getId() {
- return "org.eclipse.debug.ui.debugview.toolbar.suspend"; //$NON-NLS-1$
- }
-
- public String getToolTipText() {
- return ActionMessages.SuspendAction_3;
- }
-
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_SUSPEND);
- }
-
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_SUSPEND);
- }
-
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_SUSPEND);
- }
-
- protected Class getCommandType() {
- return ISuspendHandler.class;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandActionDelegate.java
deleted file mode 100644
index 9747cdc42..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandActionDelegate.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.commands.actions;
-
-/**
- * Suspend action delegate.
- *
- * @since 3.3
- */
-public class SuspendCommandActionDelegate extends DebugCommandActionDelegate {
-
- public SuspendCommandActionDelegate() {
- super();
- setAction(new SuspendCommandAction());
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllAction.java
deleted file mode 100644
index b6f8e6e22..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllAction.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.ILaunchesListener2;
-import org.eclipse.debug.core.commands.ITerminateHandler;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.actions.DebugCommandAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Terminates all launches.
- *
- * @since 3.3
- */
-public class TerminateAllAction extends DebugCommandAction implements ILaunchesListener2 {
-
- protected ISelection getContext() {
- return new StructuredSelection(getLaunchManager().getLaunches());
- }
-
- public void contextActivated(ISelection context, IWorkbenchPart part) {
- // DO NOTHING
- }
-
- public void contextChanged(ISelection context, IWorkbenchPart part) {
- // DO NOTHING
- }
-
- public void dispose() {
- getLaunchManager().removeLaunchListener(this);
- super.dispose();
- }
-
- public void init(IWorkbenchPart part) {
- super.init(part);
- ILaunchManager launchManager = getLaunchManager();
- launchManager.addLaunchListener(this);
- // heuristic... rather than updating all the time, just assume there's
- // something that's not terminated.
- setEnabled(launchManager.getLaunches().length > 0);
- }
-
- private ILaunchManager getLaunchManager() {
- return DebugPlugin.getDefault().getLaunchManager();
- }
-
- public String getHelpContextId() {
- return "org.eclipse.debug.ui.terminate_all_action_context"; //$NON-NLS-1$
- }
-
- public String getId() {
- return "org.eclipse.debug.ui.debugview.popupMenu.terminateAll"; //$NON-NLS-1$
- }
-
- public String getText() {
- return ActionMessages.TerminateAllAction_2;
- }
-
- public String getToolTipText() {
- return ActionMessages.TerminateAllAction_3;
- }
-
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages
- .getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TERMINATE_ALL);
- }
-
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages
- .getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_ALL);
- }
-
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages
- .getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_ALL);
- }
-
- protected Class getCommandType() {
- return ITerminateHandler.class;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesTerminated(ILaunch[] launches) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesAdded(ILaunch[] launches) {
- setEnabled(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesChanged(ILaunch[] launches) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesRemoved(ILaunch[] launches) {
- setEnabled(getLaunchManager().getLaunches().length > 0);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java
deleted file mode 100644
index 9e3b340d3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.IRequest;
-import org.eclipse.debug.core.commands.ITerminateHandler;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.actions.RelaunchActionDelegate;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.ui.actions.DebugCommandAction;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * Action which terminates a launch and then re-launches it.
- */
-public class TerminateAndRelaunchAction extends DebugCommandAction {
-
- public void postExecute(IRequest request, final Object[] targets) {
- if (request.getStatus() == null || request.getStatus().isOK()) {
- DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
- // Must be run in the UI thread since the launch can require
- // prompting to proceed
- for (int i = 0; i < targets.length; i++) {
- ILaunch launch = DebugUIPlugin.getLaunch(targets[i]);
- if (launch != null) {
- RelaunchActionDelegate.relaunch(launch.getLaunchConfiguration(), launch.getLaunchMode());
- }
- }
- }
- });
- }
- }
-
-
- protected Class getCommandType() {
- return ITerminateHandler.class;
- }
-
- public void debugContextChanged(DebugContextEvent event) {
- ISelection context = event.getContext();
- if (context instanceof IStructuredSelection) {
- Object[] elements = ((IStructuredSelection)context).toArray();
- for (int i = 0; i < elements.length; i++) {
- if (!canRelaunch(elements[i])) {
- setEnabled(false);
- return;
- }
- }
- }
- super.debugContextChanged(event);
- }
-
- protected boolean canRelaunch(Object element) {
- ILaunch launch = DebugUIPlugin.getLaunch(element);
- if (launch != null) {
- ILaunchConfiguration configuration = launch.getLaunchConfiguration();
- if (configuration != null) {
- return LaunchConfigurationManager.isVisible(configuration);
- }
- }
- return false;
- }
-
- public String getActionDefinitionId() {
- return ActionMessages.TerminateAndRelaunchAction_0;
- }
-
- public String getHelpContextId() {
- return "org.eclipse.debug.ui.terminate_and_relaunch_action_context"; //$NON-NLS-1$
- }
-
- public String getId() {
- return "org.eclipse.debug.ui.debugview.popupMenu.TerminateAndRelaunch"; //$NON-NLS-1$
- }
-
- public String getText() {
- return ActionMessages.TerminateAndRelaunchAction_3;
- }
-
- public String getToolTipText() {
- return ActionMessages.TerminateAndRelaunchAction_4;
- }
-
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TERMINATE_AND_RELAUNCH);
- }
-
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_AND_RELAUNCH);
- }
-
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_AND_RELAUNCH);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRemoveAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRemoveAction.java
deleted file mode 100644
index afcfebc40..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRemoveAction.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.IRequest;
-import org.eclipse.debug.core.commands.ITerminateHandler;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.actions.DebugCommandAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * Terminate and remove action.
- *
- * @since 3.3
- */
-public class TerminateAndRemoveAction extends DebugCommandAction {
-
- public String getText() {
- return ActionMessages.TerminateAndRemoveAction_0;
- }
-
- public String getHelpContextId() {
- return "org.eclipse.debug.ui.terminate_and_remove_action_context"; //$NON-NLS-1$
- }
-
- public String getId() {
- return "org.eclipse.debug.ui.debugview.popupMenu.terminateAndRemove"; //$NON-NLS-1$
- }
-
- public String getToolTipText() {
- return ActionMessages.TerminateAndRemoveAction_3;
- }
-
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TERMINATE_AND_REMOVE);
- }
-
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_AND_REMOVE);
- }
-
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_AND_REMOVE);
- }
-
- protected Class getCommandType() {
- return ITerminateHandler.class;
- }
-
- protected void postExecute(IRequest request, Object[] targets) {
- IStatus status = request.getStatus();
- if(status == null || status.isOK()) {
- for (int i = 0; i < targets.length; i++) {
- ILaunch launch = DebugUIPlugin.getLaunch(targets[i]);
- if (launch != null)
- DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
- }
- }
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandAction.java
deleted file mode 100644
index a8de94bdc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandAction.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.debug.core.commands.ITerminateHandler;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.actions.DebugCommandAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * Terminate action.
- *
- * @since 3.3
- */
-public class TerminateCommandAction extends DebugCommandAction {
-
- public TerminateCommandAction() {
- setActionDefinitionId("org.eclipse.debug.ui.commands.Terminate"); //$NON-NLS-1$
- }
-
- public String getText() {
- return ActionMessages.TerminateAction_0;
- }
-
- public String getHelpContextId() {
- return "org.eclipse.debug.ui.terminate_action_context"; //$NON-NLS-1$
- }
-
- public String getId() {
- return "org.eclipse.debug.ui.debugview.toolbar.terminate"; //$NON-NLS-1$
- }
-
- public String getToolTipText() {
- return ActionMessages.TerminateAction_3;
- }
-
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TERMINATE);
- }
-
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_TERMINATE);
- }
-
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_TERMINATE);
- }
-
- protected Class getCommandType() {
- return ITerminateHandler.class;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandActionDelegate.java
deleted file mode 100644
index a401b2209..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandActionDelegate.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.commands.actions;
-
-/**
- * Terminate action delegate.
- *
- * @since 3.3
- */
-public class TerminateCommandActionDelegate extends DebugCommandActionDelegate {
-
- public TerminateCommandActionDelegate() {
- super();
- setAction(new TerminateCommandAction());
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java
deleted file mode 100644
index 845733b8a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
-import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.commands.IStepFiltersHandler;
-import org.eclipse.debug.internal.core.StepFilterManager;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.actions.DebugCommandAction;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * This class provides the action for toggling step filters on or off for the debug view
- */
-public class ToggleStepFiltersAction extends DebugCommandAction implements IPropertyChangeListener {
-
- private boolean fInitialized = !DebugUITools.isUseStepFilters();
-
- /**
- * @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#getDisabledImageDescriptor()
- */
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TOGGLE_STEP_FILTERS);
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#getHelpContextId()
- */
- public String getHelpContextId() {
- return "org.eclipse.debug.ui.step_with_filters_action_context"; //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#getHoverImageDescriptor()
- */
- public ImageDescriptor getHoverImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TOGGLE_STEP_FILTERS);
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#getId()
- */
- public String getId() {
- return "org.eclipse.debug.ui.actions.ToggleStepFilters"; //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TOGGLE_STEP_FILTERS);
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#getText()
- */
- public String getText() {
- return ActionMessages.ToggleStepFiltersAction_1;
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#getToolTipText()
- */
- public String getToolTipText() {
- return ActionMessages.ToggleStepFiltersAction_0;
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#getInitialEnablement()
- */
- protected boolean getInitialEnablement() {
- return true;
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#getCommandType()
- */
- protected Class getCommandType() {
- return IStepFiltersHandler.class;
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#run()
- */
- public void run() {
- // ignore initial call to run from abstract debug view
- // that runs the action to initialize it's state when
- // the workbench persisted the action as "on"
- if (fInitialized) {
- DebugUITools.setUseStepFilters(!DebugUITools.isUseStepFilters());
- } else {
- fInitialized = true;
- }
- }
-
- /**
- * @see org.eclipse.jface.action.Action#getStyle()
- */
- public int getStyle() {
- return AS_CHECK_BOX;
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#debugContextChanged(org.eclipse.debug.ui.contexts.DebugContextEvent)
- */
- public void debugContextChanged(DebugContextEvent event) {
- ISelection context = event.getContext();
- if (context.isEmpty()) {
- setEnabled(true);
- } else {
- super.debugContextChanged(event);
- }
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#init(org.eclipse.ui.IWorkbenchPart)
- */
- public void init(IWorkbenchPart part) {
- super.init(part);
- initState();
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
- super.init(window);
- initState();
- }
-
- /**
- * Initializes the state, by adding this action as a property listener
- */
- protected void initState() {
- DebugPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(this);
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#dispose()
- */
- public void dispose() {
- super.dispose();
- DebugPlugin.getDefault().getPluginPreferences().removePropertyChangeListener(this);
- }
-
- /**
- * @see org.eclipse.core.runtime.Preferences$IPropertyChangeListener#propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(StepFilterManager.PREF_USE_STEP_FILTERS)) {
- boolean checked = DebugUITools.isUseStepFilters();
- setChecked(checked);
- IAction action = getActionProxy();
- if (action != null) {
- action.setChecked(checked);
- }
- }
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandActionDelegate.java
deleted file mode 100644
index 163927199..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandActionDelegate.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.action.IAction;
-
-/**
- * Toggle step filters action delegate.
- *
- * @since 3.3
- */
-public class ToggleStepFiltersCommandActionDelegate extends DebugCommandActionDelegate {
-
- /**
- * Constructor
- */
- public ToggleStepFiltersCommandActionDelegate() {
- super();
- setAction(new ToggleStepFiltersAction());
- }
-
- public void init(IAction action) {
- super.init(action);
- action.setChecked(DebugUITools.isUseStepFilters());
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateActionsRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateActionsRequest.java
deleted file mode 100644
index 142dbb22d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateActionsRequest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.debug.core.commands.IEnabledStateRequest;
-import org.eclipse.debug.internal.core.commands.DebugCommandRequest;
-
-/**
- * Boolean collector that collects boolean results from a number of voters.
- * Request is cancelled when one voter votes false.
- *
- * @since 3.3
- *
- */
-public class UpdateActionsRequest extends DebugCommandRequest implements IEnabledStateRequest {
-
- private IEnabledTarget[] fActions;
- private boolean fEnabled = false;
-
- public UpdateActionsRequest(Object[] elements, IEnabledTarget[] actions) {
- super(elements);
- fActions = actions;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor#setResult(boolean)
- */
- public synchronized void setEnabled(boolean result) {
- fEnabled = result;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IProgressMonitor#done()
- */
- public synchronized void done() {
- if (!isCanceled()) {
- for (int i = 0; i < fActions.length; i++) {
- fActions[i].setEnabled(fEnabled);
- }
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateHandlerRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateHandlerRequest.java
deleted file mode 100644
index a0069caee..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateHandlerRequest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.commands.actions;
-
-import org.eclipse.debug.core.commands.IEnabledStateRequest;
-import org.eclipse.debug.internal.core.commands.DebugCommandRequest;
-
-/**
- * Collects whether a handler is enabled for a set of elements and
- * reports its vote to an action updater collecting results from
- * other handlers.
- *
- * @since 3.3
- *
- */
-public class UpdateHandlerRequest extends DebugCommandRequest implements IEnabledStateRequest {
-
- private boolean fEnabled = false;
- private ActionsUpdater fUpdater;
-
- public UpdateHandlerRequest(Object[] elements, ActionsUpdater updater) {
- super(elements);
- fUpdater = updater;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor#setResult(boolean)
- */
- public synchronized void setEnabled(boolean result) {
- fEnabled = result;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IProgressMonitor#done()
- */
- public synchronized void done() {
- fUpdater.setEnabled(fEnabled);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextMessages.java
deleted file mode 100644
index 68f483862..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextMessages.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.contextlaunching;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * NLS'd messages for context launching artifacts
- * @since 3.3
- * CONTEXTLAUNCHING
- */
-public class ContextMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.contextlaunching.ContextMessages"; //$NON-NLS-1$
- public static String ContextRunner_0;
- public static String ContextRunner_1;
- public static String ContextRunner_13;
- public static String ContextRunner_14;
- public static String ContextRunner_15;
- public static String ContextRunner_2;
- public static String ContextRunner_3;
- public static String ContextRunner_7;
- public static String LaunchingResourceManager_0;
- public static String LaunchingResourceManager_1;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, ContextMessages.class);
- }
-
- private ContextMessages() {
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextMessages.properties
deleted file mode 100644
index ad1b9f9c5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextMessages.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-###############################################################################
-# Copyright (c) 2007, 2009 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-ContextRunner_0=Unable To Launch
-ContextRunner_7=The selection cannot be launched, and there are no recent launches.
-ContextRunner_2=The selection does not support {0} mode.
-ContextRunner_3=Launch configuration ''{0}'' does not support {1} mode.
-ContextRunner_13=The resource ''{0}'' is not accessible for launching
-ContextRunner_14=As...
-ContextRunner_15=...
-ContextRunner_1={0} Not Supported
-
-#The possible values for {0} are the names of the launch configurations in the current workspace
-LaunchingResourceManager_0={0} (already running)
-#The possible values for {0} are the names of launch shortcuts such as "Java Application" or "Java Applet"
-LaunchingResourceManager_1=As {0}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextRunner.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextRunner.java
deleted file mode 100644
index 820f6bdf0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextRunner.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Daniel Friederich (freescale) - Bug 293210 - Context launch launches shared launch configuration twice.
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.contextlaunching;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchMode;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationSelectionDialog;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutSelectionDialog;
-import org.eclipse.debug.internal.ui.stringsubstitution.SelectedResourceManager;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.IEditorPart;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Static runner for context launching to provide the base capability of context
- * launching to more than one form of action (drop down, toolbar, view, etc)
- *
- * @see org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction
- * @see org.eclipse.debug.ui.actions.LaunchShortcutsAction
- * @see org.eclipse.debug.ui.actions.ContextualLaunchAction
- *
- * @since 3.3
- * CONTEXTLAUNCHING
- */
-public final class ContextRunner {
-
- /**
- * The singleton instance of the context runner
- */
- private static ContextRunner fgInstance = null;
-
- /**
- * Returns the singleton instance of <code>ContextRunner</code>
- * @return the singleton instance of <code>ContextRunner</code>
- */
- public static ContextRunner getDefault() {
- if(fgInstance == null) {
- fgInstance = new ContextRunner();
- }
- return fgInstance;
- }
-
- /**
- * The one instance of <code>LaunchingResourceManager</code> we need
- * @since 3.4
- */
- private LaunchingResourceManager fLRM = DebugUIPlugin.getDefault().getLaunchingResourceManager();
-
- /**
- * Performs the context launching given the object context and the mode to launch in.
- * @param group
- */
- public void launch(ILaunchGroup group) {
- IStructuredSelection selection = SelectedResourceManager.getDefault().getCurrentSelection();
- IResource resource = SelectedResourceManager.getDefault().getSelectedResource();
- selectAndLaunch(resource, group, selection);
- }
-
-
-
- /**
- * This method launches the last configuration that was launched, if any.
- * @param group the launch group to launch with
- * @return true if there was a last launch and it was launched, false otherwise
- */
- protected boolean launchLast(ILaunchGroup group) {
- ILaunchConfiguration config = null;
- if(group != null) {
- config = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getFilteredLastLaunch(group.getIdentifier());
- if(config != null) {
- launch(config, group.getMode());
- return true;
- }
- }
- return false;
- }
-
- /**
- * Prompts the user to select a way of launching the current resource, where a 'way'
- * is defined as a launch shortcut.
- *
- * @param resource
- * @param group
- */
- protected void selectAndLaunch(IResource resource, ILaunchGroup group, IStructuredSelection selection) {
- if(group != null) {
- LaunchConfigurationManager lcm = DebugUIPlugin.getDefault().getLaunchConfigurationManager();
- String mode = group.getMode();
- List shortcuts = fLRM.getShortcutsForSelection(selection, mode);
- // allow the shortcut to translate/provide the resource for the launch
- IResource overrideResource = fLRM.getLaunchableResource(shortcuts, selection);
- if(overrideResource != null) {
- resource = overrideResource;
- }
- shortcuts = fLRM.pruneShortcuts(shortcuts, resource, mode);
- //see if the context is a shared configuration
- ILaunchConfiguration config = lcm.isSharedConfig(resource);
- if(config != null) {
- launch(config, mode);
- return;
- }
- //get the configurations from the resource and participants
- List configs = fLRM.getParticipatingLaunchConfigurations(selection, resource, shortcuts, mode);
- int csize = configs.size();
- if(csize == 1) {
- launch((ILaunchConfiguration) configs.get(0), mode);
- }
- else if(csize < 1) {
- int esize = shortcuts.size();
- if(esize == 1) {
- launchShortcut(selection, (LaunchShortcutExtension) shortcuts.get(0), mode);
- }
- else if(esize > 1) {
- showShortcutSelectionDialog(resource, shortcuts, mode, selection);
- }
- else if(esize < 1) {
- if(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_LAUNCH_LAST_IF_NOT_LAUNCHABLE)) {
- if(!launchLast(group)) {
- MessageDialog.openInformation(DebugUIPlugin.getShell(), ContextMessages.ContextRunner_0, ContextMessages.ContextRunner_7);
- }
- }
- else if (shortcuts.size() > 0) {
- // there are shortcuts, but not applicable to the selected mode
- ILaunchMode launchMode = DebugPlugin.getDefault().getLaunchManager().getLaunchMode(mode);
- if (launchMode == null) {
- DebugUIPlugin.logErrorMessage("Unsupported launch mode: " + mode); //$NON-NLS-1$
- } else {
- String label = launchMode.getLabel();
- String modeLabel = DebugUIPlugin.removeAccelerators(label);
- MessageDialog.openInformation(DebugUIPlugin.getShell(),
- MessageFormat.format(ContextMessages.ContextRunner_1, new String[]{modeLabel}),
- MessageFormat.format(ContextMessages.ContextRunner_2, new String[]{modeLabel.toLowerCase()}));
- }
- } else {
- if(resource != null) {
- IProject project = resource.getProject();
- if(project != null && !project.equals(resource)) {
- selectAndLaunch(project, group, new StructuredSelection(project));
- }
- else {
- String msg = ContextMessages.ContextRunner_7;
- if(!resource.isAccessible()) {
- msg = MessageFormat.format(ContextMessages.ContextRunner_13, new String[] {resource.getName()});
- }
- MessageDialog.openInformation(DebugUIPlugin.getShell(), ContextMessages.ContextRunner_0, msg);
- }
- }
- else {
- if (!launchLast(group)) {
- MessageDialog.openInformation(DebugUIPlugin.getShell(), ContextMessages.ContextRunner_0, ContextMessages.ContextRunner_7);
- }
- }
- }
- }
- }
- else if(csize > 1){
- config = lcm.getMRUConfiguration(configs, group, resource);
- if(config != null) {
- launch(config, mode);
- } else {
- showConfigurationSelectionDialog(configs, mode);
- }
- }
- }
- }
-
- /**
- * Validates the given launch mode and launches.
- *
- * @param configuration configuration to launch
- * @param mode launch mode identifier
- */
- private void launch(ILaunchConfiguration configuration, String mode) {
- if (validateMode(configuration, mode)) {
- DebugUITools.launch(configuration, mode);
- }
- }
-
- /**
- * Delegate method that calls the appropriate launch method on a <code>LaunchShortcutExtension</code> given
- * the current resource and selection context
- * @param selection the current selection
- * @param shortcut the shortcut that wants to launch
- * @param mode the mode to launch in
- *
- * @since 3.4
- */
- private void launchShortcut(IStructuredSelection selection, LaunchShortcutExtension shortcut, String mode) {
- Object o = selection.getFirstElement();
- if(o instanceof IEditorPart) {
- shortcut.launch((IEditorPart) o, mode);
- }
- else {
- shortcut.launch(selection, mode);
- }
- }
-
- /**
- * Validates the given launch mode is supported, and returns whether to continue with
- * the launch.
- *
- * @param configuration launch configuration
- * @param mode launch mode
- * @return whether the mode is supported
- */
- private boolean validateMode(ILaunchConfiguration configuration, String mode) {
- try {
- // if this is a multi-mode launch, allow the launch dialog to be opened
- // to resolve a valid mode, if needed.
- if (configuration.getModes().isEmpty()) {
- if (!configuration.supportsMode(mode)) {
- ILaunchMode launchMode = DebugPlugin.getDefault().getLaunchManager().getLaunchMode(mode);
- if (launchMode == null) {
- DebugUIPlugin.logErrorMessage("Unsupported launch mode: " + mode); //$NON-NLS-1$
- } else {
- String label = launchMode.getLabel();
- String modeLabel = DebugUIPlugin.removeAccelerators(label);
- MessageDialog.openInformation(DebugUIPlugin.getShell(), MessageFormat.format(ContextMessages.ContextRunner_1, new String[]{modeLabel}),
- MessageFormat.format(ContextMessages.ContextRunner_3, new String[]{configuration.getName(), modeLabel.toLowerCase()}));
- }
- return false;
- }
- }
- } catch (CoreException e) {
- DebugUIPlugin.log(e.getStatus());
- return false;
- }
- return true;
- }
-
- /**
- * Presents the user with a dialog to pick the launch configuration to launch
- * and launches that configuration.
- *
- * @param configurations the listing of applicable configurations to present
- * @param mode the mode
- */
- protected void showConfigurationSelectionDialog(List configurations, String mode) {
- LaunchConfigurationSelectionDialog lsd = new LaunchConfigurationSelectionDialog(DebugUIPlugin.getShell(), configurations);
- if(lsd.open() == IDialogConstants.OK_ID) {
- ILaunchConfiguration config = (ILaunchConfiguration) lsd.getResult()[0];
- launch(config, mode);
- }
- }
-
- /**
- * Presents a selection dialog to the user to pick a launch shortcut and
- * launch using that shortcut.
- *
- * @param resource the resource context
- * @param mode the mode
- */
- protected void showShortcutSelectionDialog(IResource resource, List shortcuts, String mode, IStructuredSelection selection) {
- LaunchShortcutSelectionDialog dialog = new LaunchShortcutSelectionDialog(shortcuts, resource, mode);
- if (dialog.open() == Window.OK) {
- Object[] result = dialog.getResult();
- if(result.length > 0) {
- LaunchShortcutExtension method = (LaunchShortcutExtension) result[0];
- if(method != null) {
- launchShortcut(selection, method, mode);
- }
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java
deleted file mode 100644
index ffa1840d9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java
+++ /dev/null
@@ -1,699 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.contextlaunching;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Set;
-
-import org.eclipse.core.expressions.EvaluationContext;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchesListener2;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.ILaunchHistoryChangedListener;
-import org.eclipse.debug.internal.ui.ILaunchLabelChangedListener;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension;
-import org.eclipse.debug.internal.ui.stringsubstitution.SelectedResourceManager;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.action.CoolBarManager;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.ToolBarContributionItem;
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseTrackAdapter;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IWindowListener;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.activities.WorkbenchActivityHelper;
-import org.eclipse.ui.internal.WorkbenchWindow;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * This manager is used to calculate the labels for the current resource or for the current
- * state of the launch history, depending on the enabled status of contextual launching. More specifically
- * if contextual launching is enabled the calculated labels are for the current resource, otherwise
- * the calculated labels are for the current state of the launch history.
- *
- * Any actions interested in being notified of launch label updates need to register with this manager, and implement
- * the <code>ILaunchLabelChangedListener</code> interface.
- *
- * @see ILaunchLabelChangedListener
- * @see org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction
- *
- * @since 3.3
- */
-public class LaunchingResourceManager implements IPropertyChangeListener, IWindowListener, ISelectionListener, ILaunchHistoryChangedListener, ILaunchesListener2 {
-
- /**
- *The set of label update listeners
- */
- private ListenerList fLabelListeners = new ListenerList();
-
- /**
- * The map of ToolBars that have mouse tracker listeners associated with them:
- * stored as Map<IWorkbenchWindow, ToolBar>
- */
- private HashMap fToolbars = new HashMap();
-
- /**
- * the map of current labels
- */
- private HashMap fCurrentLabels = new HashMap();
-
- /**
- * The selection has changed and we need to update the labels
- */
- private boolean fUpdateLabel = true;
-
- /**
- * Set of windows that have been opened and that we have registered selection listeners with
- */
- private HashSet fWindows = new HashSet();
-
- /**
- * Cache of IResource -> ILaunchConfiguration[] used during a tooltip update job.
- * The cache is cleared after each tooltip update job is complete.
- */
- private HashMap fConfigCache = new HashMap();
-
- /**
- * Cache of IResource -> LaunchShortcutExtension used during a tooltip update job.
- * The cache is cleared after each tooltip update job is complete.
- */
- private HashMap fExtCache = new HashMap();
-
- /**
- * Constant denoting the empty string;
- */
- private static final String EMPTY_STRING = IInternalDebugCoreConstants.EMPTY_STRING;
-
- /**
- * Provides a mouse tracker listener for the launching main toolbar
- */
- private MouseTrackAdapter fMouseListener = new MouseTrackAdapter() {
- public void mouseEnter(MouseEvent e) {
- if(fUpdateLabel) {
- fUpdateLabel = false;
- fCurrentLabels.clear();
- Job job = new Job("Compute launch button tooltip") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- computeLabels();
- fConfigCache.clear();
- fExtCache.clear();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
- }
- };
-
- /**
- * Returns if context launching is enabled
- * @return if context launching is enabled
- */
- public static boolean isContextLaunchEnabled() {
- return DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_USE_CONTEXTUAL_LAUNCH);
- }
-
- /**
- * Allows an <code>AbstractLaunchHistoryAction</code> to register with this manager to be notified
- * of a context (<code>IResource</code>) change and have its updateToolTip(..) method called back to.
- * @param action the action to add
- * @param group the launch group
- * @return true if the <code>AbstractLaunchHistoryAction</code> was added as a listener, false otherwise
- */
- public void addLaunchLabelUpdateListener(ILaunchLabelChangedListener listener) {
- fLabelListeners.add(listener);
- }
-
- /**
- * Removes the specified <code>AbstractLaunchHistoryAction</code> from the listing of registered
- * listeners
- * @param action the action to remove
- * @param group the launch group
- * @return true if the action was removed from the listing of <code>AbstractLaunchHistoryAction</code> listeners,
- * false otherwise
- */
- public void removeLaunchLabelChangedListener(ILaunchLabelChangedListener listener) {
- fLabelListeners.remove(listener);
- }
-
- /**
- * Returns the current resource label to be displayed.
- *
- * @param group the launch group to get the label for
- * @return the current resource label;
- */
- public String getLaunchLabel(ILaunchGroup group) {
- return (String) fCurrentLabels.get(group);
- }
-
- /**
- * Returns if the parent project should be checked automatically
- * @return true if the parent project should checked automatically, false otherwise
- */
- protected boolean shouldCheckParent() {
- return DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_LAUNCH_PARENT_PROJECT);
- }
-
- /**
- * Returns if the the last launch configuration should be launched if the selected resource is not launchable and context launching is enabled
- * @return true if the last launched should be launched, false otherwise
- */
- protected boolean shouldLaunchLast() {
- return DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_LAUNCH_LAST_IF_NOT_LAUNCHABLE);
- }
-
- /**
- * Computes the current listing of labels for the given <code>IResource</code> context change or the
- * current launch history changed event
- */
- protected void computeLabels() {
- ILaunchGroup group = null;
- ILaunchConfiguration config = null;
- String label = null;
- Object[] listeners = fLabelListeners.getListeners();
- SelectedResourceManager srm = SelectedResourceManager.getDefault();
- IStructuredSelection selection = srm.getCurrentSelection();
- List shortcuts = null;
- IResource resource = srm.getSelectedResource();
- for(int i = 0; i < listeners.length; i++) {
- group = ((ILaunchLabelChangedListener)listeners[i]).getLaunchGroup();
- if(group != null) {
- if(isContextLaunchEnabled() && !group.getIdentifier().equals("org.eclipse.ui.externaltools.launchGroup")) { //$NON-NLS-1$
- shortcuts = getShortcutsForSelection(selection, group.getMode());
- if(resource == null) {
- resource = getLaunchableResource(shortcuts, selection);
- }
- label = getLabel(selection, resource, shortcuts, group);
- }
- else {
- config = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getFilteredLastLaunch(group.getIdentifier());
- if(config != null) {
- label = appendLaunched(config);
- }
- }
- fCurrentLabels.put(group, label);
- label = null;
- }
- }
- notifyLabelChanged();
- }
-
- /**
- * Notifies all registered listeners that the known labels have changed
- */
- protected void notifyLabelChanged() {
- Object[] listeners = fLabelListeners.getListeners();
- for(int i = 0; i < listeners.length; i++) {
- ((ILaunchLabelChangedListener)listeners[i]).labelChanged();
- }
- }
-
- /**
- * Appends the text '(already running)' to the tooltip label if there is a launch currently
- * running (not terminated) with the same backing launch configuration as the one specified
- * @param config
- * @return the appended string for the tooltip label or the configuration name (default)
- */
- private String appendLaunched(ILaunchConfiguration config) {
- ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
- boolean launched = false;
- ILaunchConfiguration tmp = null;
- for(int i = 0; i < launches.length; i++) {
- tmp = launches[i].getLaunchConfiguration();
- if(tmp != null) {
- if(!launches[i].isTerminated() && tmp.equals(config)) {
- launched = true;
- break;
- }
- }
- }
- if(launched) {
- return MessageFormat.format(ContextMessages.LaunchingResourceManager_0, new String[] {config.getName()});
- }
- return config.getName();
- }
-
- /**
- * Returns the label for the last launched configuration or and empty string if there was no last launch.
- * @param group
- * @return the name of the last launched configuration, altered with '(running)' if needed, or the empty
- * string if there is no last launch.
- */
- protected String getlastLaunchedLabel(ILaunchGroup group) {
- ILaunchConfiguration config = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getFilteredLastLaunch(group.getIdentifier());
- if(config != null) {
- return appendLaunched(config);
- }
- return EMPTY_STRING;
- }
-
- /**
- * Returns the label for the specified resource or the empty string, never <code>null</code>
- * @param resource
- * @param group
- * @return the label for the resource or the empty string, never <code>null</code>
- */
- protected String getLabel(IStructuredSelection selection, IResource resource, List shortcuts, ILaunchGroup group) {
- List sc = pruneShortcuts(shortcuts, resource, group.getMode());
- LaunchConfigurationManager lcm = DebugUIPlugin.getDefault().getLaunchConfigurationManager();
- //see if the context is a shared configuration
- ILaunchConfiguration config = lcm.isSharedConfig(resource);
- if(config != null) {
- return appendLaunched(config);
- }
- //TODO cache the results ?
- List configs = getParticipatingLaunchConfigurations(selection, resource, sc, group.getMode());
- int csize = configs.size();
- if(csize == 1) {
- return appendLaunched((ILaunchConfiguration)configs.get(0));
- }
- else if(csize > 1) {
- config = lcm.getMRUConfiguration(configs, group, resource);
- if(config != null) {
- return appendLaunched(config);
- }
- else {
- return ContextMessages.ContextRunner_14;
- }
- }
- else {
- List exts = (List) fExtCache.get(resource);
- if(exts == null && resource != null) {
- fExtCache.put(resource, sc);
- }
- int esize = sc.size();
- if(esize == 0) {
- if(resource != null && shouldCheckParent()) {
- IProject project = resource.getProject();
- if(project != null && !project.equals(resource)) {
- return getLabel(selection, project, sc, group);
- }
- }
- else if(shouldLaunchLast() || resource == null) {
- return getlastLaunchedLabel(group);
- }
- else {
- return ContextMessages.ContextRunner_15;
- }
- }
- if(esize == 1) {
- if(resource != null) {
- return resource.getName();
- }
- else {
- return MessageFormat.format(ContextMessages.LaunchingResourceManager_1, new String[] {((LaunchShortcutExtension) sc.get(0)).getLabel()});
- }
- }
- else {
- return ContextMessages.ContextRunner_14;
- }
- }
- }
-
- /**
- * Prunes the original listing of shortcuts
- * @param shortcuts the original listing of <code>LaunchShortcutExtension</code>s
- * @param resource the derived resource
- *
- * @since 3.4
- */
- protected List pruneShortcuts(List shortcuts, IResource resource, String mode) {
- List list = new ArrayList(shortcuts);
- if(resource == null) {
- LaunchShortcutExtension ext = null;
- for(ListIterator iter = list.listIterator(); iter.hasNext();) {
- ext = (LaunchShortcutExtension) iter.next();
- if(!ext.isParticipant()) {
- iter.remove();
- }
- }
- }
- else {
- list = getShortcutsForSelection(new StructuredSelection(resource), mode);
- }
- return list;
- }
-
- /**
- * Computes the current resources context, given all of the launch shortcut participants
- * and the current selection
- * @param shortcuts
- * @param selection
- * @return The set of resources who care about this launch
- *
- * @since 3.4
- */
- public IResource getLaunchableResource(List shortcuts, IStructuredSelection selection) {
- if(selection != null && !selection.isEmpty()) {
- ArrayList resources = new ArrayList();
- IResource resource = null;
- Object o = selection.getFirstElement();
- LaunchShortcutExtension ext = null;
- for(Iterator iter = shortcuts.iterator(); iter.hasNext();) {
- ext = (LaunchShortcutExtension) iter.next();
- if(o instanceof IEditorPart) {
- resource = ext.getLaunchableResource((IEditorPart) o);
- }
- else {
- resource = ext.getLaunchableResource(selection);
- }
- if(resource != null && !resources.contains(resource)) {
- resources.add(resource);
- resource = null;
- }
- }
- if(resources.size() > 0) {
- return (IResource) resources.get(0);
- }
- }
- return null;
- }
-
- /**
- * Returns the launch shortcuts that apply to the current <code>IStructuredSelection</code>
- * @param selection the current selection
- * @param mode the mode
- * @return the list of shortcuts that apply to the given selection and mode or an empty listing, never <code>null</code>
- *
- * @since 3.4
- */
- public List getShortcutsForSelection(IStructuredSelection selection, String mode) {
- ArrayList list = new ArrayList();
- List sc = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchShortcuts();
- List ctxt = new ArrayList();
- // work around to bug in Structured Selection that returns actual underlying array in selection
- // @see bug 211646
- ctxt.addAll(selection.toList());
- Object o = selection.getFirstElement();
- if(o instanceof IEditorPart) {
- ctxt.set(0, ((IEditorPart)o).getEditorInput());
- }
- IEvaluationContext context = new EvaluationContext(null, ctxt);
- context.addVariable("selection", ctxt); //$NON-NLS-1$
- LaunchShortcutExtension ext = null;
- for(Iterator iter = sc.iterator(); iter.hasNext();) {
- ext = (LaunchShortcutExtension) iter.next();
- try {
- if(ext.evalEnablementExpression(context, ext.getContextualLaunchEnablementExpression()) &&
- ext.getModes().contains(mode) && !WorkbenchActivityHelper.filterItem(ext)) {
- if(!list.contains(ext)) {
- list.add(ext);
- }
- }
- }
- catch(CoreException ce) {}
- }
- return list;
- }
-
- /**
- * Returns a listing of all launch configurations that want to participate in the contextual
- * launch of the specified resource or specified selection
- * @param resource the underlying resource
- * @param selection the current selection in the workbench
- * @param shortcuts the listing of shortcut extensions that apply to the current context
- * @param mode the mode
- * @return a listing of all launch configurations wanting to participate in the current launching
- *
- * @since 3.4
- */
- public List getParticipatingLaunchConfigurations(IStructuredSelection selection, IResource resource, List shortcuts, String mode) {
- HashSet configs = new HashSet();
- boolean useDefault = false;
- if(selection != null) {
- Object o = selection.getFirstElement();
- LaunchShortcutExtension ext = null;
- ILaunchConfiguration[] cfgs = null;
- //TODO this falls victim to contributors code performance
- for(int i = 0; i < shortcuts.size(); i++) {
- ext = (LaunchShortcutExtension) shortcuts.get(i);
- if(o instanceof IEditorPart) {
- cfgs = ext.getLaunchConfigurations((IEditorPart)o);
- }
- else {
- cfgs = ext.getLaunchConfigurations(selection);
- }
- if (cfgs == null) {
- Set types = ext.getAssociatedConfigurationTypes();
- addAllToList(configs, DebugUIPlugin.getDefault().getLaunchConfigurationManager().getApplicableLaunchConfigurations((String[]) types.toArray(new String[types.size()]), resource));
- useDefault = true;
- } else if(cfgs.length > 0) {
- for(int j = 0; j < cfgs.length; j++) {
- configs.add(cfgs[j]);
- }
- useDefault = false;
- }
- }
- }
- if (useDefault) {
- // consider default configurations if the shortcuts did not contribute any
- addAllToList(configs, DebugUIPlugin.getDefault().getLaunchConfigurationManager().getApplicableLaunchConfigurations(null, resource));
- }
- Iterator iterator = configs.iterator();
- while (iterator.hasNext()) {
- ILaunchConfiguration config = (ILaunchConfiguration) iterator.next();
- try {
- Set modes = config.getModes();
- modes.add(mode);
- if (!config.getType().supportsModeCombination(modes)) {
- iterator.remove();
- }
- }
- catch (CoreException e) {}
- }
- return new ArrayList(configs);
- }
-
- /**
- * Adds all of the items in the given object array to the given collection.
- * Does nothing if either the collection or array is <code>null</code>.
- * @param list
- * @param values
- */
- private void addAllToList(Collection list, Object[] values) {
- if(list == null || values == null) {
- return;
- }
- for(int i = 0; i < values.length; i++) {
- list.add(values[i]);
- }
- }
-
- /**
- * Starts up the manager
- */
- public void startup() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- if(workbench != null) {
- workbench.addWindowListener(this);
- // initialize for already open windows
- IWorkbenchWindow[] workbenchWindows = workbench.getWorkbenchWindows();
- for (int i = 0; i < workbenchWindows.length; i++) {
- windowOpened(workbenchWindows[i]);
- }
- }
- DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
- DebugUIPlugin.getDefault().getLaunchConfigurationManager().addLaunchHistoryListener(this);
- DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
- }
-
- /**
- * Shutdown and clean up the manager
- */
- public void shutdown() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- if(workbench != null) {
- workbench.removeWindowListener(this);
- }
- DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
- DebugUIPlugin.getDefault().getLaunchConfigurationManager().removeLaunchHistoryListener(this);
- DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
- for(Iterator iter = fWindows.iterator(); iter.hasNext();) {
- ((IWorkbenchWindow)iter.next()).getSelectionService().removeSelectionListener(this);
- }
- IWorkbenchWindow window = null;
- // set fUpdateLabel to false so that mouse track listener will do nothing if called
- // before the asynchronous execution disposes them
- fUpdateLabel = false;
- for(Iterator iter = fToolbars.keySet().iterator(); iter.hasNext();) {
- window = (IWorkbenchWindow) iter.next();
- final ToolBar bar = (ToolBar) fToolbars.get(window);
- if(bar != null && !bar.isDisposed()) {
- final MouseTrackAdapter listener = fMouseListener;
- DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
- bar.removeMouseTrackListener(listener);
- }
- });
-
- }
- }
- fWindows.clear();
- fToolbars.clear();
- fLabelListeners.clear();
- fCurrentLabels.clear();
- }
-
- /**
- * @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowActivated(IWorkbenchWindow window) {
- if(!fToolbars.containsKey(window)) {
- addMouseListener(window);
- }
- }
-
- /**
- * @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowClosed(IWorkbenchWindow window) {
- ToolBar bar = (ToolBar) fToolbars.remove(window);
- if(bar != null && !bar.isDisposed()) {
- bar.removeMouseTrackListener(fMouseListener);
- }
- if(fWindows.remove(window)) {
- window.getSelectionService().removeSelectionListener(this);
- }
- }
-
- /**
- * @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowDeactivated(IWorkbenchWindow window) {}
-
- /**
- * @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowOpened(IWorkbenchWindow window) {
- if(fWindows.add(window)) {
- window.getSelectionService().addSelectionListener(this);
- }
- }
-
- /**
- * Adds a mouse listener to the launch toolbar
- *
- * @param window
- */
- private void addMouseListener(IWorkbenchWindow window) {
- CoolBarManager cmgr = ((WorkbenchWindow)window).getCoolBarManager();
- if(cmgr != null) {
- IContributionItem item = cmgr.find("org.eclipse.debug.ui.launchActionSet"); //$NON-NLS-1$
- if(item instanceof ToolBarContributionItem) {
- ToolBarManager tmgr = (ToolBarManager) ((ToolBarContributionItem)item).getToolBarManager();
- ToolBar bar = tmgr.getControl();
- if(bar != null && !bar.isDisposed()) {
- bar.addMouseTrackListener(fMouseListener);
- fToolbars.put(window, bar);
- }
- }
- }
- }
-
- /**
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if(event.getProperty().equals(IInternalDebugUIConstants.PREF_USE_CONTEXTUAL_LAUNCH) ||
- event.getProperty().equals(IInternalDebugUIConstants.PREF_LAUNCH_LAST_IF_NOT_LAUNCHABLE)) {
- if(isContextLaunchEnabled()) {
- windowActivated(DebugUIPlugin.getActiveWorkbenchWindow());
- }
- fUpdateLabel = true;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if(isContextLaunchEnabled()) {
- fUpdateLabel = true;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.ILaunchHistoryChangedListener#launchHistoryChanged()
- */
- public void launchHistoryChanged() {
- //this always must be set to true, because as the history is loaded these events are fired, and we need to
- //update on workspace load.
- fUpdateLabel = true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesTerminated(ILaunch[] launches) {
- fUpdateLabel = true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesAdded(ILaunch[] launches) {
- fUpdateLabel = true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesChanged(ILaunch[] launches) {}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesRemoved(ILaunch[] launches) {
- //we want to ensure that even if a launch is removed from the debug view
- //when it is not terminated we update the label just in case.
- //bug 195232
- for(int i = 0; i < launches.length; i++) {
- if(!launches[i].isTerminated()) {
- fUpdateLabel = true;
- return;
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
deleted file mode 100644
index 7ebc01b2c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.contexts;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.internal.ui.views.ViewContextManager;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextManager;
-import org.eclipse.debug.ui.contexts.IDebugContextService;
-import org.eclipse.ui.IWindowListener;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * @since 3.2
- */
-public class DebugContextManager implements IDebugContextManager {
-
- private static DebugContextManager fgDefault;
- private Map fServices = new HashMap();
- private ListenerList fGlobalListeners = new ListenerList();
-
- private class WindowListener implements IWindowListener {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowActivated(IWorkbenchWindow window) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowDeactivated(IWorkbenchWindow window) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowClosed(final IWorkbenchWindow window) {
- // Use an async exec to dispose the debug context service for the
- // closed window. This will allow other window closed listeners
- // to still use the context service before it is disposed.
- new UIJob(window.getShell().getDisplay(), "DebugContextManager windowClosed() handler") { //$NON-NLS-1$
- {
- setSystem(true);
- }
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- DebugWindowContextService service = (DebugWindowContextService) fServices.remove(window);
- if (service != null) {
- service.dispose();
- }
- return Status.OK_STATUS;
- }
- }.schedule();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowOpened(IWorkbenchWindow window) {
- }
-
- }
-
- private DebugContextManager() {
- PlatformUI.getWorkbench().addWindowListener(new WindowListener());
- }
-
- public static IDebugContextManager getDefault() {
- if (fgDefault == null) {
- fgDefault = new DebugContextManager();
- // create the model context bindigg manager at the same time
- DebugModelContextBindingManager.getDefault();
- // create view manager
- ViewContextManager.getDefault();
- }
- return fgDefault;
- }
-
- protected DebugWindowContextService createService(IWorkbenchWindow window) {
- DebugWindowContextService service = (DebugWindowContextService) fServices.get(window);
- if (service == null) {
- service = new DebugWindowContextService(window);
- fServices.put(window, service);
- // register global listeners
- Object[] listeners = fGlobalListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- IDebugContextListener listener = (IDebugContextListener) listeners[i];
- service.addDebugContextListener(listener);
- }
- }
- return service;
- }
-
- protected IDebugContextService getService(IWorkbenchWindow window) {
- return (DebugWindowContextService) fServices.get(window);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.contexts.IDebugContextManager#addDebugContextListener(org.eclipse.debug.internal.ui.contexts.IDebugContextListener)
- */
- public void addDebugContextListener(IDebugContextListener listener) {
- fGlobalListeners.add(listener);
- DebugWindowContextService[] services = getServices();
- for (int i = 0; i < services.length; i++) {
- DebugWindowContextService service = services[i];
- service.addDebugContextListener(listener);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.contexts.IDebugContextManager#removeDebugContextListener(org.eclipse.debug.internal.ui.contexts.IDebugContextListener)
- */
- public void removeDebugContextListener(IDebugContextListener listener) {
- fGlobalListeners.remove(listener);
- DebugWindowContextService[] services = getServices();
- for (int i = 0; i < services.length; i++) {
- DebugWindowContextService service = services[i];
- service.removeDebugContextListener(listener);
- }
- }
-
- /**
- * Returns the existing context services.
- *
- * @return existing context services
- */
- private DebugWindowContextService[] getServices() {
- Collection sevices = fServices.values();
- return (DebugWindowContextService[]) sevices.toArray(new DebugWindowContextService[sevices.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextManager#getContextService(org.eclipse.ui.IWorkbenchWindow)
- */
- public IDebugContextService getContextService(IWorkbenchWindow window) {
- return createService(window);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextSourceProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextSourceProvider.java
deleted file mode 100644
index 847f24112..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextSourceProvider.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.contexts;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextService;
-import org.eclipse.ui.AbstractSourceProvider;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.services.IEvaluationService;
-
-/**
- * A source provider for the active debug context variable.
- *
- * @since 3.5
- */
-public class DebugContextSourceProvider extends AbstractSourceProvider implements IDebugContextListener {
-
- /**
- * The names of the sources supported by this source provider.
- */
- private static final String[] PROVIDED_SOURCE_NAMES = new String[] { IDebugUIConstants.DEBUG_CONTEXT_SOURCE_NAME };
-
- private final IDebugContextService fDebugContextService;
-
- private final IEvaluationService fEvaluationService;
-
- /**
- * Creates the source provider. It registers it as a listener to the
- * given debug context service, and as a provider with the given
- * evaluation service.
- */
- public DebugContextSourceProvider(IDebugContextService debugContextService, IEvaluationService evaluationService) {
- fDebugContextService = debugContextService;
- fDebugContextService.addDebugContextListener(this);
- fEvaluationService = evaluationService;
- fEvaluationService.addSourceProvider(this);
- }
-
- public void debugContextChanged(DebugContextEvent event) {
- Map values = new HashMap(1);
- values.put(IDebugUIConstants.DEBUG_CONTEXT_SOURCE_NAME, event.getContext());
- fireSourceChanged(ISources.ACTIVE_CURRENT_SELECTION, values);
- }
-
- public void dispose() {
- fDebugContextService.removeDebugContextListener(this);
- fEvaluationService.removeSourceProvider(this);
- }
-
- public String[] getProvidedSourceNames() {
- return PROVIDED_SOURCE_NAMES;
- }
-
- public Map getCurrentState() {
- Map currentState = new HashMap(1);
- currentState.put(IDebugUIConstants.DEBUG_CONTEXT_SOURCE_NAME, fDebugContextService.getActiveContext());
- return currentState;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.java
deleted file mode 100644
index 07932fa16..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.java
+++ /dev/null
@@ -1,453 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech - Bug 154598: DebugModelContextBindingManager does not use IAdaptable.getAdapter() to retrieve IDebugModelProvider adapter
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.contexts;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Pattern;
-
-import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.core.commands.contexts.Context;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-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.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchesListener2;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugModelProvider;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.activities.ActivityManagerEvent;
-import org.eclipse.ui.activities.IActivity;
-import org.eclipse.ui.activities.IActivityManager;
-import org.eclipse.ui.activities.IActivityManagerListener;
-import org.eclipse.ui.activities.IActivityPatternBinding;
-import org.eclipse.ui.activities.IWorkbenchActivitySupport;
-import org.eclipse.ui.contexts.IContextActivation;
-import org.eclipse.ui.contexts.IContextService;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * Manages <code>debugModelContextBindings</code> extensions.
- * <p>
- * As debug contexts are activated, associated <code>org.eclipse.ui.contexts</code>
- * are activated. When a debug session (launch) terminates, the associated contexts
- * are disabled. Debug model activation also triggers assocaited activities.
- * </p>
- * @since 3.2
- */
-public class DebugModelContextBindingManager implements IDebugContextListener, ILaunchesListener2, IActivityManagerListener {
-
- /**
- * Map of debug model identifier to associated contexts as defined
- * by <code>debugModelContextBindings</code> extensions.
- */
- private Map fModelToContextIds = new HashMap();
-
- /**
- * Map of launch objects to enabled model ids
- */
- private Map fLaunchToModelIds = new HashMap();
-
- /**
- * Map of launch objects to context activations
- */
- private Map fLanuchToContextActivations = new HashMap();
-
- /**
- * A list of activity pattern bindings for debug models.
- */
- private List fModelPatternBindings = new ArrayList();
-
- /**
- * Map of debug model ids to assocaited activity ids.
- */
- private Map fModelToActivities = new HashMap();
-
- /**
- * A set of debug model ids for which activities have been enabled.
- * Cleared when enabled activities change.
- */
- private Set fModelsEnabledForActivities = new HashSet();
-
- // extension point
- public static final String ID_DEBUG_MODEL_CONTEXT_BINDINGS= "debugModelContextBindings"; //$NON-NLS-1$
-
- // extension point attributes
- public static final String ATTR_CONTEXT_ID= "contextId"; //$NON-NLS-1$
- public static final String ATTR_DEBUG_MODEL_ID= "debugModelId"; //$NON-NLS-1$
-
- // base debug context
- public static final String DEBUG_CONTEXT= "org.eclipse.debug.ui.debugging"; //$NON-NLS-1$
-
- // suffix for debug activities triggered by debug model context binding activation
- private static final String DEBUG_MODEL_ACTIVITY_SUFFIX = "/debugModel"; //$NON-NLS-1$
-
- // singleton manager
- private static DebugModelContextBindingManager fgManager;
-
- private static IContextService fgContextService = (IContextService) PlatformUI.getWorkbench().getAdapter(IContextService.class);
-
- public static DebugModelContextBindingManager getDefault() {
- if (fgManager == null) {
- fgManager = new DebugModelContextBindingManager();
- }
- return fgManager;
- }
-
- private DebugModelContextBindingManager() {
- loadDebugModelContextBindings();
- loadDebugModelActivityExtensions();
- DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
- DebugUITools.getDebugContextManager().addDebugContextListener(this);
- IWorkbenchActivitySupport activitySupport = PlatformUI.getWorkbench().getActivitySupport();
- activitySupport.getActivityManager().addActivityManagerListener(this);
- }
-
- /**
- * Loads the extensions which map debug model identifiers
- * to context ids.
- */
- private void loadDebugModelContextBindings() {
- IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), ID_DEBUG_MODEL_CONTEXT_BINDINGS);
- IConfigurationElement[] configurationElements = extensionPoint.getConfigurationElements();
- for (int i = 0; i < configurationElements.length; i++) {
- IConfigurationElement element = configurationElements[i];
- String modelIdentifier = element.getAttribute(ATTR_DEBUG_MODEL_ID);
- String contextId = element.getAttribute(ATTR_CONTEXT_ID);
- if (modelIdentifier != null && contextId != null) {
- List contextIds = (List) fModelToContextIds.get(modelIdentifier);
- if (contextIds == null) {
- contextIds = new ArrayList();
- fModelToContextIds.put(modelIdentifier, contextIds);
- }
- contextIds.add(contextId);
- }
- }
- }
-
- /**
- * Loads the extensions which map debug model patterns
- * to activity ids. This information is used to activate the
- * appropriate activities when a debug element is selected.
- */
- private void loadDebugModelActivityExtensions() {
- IActivityManager activityManager = PlatformUI.getWorkbench().getActivitySupport().getActivityManager();
- Set activityIds = activityManager.getDefinedActivityIds();
- Iterator activityIterator = activityIds.iterator();
- while (activityIterator.hasNext()) {
- String activityId= (String) activityIterator.next();
- IActivity activity = activityManager.getActivity(activityId);
- if (activity != null) {
- Set patternBindings = activity.getActivityPatternBindings();
- Iterator patternIterator= patternBindings.iterator();
- while (patternIterator.hasNext()) {
- IActivityPatternBinding patternBinding= (IActivityPatternBinding) patternIterator.next();
- String pattern = patternBinding.getPattern().pattern();
- if (pattern.endsWith(DEBUG_MODEL_ACTIVITY_SUFFIX)) {
- fModelPatternBindings.add(patternBinding);
- }
- }
- }
- }
- }
-
- public void debugContextChanged(DebugContextEvent event) {
- if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
- ISelection selection = event.getContext();
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- Iterator iterator = ss.iterator();
- while (iterator.hasNext()) {
- activated(iterator.next());
- }
- }
- }
- }
-
- /**
- * The specified object has been activated. Activate contexts and activities as
- * required for the object.
- *
- * @param object object that has been activated
- */
- private void activated(Object object) {
- String[] modelIds = getDebugModelIds(object);
- if (modelIds == null) {
- return;
- }
- ILaunch launch = getLaunch(object);
- if (launch == null) {
- return;
- }
- Set alreadyEnabled = (Set) fLaunchToModelIds.get(launch);
- if (alreadyEnabled == null) {
- alreadyEnabled = new HashSet();
- fLaunchToModelIds.put(launch, alreadyEnabled);
- }
- for (int i = 0; i < modelIds.length; i++) {
- String id = modelIds[i];
- if (!alreadyEnabled.contains(id)) {
- alreadyEnabled.add(id);
- activateModel(id, launch);
- }
- }
- enableActivitiesFor(modelIds);
- }
-
- /**
- * Activates the given model identifier for the specified launch. This activates
- * associated contexts and all parent contexts for the model.
- *
- * @param modelId model to be enabled
- * @param launch the launch the model is being enabled for
- */
- private void activateModel(String modelId, ILaunch launch) {
- List contextIds = (List) fModelToContextIds.get(modelId);
- if (contextIds == null) {
- // if there are no contexts for a model, the base debug context should
- // be activated (i.e. a debug model with no org.eclipse.ui.contexts and
- // associated org.eclipse.debug.ui.modelContextBindings)
- contextIds = new ArrayList();
- contextIds.add(DEBUG_CONTEXT);
- fModelToContextIds.put(modelId, contextIds);
- }
- Iterator iterator = contextIds.iterator();
- while (iterator.hasNext()) {
- activateContext((String) iterator.next(), launch);
- }
- }
-
- /**
- * Activates the given context and all its parent contexts.
- *
- * @param contextId
- * @param launch
- */
- private void activateContext(String contextId, ILaunch launch) {
- while (contextId != null) {
- Context context = fgContextService.getContext(contextId);
- IContextActivation activation = fgContextService.activateContext(contextId);
- addActivation(launch, activation);
- try {
- if (contextId.equals(DEBUG_CONTEXT)) {
- // don't enable windows contexts and higher
- break;
- }
- contextId = context.getParentId();
- } catch (NotDefinedException e) {
- contextId = null;
- DebugUIPlugin.log(e);
- }
- }
- }
-
- /**
- * Notes the activation for a context and launch so we can de-activate later.
- *
- * @param launch
- * @param activation
- */
- private void addActivation(ILaunch launch, IContextActivation activation) {
- List activations = (List) fLanuchToContextActivations.get(launch);
- if (activations == null) {
- activations = new ArrayList();
- fLanuchToContextActivations.put(launch, activations);
- }
- activations.add(activation);
- }
-
- /**
- * Returns the debug model identifiers associated with the given object or <code>null</code>
- * if none.
- *
- * @param object
- * @return debug model identifiers associated with the given object or <code>null</code>
- */
- private String[] getDebugModelIds(Object object) {
- if (object instanceof IAdaptable) {
- IDebugModelProvider modelProvider= (IDebugModelProvider)((IAdaptable)object).getAdapter(IDebugModelProvider.class);
- if (modelProvider != null) {
- String[] modelIds= modelProvider.getModelIdentifiers();
- if (modelIds != null) {
- return modelIds;
- }
- }
- }
- if (object instanceof IStackFrame) {
- return new String[] { ((IStackFrame) object).getModelIdentifier() };
- }
- return null;
- }
-
- /**
- * Returns the ILaunch associated with the given object or
- * <code>null</code> if none.
- *
- * @param object object for which launch is required
- * @return the ILaunch associated with the given object or <code>null</code>
- */
- public static ILaunch getLaunch(Object object) {
- ILaunch launch = null;
- if (object instanceof IAdaptable) {
- launch = (ILaunch) ((IAdaptable)object).getAdapter(ILaunch.class);
- }
- if (launch == null && object instanceof IDebugElement) {
- launch = ((IDebugElement) object).getLaunch();
- }
- return launch;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesTerminated(ILaunch[] launches) {
- // disable activated contexts
- for (int i = 0; i < launches.length; i++) {
- ILaunch launch = launches[i];
- final List activations = (List) fLanuchToContextActivations.remove(launch);
- fLaunchToModelIds.remove(launch);
- if (activations != null) {
- UIJob job = new UIJob("Deactivate debug contexts") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- Iterator iterator = activations.iterator();
- while (iterator.hasNext()) {
- IContextActivation activation = (IContextActivation) iterator.next();
- activation.getContextService().deactivateContext(activation);
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
-
- }
- // TODO: Terminated notification
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesRemoved(ILaunch[] launches) {}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesAdded(ILaunch[] launches) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesChanged(ILaunch[] launches) {
- }
-
- /**
- * Returns the workbench contexts associated with a debug context
- *
- * @param target debug context
- * @return associated workbench contexts
- */
- public List getWorkbenchContextsForDebugContext(Object target) {
- List workbenchContexts = new ArrayList();
- String[] modelIds = getDebugModelIds(target);
- if (modelIds != null) {
- for (int i = 0; i < modelIds.length; i++) {
- String modelId = modelIds[i];
- List contextIds = (List) fModelToContextIds.get(modelId);
- if (contextIds != null) {
- Iterator contextIterator = contextIds.iterator();
- while (contextIterator.hasNext()) {
- String contextId = (String) contextIterator.next();
- if (!workbenchContexts.contains(contextId)) {
- workbenchContexts.add(contextId);
- }
- }
- }
- }
- }
- return workbenchContexts;
- }
-
- /**
- * Enables activities in the workbench associated with the given debug
- * model ids that have been activated.
- *
- * @param debug model ids for which to enable activities
- */
- private void enableActivitiesFor(String[] modelIds) {
- Set activities = null;
- for (int i = 0; i < modelIds.length; i++) {
- String id = modelIds[i];
- if (!fModelsEnabledForActivities.contains(id)) {
- Set ids= (Set) fModelToActivities.get(id);
- if (ids == null) {
- // first time the model has been seen, perform pattern matching
- ids = new HashSet();
- fModelToActivities.put(id, ids);
- Iterator bindings = fModelPatternBindings.iterator();
- while (bindings.hasNext()) {
- IActivityPatternBinding binding = (IActivityPatternBinding) bindings.next();
- String regex = binding.getPattern().pattern();
- regex = regex.substring(0, regex.length() - DEBUG_MODEL_ACTIVITY_SUFFIX.length());
- if (Pattern.matches(regex, id)) {
- ids.add(binding.getActivityId());
- }
- }
- }
- if (!ids.isEmpty()) {
- if (activities == null) {
- activities = new HashSet();
- }
- activities.addAll(ids);
- }
- fModelsEnabledForActivities.add(id);
- }
- }
- if (activities != null) {
- IWorkbenchActivitySupport activitySupport = PlatformUI.getWorkbench().getActivitySupport();
- Set enabledActivityIds = activitySupport.getActivityManager().getEnabledActivityIds();
- if (!enabledActivityIds.containsAll(activities)) {
- enabledActivityIds = new HashSet(enabledActivityIds);
- enabledActivityIds.addAll(activities);
- activitySupport.setEnabledActivityIds(activities);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.activities.IActivityManagerListener#activityManagerChanged(org.eclipse.ui.activities.ActivityManagerEvent)
- */
- public void activityManagerChanged(ActivityManagerEvent activityManagerEvent) {
- if (activityManagerEvent.haveEnabledActivityIdsChanged()) {
- fModelsEnabledForActivities.clear();
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
deleted file mode 100644
index 596c2bc5d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River - Pawel Piech - added an evaluation context source provider (bug 229219)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.contexts;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextProvider;
-import org.eclipse.debug.ui.contexts.IDebugContextService;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IPartListener2;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartReference;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.services.IEvaluationService;
-
-/**
- * Context service for a specific window.
- *
- * @since 3.2
- */
-public class DebugWindowContextService implements IDebugContextService, IPartListener2, IDebugContextListener {
-
- private Map fListenersByPartId = new HashMap();
- private Map fProvidersByPartId = new HashMap();
- private Map fPostListenersByPartId = new HashMap();
-
- private IWorkbenchWindow fWindow;
- private List fProviders = new ArrayList();
-
- private DebugContextSourceProvider fSourceProvider;
-
- public DebugWindowContextService(IWorkbenchWindow window) {
- fWindow = window;
- fWindow.getPartService().addPartListener(this);
-
- IEvaluationService evaluationService = (IEvaluationService)window.getService(IEvaluationService.class);
- fSourceProvider = new DebugContextSourceProvider(this, evaluationService);
- }
-
- public void dispose() {
- fSourceProvider.dispose();
- fWindow.getPartService().removePartListener(this);
- fWindow = null;
- }
-
- public synchronized void addDebugContextProvider(IDebugContextProvider provider) {
- IWorkbenchPart part = provider.getPart();
- String id = null;
- if (part != null) {
- id = part.getSite().getId();
- }
- fProvidersByPartId.put(id, provider);
- fProviders.add(provider);
- IWorkbenchPart active = null;
- IWorkbenchPage activePage = fWindow.getActivePage();
- if (activePage != null) {
- active = activePage.getActivePart();
- }
- if (fProviders.size() == 1 && (part == null || part.equals(active))) {
- notify(provider);
- }
- provider.addDebugContextListener(this);
- }
-
- public synchronized void removeDebugContextProvider(IDebugContextProvider provider) {
- int index = fProviders.indexOf(provider);
- if (index >= 0) {
- IWorkbenchPart part = provider.getPart();
- String id = null;
- if (part != null) {
- id = part.getSite().getId();
- }
- fProvidersByPartId.remove(id);
- fProviders.remove(index);
- if (index == 0) {
- IDebugContextProvider activeProvider = getActiveProvider();
- if (activeProvider != null) {
- notify(activeProvider);
- } else {
- notify(new DebugContextEvent(provider, new StructuredSelection(), DebugContextEvent.ACTIVATED));
- }
- }
- }
- provider.removeDebugContextListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.IDebugContextService#addDebugContextListener(org.eclipse.debug.ui.contexts.IDebugContextListener)
- */
- public void addDebugContextListener(IDebugContextListener listener) {
- addDebugContextListener(listener, null);
- }
-
- public void addPostDebugContextListener(IDebugContextListener listener, String partId) {
- ListenerList list = (ListenerList) fPostListenersByPartId.get(partId);
- if (list == null) {
- list = new ListenerList();
- fPostListenersByPartId.put(partId, list);
- }
- list.add(listener);
- }
-
- public void addPostDebugContextListener(IDebugContextListener listener) {
- addPostDebugContextListener(listener, null);
- }
-
- public void removePostDebugContextListener(IDebugContextListener listener, String partId) {
- ListenerList list = (ListenerList) fPostListenersByPartId.get(partId);
- if (list != null) {
- list.remove(listener);
- }
- }
-
- public void removePostDebugContextListener(IDebugContextListener listener) {
- removePostDebugContextListener(listener, null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.IDebugContextService#removeDebugContextListener(org.eclipse.debug.ui.contexts.IDebugContextListener)
- */
- public void removeDebugContextListener(IDebugContextListener listener) {
- removeDebugContextListener(listener, null);
- }
-
- /**
- * Notifies listeners of the context in the specified provider.
- *
- * @param provdier context provider
- */
- protected void notify(IDebugContextProvider provdier) {
- ISelection activeContext = provdier.getActiveContext();
- if (activeContext == null) {
- activeContext = new StructuredSelection();
- }
- notify(new DebugContextEvent(provdier, activeContext, DebugContextEvent.ACTIVATED));
- }
-
- protected void notify(DebugContextEvent event) {
- notify(event, getListeners(null));
- IWorkbenchPart part = event.getDebugContextProvider().getPart();
- if (part != null) {
- notify(event, getListeners(part));
- }
- notify(event, getPostListeners(null));
- if (part != null) {
- notify(event, getPostListeners(part));
- }
- }
-
- protected void notify(final DebugContextEvent event, ListenerList list) {
- if (list != null) {
- Object[] listeners = list.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final IDebugContextListener listener = (IDebugContextListener) listeners[i];
- SafeRunner.run(new ISafeRunnable() {
- public void run() throws Exception {
- listener.debugContextChanged(event);
- }
- public void handleException(Throwable exception) {
- DebugUIPlugin.log(exception);
- }
- });
- }
- }
- }
-
- protected ListenerList getListeners(IWorkbenchPart part) {
- String id = null;
- if (part != null) {
- id = part.getSite().getId();
- }
- return (ListenerList) fListenersByPartId.get(id);
- }
-
- protected ListenerList getPostListeners(IWorkbenchPart part) {
- String id = null;
- if (part != null) {
- id = part.getSite().getId();
- }
- return (ListenerList) fPostListenersByPartId.get(id);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.IDebugContextService#addDebugContextListener(org.eclipse.debug.ui.contexts.IDebugContextListener, java.lang.String)
- */
- public synchronized void addDebugContextListener(IDebugContextListener listener, String partId) {
- ListenerList list = (ListenerList) fListenersByPartId.get(partId);
- if (list == null) {
- list = new ListenerList();
- fListenersByPartId.put(partId, list);
- }
- list.add(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.IDebugContextService#removeDebugContextListener(org.eclipse.debug.ui.contexts.IDebugContextListener, java.lang.String)
- */
- public void removeDebugContextListener(IDebugContextListener listener, String partId) {
- ListenerList list = (ListenerList) fListenersByPartId.get(partId);
- if (list != null) {
- list.remove(listener);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.IDebugContextService#getActiveContext(java.lang.String)
- */
- public ISelection getActiveContext(String partId) {
- IDebugContextProvider provider = (IDebugContextProvider) fProvidersByPartId.get(partId);
- if (provider != null) {
- return provider.getActiveContext();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.IDebugContextService#getActiveContext()
- */
- public ISelection getActiveContext() {
- IDebugContextProvider activeProvider = getActiveProvider();
- if (activeProvider != null) {
- return activeProvider.getActiveContext();
- }
- return null;
- }
-
- /**
- * Returns the active provider or <code>null</code>
- *
- * @return active provider or <code>null</code>
- */
- protected IDebugContextProvider getActiveProvider() {
- if (!fProviders.isEmpty()) {
- return (IDebugContextProvider)fProviders.get(0);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partActivated(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partActivated(IWorkbenchPartReference partRef) {
- IDebugContextProvider provider = (IDebugContextProvider) fProvidersByPartId.get(partRef.getId());
- if (provider != null) {
- int index = fProviders.indexOf(provider);
- if (index > 0) {
- fProviders.remove(index);
- fProviders.add(0, provider);
- notify(provider);
- }
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partBroughtToTop(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partClosed(org.eclipse.ui.IWorkbenchPartReference)
- */
- public synchronized void partClosed(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partDeactivated(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partDeactivated(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partOpened(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partOpened(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partHidden(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partHidden(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partVisible(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partVisible(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partInputChanged(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partInputChanged(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextEventListener#contextEvent(org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent)
- */
- public void debugContextChanged(DebugContextEvent event) {
- if (!fProviders.isEmpty()) {
- IDebugContextProvider provider = (IDebugContextProvider) fProviders.get(0);
- if (provider == event.getDebugContextProvider()) {
- notify(event);
- }
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java
deleted file mode 100644
index 08dd1518d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.contexts;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.contexts.ISuspendTrigger;
-import org.eclipse.debug.ui.contexts.ISuspendTriggerListener;
-
-/**
- * @since 3.2
- */
-public class LaunchSuspendTrigger implements ISuspendTrigger, IDebugEventSetListener {
-
- private ListenerList fListeners = new ListenerList();
- private SuspendTriggerAdapterFactory fFactory = null;
- private ILaunch fLaunch = null;
-
- public LaunchSuspendTrigger(ILaunch launch, SuspendTriggerAdapterFactory factory) {
- fFactory = factory;
- fLaunch = launch;
- DebugPlugin.getDefault().addDebugEventListener(this);
- }
-
- public ILaunch getLaunch() {
- return fLaunch;
- }
-
- protected void dispose() {
- DebugPlugin.getDefault().removeDebugEventListener(this);
- fListeners = null;
- fFactory.dispose(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.ISuspendTrigger#addSuspendTriggerListener(org.eclipse.debug.ui.contexts.ISuspendTriggerListener)
- */
- public void addSuspendTriggerListener(ISuspendTriggerListener listener) {
- if (fListeners != null) {
- fListeners.add(listener);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.ISuspendTrigger#removeSuspendTriggerListener(org.eclipse.debug.ui.contexts.ISuspendTriggerListener)
- */
- public void removeSuspendTriggerListener(ISuspendTriggerListener listener) {
- if (fListeners != null) {
- fListeners.remove(listener);
- }
- if (fListeners.size() == 0) {
- dispose();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
- */
- public void handleDebugEvents(DebugEvent[] events) {
- // open the debugger if this is a suspend event and the debug view is not yet open
- // and the preferences are set to switch
- for (int i = 0; i < events.length; i++) {
- DebugEvent event = events[i];
- if (event.getKind() == DebugEvent.SUSPEND && !event.isEvaluation() && event.getDetail() != DebugEvent.STEP_END) {
-// Don't switch perspective for evaluations or stepping
- Object source = event.getSource();
- if (source instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) source;
- ILaunch launch = (ILaunch) adaptable.getAdapter(ILaunch.class);
- if (fLaunch.equals(launch)) {
- // only notify for this launch
- notifySuspend(event);
- }
- }
-
- }
- }
- }
-
- /**
- * @param event
- */
- private void notifySuspend(DebugEvent event) {
- Object source = event.getSource();
- if (source instanceof IDebugElement) {
- final ILaunch launch = ((IDebugElement)source).getLaunch();
- Object context = null;
- if (source instanceof IThread) {
- try {
- context = ((IThread)source).getTopStackFrame();
- } catch (DebugException e) {
- }
- } else if (source instanceof IDebugTarget) {
- context = source;
- }
- final Object temp = context;
- ListenerList list = fListeners;
- if (list != null) {
- Object[] listeners = list.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final ISuspendTriggerListener listener = (ISuspendTriggerListener) listeners[i];
- SafeRunner.run(new ISafeRunnable() {
- public void run() throws Exception {
- listener.suspended(launch, temp);
- }
-
- public void handleException(Throwable exception) {
- DebugUIPlugin.log(exception);
- }
-
- });
- }
- }
-
- }
-
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java
deleted file mode 100644
index 27c026894..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.contexts;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.ui.contexts.ISuspendTrigger;
-
-/**
- * @since 3.2
- */
-public class SuspendTriggerAdapterFactory implements IAdapterFactory {
-
- private Map fSuspendTriggers = new HashMap();
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- public synchronized Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adapterType.equals(ISuspendTrigger.class)) {
- if (adaptableObject instanceof ILaunch) {
- Object trigger = fSuspendTriggers.get(adaptableObject);
- if (trigger == null) {
- trigger = new LaunchSuspendTrigger((ILaunch) adaptableObject, this);
- fSuspendTriggers.put(adaptableObject, trigger);
- }
- return trigger;
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList() {
- return new Class[]{ISuspendTrigger.class};
- }
-
- public synchronized void dispose(LaunchSuspendTrigger trigger) {
- fSuspendTriggers.remove(trigger.getLaunch());
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/AsynchronousDebugLabelAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/AsynchronousDebugLabelAdapter.java
deleted file mode 100644
index 7f84fba56..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/AsynchronousDebugLabelAdapter.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.elements.adapters;
-
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
-import org.eclipse.debug.internal.ui.LazyModelPresentation;
-import org.eclipse.debug.internal.ui.viewers.PartPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.provisional.AsynchronousLabelAdapter;
-import org.eclipse.debug.internal.ui.viewers.provisional.ILabelRequestMonitor;
-import org.eclipse.debug.internal.ui.views.launch.DebugElementHelper;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IDebugView;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Asynchronous label adapter for debug elements.
- *
- * @since 3.2
- */
-public class AsynchronousDebugLabelAdapter extends AsynchronousLabelAdapter {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.viewers.AsynchronousLabelAdapter#computeLabels(java.lang.Object, org.eclipse.debug.ui.viewers.IPresentationContext, org.eclipse.debug.ui.viewers.ILabelRequestMonitor)
- */
- protected void computeLabels(Object element, IPresentationContext context, ILabelRequestMonitor monitor) {
- DelegatingModelPresentation presentation = DebugElementHelper.getPresentation();
- // Honor view specific settings in a debug view by copying model presentation settings
- // into the debug element helper's presentation before we get the label. This allows
- // for qualified name and type name settings to remain in tact.
- if (context instanceof PartPresentationContext) {
- PartPresentationContext ppc = (PartPresentationContext) context;
- if (element instanceof IDebugElement && ppc.getPart() instanceof IDebugView) {
- IWorkbenchPart part = ppc.getPart();
- if (part instanceof IDebugView) {
- IDebugModelPresentation pres = ((IDebugView)part).getPresentation(((IDebugElement)element).getModelIdentifier());
- Map settings = null;
- synchronized (presentation) {
- if (pres instanceof DelegatingModelPresentation) {
- settings = ((DelegatingModelPresentation)pres).getAttributes();
- } else if (pres instanceof LazyModelPresentation) {
- settings = ((LazyModelPresentation)pres).getAttributes();
- }
- if (settings != null) {
- Iterator iterator = settings.entrySet().iterator();
- while (iterator.hasNext()) {
- Map.Entry entry = (Entry) iterator.next();
- presentation.setAttribute((String) entry.getKey(), entry.getValue());
- }
- super.computeLabels(element, context, monitor);
- return;
- }
- }
- }
- }
- }
- super.computeLabels(element, context, monitor);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.viewers.AsynchronousLabelAdapter#getLabels(java.lang.Object, org.eclipse.debug.ui.viewers.IPresentationContext)
- */
- protected String[] getLabels(Object element, IPresentationContext context) throws CoreException {
- return new String[] {DebugElementHelper.getLabel(element)};
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.viewers.AsynchronousLabelAdapter#getImageDescriptors(java.lang.Object, org.eclipse.debug.ui.viewers.IPresentationContext)
- */
- protected ImageDescriptor[] getImageDescriptors(Object element, IPresentationContext context) throws CoreException {
- return new ImageDescriptor[] {DebugElementHelper.getImageDescriptor(element)};
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.viewers.AsynchronousLabelAdapter#getFontDatas(java.lang.Object, org.eclipse.debug.ui.viewers.IPresentationContext)
- */
- protected FontData[] getFontDatas(Object element, IPresentationContext context) throws CoreException {
- FontData[] datas = new FontData[getNumElements(context)];
- Arrays.fill(datas, DebugElementHelper.getFont(element));
- return datas;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.viewers.AsynchronousLabelAdapter#getForegrounds(java.lang.Object, org.eclipse.debug.ui.viewers.IPresentationContext)
- */
- protected RGB[] getForegrounds(Object element, IPresentationContext context) throws CoreException {
- RGB[] rgbs = new RGB[getNumElements(context)];
- Arrays.fill(rgbs, DebugElementHelper.getForeground(element));
- return rgbs;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.viewers.AsynchronousLabelAdapter#getBackgrounds(java.lang.Object, org.eclipse.debug.ui.viewers.IPresentationContext)
- */
- protected RGB[] getBackgrounds(Object element, IPresentationContext context) throws CoreException {
- RGB[] rgbs = new RGB[getNumElements(context)];
- Arrays.fill(rgbs, DebugElementHelper.getBackground(element));
- return rgbs;
- }
-
- /**
- * Returns the number of columns in the given presentation context, or 1
- * if there are no columns.
- *
- * @param context presentation context
- * @return number of columns or 1 if none
- */
- protected int getNumElements(IPresentationContext context) {
- String[] columns = context.getColumns();
- if (columns == null) {
- return 1;
- }
- return columns.length;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultVariableCellModifier.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultVariableCellModifier.java
deleted file mode 100644
index 346efdc21..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultVariableCellModifier.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.elements.adapters;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.DefaultLabelProvider;
-import org.eclipse.debug.internal.ui.actions.variables.details.DetailPaneAssignValueAction;
-import org.eclipse.jface.viewers.ICellModifier;
-
-/**
- * @since 3.2
- *
- */
-public class DefaultVariableCellModifier implements ICellModifier {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String)
- */
- public boolean canModify(Object element, String property) {
- if (VariableColumnPresentation.COLUMN_VARIABLE_VALUE.equals(property)) {
- if (element instanceof IVariable) {
- return ((IVariable) element).supportsValueModification();
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String)
- */
- public Object getValue(Object element, String property) {
- if (VariableColumnPresentation.COLUMN_VARIABLE_VALUE.equals(property)) {
- if (element instanceof IVariable) {
- IVariable variable = (IVariable) element;
- try {
- return DefaultLabelProvider.escapeSpecialChars(variable.getValue().getValueString());
- } catch (DebugException e) {
- DebugUIPlugin.log(e);
- }
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object)
- */
- public void modify(Object element, String property, Object value) {
- Object oldValue = getValue(element, property);
- if (!value.equals(oldValue)) {
- if (VariableColumnPresentation.COLUMN_VARIABLE_VALUE.equals(property)) {
- if (element instanceof IVariable) {
- if (value instanceof String) {
- // The value column displays special characters escaped, so encode the string with any special characters escaped properly
- String valueExpression = DefaultLabelProvider.encodeEsacpedChars((String)value);
- IVariable variable = (IVariable) element;
- DetailPaneAssignValueAction.assignValue(DebugUIPlugin.getShell(), variable, valueExpression);
- }
- }
- }
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultViewerInputProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultViewerInputProvider.java
deleted file mode 100644
index cd5a10d91..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultViewerInputProvider.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.elements.adapters;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.internal.ui.model.elements.ViewerInputProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Default input provider supplies the expression manager as input to the
- * expression view.
- *
- * @since 3.4
- */
-public class DefaultViewerInputProvider extends ViewerInputProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.ViewerInputProvider#getViewerInput(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
- */
- protected Object getViewerInput(Object source, IPresentationContext context, IViewerUpdate update) throws CoreException {
- return DebugPlugin.getDefault().getExpressionManager();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.ViewerInputProvider#supportsContextId(java.lang.String)
- */
- protected boolean supportsContextId(String id) {
- return IDebugUIConstants.ID_EXPRESSION_VIEW.equals(id);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.java
deleted file mode 100644
index 65c221efa..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.java
+++ /dev/null
@@ -1,503 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * WindRiver - Bug 192028 [Memory View] Memory view does not
- * display memory blocks that do not reference IDebugTarget
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.elements.adapters;
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
-import org.eclipse.debug.internal.ui.memory.provisional.MemoryViewPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.provisional.AsynchronousContentAdapter;
-import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
-import org.eclipse.debug.internal.ui.views.memory.renderings.MemorySegment;
-import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingContentDescriptor;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-
-public class MemoryBlockContentAdapter extends AsynchronousContentAdapter {
-
- // Cache to allow the content provider to comppute change information
- // Cache is taken by copying the lineCache after a suspend event
- // or change event from the the memory block.
- protected Hashtable contentCache;
-
- public MemoryBlockContentAdapter()
- {
- contentCache = new Hashtable();
- }
-
- protected Object[] getChildren(Object parent, IPresentationContext context)
- throws CoreException {
-
- if (!(parent instanceof IMemoryBlock))
- return new Object[0];
-
- if (!(context instanceof MemoryViewPresentationContext))
- return new Object[0];
-
- MemoryViewPresentationContext memoryViewContext = (MemoryViewPresentationContext)context;
- IMemoryRendering rendering = memoryViewContext.getRendering();
-
- if (!(rendering instanceof AbstractAsyncTableRendering))
- return new Object[0];
-
- try
- {
- return getMemoryFromMemoryBlock(memoryViewContext);
- } catch (DebugException e) {
- throw e;
- }
-
- }
-
- protected boolean hasChildren(Object element, IPresentationContext context)
- throws CoreException {
-
- if (context instanceof MemoryViewPresentationContext)
- {
- if (((MemoryViewPresentationContext)context).getRendering() != null)
- return true;
- }
-
- return false;
- }
-
- protected boolean supportsPartId(String id) {
- return true;
- }
-
-
- private Object[] getMemoryFromMemoryBlock(MemoryViewPresentationContext context) throws DebugException {
- IMemoryBlock memoryBlock = context.getRendering().getMemoryBlock();
- if (memoryBlock instanceof IMemoryBlockExtension)
- {
- return loadContentForExtendedMemoryBlock(context);
- }
-
- return loadContentForSimpleMemoryBlock(context);
-
- }
-
- /**
- * @throws DebugException
- */
- public Object[] loadContentForSimpleMemoryBlock(MemoryViewPresentationContext context) throws DebugException {
- AbstractAsyncTableRendering rendering = getTableRendering(context);
- if (rendering != null)
- {
- IMemoryBlock memoryBlock = rendering.getMemoryBlock();
- long startAddress = memoryBlock.getStartAddress();
- BigInteger address = BigInteger.valueOf(startAddress);
- long length = memoryBlock.getLength();
- long numLines = length / rendering.getBytesPerLine();
- return getMemoryToFitTable(address, numLines, context);
- }
- return EMPTY;
- }
-
- /**
- * @throws DebugException
- */
- public Object[] loadContentForExtendedMemoryBlock(MemoryViewPresentationContext context) throws DebugException {
-
- AbstractAsyncTableRendering rendering = getTableRendering(context);
- if (rendering != null)
- {
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)rendering.getAdapter(TableRenderingContentDescriptor.class);
-
- if (descriptor == null)
- return new Object[0];
-
- if (descriptor.getNumLines() <= 0)
- return new Object[0];
-
- // calculate top buffered address
- BigInteger loadAddress = descriptor.getLoadAddress();
- if (loadAddress == null)
- {
- loadAddress = new BigInteger("0"); //$NON-NLS-1$
- }
-
- BigInteger mbStart = descriptor.getStartAddress();
- BigInteger mbEnd = descriptor.getEndAddress();
-
- // check that the load address is within range
- if (loadAddress.compareTo(mbStart) < 0 || loadAddress.compareTo(mbEnd) > 0)
- {
- // default load address to memory block base address
- loadAddress = ((IMemoryBlockExtension)descriptor.getMemoryBlock()).getBigBaseAddress();
- descriptor.setLoadAddress(loadAddress);
- }
-
- // if address is still out of range, throw an exception
- if (loadAddress.compareTo(mbStart) < 0 || loadAddress.compareTo(mbEnd) > 0)
- {
- throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_0 + loadAddress.toString(16), null));
- }
-
- int addressableUnitsPerLine = rendering.getAddressableUnitPerLine();
- BigInteger bufferStart = loadAddress.subtract(BigInteger.valueOf(descriptor.getPreBuffer()*addressableUnitsPerLine));
- BigInteger bufferEnd = loadAddress.add(BigInteger.valueOf(descriptor.getPostBuffer()*addressableUnitsPerLine));
- bufferEnd = bufferEnd.add(BigInteger.valueOf(descriptor.getNumLines()*addressableUnitsPerLine));
-
- // TODO: should rely on input to tell us what to load
- // instead of having the content adapter override the setting
- if (descriptor.isDynamicLoad())
- {
- if (bufferStart.compareTo(mbStart) < 0)
- bufferStart = mbStart;
-
- if (bufferEnd.compareTo(mbEnd) > 0)
- {
- bufferEnd = mbEnd;
-
- int numLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue();
- if (numLines < descriptor.getNumLines())
- {
- // re-calculate buffer start since we may not have enough lines to popoulate the view
- bufferStart = bufferEnd.subtract(BigInteger.valueOf(descriptor.getNumLines()*addressableUnitsPerLine));
- bufferStart = bufferStart.subtract(BigInteger.valueOf(descriptor.getPreBuffer()*addressableUnitsPerLine));
-
- // if after adjusting buffer start, it goes before the memory block start
- // address, adjust it back
- if (bufferStart.compareTo(mbStart) < 0)
- bufferStart = mbStart;
- }
- }
-
- // buffer end must be greater than buffer start
- if (bufferEnd.compareTo(bufferStart) <= 0)
- throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_1, null));
-
- int numLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue()+1;
- // get stoarage to fit the memory view tab size
- return getMemoryToFitTable(bufferStart, numLines,context);
- }
- else
- {
- if (bufferStart.compareTo(mbStart) < 0)
- bufferStart = mbStart;
-
- if (bufferEnd.compareTo(mbEnd) > 0)
- {
- bufferStart = mbEnd.subtract(BigInteger.valueOf((descriptor.getNumLines()-1)*addressableUnitsPerLine));
- bufferEnd = mbEnd;
-
- // after adjusting buffer start, check if it's smaller than memory block's start address
- if (bufferStart.compareTo(mbStart) < 0)
- bufferStart = mbStart;
- }
-
- // buffer end must be greater than buffer start
- if (bufferEnd.compareTo(bufferStart) <= 0)
- throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_2, null));
-
- int numLines = descriptor.getNumLines();
- int bufferNumLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue()+1;
-
- if (bufferNumLines < numLines)
- numLines = bufferNumLines;
-
- // get stoarage to fit the memory view tab size
- return getMemoryToFitTable(bufferStart, numLines, context);
- }
- }
- return EMPTY;
- }
-
- /**
- * Get memory to fit table
- * @param startingAddress
- * @param numberOfLines
- * @param updateDelta
- * @throws DebugException
- */
- public Object[] getMemoryToFitTable(BigInteger startAddress, long numberOfLines, MemoryViewPresentationContext context) throws DebugException
- {
- AbstractAsyncTableRendering tableRendering = getTableRendering(context);
- if (tableRendering == null)
- {
- DebugException e = new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.MemoryViewContentProvider_Unable_to_retrieve_content, null));
- throw e;
- }
-
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)tableRendering.getAdapter(TableRenderingContentDescriptor.class);
- if(descriptor == null)
- return new Object[0];
-
- // do not ask for memory from memory block if the debug target
- // is already terminated
- IDebugTarget target = descriptor.getMemoryBlock().getDebugTarget();
-
- // check for null target to not calculate and retrieve memory for standard debug model
- if (target != null && (target.isDisconnected() || target.isTerminated()))
- return new Object[0];
-
- boolean error = false;
- DebugException dbgEvt = null;
-
- String adjustedAddress = startAddress.toString(16);
-
- // align to the closest boundary based on addressable size per line
- if (descriptor.isAlignAddressToBoundary() && descriptor.getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- startAddress = MemoryViewUtil.alignToBoundary(startAddress, tableRendering.getAddressableUnitPerLine());
- }
-
- IMemoryBlockExtension extMemoryBlock = null;
- MemoryByte[] memoryBuffer = null;
-
- long reqNumBytes = 0;
- try
- {
-
- if (descriptor.getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- reqNumBytes = tableRendering.getBytesPerLine() * numberOfLines;
- // get memory from memory block
- extMemoryBlock = (IMemoryBlockExtension) descriptor.getMemoryBlock();
-
- long reqNumberOfUnits = tableRendering.getAddressableUnitPerLine() * numberOfLines;
-
- memoryBuffer = extMemoryBlock.getBytesFromAddress(startAddress, reqNumberOfUnits);
-
- if(memoryBuffer == null)
- {
- DebugException e = new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.MemoryViewContentProvider_Unable_to_retrieve_content, null));
- throw e;
- }
- }
- else
- {
- // get memory from memory block
- byte[] memory = descriptor.getMemoryBlock().getBytes();
-
- if (memory == null)
- {
- DebugException e = new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.MemoryViewContentProvider_Unable_to_retrieve_content, null));
- throw e;
- }
-
- int prefillNumBytes = 0;
-
- // number of bytes need to prefill
- if (!startAddress.toString(16).endsWith("0")) //$NON-NLS-1$
- {
- adjustedAddress = startAddress.toString(16).substring(0, adjustedAddress.length() - 1);
- adjustedAddress += "0"; //$NON-NLS-1$
- BigInteger adjustedStart = new BigInteger(adjustedAddress, 16);
- prefillNumBytes = startAddress.subtract(adjustedStart).intValue();
- startAddress = adjustedStart;
- }
- reqNumBytes = descriptor.getMemoryBlock().getLength() + prefillNumBytes;
-
- // figure out number of dummy bytes to append
- while (reqNumBytes % tableRendering.getBytesPerLine() != 0)
- {
- reqNumBytes ++;
- }
-
- numberOfLines = reqNumBytes / tableRendering.getBytesPerLine();
-
- // create memory byte for IMemoryBlock
- memoryBuffer = new MemoryByte[(int)reqNumBytes];
-
- // prefill buffer to ensure double-word alignment
- for (int i=0; i<prefillNumBytes; i++)
- {
- MemoryByte tmp = new MemoryByte();
- tmp.setValue((byte)0);
- tmp.setWritable(false);
- tmp.setReadable(false);
- tmp.setEndianessKnown(false);
- memoryBuffer[i] = tmp;
- }
-
- // fill buffer with memory returned by debug adapter
- int j = prefillNumBytes; // counter for memoryBuffer
- for (int i=0; i<memory.length; i++)
- {
- MemoryByte tmp = new MemoryByte();
- tmp.setValue(memory[i]);
- tmp.setReadable(true);
- tmp.setWritable(true);
- tmp.setEndianessKnown(false);
- memoryBuffer[j] = tmp;
- j++;
- }
-
- // append to buffer to fill up the entire line
- for (int i=j; i<memoryBuffer.length; i++)
- {
- MemoryByte tmp = new MemoryByte();
- tmp.setValue((byte)0);
- tmp.setWritable(false);
- tmp.setReadable(false);
- tmp.setEndianessKnown(false);
- memoryBuffer[i] = tmp;
- }
- }
- }
- catch (DebugException e)
- {
- memoryBuffer = makeDummyContent(numberOfLines, tableRendering.getBytesPerLine());
-
- // finish creating the content provider before throwing an event
- error = true;
- dbgEvt = e;
- }
- catch (Throwable e)
- {
- // catch all errors from this process just to be safe
- memoryBuffer = makeDummyContent(numberOfLines, tableRendering.getBytesPerLine());
-
- // finish creating the content provider before throwing an event
- error = true;
- dbgEvt = new DebugException(DebugUIPlugin.newErrorStatus(e.getMessage(), e));
- }
-
- // if debug adapter did not return enough memory, create dummy memory
- if (memoryBuffer.length < reqNumBytes)
- {
- ArrayList newBuffer = new ArrayList();
-
- for (int i=0; i<memoryBuffer.length; i++)
- {
- newBuffer.add(memoryBuffer[i]);
- }
-
- for (int i=memoryBuffer.length; i<reqNumBytes; i++)
- {
- MemoryByte mb = new MemoryByte();
- mb.setReadable(false);
- mb.setWritable(false);
- mb.setEndianessKnown(false);
- newBuffer.add(mb);
- }
-
- memoryBuffer = (MemoryByte[])newBuffer.toArray(new MemoryByte[newBuffer.size()]);
-
- }
-
- boolean manageDelta = true;
-
- // If change information is not managed by the memory block
- // The view tab will manage it and calculate delta information
- // for its content cache.
- if (descriptor.getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- manageDelta = !((IMemoryBlockExtension)descriptor.getMemoryBlock()).supportsChangeManagement();
- }
-
- if (error){
- throw dbgEvt;
- }
-
- // put memory information into MemoryViewLine
- return organizeLines(numberOfLines, memoryBuffer, startAddress, manageDelta, context);
-
-
- }
-
- private Object[] organizeLines(long numberOfLines, MemoryByte[] memoryBuffer, BigInteger address, boolean manageDelta, MemoryViewPresentationContext context)
- {
- Vector lineCache = new Vector();
- IMemoryRendering rendering = context.getRendering();
- if (!(rendering instanceof AbstractAsyncTableRendering))
- return lineCache.toArray();
-
- AbstractAsyncTableRendering tableRendering = (AbstractAsyncTableRendering)rendering;
- int addressableUnit = tableRendering.getBytesPerLine()/tableRendering.getAddressableSize();
-
- for (int i = 0; i < numberOfLines; i++)
- {
- int bytesPerLine = tableRendering.getBytesPerLine();
- MemoryByte[] memory = new MemoryByte[bytesPerLine];
-
- // counter for memory, starts from 0 to number of bytes per line
- int k = 0;
- // j is the counter for memArray, memory returned by debug adapter
- for (int j = i * bytesPerLine;
- j < i * bytesPerLine + bytesPerLine;
- j++)
- {
-
- byte changeFlag = memoryBuffer[j].getFlags();
- if (manageDelta)
- {
- // turn off both change and known bits to make sure that
- // the change bits returned by debug adapters do not take
- // any effect
-
- changeFlag |= MemoryByte.HISTORY_KNOWN;
- changeFlag ^= MemoryByte.HISTORY_KNOWN;
-
- changeFlag |= MemoryByte.CHANGED;
- changeFlag ^= MemoryByte.CHANGED;
- }
-
- MemoryByte newByteObj = new MemoryByte(memoryBuffer[j].getValue(), changeFlag);
- memory[k] = newByteObj;
- k++;
- }
-
- MemorySegment newLine = new MemorySegment(address, memory, addressableUnit);
- lineCache.add(newLine);
- address = address.add(BigInteger.valueOf(addressableUnit));
- }
- return lineCache.toArray();
- }
-
- /**
- * @param numberOfLines
- * @return an array of dummy MemoryByte
- */
- private MemoryByte[] makeDummyContent(long numberOfLines, int bytesPerLine) {
- MemoryByte[] memoryBuffer;
- // make up dummy memory, needed for recovery in case the debug adapter
- // is capable of retrieving memory again
-
- int numBytes = (int)(bytesPerLine * numberOfLines);
- memoryBuffer = new MemoryByte[numBytes];
-
- for (int i=0; i<memoryBuffer.length; i++){
- memoryBuffer[i] = new MemoryByte();
- memoryBuffer[i].setValue((byte)0);
- memoryBuffer[i].setWritable(false);
- memoryBuffer[i].setReadable(false);
- memoryBuffer[i].setEndianessKnown(false);
- }
- return memoryBuffer;
- }
-
- protected AbstractAsyncTableRendering getTableRendering(MemoryViewPresentationContext context)
- {
- IMemoryRendering memRendering = context.getRendering();
- if (memRendering != null && memRendering instanceof AbstractAsyncTableRendering)
- {
- return (AbstractAsyncTableRendering)memRendering;
- }
- return null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockLabelAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockLabelAdapter.java
deleted file mode 100644
index 6e9c3c116..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockLabelAdapter.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.elements.adapters;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-public class MemoryBlockLabelAdapter extends AsynchronousDebugLabelAdapter {
-
- protected ImageDescriptor[] getImageDescriptors(Object element, IPresentationContext context) throws CoreException {
- if (element instanceof IMemoryBlock)
- return new ImageDescriptor[]{DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_OBJS_VARIABLE)};
-
- return new ImageDescriptor[0];
- }
-
- /**
- * @param memoryBlockLabel
- * @return
- */
- private String getLabel(IMemoryBlock memoryBlock) {
-
- String memoryBlockLabel = " "; //$NON-NLS-1$
- if (memoryBlock instanceof IMemoryBlockExtension)
- {
- // simply return the expression without the address
- // do not want to keep track of changes in the address
- if (((IMemoryBlockExtension)memoryBlock).getExpression() != null)
- {
- memoryBlockLabel += ((IMemoryBlockExtension)memoryBlock).getExpression();
- }
- }
- else
- {
- long address = memoryBlock.getStartAddress();
- memoryBlockLabel = Long.toHexString(address);
- }
- return memoryBlockLabel;
- }
-
- protected String[] getLabels(Object element, IPresentationContext context) throws CoreException {
- if (element instanceof IMemoryBlock)
- return new String[]{getLabel((IMemoryBlock)element)};
- return super.getLabels(element, context);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryRetrievalContentAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryRetrievalContentAdapter.java
deleted file mode 100644
index eb963920b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryRetrievalContentAdapter.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.elements.adapters;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.provisional.AsynchronousContentAdapter;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-public class MemoryRetrievalContentAdapter extends AsynchronousContentAdapter{
-
- protected Object[] getChildren(Object parent, IPresentationContext context) throws CoreException {
- String id = context.getId();
- if (id.equals(IDebugUIConstants.ID_MEMORY_VIEW))
- {
- if (parent instanceof IMemoryBlockRetrieval)
- {
- return DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks((IMemoryBlockRetrieval)parent);
- }
- }
- return EMPTY;
- }
-
- protected boolean hasChildren(Object element, IPresentationContext context) throws CoreException {
- String id = context.getId();
- if (id.equals(IDebugUIConstants.ID_MEMORY_VIEW))
- {
- if (element instanceof IMemoryBlockRetrieval)
- {
- if (((IMemoryBlockRetrieval)element).supportsStorageRetrieval())
- return DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks((IMemoryBlockRetrieval)element).length > 0;
- }
- }
- return false;
- }
-
- protected boolean supportsPartId(String id) {
- return id.equals(IDebugUIConstants.ID_MEMORY_VIEW);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java
deleted file mode 100644
index 5d07d2d1a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java
+++ /dev/null
@@ -1,418 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.elements.adapters;
-
-import java.math.BigInteger;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
-import org.eclipse.debug.internal.ui.memory.provisional.MemoryViewPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.provisional.AsynchronousLabelAdapter;
-import org.eclipse.debug.internal.ui.views.launch.DebugElementHelper;
-import org.eclipse.debug.internal.ui.views.memory.renderings.AbstractBaseTableRendering;
-import org.eclipse.debug.internal.ui.views.memory.renderings.MemorySegment;
-import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingContentDescriptor;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.memory.IMemoryBlockTablePresentation;
-import org.eclipse.debug.ui.memory.MemoryRenderingElement;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.jface.viewers.IFontProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.RGB;
-
-public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
-
- protected String[] getLabels(Object element, IPresentationContext context)
- throws CoreException {
-
- if (context instanceof MemoryViewPresentationContext)
- {
- MemoryViewPresentationContext tableRenderingContext = (MemoryViewPresentationContext)context;
- if (tableRenderingContext.getRendering() != null && tableRenderingContext.getRendering() instanceof AbstractAsyncTableRendering)
- {
- AbstractAsyncTableRendering tableRendering = (AbstractAsyncTableRendering)tableRenderingContext.getRendering();
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)tableRendering.getAdapter(TableRenderingContentDescriptor.class);
- if (descriptor != null)
- {
- String addressStr = getColumnText(element, 0, tableRendering, descriptor);
- int numColumns = tableRendering.getAddressableUnitPerLine() / tableRendering.getAddressableUnitPerColumn();
-
- String[] labels = new String[numColumns+2];
- labels[0] = addressStr;
-
- for (int i=0; i<=numColumns; i++)
- {
- labels[i+1] = getColumnText(element, i+1, tableRendering, (TableRenderingContentDescriptor)tableRendering.getAdapter(TableRenderingContentDescriptor.class));
- }
-
- labels[labels.length - 1 ] = IInternalDebugCoreConstants.EMPTY_STRING;
- return labels;
- }
- }
- }
- return new String[0];
- }
-
- private String getColumnText(Object element, int columnIndex, AbstractAsyncTableRendering tableRendering, TableRenderingContentDescriptor descriptor) {
- String columnLabel = null;
-
- if (columnIndex == 0)
- {
- IMemoryBlockTablePresentation presentation = (IMemoryBlockTablePresentation)tableRendering.getMemoryBlock().getAdapter(IMemoryBlockTablePresentation.class);
- if (presentation != null)
- {
- String rowLabel = presentation.getRowLabel(tableRendering.getMemoryBlock(), ((MemorySegment)element).getAddress());
- if (rowLabel != null)
- return rowLabel;
- }
-
- columnLabel = ((MemorySegment)element).getAddress().toString(16).toUpperCase();
-
- int addressSize = descriptor.getAddressSize();
- int prefillLength = addressSize * 2 - columnLabel.length();
- StringBuffer buf = new StringBuffer();
- if (prefillLength > 0)
- {
- for (int i=0; i<prefillLength; i++)
- {
- buf.append("0"); //$NON-NLS-1$
- }
- }
- buf.append(columnLabel);
- return buf.toString();
-
- }
- else if (columnIndex > (tableRendering.getBytesPerLine()/tableRendering.getBytesPerColumn()))
- {
- columnLabel = " "; //$NON-NLS-1$
- }
- else
- {
- if (element instanceof MemorySegment)
- {
- MemorySegment segment = (MemorySegment)element;
- if (segment.getBytes().length != tableRendering.getBytesPerLine())
- return IInternalDebugCoreConstants.EMPTY_STRING;
- }
-
- ILabelProvider labelProvider = (ILabelProvider)tableRendering.getAdapter(ILabelProvider.class);
- if (labelProvider != null && columnIndex > 0)
- {
- MemoryRenderingElement renderingElement = getMemoryRenderingElement(element, columnIndex, tableRendering);
- if (renderingElement != null) {
- String label = labelProvider.getText(renderingElement);
- if (label != null)
- return label;
- }
- }
-
- int start = (columnIndex-1)*tableRendering.getBytesPerColumn();
- MemoryByte[] bytes = ((MemorySegment)element).getBytes(start, tableRendering.getBytesPerColumn());
- BigInteger address = ((MemorySegment)element).getAddress();
- address = address.add(BigInteger.valueOf(start));
-
- columnLabel = tableRendering.getString(tableRendering.getRenderingId(), address, bytes);
- }
- return columnLabel;
- }
-
- protected ImageDescriptor[] getImageDescriptors(Object element,
- IPresentationContext context) throws CoreException {
- if (context instanceof MemoryViewPresentationContext)
- {
- MemoryViewPresentationContext tableRenderingContext = (MemoryViewPresentationContext)context;
- if (tableRenderingContext.getRendering() != null && tableRenderingContext.getRendering() instanceof AbstractAsyncTableRendering)
- {
- AbstractAsyncTableRendering tableRendering = (AbstractAsyncTableRendering)tableRenderingContext.getRendering();
- int numColumns = tableRendering.getAddressableUnitPerLine() / tableRendering.getAddressableUnitPerColumn();
-
- ImageDescriptor[] images = new ImageDescriptor[numColumns+2];
-
- for (int i=0; i<=numColumns; i++)
- {
- images[i] = getColumnImageDescriptor(element, i, tableRendering);
- }
-
- images[images.length - 1 ] = null;
- return images;
- }
- }
- return new ImageDescriptor[0];
- }
-
- private ImageDescriptor getColumnImageDescriptor(Object element, int columnIndex, AbstractAsyncTableRendering tableRendering)
- {
- if (columnIndex == 0)
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_OBJECT_MEMORY);
-
- if (element instanceof MemorySegment)
- {
- MemorySegment segment = (MemorySegment)element;
- if (segment.getBytes().length != tableRendering.getBytesPerLine())
- return null;
-
- ILabelProvider labelProvider = (ILabelProvider)tableRendering.getAdapter(ILabelProvider.class);
- if (labelProvider != null && columnIndex > 0)
- {
- MemoryRenderingElement renderingElement = getMemoryRenderingElement(element, columnIndex, tableRendering);
- if (renderingElement != null) {
- Image image = labelProvider.getImage(renderingElement);
- if (image != null)
- {
- return DebugElementHelper.getImageDescriptor(image);
- }
- }
- }
-
- int start = (columnIndex-1)*tableRendering.getBytesPerColumn();
-
- MemoryByte[] bytes = ((MemorySegment)element).getBytes(start, tableRendering.getBytesPerColumn());
- boolean allKnown = true;
- boolean unchanged = true;
- for (int i=0; i<bytes.length; i++)
- {
- if (!bytes[i].isHistoryKnown())
- allKnown = false;
-
- if (bytes[i].isChanged())
- unchanged = false;
- }
-
- if (allKnown)
- {
- // mark changed elements with changed icon
- if (!unchanged)
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_OBJECT_MEMORY_CHANGED);
-
- }
- }
- return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_OBJECT_MEMORY);
- }
-
- protected FontData[] getFontDatas(Object element,
- IPresentationContext context) throws CoreException {
- if (context instanceof MemoryViewPresentationContext)
- {
- MemoryViewPresentationContext tableRenderingContext = (MemoryViewPresentationContext)context;
- if (tableRenderingContext.getRendering() != null && tableRenderingContext.getRendering() instanceof AbstractAsyncTableRendering)
- {
- AbstractAsyncTableRendering tableRendering = (AbstractAsyncTableRendering)tableRenderingContext.getRendering();
- int numColumns = tableRendering.getAddressableUnitPerLine() / tableRendering.getAddressableUnitPerColumn();
-
- FontData[] fontData = new FontData[numColumns+2];
-
- for (int i=0; i<fontData.length-1; i++)
- {
- fontData[i] = getColumnFontData(element, i, tableRendering);
- }
- return fontData;
- }
- }
-
- return new FontData[0];
- }
-
- private FontData getColumnFontData(Object element, int columnIndex, AbstractAsyncTableRendering tableRendering)
- {
- if (element instanceof MemorySegment)
- {
- MemorySegment segment = (MemorySegment)element;
- if (segment.getBytes().length != tableRendering.getBytesPerLine())
- return null;
-
- IFontProvider fontProvider = (IFontProvider)tableRendering.getAdapter(IFontProvider.class);
- if (fontProvider != null && columnIndex > 0)
- {
- MemoryRenderingElement renderingElement = getMemoryRenderingElement(element, columnIndex, tableRendering);
- if (renderingElement != null) {
- Font font = fontProvider.getFont(renderingElement);
- if (font != null)
- return font.getFontData()[0];
- }
- }
- }
- return null;
- }
-
- protected RGB[] getForegrounds(Object element, IPresentationContext context)
- throws CoreException {
-
- if (context instanceof MemoryViewPresentationContext)
- {
- MemoryViewPresentationContext tableRenderingContext = (MemoryViewPresentationContext)context;
- if (tableRenderingContext.getRendering() != null && tableRenderingContext.getRendering() instanceof AbstractAsyncTableRendering)
- {
- AbstractAsyncTableRendering tableRendering = (AbstractAsyncTableRendering)tableRenderingContext.getRendering();
- int numColumns = tableRendering.getAddressableUnitPerLine() / tableRendering.getAddressableUnitPerColumn();
-
- RGB[] colors = new RGB[numColumns+2];
-
- for (int i=0; i<colors.length-1; i++)
- {
- colors[i] = getColumnForeground(element, i, tableRendering);
- }
-
- colors[colors.length-1] = null;
-
- return colors;
- }
- }
-
- return new RGB[0];
- }
-
- private RGB getColumnBackground(Object element, int columnIndex, AbstractAsyncTableRendering tableRendering)
- {
- if (columnIndex == 0)
- return null;
-
- if (element instanceof MemorySegment)
- {
- MemorySegment segment = (MemorySegment)element;
- if (segment.getBytes().length != tableRendering.getBytesPerLine())
- return null;
-
- IColorProvider colorProvider = (IColorProvider)tableRendering.getAdapter(IColorProvider.class);
- if (colorProvider != null && columnIndex > 0)
- {
- MemoryRenderingElement renderingElement = getMemoryRenderingElement(element, columnIndex, tableRendering);
- if (renderingElement != null) {
- Color color = colorProvider.getBackground(renderingElement);
- if (color != null)
- return color.getRGB();
- }
- }
- }
- return null;
- }
-
- private RGB getColumnForeground(Object element, int columnIndex, AbstractAsyncTableRendering tableRendering)
- {
- if (columnIndex == 0)
- return null;
-
- if (element instanceof MemorySegment)
- {
- MemorySegment segment = (MemorySegment)element;
- if (segment.getBytes().length != tableRendering.getBytesPerLine())
- return null;
-
- IColorProvider colorProvider = (IColorProvider)tableRendering.getAdapter(IColorProvider.class);
- if (colorProvider != null && columnIndex > 0)
- {
- MemoryRenderingElement renderingElement = getMemoryRenderingElement(element, columnIndex, tableRendering);
- if (renderingElement != null) {
- Color color = colorProvider.getForeground(renderingElement);
- if (color != null)
- return color.getRGB();
- }
- }
-
- int start = (columnIndex-1)*tableRendering.getBytesPerColumn();
- MemoryByte[] bytes = segment.getBytes(start, tableRendering.getBytesPerColumn());
- boolean allKnown = true;
- boolean unchanged = true;
- for (int i=0; i<bytes.length; i++)
- {
- if (!bytes[i].isHistoryKnown())
- allKnown = false;
-
- if (bytes[i].isChanged())
- unchanged = false;
- }
-
- if (allKnown)
- {
- // mark changed elements in changed color
- if (!unchanged)
- return DebugUIPlugin.getPreferenceColor(IDebugUIConstants.PREF_CHANGED_DEBUG_ELEMENT_COLOR).getRGB();
-
- return DebugUIPlugin.getPreferenceColor(IDebugUIConstants.PREF_MEMORY_HISTORY_KNOWN_COLOR).getRGB();
- }
-
- return DebugUIPlugin.getPreferenceColor(IDebugUIConstants.PREF_MEMORY_HISTORY_UNKNOWN_COLOR).getRGB();
-
- }
- return null;
- }
-
- protected RGB[] getBackgrounds(Object element, IPresentationContext context)
- throws CoreException {
-
- if (context instanceof MemoryViewPresentationContext)
- {
- MemoryViewPresentationContext tableRenderingContext = (MemoryViewPresentationContext)context;
- if (tableRenderingContext.getRendering() != null && tableRenderingContext.getRendering() instanceof AbstractAsyncTableRendering)
- {
- AbstractAsyncTableRendering tableRendering = (AbstractAsyncTableRendering)tableRenderingContext.getRendering();
- int numColumns = tableRendering.getAddressableUnitPerLine() / tableRendering.getAddressableUnitPerColumn();
-
- RGB[] colors = new RGB[numColumns+2];
-
- for (int i=0; i<colors.length-1; i++)
- {
- colors[i] = getColumnBackground(element, i, tableRendering);
- }
-
- colors[colors.length-1] = null;
-
- return colors;
- }
- }
-
- return new RGB[0];
- }
-
- /**
- * Returns a memory rendering element corresponding to the given element
- * or <code>null</code> if none.
- *
- * @param element element to be rendered
- * @param columnIndex column index at which to render
- * @return memory rendering element or <code>null</code>
- */
- private MemoryRenderingElement getMemoryRenderingElement(Object element, int columnIndex, AbstractBaseTableRendering rendering) {
- if (element instanceof MemorySegment) {
- MemorySegment line = (MemorySegment) element;
- BigInteger address = line.getAddress();
- int offset = (columnIndex - 1) * rendering.getBytesPerColumn();
- if (offset < rendering.getBytesPerLine() && (offset + rendering.getBytesPerColumn()) <= rendering.getBytesPerLine()) {
- return getMemoryRenderingElement(line, address, offset, rendering);
- }
- }
- return null;
- }
-
- private MemoryRenderingElement getMemoryRenderingElement(MemorySegment line, BigInteger lineAddress, int offset, AbstractBaseTableRendering rendering) {
- BigInteger cellAddress = lineAddress.add(BigInteger.valueOf(offset));
- MemoryByte[] bytes = line.getBytes(offset, rendering.getBytesPerColumn());
- // make a copy to ensure that the memory bytes are not overwritten
- // by clients
- MemoryByte[] copy = new MemoryByte[bytes.length];
- System.arraycopy(bytes, 0, copy, 0, bytes.length);
- MemoryRenderingElement renderingElement = new MemoryRenderingElement(
- rendering, cellAddress, copy);
- return renderingElement;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/Messages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/Messages.java
deleted file mode 100644
index 3dc7f87a3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/Messages.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.elements.adapters;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * @since 3.2
- *
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.elements.adapters.Messages"; //$NON-NLS-1$
-
- private Messages() {
- }
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- public static String VariableColumnPresentation_0;
- public static String VariableColumnPresentation_1;
- public static String VariableColumnPresentation_2;
- public static String VariableColumnPresentation_3;
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/Messages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/Messages.properties
deleted file mode 100644
index 2e62499d3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/Messages.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-VariableColumnPresentation_0=Declared Type
-VariableColumnPresentation_1=Name
-VariableColumnPresentation_2=Value
-VariableColumnPresentation_3=Actual Type
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/RegisterGroupProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/RegisterGroupProxy.java
deleted file mode 100644
index ba69b6ff7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/RegisterGroupProxy.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.elements.adapters;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IRegisterGroup;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.internal.core.commands.Request;
-import org.eclipse.debug.internal.ui.viewers.model.ViewerAdapterService;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.ui.IMemento;
-
-/**
- * Used as input to the registers view for a stack frame. Insulates register groups
- * that do not change across stack frame selection to avoid register groups collapsing
- * while stepping between frames.
- * <p>
- * The standard debug model {@link IStackFrame} uses an
- * {@link org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputProvider} to
- * create a register group proxy for the register view's input.
- * </p>
- * <p>
- * This class delegates to the underlying stack frame for the following adapters. This way,
- * if a standard model provides custom adapters they are still used to present custom content
- * in the view and provide stable register groups while stepping.
- * <ul>
- * <li>{@link IModelProxyFactory}</li>
- * <li>{@link IColumnPresentationFactory}</li>
- * <li>{@link IElementContentProvider}</li>
- * <li>{@link IElementMementoProvider}</li>
- * </ul>
- * </p>
- * @since 3.4
- */
-public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentationFactory, IElementContentProvider, IElementMementoProvider {
-
- private IRegisterGroup[] fGroups;
- private IStackFrame fFrame;
-
- private static final String HASH_CODE = "HASH_CODE"; //$NON-NLS-1$
-
- /**
- * Local implementation of a viewer update request. This class delegates to the underlying frame
- * for viewer requests. The requests have to be wrapped such that the request's element provided
- * for existing clients is the underlying frame, rather than the register group proxy (as existing
- * models do not know or need to know about the proxy).
- */
- private class Update extends Request implements IViewerUpdate {
- private IViewerUpdate fViewerUpdate;
-
- Update(IViewerUpdate update) {
- fViewerUpdate = update;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElement()
- */
- public Object getElement() {
- return fFrame;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElementPath()
- */
- public TreePath getElementPath() {
- return TreePath.EMPTY;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getPresentationContext()
- */
- public IPresentationContext getPresentationContext() {
- return fViewerUpdate.getPresentationContext();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.commands.Request#done()
- */
- public void done() {
- fViewerUpdate.setStatus(getStatus());
- fViewerUpdate.done();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getViewerInput()
- */
- public Object getViewerInput() {
- return fFrame;
- }
-
- }
-
- private class CountUpdate extends Update implements IChildrenCountUpdate {
-
- private IChildrenCountUpdate fUpdate;
-
- CountUpdate(IChildrenCountUpdate delegate) {
- super(delegate);
- fUpdate = delegate;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate#setChildCount(int)
- */
- public void setChildCount(int numChildren) {
- fUpdate.setChildCount(numChildren);
- }
-
- }
-
- private class HasUpdate extends Update implements IHasChildrenUpdate {
-
- private IHasChildrenUpdate fUpdate;
-
- HasUpdate(IHasChildrenUpdate delegate) {
- super(delegate);
- fUpdate = delegate;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate#setHasChilren(boolean)
- */
- public void setHasChilren(boolean hasChildren) {
- fUpdate.setHasChilren(hasChildren);
- }
-
- }
-
- private class ChildrenUpdate extends Update implements IChildrenUpdate {
-
- private IChildrenUpdate fUpdate;
-
- ChildrenUpdate(IChildrenUpdate delegate) {
- super(delegate);
- fUpdate = delegate;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate#getLength()
- */
- public int getLength() {
- return fUpdate.getLength();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate#getOffset()
- */
- public int getOffset() {
- return fUpdate.getOffset();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate#setChild(java.lang.Object, int)
- */
- public void setChild(Object child, int offset) {
- fUpdate.setChild(child, offset);
- }
-
- }
-
- /**
- * The memento request has to override {@link #getElement()} to provide the element
- * that a memento is requested for (which could be any element in the view, not just
- * the root stack frame).
- */
- private class MementoRequest extends Update implements IElementMementoRequest {
-
- private IElementMementoRequest fUpdate;
- MementoRequest(IElementMementoRequest request) {
- super(request);
- fUpdate = request;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest#getMemento()
- */
- public IMemento getMemento() {
- return fUpdate.getMemento();
- }
- public Object getElement() {
- return fUpdate.getElement();
- }
- public TreePath getElementPath() {
- return fUpdate.getElementPath();
- }
-
- }
-
- private class ElementCompare extends MementoRequest implements IElementCompareRequest {
-
- private IElementCompareRequest fRequest;
- ElementCompare(IElementCompareRequest request) {
- super(request);
- fRequest = request;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest#setEqual(boolean)
- */
- public void setEqual(boolean equal) {
- fRequest.setEqual(equal);
- }
-
- }
-
- /**
- * Creates a new register group proxy for the given stack frame.
- *
- * @param frame stack frame
- * @throws DebugException exception if unable to retrieve register groups
- */
- public RegisterGroupProxy(IStackFrame frame) throws DebugException {
- fFrame = frame;
- init(frame);
- }
-
- /* (non-Javadoc)
- *
- * A register group proxy is equal to other stack frames that have the same
- * register groups.
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if (obj instanceof RegisterGroupProxy) {
- return Arrays.equals(fGroups, ((RegisterGroupProxy)obj).fGroups);
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- int code = getClass().hashCode();
- for (int i = 0; i < fGroups.length; i++) {
- code+=fGroups[i].hashCode();
- }
- return code;
- }
-
- /**
- * Initializes the register groups for this stack frame.
- *
- * @param frame stack frame
- */
- private void init(IStackFrame frame) throws DebugException {
- fGroups = frame.getRegisterGroups();
- }
-
- /**
- * Returns cached register groups for this stack frame.
- *
- * @return register groups
- */
- protected IRegisterGroup[] getRegisterGroups() {
- return fGroups;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory#createModelProxy(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
- */
- public IModelProxy createModelProxy(Object element, IPresentationContext context) {
- IModelProxyFactory factory = ViewerAdapterService.getModelProxyFactory(fFrame);
- if (factory != null) {
- return factory.createModelProxy(fFrame, context);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory#createColumnPresentation(org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.Object)
- */
- public IColumnPresentation createColumnPresentation(IPresentationContext context, Object element) {
- IColumnPresentationFactory factory = ViewerAdapterService.getColumnPresentationFactory(fFrame);
- if (factory != null) {
- return factory.createColumnPresentation(context, fFrame);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory#getColumnPresentationId(org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.Object)
- */
- public String getColumnPresentationId(IPresentationContext context, Object element) {
- IColumnPresentationFactory factory = ViewerAdapterService.getColumnPresentationFactory(fFrame);
- if (factory != null) {
- return factory.getColumnPresentationId(context, fFrame);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider#update(org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate[])
- */
- public void update(IChildrenCountUpdate[] updates) {
- IElementContentProvider provider = ViewerAdapterService.getContentProvider(fFrame);
- if (provider != null) {
- IChildrenCountUpdate[] others = new IChildrenCountUpdate[updates.length];
- for (int i = 0; i < updates.length; i++) {
- others[i] = new CountUpdate(updates[i]);
- }
- provider.update(others);
- } else {
- cancelUpdates(updates);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider#update(org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate[])
- */
- public void update(IChildrenUpdate[] updates) {
- IElementContentProvider provider = ViewerAdapterService.getContentProvider(fFrame);
- if (provider != null) {
- IChildrenUpdate[] others = new IChildrenUpdate[updates.length];
- for (int i = 0; i < updates.length; i++) {
- others[i] = new ChildrenUpdate(updates[i]);
- }
- provider.update(others);
- } else {
- cancelUpdates(updates);
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider#update(org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate[])
- */
- public void update(IHasChildrenUpdate[] updates) {
- IElementContentProvider provider = ViewerAdapterService.getContentProvider(fFrame);
- if (provider != null) {
- IHasChildrenUpdate[] others = new IHasChildrenUpdate[updates.length];
- for (int i = 0; i < updates.length; i++) {
- others[i] = new HasUpdate(updates[i]);
- }
- provider.update(others);
- } else {
- cancelUpdates(updates);
- }
- }
-
- /**
- * Cancels a collection of update requests.
- *
- * @param updates updates to cancel
- */
- private void cancelUpdates(IViewerUpdate[] updates) {
- for (int i = 0; i < updates.length; i++) {
- updates[i].setStatus(Status.CANCEL_STATUS);
- updates[i].done();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider#compareElements(org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest[])
- */
- public void compareElements(IElementCompareRequest[] requests) {
- IElementMementoProvider provider = ViewerAdapterService.getMementoProvider(fFrame);
- if (provider != null) {
- List others = new ArrayList(requests.length);
- for (int i = 0; i < requests.length; i++) {
- IElementCompareRequest request = requests[i];
- if (request.getElement().equals(this)) {
- Integer integer = request.getMemento().getInteger(HASH_CODE);
- if (integer != null) {
- request.setEqual(integer.intValue() == hashCode());
- } else {
- request.setEqual(false);
- }
- request.done();
- } else {
- others.add(new ElementCompare(request));
- }
- }
- if (!others.isEmpty()) {
- provider.compareElements((IElementCompareRequest[]) others.toArray(new IElementCompareRequest[others.size()]));
- }
- } else {
- cancelUpdates(requests);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider#encodeElements(org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest[])
- */
- public void encodeElements(IElementMementoRequest[] requests) {
- IElementMementoProvider provider = ViewerAdapterService.getMementoProvider(fFrame);
- if (provider != null) {
- List others = new ArrayList(requests.length);
- for (int i = 0; i < requests.length; i++) {
- IElementMementoRequest request = requests[i];
- if (request.getElement().equals(this)) {
- request.getMemento().putInteger(HASH_CODE, this.hashCode());
- request.done();
- } else {
- others.add(new MementoRequest(request));
- }
- }
- if (!others.isEmpty()) {
- provider.encodeElements((IElementMementoRequest[]) others.toArray(new IElementMementoRequest[others.size()]));
- }
- } else {
- cancelUpdates(requests);
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameSourceDisplayAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameSourceDisplayAdapter.java
deleted file mode 100644
index 5b4045744..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameSourceDisplayAdapter.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.elements.adapters;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.ISourceLocator;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.internal.ui.InstructionPointerManager;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupResult;
-import org.eclipse.debug.internal.ui.views.launch.DecorationManager;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.sourcelookup.ISourceDisplay;
-import org.eclipse.debug.ui.sourcelookup.ISourceLookupResult;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * @since 3.2
- */
-public class StackFrameSourceDisplayAdapter implements ISourceDisplay {
-
- private IStackFrame fPrevFrame;
- private SourceLookupResult fPrevResult;
-
- /**
- * Constructs singleton source display adapter for stack frames.
- */
- public StackFrameSourceDisplayAdapter() {
- DebugPlugin.getDefault().addDebugEventListener(new IDebugEventSetListener() {
- public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- final DebugEvent event = events[i];
- switch (event.getKind()) {
- case DebugEvent.TERMINATE:
- clearCachedModel(event.getSource());
- // fall through
- case DebugEvent.RESUME:
- if (!event.isEvaluation()) {
- Job uijob = new UIJob("clear source selection"){ //$NON-NLS-1$
- public IStatus runInUIThread(
- IProgressMonitor monitor) {
- clearSourceSelection(event.getSource());
- return Status.OK_STATUS;
- }
-
- };
- uijob.setSystem(true);
- uijob.schedule();
- }
- break;
- case DebugEvent.CHANGE:
- if (event.getSource() instanceof IStackFrame) {
- if (event.getDetail() == DebugEvent.CONTENT) {
- // force source lookup if a stack frame fires a content change event
- clearCachedModel(event.getSource());
- }
- }
- break;
- }
- }
- }
- });
- }
-
- /**
- * A job to perform source lookup on the currently selected stack frame.
- */
- class SourceLookupJob extends Job {
-
- private IStackFrame fTarget;
- private ISourceLocator fLocator;
- private IWorkbenchPage fPage;
-
- /**
- * Constructs a new source lookup job.
- */
- public SourceLookupJob(IStackFrame frame, ISourceLocator locator, IWorkbenchPage page) {
- super("Debug Source Lookup"); //$NON-NLS-1$
- setPriority(Job.INTERACTIVE);
- setSystem(true);
- fTarget = frame;
- fLocator = locator;
- fPage = page;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected IStatus run(IProgressMonitor monitor) {
- if (!monitor.isCanceled()) {
- if (!fTarget.isTerminated()) {
- ISourceLookupResult result = DebugUITools.lookupSource(fTarget, fLocator);
- synchronized (StackFrameSourceDisplayAdapter.this) {
- fPrevResult = (SourceLookupResult)result;
- fPrevFrame = fTarget;
- }
- if (!monitor.isCanceled() && !fTarget.isTerminated()) {
- new SourceDisplayJob(result, fPage).schedule();
- }
- }
- }
- return Status.OK_STATUS;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object)
- */
- public boolean belongsTo(Object family) {
- // source lookup jobs are a family per workbench page
- if (family instanceof SourceLookupJob) {
- SourceLookupJob slj = (SourceLookupJob) family;
- return slj.fPage.equals(fPage);
- }
- return false;
- }
-
- }
-
- class SourceDisplayJob extends UIJob {
-
- private ISourceLookupResult fResult;
- private IWorkbenchPage fPage;
-
- public SourceDisplayJob(ISourceLookupResult result, IWorkbenchPage page) {
- super("Debug Source Display"); //$NON-NLS-1$
- setSystem(true);
- setPriority(Job.INTERACTIVE);
- fResult = result;
- fPage = page;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.IProgressMonitor)
- */
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if (!monitor.isCanceled() && fResult != null) {
- DebugUITools.displaySource(fResult, fPage);
- // termination may have occurred while displaying source
- if (monitor.isCanceled()) {
- Object artifact = fResult.getArtifact();
- if (artifact instanceof IStackFrame) {
- clearSourceSelection(((IStackFrame)artifact).getThread());
- }
- }
- }
-
- return Status.OK_STATUS;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object)
- */
- public boolean belongsTo(Object family) {
- // source display jobs are a family per workbench page
- if (family instanceof SourceDisplayJob) {
- SourceDisplayJob sdj = (SourceDisplayJob) family;
- return sdj.fPage.equals(fPage);
- }
- return false;
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.ISourceDisplayAdapter#displaySource(java.lang.Object, org.eclipse.ui.IWorkbenchPage, boolean)
- */
- public synchronized void displaySource(Object context, IWorkbenchPage page, boolean force) {
- IStackFrame frame = (IStackFrame)context;
- if (!force && frame.equals(fPrevFrame)) {
- fPrevResult.updateArtifact(context);
- SourceDisplayJob sdj = new SourceDisplayJob(fPrevResult, page);
- // cancel any existing source display jobs for this page
- Job.getJobManager().cancel(sdj);
- sdj.schedule();
- } else {
- SourceLookupJob slj = new SourceLookupJob(frame, frame.getLaunch().getSourceLocator(), page);
- // cancel any existing source lookup jobs for this page
- Job.getJobManager().cancel(slj);
- slj.schedule();
- }
- }
-
- /**
- * Clears any source decorations associated with the given thread or
- * debug target.
- *
- * @param source thread or debug target
- */
- private void clearSourceSelection(Object source) {
- if (source instanceof IThread) {
- IThread thread = (IThread)source;
- DecorationManager.removeDecorations(thread);
- InstructionPointerManager.getDefault().removeAnnotations(thread);
- } else if (source instanceof IDebugTarget) {
- IDebugTarget target = (IDebugTarget)source;
- DecorationManager.removeDecorations(target);
- InstructionPointerManager.getDefault().removeAnnotations(target);
- }
- }
-
- /**
- * Clear any cached results associated with the given object.
- *
- * @param source
- */
- private synchronized void clearCachedModel(Object source) {
- if (fPrevFrame != null) {
- IDebugTarget target = null;
- if (source instanceof IDebugElement) {
- target = ((IDebugElement)source).getDebugTarget();
- }
- if (fPrevFrame.getDebugTarget().equals(target)) {
- fPrevFrame = null;
- fPrevResult = null;
- }
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameViewerInputProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameViewerInputProvider.java
deleted file mode 100644
index d48d9d822..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameViewerInputProvider.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - support for alternative expression view content providers
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.elements.adapters;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.internal.ui.model.elements.ViewerInputProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * @since 3.4
- */
-public class StackFrameViewerInputProvider extends ViewerInputProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.ViewerInputProvider#getViewerInput(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
- */
- protected Object getViewerInput(Object source, IPresentationContext context, IViewerUpdate update) throws CoreException {
- if ( IDebugUIConstants.ID_REGISTER_VIEW.equals(context.getId()) ) {
- return new RegisterGroupProxy((IStackFrame) source);
- } else {
- return DebugPlugin.getDefault().getExpressionManager();
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.ViewerInputProvider#supportsContextId(java.lang.String)
- */
- protected boolean supportsContextId(String id) {
- return IDebugUIConstants.ID_REGISTER_VIEW.equals(id) ||
- IDebugUIConstants.ID_EXPRESSION_VIEW.equals(id);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnFactoryAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnFactoryAdapter.java
deleted file mode 100644
index c756501a0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnFactoryAdapter.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.elements.adapters;
-
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Factory for default variable column presentation.
- *
- * @since 3.2
- */
-public class VariableColumnFactoryAdapter implements IColumnPresentationFactory {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresenetationFactoryAdapter#createColumnPresentation(org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext, java.lang.Object)
- */
- public IColumnPresentation createColumnPresentation(IPresentationContext context, Object element) {
- String id = context.getId();
- if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(id) || IDebugUIConstants.ID_REGISTER_VIEW.equals(id)) {
- if (element instanceof IStackFrame) {
- return new VariableColumnPresentation();
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresenetationFactoryAdapter#getColumnPresentationId(org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext, java.lang.Object)
- */
- public String getColumnPresentationId(IPresentationContext context, Object element) {
- String id = context.getId();
- if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(id) || IDebugUIConstants.ID_REGISTER_VIEW.equals(id)) {
- if (element instanceof IStackFrame) {
- return VariableColumnPresentation.DEFAULT_VARIABLE_COLUMN_PRESENTATION;
- }
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnPresentation.java
deleted file mode 100644
index 961e340bf..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnPresentation.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.elements.adapters;
-
-import org.eclipse.debug.internal.ui.viewers.provisional.AbstractColumnPresentation;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Columns for Java variables.
- *
- * @since 3.2
- */
-public class VariableColumnPresentation extends AbstractColumnPresentation {
-
- /**
- * Constant identifier for the default variable column presentation.
- */
- public final static String DEFAULT_VARIABLE_COLUMN_PRESENTATION = IDebugUIConstants.PLUGIN_ID + ".VARIALBE_COLUMN_PRESENTATION"; //$NON-NLS-1$
-
- /**
- * Default column identifiers
- */
- public final static String COLUMN_VARIABLE_NAME = DEFAULT_VARIABLE_COLUMN_PRESENTATION + ".COL_VAR_NAME"; //$NON-NLS-1$
- public final static String COLUMN_VARIABLE_TYPE = DEFAULT_VARIABLE_COLUMN_PRESENTATION + ".COL_VAR_TYPE"; //$NON-NLS-1$
- public final static String COLUMN_VARIABLE_VALUE = DEFAULT_VARIABLE_COLUMN_PRESENTATION + ".COL_VAR_VALUE"; //$NON-NLS-1$
- public final static String COLUMN_VALUE_TYPE = DEFAULT_VARIABLE_COLUMN_PRESENTATION + ".COL_VALUE_TYPE"; //$NON-NLS-1$
-
- private static final String[] ALL_COLUMNS = new String[]{COLUMN_VARIABLE_NAME, COLUMN_VARIABLE_TYPE, COLUMN_VARIABLE_VALUE, COLUMN_VALUE_TYPE};
- private static final String[] INITIAL_COLUMNS = new String[]{COLUMN_VARIABLE_NAME, COLUMN_VARIABLE_VALUE};
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#getColumns()
- */
- public String[] getAvailableColumns() {
- return ALL_COLUMNS;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#getHeader(java.lang.String)
- */
- public String getHeader(String id) {
- if (COLUMN_VARIABLE_TYPE.equals(id)) {
- return Messages.VariableColumnPresentation_0;
- }
- if (COLUMN_VARIABLE_NAME.equals(id)) {
- return Messages.VariableColumnPresentation_1;
- }
- if (COLUMN_VARIABLE_VALUE.equals(id)) {
- return Messages.VariableColumnPresentation_2;
- }
- if (COLUMN_VALUE_TYPE.equals(id)) {
- return Messages.VariableColumnPresentation_3;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#getId()
- */
- public String getId() {
- return DEFAULT_VARIABLE_COLUMN_PRESENTATION;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#getInitialColumns()
- */
- public String[] getInitialColumns() {
- return INITIAL_COLUMNS;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#isOptional()
- */
- public boolean isOptional() {
- return true;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointImportExport.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointImportExport.properties
deleted file mode 100644
index db93e4257..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointImportExport.properties
+++ /dev/null
@@ -1,33 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2009 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-WizardImportBreakpoints_0=Import Breakpoints
-WizardImportBreakpointsPage_0=Import Breakpoints
-WizardImportBreakpointsPage_1=File does not exist: {0}
-WizardImportBreakpointsPage_2=Import breakpoints from local file system.
-WizardImportBreakpointsPage_3=&Update existing breakpoints
-WizardImportBreakpointsPage_4=F&rom file:
-WizardImportBreakpointsPage_5=Create breakpoint &working sets
-WizardImportBreakpointsPage_6=Please specify a file to import.
-WizardExportBreakpoints_0=Export Breakpoints
-WizardExportBreakpointsPage_0=Please specify a destination file.
-WizardExportBreakpointsPage_1=Select one or more breakpoints to export.
-WizardExportBreakpointsPage_2=Brea&kpoints:
-WizardExportBreakpointsPage_3=The destination directory does not exist.
-WizardBreakpointsPage_1=&Select All
-WizardBreakpointsPage_2=&Deselect All
-WizardBreakpointsPage_4=Export breakpoints to the local file system.
-WizardBreakpointsPage_6=&Overwrite existing file without warning
-WizardBreakpointsPage_7=&To file:
-WizardBreakpointsPage_8=Brows&e...
-WizardBreakpointsPage_12=Overwrite?
-ImportExportOperations_0=Do you want to overwrite: {0} ?
-ImportOperation_0=Importing Breakpoints
-ExportOperation_0=Exporting Breakpoints
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java
deleted file mode 100644
index 92e8b3138..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java
+++ /dev/null
@@ -1,321 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.importexport.breakpoints;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointContainer;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsComparator;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsContentProvider;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsLabelProvider;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsView;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsViewer;
-import org.eclipse.debug.internal.ui.views.breakpoints.IBreakpointOrganizer;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.IViewPart;
-
-/**
- * This class creates a simplified debug view that can be used in wizards etc., to emulate the current debug view
- *
- * @see WizardExportBreakpointsPage
- * @see WizardImportBreakpointsPage
- *
- * @since 3.2
- */
-public class EmbeddedBreakpointsViewer {
-
- //widgets
- private IStructuredSelection fSelection = null;
- private BreakpointsContentProvider fProvider = null;
- private Tree fTree = null;
- private BreakpointsViewer fViewer = null;
- private ICheckStateListener fCheckListener = new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- updateCheckedState(event.getElement(), event.getChecked());
- }
- };
-
- /**
- * This constructor allows a specific selection to be used in stead of the default
- *
- * @param parent the parent composite to add this one to
- * @param input the input to the viewer
- * @param selection the selection to set on the viewer
- */
- public EmbeddedBreakpointsViewer(Composite parent, Object input, IStructuredSelection selection) {
- Assert.isNotNull(parent);
- Assert.isNotNull(input);
- createControl(parent, input, selection);
- }
-
- /**
- * Creates the control initialized to the current view, selection, and organization of the breakpoints view
- * @param parent the parent composite to add this one to.
- *
- * @param parent the parent composite to add this one to
- * @param input the input for the viewer
- * @param selection the selection for the viewer to be initialized to. If null the selection from the breakpoints view is used
- */
- private void createControl(Composite parent, Object input, IStructuredSelection selection) {
- fSelection = selection;
- if(fSelection == null) {
- IViewPart fViewpart = DebugUIPlugin.getActiveWorkbenchWindow().getActivePage().findView(IDebugUIConstants.ID_BREAKPOINT_VIEW);
- if(fViewpart != null) {
- fSelection = (IStructuredSelection)fViewpart.getViewSite().getSelectionProvider().getSelection();
- }
- else {
- fSelection = new StructuredSelection();
- }
- }
- Composite composite = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, GridData.FILL_BOTH, 0, 0);
-
- // create the treeview
- fTree = new Tree(composite, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CHECK);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.heightHint = 150;
- fTree.setLayoutData(gd);
- fProvider = new BreakpointsContentProvider();
- BreakpointsView view = ((BreakpointsView)DebugUIPlugin.getActiveWorkbenchWindow().getActivePage().findView(IDebugUIConstants.ID_BREAKPOINT_VIEW));
- fViewer = new BreakpointsViewer(fTree);
- BreakpointsLabelProvider labelprovider = new BreakpointsLabelProvider();
- if(view != null) {
- //if we have handle to the view try get the current attributes, that way the
- //presentation of the embedded viewer matches the current view
- IBaseLabelProvider current = ((StructuredViewer)view.getViewer()).getLabelProvider();
- if (current instanceof BreakpointsLabelProvider) {
- current = ((BreakpointsLabelProvider)current).getPresentation();
- }
- Map map = null;
- if(current instanceof DelegatingModelPresentation) {
- map = ((DelegatingModelPresentation) current).getAttributes();
- }
- if(map != null) {
- Object key = null;
- IDebugModelPresentation newpres = labelprovider.getPresentation();
- for(Iterator iter = map.keySet().iterator(); iter.hasNext();) {
- key = iter.next();
- newpres.setAttribute((String) key, map.get(key));
- }
- }
- }
- fViewer.setComparator(new BreakpointsComparator());
- fViewer.setLabelProvider(labelprovider);
- fViewer.addCheckStateListener(fCheckListener);
- IBreakpointOrganizer[] orgs = null;
- if(view != null) {
- orgs = view.getBreakpointOrganizers();
- }
- fViewer.setContentProvider(fProvider);
- fViewer.setInput(input);
- fProvider.setOrganizers(orgs);
- initViewerState();
- }
-
- /**
- * Performs the initialization of the viewer from a selection
- */
- private void initViewerState() {
- Object[] items = fSelection.toArray();
- fViewer.setGrayedElements(new Object[] {});
- fViewer.setCheckedElements(new Object[] {});
- ArrayList list = new ArrayList();
- for(int i = 0; i < items.length; i++) {
- Object item = items[i];
- if(item instanceof IBreakpoint) {
- list.add(item);
- }
- else if (item instanceof BreakpointContainer) {
- getBreakpointsFromContainers((BreakpointContainer)item, list);
- }
- }
- for(int i = 0; i < list.size(); i++) {
- updateCheckedState(list.get(i), true);
- }
- }
-
- /**
- * FInds the breakpoints of a given container
- * @param container the container to get breakpoints from
- * @param list the list of breakpoints to update state for
- */
- private void getBreakpointsFromContainers(BreakpointContainer container, ArrayList list) {
- Object[] elements = container.getChildren();
- for(int i = 0; i < elements.length; i++) {
- if(elements[i] instanceof IBreakpoint) {
- list.add(elements[i]);
- }
- else {
- getBreakpointsFromContainers((BreakpointContainer)elements[i], list);
- }
- }
- }
-
- /**
- * Returns the selection from the viewer with no duplicates
- * @return the selection from the viewer with no duplicates
- */
- public IStructuredSelection getCheckedElements() {
- Object[] list = fViewer.getCheckedElements();
- Vector selected = new Vector();
- for(int i = 0; i < list.length; i++) {
- if(!selected.contains(list[i])) {
- selected.addElement(list[i]);
- }
- }
- return new StructuredSelection(selected);
- }
-
- /**
- * Allows access to the viewer
- * @return the viewer
- */
- public BreakpointsViewer getViewer() {
- return fViewer;
- }
-
- /**
- * finds all occurrences of a widget to update
- * @param element the element to search for when finding occurrences
- * @return a list of widget occurrences to update or an empty list
- */
- private Widget[] searchItems(Object element) {
- ArrayList list = new ArrayList();
- TreeItem[] items = fTree.getItems();
- for (int i = 0; i < items.length; i++) {
- findAllOccurrences(items[i], element, list);
- }
- return (Widget[]) list.toArray(new Widget[0]);
- }
-
- /**
- * performs the actual search for items in the tree
- * @param list the list to add matches to
- * @param item the item in the tree
- * @param element the element to compare
- */
- private void findAllOccurrences(TreeItem item, Object element, ArrayList list) {
- if (element.equals(item.getData())) {
- list.add(item);
- }
- TreeItem[] items = item.getItems();
- for (int i = 0; i < items.length; i++) {
- findAllOccurrences(items[i], element, list);
- }
- }
-
- /**
- * Update the checked state of the given element and all of its children.
- *
- * @param obj the object that has been changed
- * @param enable the checked status of the obj
- */
- private void updateCheckedState(Object obj, boolean enable) {
- if (obj instanceof IBreakpoint) {
- Widget[] list = searchItems(obj);
- TreeItem item = null;
- for(int i = 0; i < list.length; i++) {
- item = (TreeItem)list[i];
- item.setChecked(enable);
- refreshParents(item);
- }
- }
- else if (obj instanceof BreakpointContainer) {
- ArrayList bps = new ArrayList();
- getBreakpointsFromContainers((BreakpointContainer)obj, bps);
- for(int j = 0; j < bps.size(); j++) {
- updateCheckedState(bps.get(j), enable);
- }
- }
- }
-
- /**
- * refreshes the grayed/checked state of the parents of item
- * @param item the item to refresh parents of
- */
- private void refreshParents(TreeItem item) {
- TreeItem parent = item.getParentItem();
- while (parent != null) {
- int checked = getNumberChildrenChecked(parent);
- if(checked == 0) {
- parent.setGrayed(false);
- parent.setChecked(false);
- }
- else if(checked == parent.getItemCount()) {
- if(getNumberChildrenGrayed(parent) > 0) {
- parent.setGrayed(true);
- }
- else {
- parent.setGrayed(false);
- }
- parent.setChecked(true);
- }
- else {
- parent.setGrayed(true);
- parent.setChecked(true);
- }
- parent = parent.getParentItem();
- }
- }
-
- /**
- * Gets the number of grayed children for this parent
- * @param parent the parent to inspect
- * @return treu is any one or more children is grayed, false otherwise
- */
- private int getNumberChildrenGrayed(TreeItem parent) {
- TreeItem[] children = parent.getItems();
- int count = 0;
- for(int i = 0; i < children.length; i++) {
- if(children[i].getGrayed()) {
- count++;
- }
- }
- return count;
- }
-
- /**
- * Checks to see if all of the children under an given parent are checked or not
- * @param children the children to check
- * @return true if all children are checked, false otherwise
- */
- private int getNumberChildrenChecked(TreeItem parent) {
- TreeItem[] children = parent.getItems();
- int count = 0;
- for(int i = 0; i < children.length; i++) {
- if(children[i].getChecked()) {
- count++;
- }
- }
- return count;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ExportBreakpoints.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ExportBreakpoints.java
deleted file mode 100644
index 0ca84788c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ExportBreakpoints.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.importexport.breakpoints;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.ui.IViewPart;
-
-/**
- * <p>
- * This class provides the aciton event for both the context menu in breakpoints view
- * and the drop down menu inn the breakpoints view.
- * </p>
- * <p>
- * The action simply calls the wizard to export breakpoints.
- * </p>
- * @see WizardExportBreakpoints
- * @see WizardExportBreakpointsPage
- *
- * @since 3.2
- */
-public class ExportBreakpoints extends AbstractDebugActionDelegate {
-
- /**
- * This method actually performs the execution of the action event
- *
- * @param action IAction the action
- */
- public void run(IAction action) {
- IViewPart fViewpart = DebugUIPlugin.getActiveWorkbenchWindow().getActivePage().findView(IDebugUIConstants.ID_BREAKPOINT_VIEW);
- WizardExportBreakpoints wiz = new WizardExportBreakpoints();
- wiz.init(DebugUIPlugin.getDefault().getWorkbench(), (IStructuredSelection)fViewpart.getViewSite().getSelectionProvider().getSelection());
- WizardDialog wizdialog = new WizardDialog(DebugUIPlugin.getShell(), wiz);
- wizdialog.setBlockOnOpen(true);
- wizdialog.open();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate#update(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- protected void update(IAction action, ISelection s) {
- getAction().setEnabled(DebugPlugin.getDefault().getBreakpointManager().hasBreakpoints());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate#doAction(java.lang.Object)
- */
- protected void doAction(Object element) throws DebugException {}
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/IImportExportConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/IImportExportConstants.java
deleted file mode 100644
index 991dc9791..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/IImportExportConstants.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.importexport.breakpoints;
-
-/**
- *
- * XML tag constants for importing and exporting breakpoints
- */
-public interface IImportExportConstants {
-
- /**
- * <p>
- * The name for the top level node in the XMLMemento for storing/restoring breakpoint information.</br>
- *
- * General formulation of the XMLMemento is as follows:</br>
- *
- * breakpoints := (breakpoint)*</br>
- *
- * breakpoint := resource</br>
- *
- * resource := (marker)+</br>
- *
- * marker := (attribs)+</br>
- * </p>
- * @see WizardExportBreakpointsPage
- * @see WizardImportBreakpointsPage
- *
- */
- public static final String IE_NODE_BREAKPOINTS = "breakpoints"; //$NON-NLS-1$
-
- /**
- * The name of the node type for each of the imported or exported breakpoints
- *
- * @see WizardExportBreakpointsPage
- * @see WizardImportBreakpointsPage
- */
- public static final String IE_NODE_BREAKPOINT = "breakpoint"; //$NON-NLS-1$
-
- /**
- * <p>
- * The generalized ID for each of the values stored in a markers' attribute map.
- * Since a marker can have any number of attributes and or values, we use a
- * (name, value) paring in the XMLmemento to store them, without having a dependence upon what the attribute
- * is or what type it is.
- * </p>
- * @see WizardExportBreakpointsPage
- * @see WizardImportBreakpointsPage
- */
- public static final String IE_NODE_VALUE = "value"; //$NON-NLS-1$
-
- /**
- * Each breakpoint has an associated resource, which is described with this element
- * name
- *
- * @see WizardExportBreakpointsPage
- * @see WizardImportBreakpointsPage
- */
- public static final String IE_NODE_RESOURCE = "resource"; //$NON-NLS-1$
-
- /**
- * To validate the resource when filtering importable breakpoints we need to know its path.
- * This is the the name of XMLMemento node that stores that path.
- *
- * @see WizardExportBreakpointsPage
- * @see WizardImportBreakpointsPage
- */
- public static final String IE_NODE_PATH = "path"; //$NON-NLS-1$
-
- /**
- * To filter the type of path searched for within the workspace to allow for the filtering of
- * breakpoints for import, we need to know the type to filter for.
- *
- * This is the name of the XMLMemento node that stores the type of the resource
- *
- * @see WizardExportBreakpointsPage
- * @see WizardImportBreakpointsPage
- */
- public static final String IE_NODE_TYPE = "type"; //$NON-NLS-1$
-
- /**
- * The name for the marker node in the corresponding XMLMemento
- *
- * @see WizardExportBreakpointsPage
- * @see WizardImportBreakpointsPage
- */
- public static final String IE_NODE_MARKER = "marker"; //$NON-NLS-1$
-
- /**
- * The name for a marker attribute node in the corresponding XMLMemento
- *
- * @see WizardExportBreakpointsPage
- * @see WizardImportBreakpointsPage
- */
- public static final String IE_NODE_ATTRIB = "attrib"; //$NON-NLS-1$
-
- /**
- * The generalized name for the "name" node used in marker attribute nodes.
- * This is the other ID in the (name, value) pairing used to describe attributes
- * of markers.
- *
- * @see WizardExportBreakpointsPage
- * @see WizardImportBreakpointsPage
- */
- public static final String IE_NODE_NAME = "name"; //$NON-NLS-1$
-
- /**
- * The name of the enabled attribute, which is part of the breakpoint node information
- *
- * @see WizardExportBreakpointsPage
- * @see WizardImportBreakpointsPage
- */
- public static final String IE_BP_ENABLED = "enabled"; //$NON-NLS-1$
-
- /**
- * The name of the registered attribute, which is part of the breakpoint node information
- *
- * @see WizardExportBreakpointsPage
- * @see WizardImportBreakpointsPage
- */
- public static final String IE_BP_REGISTERED = "registered"; //$NON-NLS-1$
-
- /**
- * The name of the persistent attribute for breakpoint information
- */
- public static final String IE_BP_PERSISTANT = "persistant"; //$NON-NLS-1$
-
- /**
- * The default file extension for breakpoint export files
- */
- public static final String EXTENSION = "bkpt"; //$NON-NLS-1$
-
- /**
- * the charstart attribute from a marker
- */
- public static final String CHARSTART = "charStart"; //$NON-NLS-1$
-
- /**
- * The delimiter for the listing of working sets that a marker belongs to
- */
- public static final String DELIMITER = "<;#>"; //$NON-NLS-1$
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportBreakpoints.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportBreakpoints.java
deleted file mode 100644
index 0cd0a82dc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportBreakpoints.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c)2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.importexport.breakpoints;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.wizard.WizardDialog;
-
-/**
- * This class provides the aciton event for both the context menu in breakpoints view
- * and the drop down menu in the breakpoints view.
- * <p>
- * The action simply calls the wizard to import breakpoints.
- * </p>
- *
- * @see WizardImportBreakpoints
- * @see WizardImportBreakpointsPage
- *
- * @since 3.2
- */
-public class ImportBreakpoints extends AbstractDebugActionDelegate {
-
- /**
- * Opens import wizard
- *
- * @param action IAction the action
- */
- public void run(IAction action) {
- WizardImportBreakpoints wiz = new WizardImportBreakpoints();
- wiz.init(DebugUIPlugin.getDefault().getWorkbench(), null);
- WizardDialog wizdialog = new WizardDialog(DebugUIPlugin.getShell(), wiz);
- wizdialog.setBlockOnOpen(true);
- wizdialog.open();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate#doAction(java.lang.Object)
- */
- protected void doAction(Object element) throws DebugException {}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate#update(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- protected void update(IAction action, ISelection s) {
- getAction().setEnabled(true);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportExportMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportExportMessages.java
deleted file mode 100644
index 17083df3a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportExportMessages.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.importexport.breakpoints;
-
-import org.eclipse.osgi.util.NLS;
-
-public class ImportExportMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.importexport.breakpoints.BreakpointImportExport"; //$NON-NLS-1$
-
- private ImportExportMessages() {
- }
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, ImportExportMessages.class);
- }
-
- public static String WizardImportBreakpoints_0;
- public static String WizardExportBreakpoints_0;
- public static String WizardBreakpointsPage_1;
- public static String WizardBreakpointsPage_2;
- public static String WizardBreakpointsPage_4;
- public static String WizardBreakpointsPage_6;
- public static String WizardBreakpointsPage_7;
- public static String WizardBreakpointsPage_8;
- public static String WizardBreakpointsPage_12;
- public static String ImportExportOperations_0;
- public static String ImportOperation_0;
- public static String WizardImportBreakpointsPage_0;
- public static String WizardImportBreakpointsPage_1;
- public static String WizardImportBreakpointsPage_2;
- public static String WizardImportBreakpointsPage_3;
- public static String WizardImportBreakpointsPage_4;
- public static String ExportOperation_0;
- public static String WizardImportBreakpointsPage_5;
- public static String WizardExportBreakpointsPage_0;
- public static String WizardExportBreakpointsPage_1;
- public static String WizardExportBreakpointsPage_2;
- public static String WizardExportBreakpointsPage_3;
- public static String WizardImportBreakpointsPage_6;
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpoints.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpoints.java
deleted file mode 100644
index 882cab6bd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpoints.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.importexport.breakpoints;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.IExportWizard;
-import org.eclipse.ui.IWorkbench;
-
-/**
- * <p>
- * This class provides a wizard for exporting breakpoints.
- * It serves dual purpose, in that it is used by the platform import/export wizard,
- * but it can also be used as a standalone wizard.
- * </p>
- * <p>
- * Example:
- * </p>
- * <pre>
- * IWizard wiz = new WizardExportBreakpoints();
- * wiz.init(workbench, selection);
- * WizardDialog wizdialog = new WizardDialog(shell, wiz);
- * wizdialog.open();
- * </pre>
- *
- * This class uses <code>WizardExportBreakpointsPage</code>
- *
- * @since 3.2
- *
- */
-public class WizardExportBreakpoints extends Wizard implements IExportWizard {
-
- /*
- * The main page
- */
- private WizardExportBreakpointsPage fMainPage = null;
-
- /**
- * The existing selection
- */
- private IStructuredSelection fSelection = null;
-
- /**
- * Identifier for dialog settings section for the export wizard.
- */
- private static final String EXPORT_DIALOG_SETTINGS = "BreakpointExportSettings"; //$NON-NLS-1$
-
- /**
- * This is the default constructor
- */
- public WizardExportBreakpoints() {
- super();
- DebugUIPlugin plugin = DebugUIPlugin.getDefault();
- IDialogSettings workbenchSettings = plugin.getDialogSettings();
- IDialogSettings section = workbenchSettings.getSection(EXPORT_DIALOG_SETTINGS);
- if (section == null)
- section = workbenchSettings.addNewSection(EXPORT_DIALOG_SETTINGS);
- setDialogSettings(section);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#addPages()
- */
- public void addPages() {
- super.addPages();
- fMainPage = new WizardExportBreakpointsPage(ImportExportMessages.WizardExportBreakpoints_0, fSelection);
- addPage(fMainPage);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#dispose()
- */
- public void dispose() {
- super.dispose();
- fMainPage = null;
- fSelection = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#performFinish()
- */
- public boolean performFinish() {
- return fMainPage.finish();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
- */
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- fSelection = selection;
- setWindowTitle(ImportExportMessages.WizardExportBreakpoints_0);
- setNeedsProgressMonitor(true);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java
deleted file mode 100644
index d7eb36188..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.importexport.breakpoints;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.views.breakpoints.BreakpointsViewer;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.actions.ExportBreakpointsOperation;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.PlatformUI;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * <p>
- * This class provides an internal implementation of a WizardPage, which is used
- * in the Export Breakpoints wizard.
- * </p>
- * <p>
- * The implementation presents the breakpoints to the user as they are shown in
- * their current breakpoint view.
- * </p>
- * <p>
- * Possible extensions would include:
- * <ul>
- * <li> Able to change the views as in the breakpoints view itself
- * <li> Able to reorder groups from within the wizard - easier in the viewer itself though
- * </ul>
- * </p>
- * This class is used by <code>WizardExportBreakpoints</code>
- *
- * @since 3.2
- */
-public class WizardExportBreakpointsPage extends WizardPage implements Listener {
-
- // widgets
- private Button fOverwriteExistingFilesCheckbox = null;
- private Text fDestinationNameField = null;
- private Button fDestinationBrowseButton = null;
- private IPath fPath = null;
- private EmbeddedBreakpointsViewer fTView = null;
- private IStructuredSelection fSelection = null;
- private Button fSelectAll = null;
- private Button fDeselectAll = null;
-
- //state constants
- private static final String OVERWRITE_ALL_STATE = "overwrite"; //$NON-NLS-1$
- private static final String DESTINATION_FILE_NAME = "filename"; //$NON-NLS-1$
-
- /**
- * This is the default constructor. It accepts the name for the tab as a
- * parameter and an existing selection
- *
- * @param pageName the name of the page
- */
- public WizardExportBreakpointsPage(String pageName, IStructuredSelection selection) {
- super(pageName, ImportExportMessages.WizardExportBreakpoints_0, null);
- fSelection = selection;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
- */
- public void handleEvent(Event event) {
- Widget source = event.widget;
- if (source == fDestinationBrowseButton) {
- handleDestinationBrowseButtonPressed();
- }
- else if (source == fDestinationNameField) {
- handlePathTextModifiedEvent();
- }
- else if(source == fSelectAll) {
- handleSelectAllPressed();
- }
- else if(source == fDeselectAll) {
- handleDeselectAllPressed();
- }
- }
-
- /**
- * Handles the select all button pressed
- *
- */
- private void handleSelectAllPressed() {
- BreakpointsViewer viewer = fTView.getViewer();
- viewer.getTree().selectAll();
- viewer.setCheckedElements(((IStructuredSelection)viewer.getSelection()).toArray());
- viewer.setGrayedElements(new Object[] {});
- viewer.getTree().deselectAll();
- setPageComplete(detectPageComplete());
- }
-
- /**
- * Handles the de-select all button pressed
- *
- */
- private void handleDeselectAllPressed() {
- BreakpointsViewer viewer = fTView.getViewer();
- viewer.setCheckedElements(new Object[] {});
- viewer.setGrayedElements(new Object[] {});
- setPageComplete(detectPageComplete());
- }
-
- /**
- * This method handles the modified event from the path combo box.
- */
- protected void handlePathTextModifiedEvent() {
- setPageComplete(detectPageComplete());
- }
-
- /**
- * Open the SaveAsDialog so the user can save the listing of selected breakpoints
- */
- protected void handleDestinationBrowseButtonPressed() {
- FileDialog dialog = new FileDialog(getContainer().getShell(), SWT.SAVE);
- dialog.setFilterExtensions(new String[]{"*."+IImportExportConstants.EXTENSION}); //$NON-NLS-1$
- dialog.setText(ImportExportMessages.WizardExportBreakpoints_0);
- String file = dialog.open();
- if(file != null) {
- fPath = new Path(file);
- if (fPath != null) {
- setErrorMessage(null);
- if(fPath.getFileExtension() == null) {
- fPath = fPath.addFileExtension(IImportExportConstants.EXTENSION);
- }
- else if(!fPath.getFileExtension().equals(IImportExportConstants.EXTENSION)) {
- fPath = fPath.addFileExtension(IImportExportConstants.EXTENSION);
- }
- fDestinationNameField.setText(fPath.toString());
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- initializeDialogUnits(parent);
- Composite composite = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH);
- SWTFactory.createLabel(composite, ImportExportMessages.WizardExportBreakpointsPage_2, 1);
- fTView = new EmbeddedBreakpointsViewer(composite, DebugPlugin.getDefault().getBreakpointManager(), fSelection);
- fTView.getViewer().addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- setPageComplete(detectPageComplete());
- }
- });
- fTView.getViewer().setSelection(fSelection);
- //ensure we can see the beginning check-boxes etc. (bug 180971)
- //this will not work in Windows Vista as there is no way to over-ride the default viewer item showing policy
- //by setting the horizontal bar selection index. I.e. the following line of code is ignored in Vista
- fTView.getViewer().getTree().getHorizontalBar().setSelection(0);
- createButtonsGroup(composite);
- createDestinationGroup(composite);
- fOverwriteExistingFilesCheckbox = SWTFactory.createCheckButton(composite, ImportExportMessages.WizardBreakpointsPage_6, null, false, 1);
- setControl(composite);
- setPageComplete(false);
- setMessage(ImportExportMessages.WizardBreakpointsPage_4);
- restoreWidgetState();
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.EXPORT_BREAKPOINTS_WIZARD_PAGE);
-
- Dialog.applyDialogFont(parent);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#getImage()
- */
- public Image getImage() {
- return DebugUITools.getImage(IInternalDebugUIConstants.IMG_WIZBAN_EXPORT_BREAKPOINTS);
- }
-
- /**
- * Creates the buttons for selecting all or none of the elements.
- *
- * @param parent the parent control
- */
- private void createButtonsGroup(Composite parent) {
- Composite composite = SWTFactory.createComposite(parent, parent.getFont(), 3, 1, GridData.FILL_HORIZONTAL, 0, 0);
- fSelectAll = SWTFactory.createPushButton(composite, ImportExportMessages.WizardBreakpointsPage_1, null);
- fSelectAll.addListener(SWT.Selection, this);
- fDeselectAll = SWTFactory.createPushButton(composite, ImportExportMessages.WizardBreakpointsPage_2, null);
- fDeselectAll.addListener(SWT.Selection, this);
- }
-
- /**
- * This method is used to determine if the page can be "finished".
- *
- * To be determined "finishable" there must be a save path and there must be
- * a selection in the tree.
- *
- * @return if the prerequisites of the wizard are met to allow the wizard to complete.
- */
- private boolean detectPageComplete() {
- String filepath = fDestinationNameField.getText().trim();
- if (filepath.equals(IInternalDebugCoreConstants.EMPTY_STRING)) {
- setErrorMessage(ImportExportMessages.WizardExportBreakpointsPage_0);
- return false;
- }
- IPath path = new Path(filepath);
- if(!path.removeLastSegments(1).toFile().exists()) {
- setErrorMessage(ImportExportMessages.WizardExportBreakpointsPage_3);
- return false;
- }
- int size = fTView.getCheckedElements().size();
- if (size == 0) {
- setErrorMessage(ImportExportMessages.WizardExportBreakpointsPage_1);
- return false;
- }
- setErrorMessage(null);
- setMessage(ImportExportMessages.WizardBreakpointsPage_4);
- return true;
- }
-
- /**
- * Create the export destination specification widgets
- *
- * @param parent org.eclipse.swt.widgets.Composite
- */
- protected void createDestinationGroup(Composite parent) {
- // destination specification group
- Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 3, 1, GridData.FILL_HORIZONTAL, 0, 10);
- SWTFactory.createLabel(comp, ImportExportMessages.WizardBreakpointsPage_7, 1);
-
- fDestinationNameField = SWTFactory.createText(comp, SWT.SINGLE | SWT.BORDER, 1, GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- fDestinationNameField.addListener(SWT.Modify, this);
- fDestinationBrowseButton = SWTFactory.createPushButton(comp, ImportExportMessages.WizardBreakpointsPage_8, null);
- fDestinationBrowseButton.addListener(SWT.Selection, this);
- }
-
- /**
- * Save the state of the widgets select, for successive invocations of the wizard
- */
- private void saveWidgetState() {
- IDialogSettings settings = getDialogSettings();
- if(settings != null) {
- settings.put(OVERWRITE_ALL_STATE, fOverwriteExistingFilesCheckbox.getSelection());
- settings.put(DESTINATION_FILE_NAME, fDestinationNameField.getText().trim());
- }
- }
-
- /**
- * Restores the state of the wizard from previous invocations
- */
- private void restoreWidgetState() {
- IDialogSettings settings = getDialogSettings();
- if(settings != null) {
- fOverwriteExistingFilesCheckbox.setSelection(Boolean.valueOf(settings.get(OVERWRITE_ALL_STATE)).booleanValue());
- String filename = settings.get(DESTINATION_FILE_NAME);
- if (filename != null) {
- fDestinationNameField.setText(filename);
- }
- }
- }
-
- /**
- * The Finish button is clicked on the main wizard
- * dialog to export the breakpoints, we write them out with all persistent
- * information to a simple XML file via the use of XMLMemento.
- *
- * @return if the save operation was successful or not
- */
- public boolean finish() {
- try {
- //name typed in without using selection box
- if(fPath == null) {
- fPath = new Path(fDestinationNameField.getText().trim());
- if(fPath.getFileExtension() == null) {
- fPath = fPath.addFileExtension(IImportExportConstants.EXTENSION);
- }
- else if(!fPath.getFileExtension().equals(IImportExportConstants.EXTENSION)) {
- fPath = fPath.addFileExtension(IImportExportConstants.EXTENSION);
- }
- }
- saveWidgetState();
- if(fPath.toFile().exists() && !fOverwriteExistingFilesCheckbox.getSelection()) {
- if (!MessageDialog.openQuestion(null, ImportExportMessages.WizardBreakpointsPage_12, MessageFormat.format(ImportExportMessages.ImportExportOperations_0, new String[] {fPath.toPortableString()}))) {
- return false;
- }
- }
- // collect breakpoints
- Object[] elements = fTView.getCheckedElements().toArray();
- List breakpoints = new ArrayList();
- for (int i = 0; i < elements.length; i++) {
- Object object = elements[i];
- if (object instanceof IBreakpoint) {
- breakpoints.add(object);
- }
- }
- getContainer().run(false,
- true,
- new ExportBreakpointsOperation(
- (IBreakpoint[]) breakpoints.toArray(new IBreakpoint[breakpoints.size()]),
- fPath.toOSString()));
- }
- catch (InterruptedException e) {
- DebugPlugin.log(e);
- return false;
- }
- catch (InvocationTargetException e) {
- DebugPlugin.log(e);
- return false;
- }
- return true;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpoints.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpoints.java
deleted file mode 100644
index ae00a532d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpoints.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.importexport.breakpoints;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.IImportWizard;
-import org.eclipse.ui.IWorkbench;
-
-/**
- * <p>
- * Wizard for Importing breakpoints.
- * It serves a dual purpose, in that it is used by the platform import/export wizard,
- * but it can also be used as a standalone wizard.
- * </p>
- * <p>
- * Example:
- * </p>
- * <pre>
- * IWizard wiz = new WizardImportBreakpoints();
- * wiz.init(workbench, selection);
- * WizardDialog wizdialog = new WizardDialog(shell, wiz);
- * wizdialog.open();
- * </pre>
- *
- * This class uses <code>WizardImportBreakpointsPage</code>
- *
- * @since 3.2
- *
- */
-public class WizardImportBreakpoints extends Wizard implements IImportWizard {
-
- /*
- * The main page
- */
- private WizardImportBreakpointsPage fMainPage = null;
-
- /**
- * Identifier for dialog settings section for the import wizard.
- */
- private static final String IMPORT_DIALOG_SETTINGS = "BreakpointImportSettings"; //$NON-NLS-1$
-
- /**
- * This is the default constructor
- */
- public WizardImportBreakpoints() {
- super();
- DebugUIPlugin plugin = DebugUIPlugin.getDefault();
- IDialogSettings workbenchSettings = plugin.getDialogSettings();
- IDialogSettings section = workbenchSettings.getSection(IMPORT_DIALOG_SETTINGS);
- if (section == null)
- section = workbenchSettings.addNewSection(IMPORT_DIALOG_SETTINGS);
- setDialogSettings(section);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#addPages()
- */
- public void addPages() {
- super.addPages();
- fMainPage = new WizardImportBreakpointsPage(ImportExportMessages.WizardImportBreakpoints_0);
- addPage(fMainPage);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#dispose()
- */
- public void dispose() {
- super.dispose();
- fMainPage = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.IWizard#performFinish()
- */
- public boolean performFinish() {
- return fMainPage.finish();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
- */
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- setWindowTitle(ImportExportMessages.WizardImportBreakpoints_0);
- setNeedsProgressMonitor(true);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java
deleted file mode 100644
index 3b67b0836..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.importexport.breakpoints;
-
-import java.io.File;
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.actions.ImportBreakpointsOperation;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.PlatformUI;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * The import breakpoints wizard page.
- *
- * This class is used in <code>WizardImportBreakpoints</code>.
- *
- * @since 3.2
- */
-public class WizardImportBreakpointsPage extends WizardPage implements Listener {
-
- //widgets
- private Button fAutoRemoveDuplicates = null;
- private Button fAutoCreateWorkingSets = null;
- private Text fFileNameField = null;
- private Button fBrowseForFileButton = null;
-
-// state constants
- private static final String REMOVE_DUPS = "overwrite"; //$NON-NLS-1$
- private static final String CREATE_WORKING_SETS = "createws"; //$NON-NLS-1$
- private static final String SOURCE_FILE_NAME = "filename"; //$NON-NLS-1$
-
- /**
- * This is the default constructor. It accepts the name for the tab as a
- * parameter
- *
- * @param pageName the name of the page
- */
- public WizardImportBreakpointsPage(String pageName) {
- super(pageName, ImportExportMessages.WizardImportBreakpointsPage_0, null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
- */
- public void handleEvent(Event event) {
- Widget source = event.widget;
- if(source == fBrowseForFileButton) {
- handleBrowseForFileButtonPressed();
- }
- setPageComplete(detectPageComplete());
- }
-
- /**
- * This method handles the fBrowseForFileButton being pressed.
- */
- protected void handleBrowseForFileButtonPressed() {
- FileDialog dialog = new FileDialog(getContainer().getShell(), SWT.OPEN);
- dialog.setFilterExtensions(new String[]{"*."+IImportExportConstants.EXTENSION}); //$NON-NLS-1$
- String file = dialog.open();
- if(file != null) {
- fFileNameField.setText(file);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- initializeDialogUnits(parent);
- Composite composite = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH);
- createDestinationGroup(composite);
- createOptionsGroup(composite);
- setControl(composite);
- restoreWidgetState();
- setPageComplete(detectPageComplete());
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.IMPORT_BREAKPOINTS_WIZARD_PAGE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#getImage()
- */
- public Image getImage() {
- return DebugUITools.getImage(IInternalDebugUIConstants.IMG_WIZBAN_IMPORT_BREAKPOINTS);
- }
-
- /**
- * This method is used to determine if the page can be "finished".
- * To be determined "finishable" there must be an import path.
- *
- * @return if the prerequisites of the wizard are met to allow the wizard to complete.
- */
- private boolean detectPageComplete() {
- String fileName = fFileNameField.getText().trim();
- if (fileName.equals(IInternalDebugCoreConstants.EMPTY_STRING)) {
- setMessage(ImportExportMessages.WizardImportBreakpointsPage_6);
- return false;
- }
- File file = new File(fileName);
- if (!file.exists() || file.isDirectory()) {
- setMessage(MessageFormat.format(ImportExportMessages.WizardImportBreakpointsPage_1, new String[]{fileName}), ERROR);
- return false;
- }
-
- setMessage(ImportExportMessages.WizardImportBreakpointsPage_2);
- return true;
- }
-
- /**
- * Create the options specification widgets.
- *
- * @param parent the parent composite to add this one to
- */
- protected void createOptionsGroup(Composite parent) {
- fAutoRemoveDuplicates = SWTFactory.createCheckButton(parent, ImportExportMessages.WizardImportBreakpointsPage_3, null, false, 1);
- fAutoCreateWorkingSets = SWTFactory.createCheckButton(parent, ImportExportMessages.WizardImportBreakpointsPage_5, null, false, 1);
- }
-
- /**
- * Create the export destination specification widgets
- *
- * @param parent the parent composite to add this one to
- */
- protected void createDestinationGroup(Composite parent) {
- Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 3, 1, GridData.FILL_HORIZONTAL, 0, 10);
- SWTFactory.createLabel(comp, ImportExportMessages.WizardImportBreakpointsPage_4, 1);
-
- // file name entry field
- fFileNameField = SWTFactory.createText(comp, SWT.BORDER | SWT.SINGLE, 1, GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
- fFileNameField.addListener(SWT.Modify, this);
-
- // destination browse button
- fBrowseForFileButton = SWTFactory.createPushButton(comp, ImportExportMessages.WizardBreakpointsPage_8, null);
- fBrowseForFileButton.addListener(SWT.Selection, this);
- }
-
- /**
- * Save the state of the widgets select, for successive invocations of the wizard
- */
- private void saveWidgetState() {
- IDialogSettings settings = getDialogSettings();
- if(settings != null) {
- settings.put(REMOVE_DUPS, fAutoRemoveDuplicates.getSelection());
- settings.put(CREATE_WORKING_SETS, fAutoCreateWorkingSets.getSelection());
- settings.put(SOURCE_FILE_NAME, fFileNameField.getText().trim());
- }
- }
-
- /**
- * Restores the state of the wizard from previous invocations
- */
- private void restoreWidgetState() {
- IDialogSettings settings = getDialogSettings();
- if(settings != null) {
- fAutoRemoveDuplicates.setSelection(Boolean.valueOf(settings.get(REMOVE_DUPS)).booleanValue());
- fAutoCreateWorkingSets.setSelection(Boolean.valueOf(settings.get(CREATE_WORKING_SETS)).booleanValue());
- String fileName = settings.get(SOURCE_FILE_NAME);
- if (fileName != null) {
- fFileNameField.setText(fileName);
- }
- }
- }
-
- /**
- * <p>
- * This method is called when the Finish button is click on the main wizard
- * dialog To import the breakpoints, we read then from the tree
- * and add them into the BreakpointManager
- * </p>
- * @return if the import operation was successful or not
- */
- public boolean finish() {
- try {
- saveWidgetState();
- getContainer().run(false,
- true,
- new ImportBreakpointsOperation(
- fFileNameField.getText().trim(),
- fAutoRemoveDuplicates.getSelection(),
- fAutoCreateWorkingSets.getSelection()));
- }
- catch (InterruptedException e) {
- DebugPlugin.log(e);
- return false;
- }
- catch (InvocationTargetException e) {
- DebugPlugin.log(e);
- return false;
- }
- return true;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizard.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizard.java
deleted file mode 100644
index cfbbe1fcc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizard.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.importexport.launchconfigurations;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.IExportWizard;
-import org.eclipse.ui.IWorkbench;
-
-/**
- * This class provides a wizard for exporting launch configurations to the local
- * file system
- *
- * @since 3.4.0
- */
-public class ExportLaunchConfigurationsWizard extends Wizard implements IExportWizard {
-
- private String EXPORT_DIALOG_SETTINGS = "ExportLaunchConfigurations"; //$NON-NLS-1$
-
- /**
- * Constructor
- */
- public ExportLaunchConfigurationsWizard() {
- super();
- DebugUIPlugin plugin = DebugUIPlugin.getDefault();
- IDialogSettings workbenchSettings = plugin.getDialogSettings();
- IDialogSettings section = workbenchSettings.getSection(EXPORT_DIALOG_SETTINGS);
- if (section == null)
- section = workbenchSettings.addNewSection(EXPORT_DIALOG_SETTINGS);
- setDialogSettings(section);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.Wizard#addPages()
- */
- public void addPages() {
- IWizardPage page = new ExportLaunchConfigurationsWizardPage();
- addPage(page);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.Wizard#performFinish()
- */
- public boolean performFinish() {
- return ((ExportLaunchConfigurationsWizardPage)getStartingPage()).finish();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
- */
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- setWindowTitle(WizardMessages.ExportLaunchConfigurationsWizard_0);
- setNeedsProgressMonitor(true);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
deleted file mode 100644
index 0551c39fa..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
+++ /dev/null
@@ -1,432 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.importexport.launchconfigurations;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.core.LaunchConfiguration;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchCategoryFilter;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.model.WorkbenchViewerComparator;
-import org.eclipse.ui.progress.UIJob;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * This calls provides the one and only wizard page to the
- * export launch configurations wizard.
- * @since 3.4.0
- */
-public class ExportLaunchConfigurationsWizardPage extends WizardPage {
-
- /**
- * The content provider for the tree viewer
- * @since 3.4.0
- */
- class ConfigContentProvider implements ITreeContentProvider {
-
- ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
-
- public Object[] getChildren(Object parentElement) {
- if(parentElement instanceof ILaunchConfigurationType) {
- try {
- return lm.getLaunchConfigurations((ILaunchConfigurationType) parentElement);
- }
- catch (Exception e) {
- DebugUIPlugin.logErrorMessage(e.getMessage());
- }
- }
- return null;
- }
- public Object getParent(Object element) {
- if(element instanceof ILaunchConfiguration) {
- try {
- return ((ILaunchConfiguration)element).getType();
- } catch (CoreException e) {
- return null;
- }
- }
- return null;
- }
- public boolean hasChildren(Object element) {
- return element instanceof ILaunchConfigurationType;
- }
- public Object[] getElements(Object inputElement) {
- return lm.getLaunchConfigurationTypes();
- }
- public void dispose() {lm = null;}
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
-
- }
- private String OVERWRITE = "overwrite"; //$NON-NLS-1$
- private String OLD_PATH = "oldpath"; //$NON-NLS-1$
- private CheckboxTreeViewer fViewer = null;
- private Text fFilePath = null;
- private Button fOverwrite = null;
-
- /**
- * Constructor
- */
- protected ExportLaunchConfigurationsWizardPage() {
- super(WizardMessages.ExportLaunchConfigurationsWizard_0);
- setTitle(WizardMessages.ExportLaunchConfigurationsWizard_0);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- Composite comp = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_BOTH);
- //add the check table
- createViewer(comp);
- //add the file path and browse button
- createFilePath(comp);
- //add the overwrite option
- fOverwrite = SWTFactory.createCheckButton(comp, WizardMessages.ExportLaunchConfigurationsWizardPage_1, null, getDialogSettings().getBoolean(OVERWRITE), 2);
- setControl(comp);
- PlatformUI .getWorkbench().getHelpSystem().setHelp(comp, IDebugHelpContextIds.EXPORT_LAUNCH_CONFIGURATIONS_PAGE);
- setMessage(WizardMessages.ExportLaunchConfigurationsWizardPage_7);
- //do not set page complete, Eclipse UI guidelines states wizards cannot start off with an error showing
- setPageComplete(false);
- }
-
- /**
- * Creates the check table viewer portion of the control
- * @param parent the parent to add the check table viewer to
- */
- protected void createViewer(Composite parent) {
- SWTFactory.createWrapLabel(parent, WizardMessages.ExportLaunchConfigurationsWizardPage_3, 2);
- Tree tree = new Tree(parent, SWT.BORDER | SWT.SINGLE | SWT.CHECK);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.horizontalSpan = 2;
- tree.setLayoutData(gd);
- fViewer = new CheckboxTreeViewer(tree);
- fViewer.setLabelProvider(DebugUITools.newDebugModelPresentation());
- fViewer.setComparator(new WorkbenchViewerComparator());
- fViewer.setContentProvider(new ConfigContentProvider());
- fViewer.setInput(DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes());
- //we don't want to see builders....
- fViewer.addFilter(new LaunchCategoryFilter(IInternalDebugUIConstants.ID_EXTERNAL_TOOL_BUILDER_LAUNCH_CATEGORY));
- //need to force load the children so that select all works initially
- fViewer.expandAll();
- fViewer.collapseAll();
- fViewer.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- updateCheckedState(event.getElement());
- setPageComplete(isComplete());
- }
- });
- Composite buttoncomp = SWTFactory.createComposite(parent, parent.getFont(), 2, 2, GridData.FILL_HORIZONTAL, 0, 0);
- Button button = SWTFactory.createPushButton(buttoncomp, WizardMessages.ExportLaunchConfigurationsWizardPage_8, null);
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- fViewer.setAllChecked(true);
- setPageComplete(isComplete());
- }
- });
- button = SWTFactory.createPushButton(buttoncomp, WizardMessages.ExportLaunchConfigurationsWizardPage_9, null);
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- fViewer.setAllChecked(false);
- setPageComplete(isComplete());
- }
- });
- }
-
- /**
- * Updates the checked state of child launch configurations if the parent type is checked
- * @param item
- */
- protected void updateCheckedState(Object element) {
- boolean state = fViewer.getChecked(element);
- if(element instanceof ILaunchConfigurationType) {
- Object[] items = ((ConfigContentProvider)fViewer.getContentProvider()).getChildren(element);
- for(int i = 0; i < items.length; i++) {
- fViewer.setChecked(items[i], state);
- }
- fViewer.setGrayed(element, false);
- }
- else if(element instanceof ILaunchConfiguration) {
- ConfigContentProvider ccp = (ConfigContentProvider) fViewer.getContentProvider();
- Object parent = ccp.getParent(element);
- Object[] items = ccp.getChildren(parent);
- boolean checked = true;
- boolean onechecked = false;
- for(int i = 0; i < items.length; i++) {
- state = fViewer.getChecked(items[i]);
- checked &= state;
- if(state) {
- onechecked = true;
- }
- }
- fViewer.setGrayed(parent, onechecked & !checked);
- fViewer.setChecked(parent, checked | onechecked);
- }
- }
-
- /**
- * Creates the controls for the file path selection area of the page
- * @param parent
- */
- protected void createFilePath(Composite parent) {
- Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 3, 2, GridData.FILL_HORIZONTAL, 0, 10);
- SWTFactory.createLabel(comp, WizardMessages.ExportLaunchConfigurationsWizardPage_4, 1);
- fFilePath = SWTFactory.createText(comp, SWT.SINGLE | SWT.BORDER, 1);
- String opath = getDialogSettings().get(OLD_PATH);
- fFilePath.setText((opath == null ? IInternalDebugCoreConstants.EMPTY_STRING : opath));
- fFilePath.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- setPageComplete(isComplete());
- }
- });
- Button button = SWTFactory.createPushButton(comp, WizardMessages.ExportLaunchConfigurationsWizardPage_0, null, GridData.END);
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- DirectoryDialog dd = new DirectoryDialog(getContainer().getShell());
- dd.setText(WizardMessages.ExportLaunchConfigurationsWizard_0);
- String file = dd.open();
- if(file != null) {
- IPath path = new Path(file);
- if (path != null) {
- fFilePath.setText(path.toString());
- setPageComplete(isComplete());
- }
- }
- }
- });
- }
-
- /**
- * Returns if the page is complete
- * @return true if the page is complete and can be 'finished', false otherwise
- */
- protected boolean isComplete() {
- Object[] elements = fViewer.getCheckedElements();
- boolean oneconfig = false;
- for(int i = 0; i < elements.length; i++) {
- if(elements[i] instanceof ILaunchConfiguration) {
- oneconfig = true;
- break;
- }
- }
- if(elements.length < 1 || !oneconfig) {
- setErrorMessage(WizardMessages.ExportLaunchConfigurationsWizardPage_5);
- return false;
- }
- String path = fFilePath.getText().trim();
- if(path.equals(IInternalDebugCoreConstants.EMPTY_STRING)) {
- setErrorMessage(WizardMessages.ExportLaunchConfigurationsWizardPage_6);
- return false;
- }
- if ((new File(path)).isFile()) {
- setErrorMessage(WizardMessages.ExportLaunchConfigurationsWizardPage_2);
- return false;
- }
- setErrorMessage(null);
- setMessage(WizardMessages.ExportLaunchConfigurationsWizardPage_7);
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.WizardPage#getImage()
- */
- public Image getImage() {
- return DebugUITools.getImage(IInternalDebugUIConstants.IMG_WIZBAN_EXPORT_CONFIGS);
- }
-
- /**
- * This method performs the work of the page
- * @return if the export job was successful or not
- */
- public boolean finish() {
- final String dpath = fFilePath.getText().trim();
- IDialogSettings settings = getDialogSettings();
- settings.put(OVERWRITE, fOverwrite.getSelection());
- settings.put(OLD_PATH, dpath);
- final Object[] configs = fViewer.getCheckedElements();
- final boolean overwrite = fOverwrite.getSelection();
- UIJob exportjob = new UIJob(getContainer().getShell().getDisplay(), WizardMessages.ExportLaunchConfigurationsWizard_0) {
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if(monitor == null) {
- monitor = new NullProgressMonitor();
- }
- IPath destpath = new Path(dpath);
- File destfolder = destpath.toFile();
- if(!destfolder.exists()) {
- destfolder.mkdirs();
- }
- monitor.beginTask(WizardMessages.ExportLaunchConfigurationsWizardPage_10, configs.length);
- try {
- List errors = null;
- IFileStore file = null;
- File newfile = null;
- boolean owall = false, nowall = false;
- MessageDialog dialog = null;
- for(int i = 0; i < configs.length; i++) {
- if(monitor.isCanceled()) {
- return Status.CANCEL_STATUS;
- }
- if(configs[i] instanceof ILaunchConfiguration) {
- try {
- LaunchConfiguration launchConfig = (LaunchConfiguration) configs[i];
- file = launchConfig.getFileStore();
- if (file == null) {
- if (errors == null) {
- errors = new ArrayList(configs.length);
- }
- errors.add(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(),
- MessageFormat.format(WizardMessages.ExportLaunchConfigurationsWizardPage_19, new String[]{launchConfig.getName()}), null));
- } else {
- newfile = new File(destpath.append(file.getName()).toOSString());
- if(newfile.exists() & !overwrite) {
- if(nowall) {
- continue;
- }
- dialog = new MessageDialog(DebugUIPlugin.getShell(),
- WizardMessages.ExportLaunchConfigurationsWizardPage_11,
- null,
- MessageFormat.format(WizardMessages.ExportLaunchConfigurationsWizardPage_12, new String[] {file.getName()}),
- MessageDialog.QUESTION, new String[] {WizardMessages.ExportLaunchConfigurationsWizardPage_13, WizardMessages.ExportLaunchConfigurationsWizardPage_14, WizardMessages.ExportLaunchConfigurationsWizardPage_15, WizardMessages.ExportLaunchConfigurationsWizardPage_16, WizardMessages.ExportLaunchConfigurationsWizardPage_17}, 0);
- if(!owall) {
- int ret = dialog.open();
- switch(ret) {
- case 0: {
- copyFile(file, newfile);
- break;
- }
- case 1: {
- owall = true;
- copyFile(file, newfile);
- break;
- }
- case 3: {
- nowall = true;
- break;
- }
- case 4: {
- monitor.setCanceled(true);
- break;
- }
- }
- }
- else if(!nowall) {
- copyFile(file, newfile);
- }
- }
- else {
- copyFile(file, newfile);
- }
- }
- }
- catch (IOException e ) {
- if (errors == null) {
- errors = new ArrayList(configs.length);
- }
- errors.add(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(),
- e.getMessage(), e));
- }
- catch (CoreException e) {
- if (errors == null) {
- errors = new ArrayList(configs.length);
- }
- errors.add(e.getStatus());
- }
- }
- if(!monitor.isCanceled()) {
- monitor.worked(1);
- }
- }
- if (errors == null || errors.isEmpty()) {
- return Status.OK_STATUS;
- } else {
- if (errors.size() == 1) {
- return (IStatus)errors.get(0);
- } else {
- return new MultiStatus(DebugUIPlugin.getUniqueIdentifier(), 0,
- (IStatus[])errors.toArray(new IStatus[errors.size()]),
- WizardMessages.ExportLaunchConfigurationsWizardPage_18, null);
- }
- }
- }
- finally {
- monitor.done();
- }
- }
- };
- exportjob.schedule();
- return true;
- }
-
- /**
- * Copies a file from one location to another
- * @param in the file to copy
- * @param out the file to be copied out to
- * @throws Exception
- * @since 3.5
- */
- protected void copyFile(IFileStore in, File out) throws CoreException, IOException {
- BufferedInputStream is = new BufferedInputStream(in.openInputStream(EFS.NONE, null));
- BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(out));
- byte[] buf = new byte[1024];
- int i = 0;
- while((i = is.read(buf)) != -1) {
- os.write(buf, 0, i);
- }
- is.close();
- os.close();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizard.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizard.java
deleted file mode 100644
index 1cefad93b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizard.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.importexport.launchconfigurations;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.IImportWizard;
-import org.eclipse.ui.IWorkbench;
-
-/**
- * This class provides a wizard for importing launch configurations from the local
- * file system into the current workspace.
- *
- * It allows the suer to specify if the configuration should be shared or local
- * once imported
- *
- * @since 3.4.0
- */
-public class ImportLaunchConfigurationsWizard extends Wizard implements IImportWizard {
-
- private String EXPORT_DIALOG_SETTINGS = "ExportLaunchConfigurations"; //$NON-NLS-1$
-
- /**
- * Constructor
- */
- public ImportLaunchConfigurationsWizard() {
- super();
- DebugUIPlugin plugin = DebugUIPlugin.getDefault();
- IDialogSettings workbenchSettings = plugin.getDialogSettings();
- IDialogSettings section = workbenchSettings.getSection(EXPORT_DIALOG_SETTINGS);
- if (section == null)
- section = workbenchSettings.addNewSection(EXPORT_DIALOG_SETTINGS);
- setDialogSettings(section);
- setNeedsProgressMonitor(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.Wizard#performFinish()
- */
- public boolean performFinish() {
- return ((ImportLaunchConfigurationsWizardPage)getStartingPage()).finish();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.Wizard#addPages()
- */
- public void addPages() {
- addPage(new ImportLaunchConfigurationsWizardPage());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
- */
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- setWindowTitle(WizardMessages.ImportLaunchConfigurationsWizard_0);
- setNeedsProgressMonitor(true);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java
deleted file mode 100644
index e441b352e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.importexport.launchconfigurations;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.core.LaunchManager;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.FileSystemElement;
-import org.eclipse.ui.dialogs.WizardResourceImportPage;
-import org.eclipse.ui.model.AdaptableList;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.wizards.datatransfer.FileSystemStructureProvider;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * This class providers the one and only page for the import launch configurations wizard
- * @since 3.4.0
- */
-public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPage {
-
- /**
- * Represents a debug view of the file system, in that we only care about folders and files with the
- * extension *.launch
- * @since 3.4.0
- */
- class DebugFileSystemElement extends FileSystemElement {
-
- private boolean populated = false;
-
- public DebugFileSystemElement(String name, FileSystemElement parent, boolean isDirectory) {
- super(name, parent, isDirectory);
- }
-
- public void setPopulated() {
- populated = true;
- }
-
- public boolean isPopulated() {
- return populated;
- }
-
- public AdaptableList getFiles() {
- if(!populated) {
- populateElementChildren();
- }
- return super.getFiles();
- }
-
- public AdaptableList getFolders() {
- if(!populated) {
- populateElementChildren();
- }
- return super.getFolders();
- }
-
- /**
- * Populates the children of the specified parent <code>FileSystemElement</code>
- * @param element
- * @param folderonly
- */
- private void populateElementChildren() {
- FileSystemStructureProvider provider = FileSystemStructureProvider.INSTANCE;
- List allchildren = provider.getChildren(this.getFileSystemObject());
- File child = null;
- DebugFileSystemElement newelement = null;
- Iterator iter = allchildren.iterator();
- while(iter.hasNext()) {
- child = (File) iter.next();
- if(child.isFile()) {
- Path childpath = new Path(child.getAbsolutePath());
- String extension = childpath.getFileExtension();
- if(extension != null && extension.equals(ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION)) {
- newelement = new DebugFileSystemElement(provider.getLabel(child), this, provider.isFolder(child));
- newelement.setFileSystemObject(child);
- }
- }
- else {
- newelement = new DebugFileSystemElement(provider.getLabel(child), this, provider.isFolder(child));
- newelement.setFileSystemObject(child);
- }
- }
- setPopulated();
- }
- }
-
- private String OVERWRITE = "import_config_overwrite"; //$NON-NLS-1$
- private String OLD_PATH = "import_config_oldpath"; //$NON-NLS-1$
-
- private Text fFromDirectory = null;
- private Button fOverwrite = null;
-
- /**
- * Constructor
- */
- public ImportLaunchConfigurationsWizardPage() {
- super(WizardMessages.ImportLaunchConfigurationsWizardPage_0, new StructuredSelection());
- setTitle(WizardMessages.ImportLaunchConfigurationsWizardPage_0);
- setMessage(WizardMessages.ImportLaunchConfigurationsWizardPage_5);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- Composite comp = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH);
- createRootDirectoryGroup(comp);
- createFileSelectionGroup(comp);
- IDialogSettings settings = getDialogSettings();
- fOverwrite = SWTFactory.createCheckButton(comp, WizardMessages.ImportLaunchConfigurationsWizardPage_1, null, settings.getBoolean(OVERWRITE), 1);
- String oldpath = settings.get(OLD_PATH);
- oldpath = (oldpath == null ? IInternalDebugCoreConstants.EMPTY_STRING : oldpath);
- fFromDirectory.setText((oldpath == null ? IInternalDebugCoreConstants.EMPTY_STRING : oldpath));
- resetSelection(new Path(oldpath));
- setControl(comp);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(comp, IDebugHelpContextIds.IMPORT_LAUNCH_CONFIGURATIONS_PAGE);
- setPageComplete(false);
- //do not set page complete, Eclipse UI guidelines states wizards cannot start off with an error showing
- }
-
- /**
- * Performs the actual work of the wizard page and return is the work was successful
- * @return true if the import completed normally, false otherwise
- */
- public boolean finish() {
- IDialogSettings settings = getDialogSettings();
- settings.put(OVERWRITE, fOverwrite.getSelection());
- settings.put(OLD_PATH, fFromDirectory.getText().trim());
- boolean overwrite = fOverwrite.getSelection();
- List items = getSelectedResources();
- File config, newconfig = null;
- boolean owall = false, nowall = false;
- MessageDialog dialog = null;
- final List filesToImport = new ArrayList();
- for(Iterator iter = items.iterator(); iter.hasNext();) {
- config = (File) ((DebugFileSystemElement) iter.next()).getFileSystemObject();
- newconfig = new File(new Path(LaunchManager.LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH.toOSString()).append(config.getName()).toOSString());
- if(newconfig.exists() & !overwrite) {
- if(nowall) {
- continue;
- }
- if(!owall) {
- dialog = new MessageDialog(DebugUIPlugin.getShell(),
- WizardMessages.ExportLaunchConfigurationsWizardPage_11,
- null,
- MessageFormat.format(WizardMessages.ExportLaunchConfigurationsWizardPage_12, new String[] {config.getName()}),
- MessageDialog.QUESTION, new String[] {WizardMessages.ExportLaunchConfigurationsWizardPage_13, WizardMessages.ExportLaunchConfigurationsWizardPage_14, WizardMessages.ExportLaunchConfigurationsWizardPage_15, WizardMessages.ExportLaunchConfigurationsWizardPage_16, WizardMessages.ExportLaunchConfigurationsWizardPage_17}, 0);
- int ret = dialog.open();
- switch(ret) {
- case 0: {
- filesToImport.add(config);
- break;
- }
- case 1: {
- owall = true;
- filesToImport.add(config);
- break;
- }
- case 3: {
- nowall = true;
- break;
- }
- case 4: {
- return true;
- }
- }
- } else if(!nowall) {
- filesToImport.add(config);
- }
- } else {
- filesToImport.add(config);
- }
- }
-
- if (!filesToImport.isEmpty()) {
- Job job = new Job(WizardMessages.ExportLaunchConfigurationsWizard_0) {
- public IStatus run(IProgressMonitor monitor) {
- LaunchManager launchManager = (LaunchManager) DebugPlugin.getDefault().getLaunchManager();
- try {
- launchManager.importConfigurations((File[]) filesToImport.toArray(new File[filesToImport.size()]), monitor);
- } catch (CoreException e) {
- return e.getStatus();
- }
- return Status.OK_STATUS;
- }
- };
- job.schedule();
- }
- return true;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.WizardPage#getImage()
- */
- public Image getImage() {
- return DebugUITools.getImage(IInternalDebugUIConstants.IMG_WIZBAN_IMPORT_CONFIGS);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.dialogs.WizardResourceImportPage#updateWidgetEnablements()
- */
- protected void updateWidgetEnablements() {
- setPageComplete(determinePageCompletion());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.dialogs.WizardResourceImportPage#determinePageCompletion()
- */
- protected boolean determinePageCompletion() {
- if(fFromDirectory.getText().trim().equals(IInternalDebugCoreConstants.EMPTY_STRING)) {
- setErrorMessage(WizardMessages.ImportLaunchConfigurationsWizardPage_3);
- return false;
- }
- if(selectionGroup.getCheckedElementCount() < 1) {
- setErrorMessage(WizardMessages.ImportLaunchConfigurationsWizardPage_4);
- return false;
- }
- setErrorMessage(null);
- setMessage(WizardMessages.ImportLaunchConfigurationsWizardPage_5);
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.dialogs.WizardResourceImportPage#createSourceGroup(org.eclipse.swt.widgets.Composite)
- */
- protected void createSourceGroup(Composite parent) {}
-
- /**
- * Create the group for creating the root directory
- */
- protected void createRootDirectoryGroup(Composite parent) {
- Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 3, 1, GridData.FILL_HORIZONTAL, 0, 0);
- SWTFactory.createLabel(comp, WizardMessages.ImportLaunchConfigurationsWizardPage_6, 1);
- // source name entry field
- fFromDirectory = SWTFactory.createText(comp, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY, 1, GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
- // source browse button
- Button browse = SWTFactory.createPushButton(comp, WizardMessages.ImportLaunchConfigurationsWizardPage_7, null);
- browse.addSelectionListener(new SelectionAdapter () {
- public void widgetSelected(SelectionEvent e) {
- DirectoryDialog dd = new DirectoryDialog(getContainer().getShell());
- dd.setText(WizardMessages.ImportLaunchConfigurationsWizardPage_0);
- String filename = dd.open();
- if(filename != null) {
- IPath path = new Path(filename);
- if (path != null) {
- fFromDirectory.setText(path.toString());
- resetSelection(path);
- setPageComplete(determinePageCompletion());
- }
- }
- }
- });
- }
-
- /**
- * Resets the selection of the tree root element for the viewer
- * @param path the path from the text widget
- */
- protected void resetSelection(final IPath path) {
- BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
- public void run() {
- File file = new File(path.toOSString());
- DebugFileSystemElement dummyparent = new DebugFileSystemElement(IInternalDebugCoreConstants.EMPTY_STRING, null, true);
- dummyparent.setPopulated();
- DebugFileSystemElement element = new DebugFileSystemElement(FileSystemStructureProvider.INSTANCE.getLabel(file),
- dummyparent,
- file.isDirectory());
- element.setFileSystemObject(file);
- element.getFiles();
- selectionGroup.setRoot(dummyparent);
- }
- });
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.dialogs.WizardResourceImportPage#getFileProvider()
- */
- protected ITreeContentProvider getFileProvider() {
- return new WorkbenchContentProvider() {
- public Object[] getChildren(Object o) {
- if (o instanceof DebugFileSystemElement) {
- DebugFileSystemElement element = (DebugFileSystemElement) o;
- return element.getFiles().getChildren(element);
- }
- return new Object[0];
- }
- };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.dialogs.WizardResourceImportPage#getFolderProvider()
- */
- protected ITreeContentProvider getFolderProvider() {
- return new WorkbenchContentProvider() {
- public Object[] getChildren(Object o) {
- if (o instanceof DebugFileSystemElement) {
- DebugFileSystemElement element = (DebugFileSystemElement) o;
- return element.getFolders().getChildren();
- }
- return new Object[0];
- }
-
- public boolean hasChildren(Object o) {
- if (o instanceof DebugFileSystemElement) {
- DebugFileSystemElement element = (DebugFileSystemElement) o;
- if (element.isPopulated()) {
- return getChildren(element).length > 0;
- }
- //If we have not populated then wait until asked
- return true;
- }
- return false;
- }
- };
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/WizardMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/WizardMessages.java
deleted file mode 100644
index 706a4b7d9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/WizardMessages.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.importexport.launchconfigurations;
-
-import org.eclipse.osgi.util.NLS;
-
-public class WizardMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.importexport.launchconfigurations.WizardMessages"; //$NON-NLS-1$
- public static String ExportLaunchConfigurationsWizard_0;
- public static String ExportLaunchConfigurationsWizardPage_0;
- public static String ExportLaunchConfigurationsWizardPage_1;
- public static String ExportLaunchConfigurationsWizardPage_10;
- public static String ExportLaunchConfigurationsWizardPage_11;
- public static String ExportLaunchConfigurationsWizardPage_12;
- public static String ExportLaunchConfigurationsWizardPage_13;
- public static String ExportLaunchConfigurationsWizardPage_14;
- public static String ExportLaunchConfigurationsWizardPage_15;
- public static String ExportLaunchConfigurationsWizardPage_16;
- public static String ExportLaunchConfigurationsWizardPage_17;
- public static String ExportLaunchConfigurationsWizardPage_18;
- public static String ExportLaunchConfigurationsWizardPage_19;
- public static String ExportLaunchConfigurationsWizardPage_2;
- public static String ExportLaunchConfigurationsWizardPage_3;
- public static String ExportLaunchConfigurationsWizardPage_4;
- public static String ExportLaunchConfigurationsWizardPage_5;
- public static String ExportLaunchConfigurationsWizardPage_6;
- public static String ExportLaunchConfigurationsWizardPage_7;
- public static String ExportLaunchConfigurationsWizardPage_8;
- public static String ExportLaunchConfigurationsWizardPage_9;
- public static String ImportLaunchConfigurationsWizard_0;
- public static String ImportLaunchConfigurationsWizardPage_0;
- public static String ImportLaunchConfigurationsWizardPage_1;
- public static String ImportLaunchConfigurationsWizardPage_3;
- public static String ImportLaunchConfigurationsWizardPage_4;
- public static String ImportLaunchConfigurationsWizardPage_5;
- public static String ImportLaunchConfigurationsWizardPage_6;
- public static String ImportLaunchConfigurationsWizardPage_7;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, WizardMessages.class);
- }
-
- private WizardMessages() {
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/WizardMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/WizardMessages.properties
deleted file mode 100644
index b2d6f0d4b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/WizardMessages.properties
+++ /dev/null
@@ -1,39 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2008 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-ExportLaunchConfigurationsWizard_0=Export Launch Configurations
-ExportLaunchConfigurationsWizardPage_0=Brows&e...
-ExportLaunchConfigurationsWizardPage_1=&Overwrite existing file(s) without warning
-ExportLaunchConfigurationsWizardPage_10=Exporting Launch Configurations
-ExportLaunchConfigurationsWizardPage_11=Overwrite?
-ExportLaunchConfigurationsWizardPage_12=Would you like overwrite {0}?
-ExportLaunchConfigurationsWizardPage_13=Yes
-ExportLaunchConfigurationsWizardPage_14=Yes to All
-ExportLaunchConfigurationsWizardPage_15=No
-ExportLaunchConfigurationsWizardPage_16=No to All
-ExportLaunchConfigurationsWizardPage_17=Cancel
-ExportLaunchConfigurationsWizardPage_18=Launch configuration export failed
-ExportLaunchConfigurationsWizardPage_19=Launch configuration does not exist: {0}
-ExportLaunchConfigurationsWizardPage_2=Specified export location is not a directory
-ExportLaunchConfigurationsWizardPage_3=&Launch Configurations:
-ExportLaunchConfigurationsWizardPage_4=Location:
-ExportLaunchConfigurationsWizardPage_5=Please select at least one launch configuration to export
-ExportLaunchConfigurationsWizardPage_6=Please specify a path to export the launch configurations to
-ExportLaunchConfigurationsWizardPage_7=Select launch configurations to export
-ExportLaunchConfigurationsWizardPage_8=&Select All
-ExportLaunchConfigurationsWizardPage_9=&Deselect All
-ImportLaunchConfigurationsWizard_0=Import Launch Configurations
-ImportLaunchConfigurationsWizardPage_0=Import Launch Configurations
-ImportLaunchConfigurationsWizardPage_1=&Overwrite existing launch configurations without warning.
-ImportLaunchConfigurationsWizardPage_3=You must select a root folder
-ImportLaunchConfigurationsWizardPage_4=You must select at least one configuration to import
-ImportLaunchConfigurationsWizardPage_5=Import launch configurations from the local file system
-ImportLaunchConfigurationsWizardPage_6=From &Directory:
-ImportLaunchConfigurationsWizardPage_7=Brows&e...
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java
deleted file mode 100644
index 2d0606fb7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.actions.SelectionListenerAction;
-
-/**
- * Common function/behavior for launch configuration view actions
- */
-public abstract class AbstractLaunchConfigurationAction extends SelectionListenerAction {
-
- /**
- * The mode this action was created in (run, debug, ...)
- */
- private String fMode;
-
- /**
- * Allows a requestor to abort this action.
- */
- public interface IConfirmationRequestor {
- /**
- * Returns whether this action should proceed. Confirmation is requested
- * when an action is run.
- *
- * @return whether this action should proceed
- */
- public boolean getConfirmation();
- }
-
- /**
- * This action's confirmation requestor or <code>null</code> if none
- */
- private IConfirmationRequestor fConfirmationRequestor;
-
- /**
- * The viewer this action is working on
- */
- private Viewer fViewer;
-
- /**
- * Constructor for AbstractLaunchConfigurationAction.
- * @param text
- */
- public AbstractLaunchConfigurationAction(String text, Viewer viewer, String mode) {
- super(text);
- fViewer = viewer;
- fViewer.addSelectionChangedListener(this);
- fMode = mode;
- }
-
- /**
- * Returns the shell this action is contained in.
- *
- * @return the shell this action is contained in
- */
- protected Shell getShell() {
- return getViewer().getControl().getShell();
- }
-
- /**
- * Returns the viewer this action is working on
- *
- * @return the viewer this action is working on
- */
- protected Viewer getViewer() {
- return fViewer;
- }
-
- /**
- * Performs this action once confirmation has been aquired. Subclasses
- * should override this method.
- */
- protected abstract void performAction();
-
- /**
- * @see org.eclipse.jface.action.IAction#run()
- */
- public final void run() {
- if (fConfirmationRequestor != null) {
- if (!fConfirmationRequestor.getConfirmation()) {
- return;
- }
- }
- Runnable r = new Runnable() {
- /**
- * @see java.lang.Runnable#run()
- */
- public void run() {
- performAction();
- }
- };
- BusyIndicator.showWhile(getShell().getDisplay(), r);
- }
-
- /**
- * Sets this action's confirmation requestor.
- *
- * @param confirmationRequestor
- */
- public void setConfirmationRequestor(IConfirmationRequestor confirmationRequestor) {
- fConfirmationRequestor = confirmationRequestor;
- }
-
- /**
- * Disposes this action
- */
- public void dispose() {
- fViewer.removeSelectionChangedListener(this);
- }
-
- /**
- * Show an error dialog on the given exception.
- *
- * @param exception
- */
- protected void errorDialog(CoreException exception) {
- ErrorDialog.openError(getShell(), null, null, exception.getStatus());
- }
-
- /**
- * Return this action's mode.
- *
- * @return launch mode
- */
- protected String getMode() {
- return fMode;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java
deleted file mode 100644
index d36c2e406..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-/**
- *
- * This implementation is used to filter closed projects from the launch configuration dialog.
- * It is (de)activated via the <code>IInternalDebugUIConstants.PREF_FILTER_LAUNCH_CLOSED</code> preference, and is
- * provided to fix bug 19521.
- *
- * @since 3.2
- *
- */
-public class ClosedProjectFilter extends ViewerFilter {
-
- /**
- * Constructor
- */
- public ClosedProjectFilter() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public boolean select(Viewer viewer, Object parent, Object element) {
- //always let through types, we only care about configs
- if(element instanceof ILaunchConfigurationType) {
- return true;
- }
- if(element instanceof ILaunchConfiguration) {
- try {
- ILaunchConfiguration config = (ILaunchConfiguration)element;
- IResource[] resources = config.getMappedResources();
- //if it has no mapping, it might not have migration delegate, so let it pass
- if(resources == null) {
- return true;
- }
- for(int i = 0; i < resources.length; i++) {
- IProject project= resources[i].getProject();
- //we don't want overlap with the deleted projects filter, so we need to allow projects that don't exist through
- if(project != null && (project.isOpen() || !project.exists())) {
- return true;
- }
- }
- }
- catch (CoreException e) {}
- }
- return false;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CollapseAllLaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CollapseAllLaunchConfigurationAction.java
deleted file mode 100644
index a8ab1d7d7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CollapseAllLaunchConfigurationAction.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.TreeViewer;
-
-/**
- * Provides a collapse all button for the launch configuration viewer toolbar
- * @since 3.2
- */
-public class CollapseAllLaunchConfigurationAction extends Action {
-
- /**
- * Action identifier for IDebugView#getAction(String)
- */
- public static final String ID_COLLAPSEALL_ACTION = DebugUIPlugin.getUniqueIdentifier() + ".ID_COLLAPSEALL_ACTION"; //$NON-NLS-1$
-
- /**
- * the viewer to perform the collapse all on
- */
- private TreeViewer fViewer = null;
-
- /**
- * Constructor
- * @param viewer the viewer to perform the collapse all on
- */
- public CollapseAllLaunchConfigurationAction(TreeViewer viewer) {
- fViewer = viewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_COLLAPSE_ALL);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getText()
- */
- public String getText() {
- return LaunchConfigurationsMessages.CollapseAllLaunchConfigurationAction_0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getToolTipText()
- */
- public String getToolTipText() {
- return LaunchConfigurationsMessages.CollapseAllLaunchConfigurationAction_1;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getDisabledImageDescriptor()
- */
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_COLLAPSE_ALL);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- fViewer.collapseAll();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getDescription()
- */
- public String getDescription() {
- return LaunchConfigurationsMessages.CollapseAllLaunchConfigurationAction_2;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorProjectPromptStatusHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorProjectPromptStatusHandler.java
deleted file mode 100644
index 3c1d9a950..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorProjectPromptStatusHandler.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.IStatusHandler;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.widgets.Shell;
-
-import com.ibm.icu.text.MessageFormat;
-
-
-public class CompileErrorProjectPromptStatusHandler implements IStatusHandler {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
- */
- public Object handleStatus(IStatus status, Object source) throws CoreException {
- ILaunchConfiguration config = null;
- List projects = new ArrayList();
-
- if (source instanceof List) {
- List args = (List) source;
- Iterator iterator = args.iterator();
- while (iterator.hasNext()) {
- Object arg = iterator.next();
- if (arg instanceof ILaunchConfiguration) {
- config = (ILaunchConfiguration) arg;
- if (DebugUITools.isPrivate(config)) {
- return Boolean.TRUE;
- }
- } else if (arg instanceof IProject) {
- projects.add(arg);
- }
- }
- }
- Shell shell = DebugUIPlugin.getShell();
- StringBuffer projectList = new StringBuffer();
- //we need to limit this
- int size = Math.min(20, projects.size());
- for (int i = 0; i < size; i++) {
- if (i > 0) {
- projectList.append(", "); //$NON-NLS-1$
- }
- projectList.append(((IProject)projects.get(i)).getName());
- }
- String projectMessage = null;
- if(projects.size() > 20) {
- projectMessage = MessageFormat.format(LaunchConfigurationsMessages.CompileErrorProjectPromptStatusHandler_0, new Object[]{projectList.toString()});
- } else{
- projectMessage = projectList.toString();
- }
- String title = LaunchConfigurationsMessages.CompileErrorPromptStatusHandler_0;
- String message = MessageFormat.format(LaunchConfigurationsMessages.CompileErrorPromptStatusHandler_2, new String[]{projectMessage});
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
-
- String pref = store.getString(IInternalDebugUIConstants.PREF_CONTINUE_WITH_COMPILE_ERROR);
- if (pref != null) {
- if (pref.equals(MessageDialogWithToggle.ALWAYS)) {
- return Boolean.TRUE;
- }
- }
- MessageDialogWithToggle dialog = new MessageDialogWithToggle(shell,
- title,
- null,
- message,
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.PROCEED_LABEL, IDialogConstants.CANCEL_LABEL},
- 0,
- LaunchConfigurationsMessages.CompileErrorProjectPromptStatusHandler_1,
- false);
- int open = dialog.open();
- if (open == IDialogConstants.PROCEED_ID) {
- if(dialog.getToggleState()) {
- store.setValue(IInternalDebugUIConstants.PREF_CONTINUE_WITH_COMPILE_ERROR, MessageDialogWithToggle.ALWAYS);
- }
- return Boolean.TRUE;
- }
- else {
- return Boolean.FALSE;
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorPromptStatusHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorPromptStatusHandler.java
deleted file mode 100644
index ac0805393..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorPromptStatusHandler.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.IStatusHandler;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.widgets.Shell;
-
-
-public class CompileErrorPromptStatusHandler implements IStatusHandler {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
- */
- public Object handleStatus(IStatus status, Object source) throws CoreException {
- if (source instanceof ILaunchConfiguration) {
- ILaunchConfiguration config = (ILaunchConfiguration)source;
- if (DebugUITools.isPrivate(config)) {
- return Boolean.TRUE;
- }
- }
-
- Shell shell = DebugUIPlugin.getShell();
- String title = LaunchConfigurationsMessages.CompileErrorPromptStatusHandler_0;
- String message = LaunchConfigurationsMessages.CompileErrorPromptStatusHandler_1;
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
-
- String pref = store.getString(IInternalDebugUIConstants.PREF_CONTINUE_WITH_COMPILE_ERROR);
- if (pref != null) {
- if (pref.equals(MessageDialogWithToggle.ALWAYS)) {
- return Boolean.TRUE;
- }
- }
- MessageDialogWithToggle dialog = new MessageDialogWithToggle(
- shell,
- title,
- null,
- message,
- MessageDialog.WARNING,
- new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL},
- 1,
- LaunchConfigurationsMessages.CompileErrorProjectPromptStatusHandler_1,
- false);
- dialog.setPrefKey(IInternalDebugUIConstants.PREF_CONTINUE_WITH_COMPILE_ERROR);
- dialog.setPrefStore(store);
- dialog.open();
-
- int returnValue = dialog.getReturnCode();
- if (returnValue == IDialogConstants.YES_ID) {
- return Boolean.TRUE;
- }
- return Boolean.FALSE;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationAction.java
deleted file mode 100644
index b13ca8d21..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationAction.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Creates a new launch configuration based on the selection.
- */
-public class CreateLaunchConfigurationAction extends AbstractLaunchConfigurationAction {
-
- /**
- * Action identifier for IDebugView#getAction(String)
- */
- public static final String ID_CREATE_ACTION = DebugUIPlugin.getUniqueIdentifier() + ".ID_CREATE_ACTION"; //$NON-NLS-1$
-
- /**
- * Constructs an action to create a launch configuration
- */
- public CreateLaunchConfigurationAction(Viewer viewer, String mode) {
- super(LaunchConfigurationsMessages.CreateLaunchConfigurationAction_Ne_w_1, viewer, mode);
- }
-
- /**
- * @see AbstractLaunchConfigurationAction#performAction()
- */
- protected void performAction() {
- Object object = getStructuredSelection().getFirstElement();
- //double click with Ctrl key mask results in empty selection: bug 156087
- //do no work if the selection is null
- if(object != null) {
- ILaunchConfigurationType type= null;
- // Construct a new config of the selected type
- if (object instanceof ILaunchConfiguration) {
- ILaunchConfiguration config= (ILaunchConfiguration) object;
- try {
- type = config.getType();
- } catch (CoreException e) {
- errorDialog(e);
- return;
- }
- } else {
- type = (ILaunchConfigurationType) object;
- }
- try {
- ILaunchConfigurationWorkingCopy wc = type.newInstance(null, DebugPlugin.getDefault().getLaunchManager().generateUniqueLaunchConfigurationNameFrom(LaunchConfigurationsMessages.CreateLaunchConfigurationAction_New_configuration_2));
- ILaunchConfigurationTabGroup tabGroup = LaunchConfigurationPresentationManager.getDefault().getTabGroup(wc, getMode());
- // this only works because this action is only present when the dialog is open
- ILaunchConfigurationDialog dialog = LaunchConfigurationsDialog.getCurrentlyVisibleLaunchConfigurationDialog();
- tabGroup.createTabs(dialog, dialog.getMode());
- ILaunchConfigurationTab[] tabs = tabGroup.getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].setLaunchConfigurationDialog(dialog);
- }
- tabGroup.setDefaults(wc);
- tabGroup.dispose();
- wc.doSave();
- } catch (CoreException e) {
- errorDialog(e);
- return;
- }
- }
- }
-
- /**
- * @see org.eclipse.ui.actions.SelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- return selection.size() == 1;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getDisabledImageDescriptor()
- */
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_NEW_CONFIG);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_NEW_CONFIG);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getToolTipText()
- */
- public String getToolTipText() {
- return LaunchConfigurationsMessages.LaunchConfigurationsDialog_0;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DebugModePromptStatusHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DebugModePromptStatusHandler.java
deleted file mode 100644
index b56132adc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DebugModePromptStatusHandler.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.IStatusHandler;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.widgets.Shell;
-
-
-public class DebugModePromptStatusHandler implements IStatusHandler {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
- */
- public Object handleStatus(IStatus status, Object source) throws CoreException {
- if (source instanceof ILaunchConfiguration) {
- ILaunchConfiguration config = (ILaunchConfiguration)source;
- if (DebugUITools.isPrivate(config)) {
- return Boolean.FALSE;
- }
- }
-
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- ILaunchConfiguration configuration = (ILaunchConfiguration)source;
- String pref = store.getString(IInternalDebugUIConstants.PREF_RELAUNCH_IN_DEBUG_MODE);
- if (pref != null) {
- if (pref.equals(MessageDialogWithToggle.NEVER)) {
- return Boolean.FALSE;
- } else if (pref.equals(MessageDialogWithToggle.ALWAYS)) {
- relaunchInDebugMode(configuration);
- return Boolean.TRUE;
- }
- }
-
- Shell activeShell = DebugUIPlugin.getShell();
- String title = LaunchConfigurationsMessages.DebugModePromptStatusHandler_0;
- String message = LaunchConfigurationsMessages.DebugModePromptStatusHandler_1;
-
- MessageDialogWithToggle dialog = MessageDialogWithToggle.openYesNoCancelQuestion(activeShell, title, message, null, false, store, IInternalDebugUIConstants.PREF_RELAUNCH_IN_DEBUG_MODE);
- int buttonId = dialog.getReturnCode();
- if (buttonId == IDialogConstants.YES_ID) {
- relaunchInDebugMode(configuration);
- return Boolean.TRUE; // stops launch
- } else if (buttonId == IDialogConstants.NO_ID) {
- return Boolean.FALSE; // continue launch
- } else { //CANCEL
- return Boolean.TRUE; // stops the launch
- }
- }
- /**
- * @param configuration
- */
- private void relaunchInDebugMode(ILaunchConfiguration configuration) {
- DebugUITools.launch(configuration, ILaunchManager.DEBUG_MODE);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeleteLaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeleteLaunchConfigurationAction.java
deleted file mode 100644
index 7738c162c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeleteLaunchConfigurationAction.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Deletes the selected launch configuration(s).
- */
-public class DeleteLaunchConfigurationAction extends AbstractLaunchConfigurationAction {
-
- /**
- * Action identifier for IDebugView#getAction(String)
- */
- public static final String ID_DELETE_ACTION = DebugUIPlugin.getUniqueIdentifier() + ".ID_DELETE_ACTION"; //$NON-NLS-1$
-
- /**
- * Constructs an action to delete launch configuration(s)
- */
- public DeleteLaunchConfigurationAction(Viewer viewer, String mode) {
- super(LaunchConfigurationsMessages.DeleteLaunchConfigurationAction_Dele_te_1, viewer, mode);
- }
-
- /**
- * Determines if the action can delete the select launch configuration(s) or not
- * @return true if the selected launch configuration(s) can be deleted or not
- * @since 3.3
- */
- protected boolean shouldDelete() {
- IStructuredSelection selection = getStructuredSelection();
- // Make the user confirm the deletion
- String dialogMessage = selection.size() > 1 ? LaunchConfigurationsMessages.LaunchConfigurationDialog_Do_you_wish_to_delete_the_selected_launch_configurations__1 : LaunchConfigurationsMessages.LaunchConfigurationDialog_Do_you_wish_to_delete_the_selected_launch_configuration__2; //
- return MessageDialog.openQuestion(getShell(), LaunchConfigurationsMessages.LaunchConfigurationDialog_Confirm_Launch_Configuration_Deletion_3, dialogMessage);
- }
-
- /**
- * @see AbstractLaunchConfigurationAction#performAction()
- */
- protected void performAction() {
- if(!shouldDelete()) {
- return;
- }
- IStructuredSelection selection = getStructuredSelection();
-
- getViewer().getControl().setRedraw(false);
- Iterator iterator = selection.iterator();
- while (iterator.hasNext()) {
- ILaunchConfiguration configuration = (ILaunchConfiguration)iterator.next();
- try {
- configuration.delete();
- } catch (CoreException e) {
- errorDialog(e);
- }
- }
- getViewer().getControl().setRedraw(true);
- }
-
- /**
- * @see org.eclipse.ui.actions.SelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- if (selection.isEmpty()) {
- return false;
- }
- Iterator items = selection.iterator();
- while (items.hasNext()) {
- if (!(items.next() instanceof ILaunchConfiguration)) {
- return false;
- }
- }
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getDisabledImageDescriptor()
- */
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DELETE_CONFIG);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DELETE_CONFIG);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getToolTipText()
- */
- public String getToolTipText() {
- return LaunchConfigurationsMessages.LaunchConfigurationsDialog_1;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java
deleted file mode 100644
index fb68746ca..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-/**
- *
- * Provides implementation to filter unavailable projects form the launch configuration dialog.
- * It is (de) activated via the <code>IInternalDebugUIConstants.PREF_FILTER_LAUNCH_DELETED</code> preference.
- *
- * @since 3.2
- *
- */
-public class DeletedProjectFilter extends ViewerFilter {
-
- /**
- * Constructor
- */
- public DeletedProjectFilter() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- //always let through types, we only care about configs
- if (element instanceof ILaunchConfigurationType) {
- return true;
- }
- if(element instanceof ILaunchConfiguration) {
- try {
- ILaunchConfiguration config = (ILaunchConfiguration)element;
- IResource[] resources = config.getMappedResources();
- if(resources == null) {
- return true;
- }
- for(int i = 0; i < resources.length; i++) {
- IProject project= resources[i].getProject();
- if(project != null && project.exists()) {
- return true;
- }
- }
- }
- catch(CoreException e) {}
- }
- return false;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchConfigurationAction.java
deleted file mode 100644
index 825ed3c4a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchConfigurationAction.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Duplicates the selected launch configuration.
- */
-public class DuplicateLaunchConfigurationAction extends AbstractLaunchConfigurationAction {
-
- /**
- * Action identifier for IDebugView#getAction(String)
- */
- public static final String ID_DUPLICATE_ACTION = DebugUIPlugin.getUniqueIdentifier() + ".ID_DUPLICATE_ACTION"; //$NON-NLS-1$
-
- /**
- * Constructs an action to duplicate a launch configuration
- */
- public DuplicateLaunchConfigurationAction(Viewer viewer, String mode) {
- super(LaunchConfigurationsMessages.DuplicateLaunchConfigurationAction__Duplicate_1, viewer, mode);
- }
-
- /**
- * @see AbstractLaunchConfigurationAction#performAction()
- */
- protected void performAction() {
- ILaunchConfiguration original = (ILaunchConfiguration)getStructuredSelection().getFirstElement();
- String newName = DebugPlugin.getDefault().getLaunchManager().generateUniqueLaunchConfigurationNameFrom(original.getName());
- try {
- ILaunchConfigurationWorkingCopy newWorkingCopy = original.copy(newName);
- newWorkingCopy.doSave();
- } catch (CoreException e) {
- errorDialog(e);
- }
- }
-
- /**
- * @see org.eclipse.ui.actions.SelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- return selection.size() == 1 && selection.getFirstElement() instanceof ILaunchConfiguration;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getDisabledImageDescriptor()
- */
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DUPLICATE_CONFIG);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DUPLICATE_CONFIG);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getToolTipText()
- */
- public String getToolTipText() {
- return LaunchConfigurationsMessages.LaunchConfigurationsDialog_5;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchDelegatesStatusHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchDelegatesStatusHandler.java
deleted file mode 100644
index a599a91ce..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchDelegatesStatusHandler.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import java.util.HashSet;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchDelegate;
-import org.eclipse.debug.core.IStatusHandler;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This class provides a mechanism to prompt users in the UI thread from debug.core in the case where
- * duplicate launch delegates have been detected and a preferred delegate needs to be selected.
- *
- * As this handler is used once a launch has been started, and only prompts in the event that the launch <i>can</i>
- * continue with further input, it must be a blocking operation.
- *
- * @since 3.3
- */
-public class DuplicateLaunchDelegatesStatusHandler implements IStatusHandler {
-
- /**
- * @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
- */
- public Object handleStatus(IStatus status, Object source) throws CoreException {
- if(source instanceof Object[]) {
- Object[] infos = (Object[]) source;
- if(infos.length == 2) {
- ILaunchConfiguration config = (ILaunchConfiguration) infos[0];
- String mode = (String) infos[1];
- Shell shell = DebugUIPlugin.getShell();
- HashSet modes = new HashSet();
- modes.add(mode);
- modes.addAll(config.getModes());
- SelectLaunchersDialog sldd = new SelectLaunchersDialog(shell,
- config.getType().getDelegates(modes),
- config.getWorkingCopy(),
- mode);
- if(sldd.open() != IDialogConstants.OK_ID) {
- return Status.CANCEL_STATUS;
- }
- //check that the delegate has been set
- ILaunchDelegate delegate = config.getPreferredDelegate(modes);
- if(delegate == null) {
- delegate = config.getType().getPreferredDelegate(modes);
- }
- return (delegate == null ? Status.CANCEL_STATUS : Status.OK_STATUS);
- }
- }
- return Status.CANCEL_STATUS;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/EnvironmentVariable.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/EnvironmentVariable.java
deleted file mode 100644
index c93c3aede..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/EnvironmentVariable.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 Keith Seitz and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Keith Seitz (keiths@redhat.com) - initial implementation
- * IBM Corporation - integration and code cleanup
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-/**
- * A key/value set whose data is passed into Runtime.exec(...)
- */
-public class EnvironmentVariable
-{
- // The name of the environment variable
- private String name;
-
- // The value of the environment variable
- private String value;
-
- public EnvironmentVariable(String name, String value)
- {
- this.name = name;
- this.value = value;
- }
-
- /**
- * Returns this variable's name, which serves as the key in the key/value
- * pair this variable represents
- *
- * @return this variable's name
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Returns this variables value.
- *
- * @return this variable's value
- */
- public String getValue()
- {
- return value;
- }
-
- /**
- * Sets this variable's value
- * @param value
- */
- public void setValue(String value)
- {
- this.value = value;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return getName();
- }
-
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- boolean equal = false;
- if (obj instanceof EnvironmentVariable) {
- EnvironmentVariable var = (EnvironmentVariable)obj;
- equal = var.getName().equals(name);
- }
- return equal;
- }
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return name.hashCode();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java
deleted file mode 100644
index 7bedac0cd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java
+++ /dev/null
@@ -1,471 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.TrayDialog;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Dialog for organizing favorite launch configurations
- */
-public class FavoritesDialog extends TrayDialog {
-
- /**
- * Table of favorite launch configurations
- */
- private TableViewer fFavoritesTable;
-
- // history being organized
- private LaunchHistory fHistory;
-
- // favorites collection under edit
- private List fFavorites;
-
- // buttons
- protected Button fAddFavoriteButton;
- protected Button fRemoveFavoritesButton;
- protected Button fMoveUpButton;
- protected Button fMoveDownButton;
-
- // button action handler
- /**
- * Listener that delegates when a button is pressed
- */
- private SelectionAdapter fButtonListener= new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- Button button = (Button) e.widget;
- if (button == fAddFavoriteButton) {
- handleAddConfigButtonSelected();
- } else if (button == fRemoveFavoritesButton) {
- removeSelectedFavorites();
- } else if (button == fMoveUpButton) {
- handleMoveUpButtonSelected();
- } else if (button == fMoveDownButton) {
- handleMoveDownButtonSelected();
- }
- }
- };
-
- /**
- * Listener that delegates when the selection changes in a table
- */
- private ISelectionChangedListener fSelectionChangedListener= new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- handleFavoriteSelectionChanged();
- }
- };
-
- /**
- * Listener that delegates when a key is pressed in a table
- */
- private KeyListener fKeyListener= new KeyAdapter() {
- public void keyPressed(KeyEvent event) {
- if (event.character == SWT.DEL && event.stateMask == 0) {
- removeSelectedFavorites();
- }
- }
- };
-
- /**
- * Content provider for favorites table
- */
- protected class FavoritesContentProvider implements IStructuredContentProvider {
- public Object[] getElements(Object inputElement) {
- ILaunchConfiguration[] favorites= (ILaunchConfiguration[]) getFavorites().toArray(new ILaunchConfiguration[0]);
- return LaunchConfigurationManager.filterConfigs(favorites);
- }
- public void dispose() {}
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
- }
-
- /**
- * Constructs a favorites dialog.
- *
- * @param parentShell shell to open the dialog on
- * @param history launch history to edit
- */
- public FavoritesDialog(Shell parentShell, LaunchHistory history) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- fHistory = history;
- }
-
- /**
- * The 'add config' button has been pressed
- */
- protected void handleAddConfigButtonSelected() {
- SelectFavoritesDialog sfd = new SelectFavoritesDialog(fFavoritesTable.getControl().getShell(), getLaunchHistory(), getFavorites());
- sfd.open();
- Object[] selection = sfd.getResult();
- if (selection != null) {
- for (int i = 0; i < selection.length; i++) {
- getFavorites().add(selection[i]);
- }
- updateStatus();
- }
- }
-
- /**
- * The 'remove favorites' button has been pressed
- */
- protected void removeSelectedFavorites() {
- IStructuredSelection sel = (IStructuredSelection)getFavoritesTable().getSelection();
- Iterator iter = sel.iterator();
- while (iter.hasNext()) {
- Object config = iter.next();
- getFavorites().remove(config);
- }
- getFavoritesTable().refresh();
- }
-
- /**
- * The 'move up' button has been pressed
- */
- protected void handleMoveUpButtonSelected() {
- handleMove(-1);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#getInitialSize()
- */
- protected Point getInitialSize() {
- return new Point(350, 400);
- }
-
- /**
- * The 'move down' button has been pressed
- */
- protected void handleMoveDownButtonSelected() {
- handleMove(1);
- }
-
- /**
- * Handles moving a favorite up or down the listing
- * @param direction the direction to make the move (up or down)
- */
- protected void handleMove(int direction) {
- IStructuredSelection sel = (IStructuredSelection)getFavoritesTable().getSelection();
- List selList= sel.toList();
- Object[] movedFavs= new Object[getFavorites().size()];
- int i;
- for (Iterator favs = selList.iterator(); favs.hasNext();) {
- Object config = favs.next();
- i= getFavorites().indexOf(config);
- movedFavs[i + direction]= config;
- }
-
- getFavorites().removeAll(selList);
-
- for (int j = 0; j < movedFavs.length; j++) {
- Object config = movedFavs[j];
- if (config != null) {
- getFavorites().add(j, config);
- }
- }
- getFavoritesTable().refresh();
- handleFavoriteSelectionChanged();
- }
-
- /**
- * Returns the table of favorite launch configurations.
- *
- * @return table viewer
- */
- protected TableViewer getFavoritesTable() {
- return fFavoritesTable;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- getShell().setText(MessageFormat.format(LaunchConfigurationsMessages.FavoritesDialog_1, new String[]{getModeLabel()}));
- createFavoritesArea(composite);
- handleFavoriteSelectionChanged();
- return composite;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Control contents = super.createContents(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getDialogArea(), IDebugHelpContextIds.ORGANIZE_FAVORITES_DIALOG);
- return contents;
- }
-
- /**
- * Returns a label to use for launch mode with accelerators removed.
- *
- * @return label to use for launch mode with accelerators removed
- */
- private String getModeLabel() {
- return DebugUIPlugin.removeAccelerators(fHistory.getLaunchGroup().getLabel());
- }
-
- /**
- * Creates the main area of the dialog
- * @param parent the parent to add this content to
- */
- protected void createFavoritesArea(Composite parent) {
- Composite topComp = SWTFactory.createComposite(parent, parent.getFont(), 2, 1, GridData.FILL_BOTH, 0, 0);
- SWTFactory.createLabel(topComp, LaunchConfigurationsMessages.FavoritesDialog_2, 2);
- fFavoritesTable = createTable(topComp, new FavoritesContentProvider());
- Composite buttonComp = SWTFactory.createComposite(topComp, topComp.getFont(), 1, 1, GridData.VERTICAL_ALIGN_BEGINNING, 0, 0);
- fAddFavoriteButton = SWTFactory.createPushButton(buttonComp, LaunchConfigurationsMessages.FavoritesDialog_3, null);
- fAddFavoriteButton.addSelectionListener(fButtonListener);
- fAddFavoriteButton.setEnabled(true);
- fRemoveFavoritesButton = SWTFactory.createPushButton(buttonComp, LaunchConfigurationsMessages.FavoritesDialog_4, null);
- fRemoveFavoritesButton.addSelectionListener(fButtonListener);
- fMoveUpButton = SWTFactory.createPushButton(buttonComp, LaunchConfigurationsMessages.FavoritesDialog_5, null);
- fMoveUpButton.addSelectionListener(fButtonListener);
- fMoveDownButton = SWTFactory.createPushButton(buttonComp, LaunchConfigurationsMessages.FavoritesDialog_6, null);
- fMoveDownButton.addSelectionListener(fButtonListener);
- }
-
- /**
- * Creates a fully configured table with the given content provider
- */
- private TableViewer createTable(Composite parent, IContentProvider contentProvider) {
- TableViewer tableViewer= new TableViewer(parent, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION);
- tableViewer.setLabelProvider(DebugUITools.newDebugModelPresentation());
- tableViewer.setContentProvider(contentProvider);
- tableViewer.setInput(DebugUIPlugin.getDefault());
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.widthHint = 100;
- gd.heightHint = 100;
- tableViewer.getTable().setLayoutData(gd);
- tableViewer.getTable().setFont(parent.getFont());
- tableViewer.addSelectionChangedListener(fSelectionChangedListener);
- tableViewer.getControl().addKeyListener(fKeyListener);
- return tableViewer;
- }
-
- /**
- * Returns the current list of favorites.
- */
- protected List getFavorites() {
- if (fFavorites == null) {
- ILaunchConfiguration[] favs = getInitialFavorites();
- fFavorites = new ArrayList(favs.length);
- addAll(favs, fFavorites);
- }
- return fFavorites;
- }
-
- protected LaunchHistory getLaunchHistory() {
- return fHistory;
- }
-
- /**
- * Returns the initial content for the favorites list
- */
- protected ILaunchConfiguration[] getInitialFavorites() {
- return getLaunchHistory().getFavorites();
- }
-
- /**
- * Returns the mode of this page - run or debug.
- */
- protected String getMode() {
- return getLaunchHistory().getLaunchGroup().getMode();
- }
-
- /**
- * Copies the array into the list
- */
- protected void addAll(Object[] array, List list) {
- for (int i = 0; i < array.length; i++) {
- list.add(array[i]);
- }
- }
-
- /**
- * Refresh all tables and buttons
- */
- protected void updateStatus() {
- getFavoritesTable().refresh();
- handleFavoriteSelectionChanged();
- }
-
- /**
- * The selection in the favorites list has changed
- */
- protected void handleFavoriteSelectionChanged() {
- IStructuredSelection selection = (IStructuredSelection)getFavoritesTable().getSelection();
- List favs = getFavorites();
- boolean notEmpty = !selection.isEmpty();
- Iterator elements= selection.iterator();
- boolean first= false;
- boolean last= false;
- int lastFav= favs.size() - 1;
- while (elements.hasNext()) {
- Object element = elements.next();
- if(!first && favs.indexOf(element) == 0) {
- first= true;
- }
- if (!last && favs.indexOf(element) == lastFav) {
- last= true;
- }
- }
-
- fRemoveFavoritesButton.setEnabled(notEmpty);
- fMoveUpButton.setEnabled(notEmpty && !first);
- fMoveDownButton.setEnabled(notEmpty && !last);
- }
-
- /**
- * Method performOK. Uses scheduled Job format.
- * @since 3.2
- */
- public void saveFavorites() {
-
- final Job job = new Job(LaunchConfigurationsMessages.FavoritesDialog_8) {
- protected IStatus run(IProgressMonitor monitor) {
- ILaunchConfiguration[] initial = getInitialFavorites();
- List current = getFavorites();
- String groupId = getLaunchHistory().getLaunchGroup().getIdentifier();
-
- int taskSize = Math.abs(initial.length-current.size());//get task size
- monitor.beginTask(LaunchConfigurationsMessages.FavoritesDialog_8, taskSize);//and set it
-
- // removed favorites
- for (int i = 0; i < initial.length; i++) {
- ILaunchConfiguration configuration = initial[i];
- if (!current.contains(configuration)) {
- // remove fav attributes
- try {
- ILaunchConfigurationWorkingCopy workingCopy = configuration.getWorkingCopy();
- workingCopy.setAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, (String)null);
- workingCopy.setAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, (String)null);
- List groups = workingCopy.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List)null);
- if (groups != null) {
- groups.remove(groupId);
- if (groups.isEmpty()) {
- groups = null;
- }
- workingCopy.setAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, groups);
- }
- workingCopy.doSave();
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- return Status.CANCEL_STATUS;
- }
- }
- monitor.worked(1);
- }
-
- // update added favorites
- Iterator favs = current.iterator();
- while (favs.hasNext()) {
- ILaunchConfiguration configuration = (ILaunchConfiguration)favs.next();
- try {
- List groups = configuration.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List)null);
- if (groups == null) {
- groups = new ArrayList();
- }
- if (!groups.contains(groupId)) {
- groups.add(groupId);
- ILaunchConfigurationWorkingCopy workingCopy = configuration.getWorkingCopy();
- workingCopy.setAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, groups);
- workingCopy.doSave();
- }
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- return Status.CANCEL_STATUS;
- }
- monitor.worked(1);
- }
-
- fHistory.setFavorites(getArray(current));
- monitor.done();
- return Status.OK_STATUS;
- }
- };
- job.setPriority(Job.LONG);
- PlatformUI.getWorkbench().getProgressService().showInDialog(getParentShell(), job);
- job.schedule();
-
- }
-
- protected ILaunchConfiguration[] getArray(List list) {
- return (ILaunchConfiguration[])list.toArray(new ILaunchConfiguration[list.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- saveFavorites();
- super.okPressed();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
- */
- protected IDialogSettings getDialogBoundsSettings() {
- IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(getDialogSettingsSectionName());
- if (section == null) {
- section = settings.addNewSection(getDialogSettingsSectionName());
- }
- return section;
- }
-
- /**
- * Returns the name of the section that this dialog stores its settings in
- *
- * @return String
- */
- private String getDialogSettingsSectionName() {
- return "FAVORITES_DIALOG_SECTION"; //$NON-NLS-1$
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterDropDownMenuCreator.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterDropDownMenuCreator.java
deleted file mode 100644
index 507392032..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterDropDownMenuCreator.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-
-/**
- * Creates the drop down menu for the filtering button in the launch configuration dialog
- * @since 3.2
- */
-public class FilterDropDownMenuCreator implements IMenuCreator {
-
- /**
- * Provides wrapper action for filtering actions on the launch configuration dialog
- * @since 3.2
- */
- class FilterAction extends Action {
-
- /** The preference store. */
- private IPreferenceStore fStore = null;
-
- /** The preference key for the value in the store. */
- private String fKey = null;
-
- /**
- * Constructor for check style menu items
- * @param store the pref store
- * @param name the name of the action
- * @param key the pref key it is tied to
- */
- public FilterAction(Menu menu, IPreferenceStore store, String name, String key) {
- super(name, IAction.AS_CHECK_BOX);
- fStore = store;
- fKey = key;
- setChecked(fStore.getBoolean(fKey));
- fillIntoMenu(menu, this);
- }
-
- /**
- * Constructor for flyout menu style actions
- * @param menu the parent menu
- * @param name the text of the action
- * @param creator the menu creator for this action
- */
- public FilterAction(Menu menu, String name, IMenuCreator creator) {
- super(name, IAction.AS_DROP_DOWN_MENU);
- setMenuCreator(creator);
- fillIntoMenu(menu, this);
- }
-
- /**
- * fills the new action into the specified menu
- * @param menu the parent menu
- * @param action the new aciton to fill in to the parent
- */
- private void fillIntoMenu(Menu menu, IAction action) {
- ActionContributionItem item = new ActionContributionItem(action);
- item.fill(menu, -1);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- if(fStore != null) {
- fStore.setValue(fKey, isChecked());
- }
- }
- }
-
- /**
- * the menu created via this class
- */
- private Menu fCreatedMenu = null;
-
- /**
- * gets the DebugUIPlugin preference store
- * @return the pref store
- */
- private IPreferenceStore getDebugPrefStore() {
- return DebugUIPlugin.getDefault().getPreferenceStore();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#dispose()
- */
- public void dispose() {
- fCreatedMenu = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
- */
- public Menu getMenu(Control parent) {
- if(fCreatedMenu != null) {
- fCreatedMenu.dispose();
- }
- //create the menu & items
- fCreatedMenu = new Menu(parent);
- new FilterAction(fCreatedMenu, getDebugPrefStore(), LaunchConfigurationsMessages.FilterDropDownMenuCreator_0, IInternalDebugUIConstants.PREF_FILTER_LAUNCH_CLOSED);
- new FilterAction(fCreatedMenu, getDebugPrefStore(), LaunchConfigurationsMessages.FilterDropDownMenuCreator_1, IInternalDebugUIConstants.PREF_FILTER_LAUNCH_DELETED);
- new FilterAction(fCreatedMenu, getDebugPrefStore(), LaunchConfigurationsMessages.FilterDropDownMenuCreator_2, IInternalDebugUIConstants.PREF_FILTER_LAUNCH_TYPES);
- new FilterAction(fCreatedMenu, getDebugPrefStore(), LaunchConfigurationsMessages.FilterDropDownMenuCreator_4, IInternalDebugUIConstants.PREF_FILTER_WORKING_SETS);
-
- //add separator
- new MenuItem(fCreatedMenu, SWT.SEPARATOR);
-
- //add pref action
- IAction action = new Action(LaunchConfigurationsMessages.FilterDropDownMenuCreator_3) {
- public void run() {
- SWTFactory.showPreferencePage("org.eclipse.debug.ui.LaunchConfigurations"); //$NON-NLS-1$
- }
- };
- new ActionContributionItem(action).fill(fCreatedMenu, -1);
- return fCreatedMenu;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
- */
- public Menu getMenu(Menu parent) {
- return fCreatedMenu;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterLaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterLaunchConfigurationAction.java
deleted file mode 100644
index e6fd293d3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterLaunchConfigurationAction.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * provides the implementation of the filtering action for the launch configuration view within the
- * Launch Configuration Dialog
- * @since 3.2
- */
-public class FilterLaunchConfigurationAction extends Action {
-
- /**
- * Action identifier for IDebugView#getAction(String)
- */
- public static final String ID_FILTER_ACTION = DebugUIPlugin.getUniqueIdentifier() + ".ID_FILTER_ACTION"; //$NON-NLS-1$
-
- /**
- * the menu for this drop down style action
- */
- private FilterDropDownMenuCreator fMenuCreator;
-
- /**
- * Constructor
- * @param text the text for the action
- * @param viewer the viewer the action acts upon
- * @param mode the mode
- */
- public FilterLaunchConfigurationAction() {
- super(LaunchConfigurationsMessages.FilterLaunchConfigurationAction_0, IAction.AS_DROP_DOWN_MENU);
- fMenuCreator = new FilterDropDownMenuCreator();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- SWTFactory.showPreferencePage("org.eclipse.debug.ui.LaunchConfigurations"); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getDescription()
- */
- public String getDescription() {
- return LaunchConfigurationsMessages.LaunchConfigurationsDialog_4;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getDisabledImageDescriptor()
- */
- public ImageDescriptor getDisabledImageDescriptor() {
- return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_FILTER_CONFIGS);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_FILTER_CONFIGS);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getMenuCreator()
- */
- public IMenuCreator getMenuCreator() {
- return fMenuCreator;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getToolTipText()
- */
- public String getToolTipText() {
- return LaunchConfigurationsMessages.LaunchConfigurationsDialog_4;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchCategoryFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchCategoryFilter.java
deleted file mode 100644
index ae6e65f4b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchCategoryFilter.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.ui.activities.WorkbenchActivityHelper;
-
-/**
- * Filters (hides) launch configurations and launch configuration
- * types from a specific launch category.
- */
-public class LaunchCategoryFilter extends ViewerFilter {
-
- private String fCategory;
-
- /**
- * Constructs a filter that hides configurations from a specific
- * category.
- *
- * @param groupExtension
- */
- public LaunchCategoryFilter(String category) {
- fCategory = category;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- ILaunchConfigurationType type = null;
- ILaunchConfiguration config = null;
- if (parentElement instanceof ILaunchConfigurationType) {
- type = (ILaunchConfigurationType)parentElement;
- }
- if (element instanceof ILaunchConfigurationType) {
- type = (ILaunchConfigurationType)element;
- }
- if (element instanceof ILaunchConfiguration) {
- config = (ILaunchConfiguration)element;
- try {
- type = config.getType();
- }
- catch (CoreException e) {}
- }
- boolean priv = false;
- if (config != null) {
- try {
- priv = config.getAttribute(IDebugUIConstants.ATTR_PRIVATE, false);
- } catch (CoreException e) {
- }
- } else if (type != null) {
- priv = !type.isPublic();
- }
- if (type != null) {
- return !priv && !equalCategories(type.getCategory(), fCategory) && !WorkbenchActivityHelper.filterItem(new LaunchConfigurationTypeContribution(type));
- }
- return true;
- }
-
- /**
- * Returns whether the given categories are equal.
- *
- * @param c1 category identifier or <code>null</code>
- * @param c2 category identifier or <code>null</code>
- * @return boolean
- */
- private boolean equalCategories(String c1, String c2) {
- if (c1 == null || c2 == null) {
- return c1 == c2;
- }
- return c1.equals(c2);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationComparator.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationComparator.java
deleted file mode 100644
index 0c91d5932..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationComparator.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.ui.model.WorkbenchViewerComparator;
-
-/**
- * Groups configurations by type.
- *
- * @since 3.3
- * CONTEXTLAUNCHING
- */
-public class LaunchConfigurationComparator extends WorkbenchViewerComparator {
-
- /**
- * the map of categories of <code>ILaunchConfigurationType</code>s to <code>Integer</code>s entries
- */
- private static Map fgCategories;
-
- /**
- * @see org.eclipse.jface.viewers.ViewerComparator#category(java.lang.Object)
- */
- public int category(Object element) {
- Map map = getCategories();
- if (element instanceof ILaunchConfiguration) {
- ILaunchConfiguration configuration = (ILaunchConfiguration) element;
- try {
- Integer i = (Integer) map.get(configuration.getType());
- if (i != null) {
- return i.intValue();
- }
- } catch (CoreException e) {
- }
- }
- return map.size();
- }
-
- /**
- * Returns the map of categories
- * @return the map of categories
- */
- private Map getCategories() {
- if (fgCategories == null) {
- fgCategories = new HashMap();
- List types = Arrays.asList(DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes());
- Collections.sort(types, new Comparator() {
- public int compare(Object o1, Object o2) {
- ILaunchConfigurationType t1 = (ILaunchConfigurationType) o1;
- ILaunchConfigurationType t2 = (ILaunchConfigurationType) o2;
- return t1.getName().compareTo(t2.getName());
- }
-
- });
- Iterator iterator = types.iterator();
- int i = 0;
- while (iterator.hasNext()) {
- fgCategories.put(iterator.next(), new Integer(i));
- i++;
- }
- }
- return fgCategories;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java
deleted file mode 100644
index f544212ea..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * A dialog used to edit & launch a single launch configuration.
- */
-public class LaunchConfigurationDialog extends LaunchConfigurationPropertiesDialog {
-
- /**
- * Constructs a dialog
- *
- * @param shell
- * @param launchConfiguration
- * @param group
- */
- public LaunchConfigurationDialog(Shell shell, ILaunchConfiguration launchConfiguration, LaunchGroupExtension group) {
- super(shell, launchConfiguration, group);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
- */
- protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, ID_LAUNCH_BUTTON, getLaunchButtonText(), true);
- createButton(parent, ID_CLOSE_BUTTON, LaunchConfigurationsMessages.LaunchConfigurationDialog_Close_1, false);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#getTitleAreaTitle()
- */
- protected String getTitleAreaTitle() {
- return LaunchConfigurationsMessages.LaunchConfigurationDialog_Modify_attributes_and_launch__1;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.SINGLE_LAUNCH_CONFIGURATION_DIALOG;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#updateButtons()
- */
- public void updateButtons() {
- // Launch button
- getTabViewer().refresh();
- getButton(ID_LAUNCH_BUTTON).setEnabled(getTabViewer().canLaunch() & getTabViewer().canLaunchWithModes() & !getTabViewer().hasDuplicateDelegates());
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#getDialogSettingsSectionName()
- */
- protected String getDialogSettingsSectionName() {
- return IDebugUIConstants.PLUGIN_ID + ".SINGLE_LAUNCH_CONFIGURATION_DIALOG_SECTION"; //$NON-NLS-1$
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationEditDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationEditDialog.java
deleted file mode 100644
index af33234e5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationEditDialog.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This class is used to construct a launch configuration dialog used to edit a launch configuration and continue or cancel (optional),
- * not allowing a launch to occur.
- *
- * @since 3.3
- */
-public class LaunchConfigurationEditDialog extends LaunchConfigurationDialog {
-
- private boolean fShowCancel = false;
-
- /**
- * Constructor
- * @param shell the shell to create this dialog on
- * @param launchConfiguration the launch config that this dialog is allowing you to edit
- * @param group the launch group associated with the showing tab group
- * @param showcancel if the cancel button should be shown or not
- */
- public LaunchConfigurationEditDialog(Shell shell, ILaunchConfiguration launchConfiguration, LaunchGroupExtension group, boolean showcancel) {
- super(shell, launchConfiguration, group);
- fShowCancel = showcancel;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#getTitleAreaTitle()
- */
- protected String getTitleAreaTitle() {
- return LaunchConfigurationsMessages.LaunchConfigurationEditDialog_0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
- */
- protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, ID_LAUNCH_BUTTON, LaunchConfigurationsMessages.LaunchConfigurationEditDialog_1, true);
- if(fShowCancel) {
- createButton(parent, ID_CANCEL_BUTTON, IDialogConstants.CANCEL_LABEL, false);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#updateButtons()
- */
- public void updateButtons() {
- getTabViewer().refresh();
- getButton(ID_LAUNCH_BUTTON).setEnabled(getTabViewer().canLaunch() & getTabViewer().canLaunchWithModes() & !getTabViewer().hasDuplicateDelegates());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#getDialogSettingsSectionName()
- */
- protected String getDialogSettingsSectionName() {
- return IDebugUIConstants.PLUGIN_ID + ".LAUNCH_CONFIGURATION_EDIT_DIALOG_SECTION"; //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#buttonPressed(int)
- */
- protected void buttonPressed(int buttonId) {
- if(buttonId == ID_LAUNCH_BUTTON) {
- setReturnCode(IDialogConstants.OK_ID);
- int status = shouldSaveCurrentConfig();
- if(status != IDialogConstants.CANCEL_ID) {
- if(status != ID_DISCARD_BUTTON) {
- if(status == IDialogConstants.YES_ID) {
- getTabViewer().handleApplyPressed();
- }
- }
- }
- }
- else if(buttonId == ID_CANCEL_BUTTON) {
- setReturnCode(IDialogConstants.CANCEL_ID);
- }
- close();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java
deleted file mode 100644
index d760e0c64..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.HelpEvent;
-import org.eclipse.swt.events.HelpListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.FilteredTree;
-import org.eclipse.ui.dialogs.PatternFilter;
-import org.eclipse.ui.model.WorkbenchViewerComparator;
-
-/**
- * Overrides the default filtered tree to use our own tree viewer which supports preserving selection after filtering
- *
- * @see LaunchConfigurationView
- * @see LaunchConfigurationViewer
- *
- * @since 3.3
- */
-public final class LaunchConfigurationFilteredTree extends FilteredTree {
-
- private ILaunchGroup fLaunchGroup = null;
- private ViewerFilter[] fFilters = null;
- private int fTreeStyle = -1;
- private PatternFilter fPatternFilter = null;
-
- /**
- * Constructor
- * @param parent
- * @param treeStyle
- * @param filter
- */
- public LaunchConfigurationFilteredTree(Composite parent, int treeStyle, PatternFilter filter, ILaunchGroup group, ViewerFilter[] filters) {
- super(parent, treeStyle, filter, true);
- fLaunchGroup = group;
- fFilters = filters;
- fPatternFilter = filter;
- fTreeStyle = treeStyle;
- }
-
- /**
- * @see org.eclipse.ui.dialogs.FilteredTree#doCreateTreeViewer(org.eclipse.swt.widgets.Composite, int)
- */
- protected TreeViewer doCreateTreeViewer(Composite cparent, int style) {
- treeViewer = new LaunchConfigurationViewer(cparent, style);
- treeViewer.setLabelProvider(DebugUITools.newDebugModelPresentation());
- treeViewer.setComparator(new WorkbenchViewerComparator());
- treeViewer.setContentProvider(new LaunchConfigurationTreeContentProvider(fLaunchGroup.getMode(), cparent.getShell()));
- treeViewer.addFilter(new LaunchGroupFilter(fLaunchGroup));
- treeViewer.setInput(ResourcesPlugin.getWorkspace().getRoot());
- if(fFilters != null) {
- for (int i = 0; i < fFilters.length; i++) {
- treeViewer.addFilter(fFilters[i]);
- }
- }
- treeViewer.getControl().addHelpListener(new HelpListener() {
- public void helpRequested(HelpEvent evt) {
- handleHelpRequest(evt);
- }
- });
- return treeViewer;
- }
-
- /**
- * @see org.eclipse.ui.dialogs.FilteredTree#createControl(org.eclipse.swt.widgets.Composite, int)
- */
- protected void createControl(Composite cparent, int treeStyle) {
- super.createControl(cparent, treeStyle);
- setBackground(cparent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
- }
-
- /**
- * @see org.eclipse.ui.dialogs.FilteredTree#init(int, org.eclipse.ui.dialogs.PatternFilter)
- * force it to do nothing so that we can initialize the class properly
- */
- protected void init(int treeStyle, PatternFilter filter) {}
-
- /**
- * This method is used to create the actual set of controls for the dialog
- */
- public void createViewControl() {
- super.init(fTreeStyle, fPatternFilter);
- }
-
- /**
- * Handle help events locally rather than deferring to WorkbenchHelp. This
- * allows help specific to the selected config type to be presented.
- *
- */
- protected void handleHelpRequest(HelpEvent evt) {
- if (getViewer().getTree() != evt.getSource()) {
- return;
- }
- String id = computeContextId();
- if (id != null)
- PlatformUI.getWorkbench().getHelpSystem().displayHelp(id);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.dialogs.FilteredTree#textChanged()
- */
- protected void textChanged() {
- LaunchConfigurationsDialog dialog = (LaunchConfigurationsDialog)LaunchConfigurationsDialog.getCurrentlyVisibleLaunchConfigurationDialog();
- if(dialog == null) {
- return;
- }
- LaunchConfigurationTabGroupViewer viewer = dialog.getTabViewer();
- if(viewer == null) {
- return;
- }
- if(viewer.isDirty()) {
- String text = getFilterString();
- if(text.equals(IInternalDebugCoreConstants.EMPTY_STRING)) {
- //we have removed the last char of select-all delete key, reset like the filter control does
- getPatternFilter().setPattern(null);
- getViewer().refresh();
- return;
- }
- else if(text.equals(getInitialText())) {
- //ignore, this is the default text set from losing focus
- return;
- }
- String message = LaunchConfigurationsMessages.LaunchConfigurationFilteredTree_search_with_errors;
- String title = LaunchConfigurationsMessages.LaunchConfigurationFilteredTree_discard_changes;
- boolean cansave = viewer.canSave();
- if(cansave) {
- message = LaunchConfigurationsMessages.LaunchConfigurationFilteredTree_search_with_changes;
- title = LaunchConfigurationsMessages.LaunchConfigurationFilteredTree_save_changes;
- }
- if(MessageDialog.openQuestion(getShell(), title, message)) {
- if(cansave) {
- viewer.handleApplyPressed();
- }
- else {
- viewer.handleRevertPressed();
- }
- super.textChanged();
- }
- else {
- clearText();
- }
- }
- else {
- super.textChanged();
- }
- }
-
- /**
- * Computes the context id for this viewer
- * @return the context id
- */
- public String computeContextId() {
- try {
- ISelection selection = getViewer().getSelection();
- if (!selection.isEmpty() && selection instanceof IStructuredSelection ) {
- IStructuredSelection structuredSelection = (IStructuredSelection) selection;
- Object firstSelected = structuredSelection.getFirstElement();
- ILaunchConfigurationType configType = null;
- if (firstSelected instanceof ILaunchConfigurationType) {
- configType = (ILaunchConfigurationType) firstSelected;
- }
- else if (firstSelected instanceof ILaunchConfiguration) {
- configType = ((ILaunchConfiguration) firstSelected).getType();
- }
- if (configType != null) {
- String helpContextId = LaunchConfigurationPresentationManager.getDefault().getHelpContext(configType, fLaunchGroup.getMode());
- if (helpContextId != null) {
- return helpContextId;
- }
- }
- }
- }
- catch (CoreException ce) {DebugUIPlugin.log(ce);}
- return null;
- }
-
- /**
- * Returns the launch configuration viewer for this filtered tree
- * @return the tree viewer appropriately cast
- */
- public LaunchConfigurationViewer getLaunchConfigurationViewer() {
- return (LaunchConfigurationViewer) getViewer();
- }
-
- /* (non-Javadoc)
- *
- * Called after a re-filter due to user typing text. Update the filter count
- * in the LCD
- *
- * @see org.eclipse.ui.dialogs.FilteredTree#updateToolbar(boolean)
- */
- protected void updateToolbar(boolean visible) {
- super.updateToolbar(visible);
- // update filter count
- getLaunchConfigurationViewer().filterChanged();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
deleted file mode 100644
index 1ddbe86c2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
+++ /dev/null
@@ -1,1226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.core.expressions.EvaluationContext;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ISaveContext;
-import org.eclipse.core.resources.ISaveParticipant;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-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.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchDelegate;
-import org.eclipse.debug.core.ILaunchListener;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.core.IConfigurationElementConstants;
-import org.eclipse.debug.internal.core.LaunchManager;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.ILaunchHistoryChangedListener;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.activities.IWorkbenchActivitySupport;
-import org.eclipse.ui.activities.WorkbenchActivityHelper;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * Manages UI related launch configuration artifacts
- *
- * Since 3.3 the Launch Configuration Manager is an <code>ISaveParticipant</code>, allowing it to participate in
- * workspace persistence life-cycles.
- *
- * @see ISaveParticipant
- * @see org.eclipse.debug.ui.ILaunchShortcut
- * @see ILaunchGroup
- * @see ILaunchListener
- * @see ILaunchHistoryChangedListener
- * @see DebugUIPlugin
- * @see LaunchHistory
- */
-public class LaunchConfigurationManager implements ILaunchListener, ISaveParticipant {
- /**
- * A comparator for the ordering of launch shortcut extensions
- * @since 3.3
- */
- class ShortcutComparator implements Comparator {
- /**
- * @see Comparator#compare(Object, Object)
- */
- public int compare(Object a, Object b) {
- LaunchShortcutExtension shorcutA = (LaunchShortcutExtension)a;
- String labelA = shorcutA.getLabel();
- String pathA = shorcutA.getMenuPath();
- LaunchShortcutExtension shortcutB = (LaunchShortcutExtension)b;
- String labelB = shortcutB.getLabel();
- String pathB = shortcutB.getMenuPath();
-
- // group by path, then sort by label
- // a null path sorts last (i.e. highest)
- if (nullOrEqual(pathA, pathB)) {
- // null labels sort last (i.e. highest)
- if (labelA == labelB) {
- return 0;
- }
- if (labelA == null) {
- return 1;
- }
- if (labelB == null) {
- return -1;
- }
- return labelA.compareToIgnoreCase(labelB);
- }
- // compare paths
- if (pathA == null) {
- return 1;
- }
- if (pathB == null) {
- return -1;
- }
- return pathA.compareToIgnoreCase(pathB);
- }
-
- private boolean nullOrEqual(String a, String b) {
- if (a == null) {
- return b == null;
- }
- return a.equals(b);
- }
-
- }
-
- /**
- * Launch group extensions, keyed by launch group identifier.
- */
- protected Map fLaunchGroups;
-
- /**
- * Launch histories keyed by launch group identifier
- */
- protected Map fLaunchHistories;
-
- /**
- * The list of registered implementors of <code>ILaunchHistoryChangedListener</code>
- */
- protected List fLaunchHistoryChangedListeners = new ArrayList(3);
-
- /**
- * Launch shortcuts
- */
- private List fLaunchShortcuts = null;
-
- /**
- * Launch shortcuts, cached by perspective ids
- */
- private Map fLaunchShortcutsByPerspective = null;
-
- /**
- * Cache of launch configuration tab images with error overlays
- */
- protected ImageRegistry fErrorImages = null;
-
- /**
- * true when restoring launch history
- */
- protected boolean fRestoring = false;
-
- /**
- * The name of the file used to persist the launch history.
- */
- private static final String LAUNCH_CONFIGURATION_HISTORY_FILENAME = "launchConfigurationHistory.xml"; //$NON-NLS-1$
-
- /**
- * performs initialization of the manager when it is started
- */
- public void startup() {
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- launchManager.addLaunchListener(this);
- DebugUIPlugin.getDefault().addSaveParticipant(this);
- //update histories for launches already registered
- ILaunch[] launches = launchManager.getLaunches();
- for (int i = 0; i < launches.length; i++) {
- launchAdded(launches[i]);
- }
- }
-
- /**
- * Returns whether any launch config supports the given mode.
- *
- * @param mode launch mode
- * @return whether any launch config supports the given mode
- */
- public boolean launchModeAvailable(String mode) {
- return ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).launchModeAvailable(mode);
- }
-
- /**
- * Returns whether the given launch configuration should be visible in the
- * debug ui. If the config is marked as private, or belongs to a different
- * category (i.e. non-null), then this configuration should not be displayed
- * in the debug ui.
- *
- * @param launchConfiguration
- * @return boolean
- */
- public static boolean isVisible(ILaunchConfiguration launchConfiguration) {
- try {
- return !(launchConfiguration.getAttribute(IDebugUIConstants.ATTR_PRIVATE, false));
- } catch (CoreException e) {
- }
- return false;
- }
-
- /**
- * Returns a collection of launch configurations that does not contain
- * configurations from disabled activities.
- *
- * @param configurations a collection of configurations
- * @return the given collection minus any configurations from disabled activities
- */
- public static ILaunchConfiguration[] filterConfigs(ILaunchConfiguration[] configurations) {
- IWorkbenchActivitySupport activitySupport = PlatformUI.getWorkbench().getActivitySupport();
- if (activitySupport == null) {
- return configurations;
- }
- List filteredConfigs = new ArrayList();
- ILaunchConfigurationType type = null;
- LaunchConfigurationTypeContribution contribution = null;
- ILaunchConfiguration configuration = null;
- for (int i = 0; i < configurations.length; i++) {
- configuration = configurations[i];
- try {
- type = configuration.getType();
- contribution = new LaunchConfigurationTypeContribution(type);
- if (DebugUIPlugin.doLaunchConfigurationFiltering(configuration) & !WorkbenchActivityHelper.filterItem(contribution)) {
- filteredConfigs.add(configuration);
- }
- }
- catch (CoreException e) {DebugUIPlugin.log(e.getStatus());}
- }
- return (ILaunchConfiguration[]) filteredConfigs.toArray(new ILaunchConfiguration[filteredConfigs.size()]);
- }
-
- /**
- * Returns a listing of <code>IlaunchDeleagtes</code> that does not contain any delegates from disabled activities
- * @param delegates the raw listing of delegates to filter
- * @return the filtered listing of <code>ILaunchDelegate</code>s or an empty array, never <code>null</code>.
- * @since 3.3
- */
- public static ILaunchDelegate[] filterLaunchDelegates(ILaunchConfigurationType type, Set modes) throws CoreException {
- IWorkbenchActivitySupport as = PlatformUI.getWorkbench().getActivitySupport();
- ILaunchDelegate[] delegates = type.getDelegates(modes);
- if(as == null) {
- return delegates;
- }
- HashSet set = new HashSet();
- for(int i = 0; i < delegates.length; i++) {
- //filter by capabilities
- if(!WorkbenchActivityHelper.filterItem(new LaunchDelegateContribution(delegates[i]))) {
- set.add(delegates[i]);
- }
- }
- return (ILaunchDelegate[]) set.toArray(new ILaunchDelegate[set.size()]);
- }
-
- /**
- * Performs cleanup operations when the manager is being disposed of.
- */
- public void shutdown() {
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- launchManager.removeLaunchListener(this);
- if (fLaunchHistories != null) {
- Iterator histories = fLaunchHistories.values().iterator();
- while (histories.hasNext()) {
- LaunchHistory history = (LaunchHistory)histories.next();
- history.dispose();
- }
- }
- DebugUIPlugin.getDefault().removeSaveParticipant(this);
- }
-
- /**
- * @see ILaunchListener#launchRemoved(ILaunch)
- */
- public void launchRemoved(ILaunch launch) {}
-
- /**
- * @see ILaunchListener#launchChanged(ILaunch)
- */
- public void launchChanged(ILaunch launch) {}
-
- /**
- * Must not assume that will only be called from the UI thread.
- *
- * @see ILaunchListener#launchAdded(ILaunch)
- */
- public void launchAdded(final ILaunch launch) {
- removeTerminatedLaunches(launch);
- }
-
- /**
- * Removes terminated launches from the launch view, leaving the specified launch in the view
- * @param newLaunch the newly added launch to leave in the view
- */
- protected void removeTerminatedLaunches(ILaunch newLaunch) {
- if (DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugUIConstants.PREF_AUTO_REMOVE_OLD_LAUNCHES)) {
- ILaunchManager lManager= DebugPlugin.getDefault().getLaunchManager();
- Object[] launches= lManager.getLaunches();
- for (int i= 0; i < launches.length; i++) {
- ILaunch launch= (ILaunch)launches[i];
- if (launch != newLaunch && launch.isTerminated()) {
- lManager.removeLaunch(launch);
- }
- }
- }
- }
-
- /**
- * Returns the most recent launch for the given group, or <code>null</code>
- * if none. This method does not include any filtering for the returned launch configuration.
- *
- * This method is exposed via DebugTools.getLastLaunch
- *
- * @return the last launch, or <code>null</code> if none
- */
- public ILaunchConfiguration getLastLaunch(String groupId) {
- LaunchHistory history = getLaunchHistory(groupId);
- if (history != null) {
- return history.getRecentLaunch();
- }
- return null;
- }
-
- /**
- * Returns the most recent launch for the given group taking launch configuration
- * filters into account, or <code>null</code> if none.
- *
- * @param groupId launch group
- * @return the most recent, un-filtered launch
- */
- public ILaunchConfiguration getFilteredLastLaunch(String groupId) {
- LaunchHistory history = getLaunchHistory(groupId);
- if (history != null) {
- ILaunchConfiguration[] filterConfigs = history.getCompleteLaunchHistory();
- if (filterConfigs.length > 0) {
- return filterConfigs[0];
- }
- }
- return null;
- }
-
- /**
- * Add the specified listener to the list of listeners that will be notified when the
- * launch history changes.
- */
- public void addLaunchHistoryListener(ILaunchHistoryChangedListener listener) {
- if (!fLaunchHistoryChangedListeners.contains(listener)) {
- fLaunchHistoryChangedListeners.add(listener);
- }
- }
-
- /**
- * Remove the specified listener from the list of listeners that will be notified when the
- * launch history changes.
- */
- public void removeLaunchHistoryListener(ILaunchHistoryChangedListener listener) {
- fLaunchHistoryChangedListeners.remove(listener);
- }
-
- /**
- * Notify all launch history listeners that the launch history has changed in some way.
- */
- protected void fireLaunchHistoryChanged() {
- Iterator iterator = fLaunchHistoryChangedListeners.iterator();
- ILaunchHistoryChangedListener listener = null;
- while (iterator.hasNext()) {
- listener = (ILaunchHistoryChangedListener) iterator.next();
- listener.launchHistoryChanged();
- }
- }
-
- /**
- * Returns the history listing as XML
- * @return the history listing as XML
- * @throws CoreException
- * @throws ParserConfigurationException
- * @throws TransformerException
- * @throws IOException
- */
- protected String getHistoryAsXML() throws CoreException, ParserConfigurationException {
- Document doc = DebugUIPlugin.getDocument();
- Element historyRootElement = doc.createElement(IConfigurationElementConstants.LAUNCH_HISTORY);
- doc.appendChild(historyRootElement);
-
- Iterator histories = fLaunchHistories.values().iterator();
- LaunchHistory history = null;
- while (histories.hasNext()) {
- history = (LaunchHistory)histories.next();
- Element groupElement = doc.createElement(IConfigurationElementConstants.LAUNCH_GROUP);
- groupElement.setAttribute(IConfigurationElementConstants.ID, history.getLaunchGroup().getIdentifier());
- historyRootElement.appendChild(groupElement);
- Element historyElement = doc.createElement(IConfigurationElementConstants.MRU_HISTORY);
- groupElement.appendChild(historyElement);
- createEntry(doc, historyElement, history.getCompleteLaunchHistory());
- Element favs = doc.createElement(IConfigurationElementConstants.FAVORITES);
- groupElement.appendChild(favs);
- createEntry(doc, favs, history.getFavorites());
- history.setSaved(true);
- }
- return DebugPlugin.serializeDocument(doc);
- }
-
- /**
- * Creates a new launch history element and adds it to the specified <code>Document</code>
- * @param doc the <code>Document</code> to add the new element to
- * @param historyRootElement the root element
- * @param mode the modes the history element should apply to
- * @param configurations the configurations to create entries for
- * @throws CoreException
- */
- protected void createEntry(Document doc, Element historyRootElement, ILaunchConfiguration[] configurations) throws CoreException {
- for (int i = 0; i < configurations.length; i++) {
- ILaunchConfiguration configuration = configurations[i];
- if (configuration.exists()) {
- Element launch = doc.createElement(IConfigurationElementConstants.LAUNCH);
- launch.setAttribute(IConfigurationElementConstants.MEMENTO, configuration.getMemento());
- historyRootElement.appendChild(launch);
- }
- }
- }
-
- /**
- * Returns the path to the local file for the launch history
- * @return the file path for the launch history file
- */
- protected IPath getHistoryFilePath() {
- return DebugUIPlugin.getDefault().getStateLocation().append(LAUNCH_CONFIGURATION_HISTORY_FILENAME);
- }
-
- /**
- * Write out an XML file indicating the entries on the run & debug history lists and
- * the most recent launch.
- */
- protected void persistLaunchHistory() throws IOException, CoreException, ParserConfigurationException {
- synchronized (this) {
- if (fLaunchHistories == null || fRestoring) {
- return;
- }
- }
- boolean shouldsave = false;
- for(Iterator iter = fLaunchHistories.values().iterator(); iter.hasNext();) {
- shouldsave |= ((LaunchHistory)iter.next()).needsSaving();
- }
- if(shouldsave) {
- IPath historyPath = getHistoryFilePath();
- String osHistoryPath = historyPath.toOSString();
- String xml = getHistoryAsXML();
- File file = new File(osHistoryPath);
- file.createNewFile();
-
- FileOutputStream stream = new FileOutputStream(file);
- stream.write(xml.getBytes("UTF8")); //$NON-NLS-1$
- stream.close();
- }
- }
-
- /**
- * Find the XML history file and parse it. Place the corresponding configurations
- * in the appropriate history, and set the most recent launch.
- */
- private void restoreLaunchHistory() {
- // Find the history file
- IPath historyPath = getHistoryFilePath();
- String osHistoryPath = historyPath.toOSString();
- File file = new File(osHistoryPath);
- // If no history file, nothing to do
- if (!file.exists()) {
- return;
- }
- InputStream stream= null;
- Element rootHistoryElement= null;
- try {
- // Parse the history file
- stream = new BufferedInputStream(new FileInputStream(file));
- try {
- DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- parser.setErrorHandler(new DefaultHandler());
- rootHistoryElement = parser.parse(new InputSource(stream)).getDocumentElement();
- } catch (SAXException e) {
- DebugUIPlugin.log(e);
- return;
- } catch (ParserConfigurationException e) {
- DebugUIPlugin.log(e);
- return;
- } finally {
- stream.close();
- }
- } catch (IOException exception) {
- DebugUIPlugin.log(exception);
- return;
- }
- // If root node isn't what we expect, return
- if (!rootHistoryElement.getNodeName().equalsIgnoreCase(IConfigurationElementConstants.LAUNCH_HISTORY)) {
- return;
- }
- // For each child of the root node, construct a launch config handle and add it to
- // the appropriate history, or set the most recent launch
- Collection l = fLaunchHistories.values();
- LaunchHistory[] histories = (LaunchHistory[])l.toArray(new LaunchHistory[l.size()]);
- NodeList list = rootHistoryElement.getChildNodes();
- int length = list.getLength();
- Node node = null;
- Element entry = null;
- for (int i = 0; i < length; ++i) {
- node = list.item(i);
- short type = node.getNodeType();
- if (type == Node.ELEMENT_NODE) {
- entry = (Element) node;
- if (entry.getNodeName().equalsIgnoreCase(IConfigurationElementConstants.LAUNCH)) {
- createHistoryElement(entry, histories, false);
- } else if (entry.getNodeName().equalsIgnoreCase(IConfigurationElementConstants.LAST_LAUNCH)) {
- createHistoryElement(entry, histories, true);
- } else if (entry.getNodeName().equals(IConfigurationElementConstants.LAUNCH_GROUP)) {
- String id = entry.getAttribute(IConfigurationElementConstants.ID);
- if (id != null) {
- LaunchHistory history = getLaunchHistory(id);
- if (history != null) {
- restoreHistory(entry, history);
- }
- }
- }
- }
- }
- }
-
- /**
- * Restores the given launch history.
- *
- * @param groupElement launch group history
- * @param history associated history cache
- */
- private void restoreHistory(Element groupElement, LaunchHistory history) {
- NodeList nodes = groupElement.getChildNodes();
- int length = nodes.getLength();
- for (int i = 0; i < length; i++) {
- Node node = nodes.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element)node;
- if (element.getNodeName().equals(IConfigurationElementConstants.MRU_HISTORY)) {
- ILaunchConfiguration[] configs = getLaunchConfigurations(element);
- for (int j = 0; j < configs.length; j++) {
- history.addHistory(configs[j], false);
- }
- } else if (element.getNodeName().equals(IConfigurationElementConstants.FAVORITES)) {
- ILaunchConfiguration[] favs = getLaunchConfigurations(element);
- history.setFavorites(favs);
- // add any favorites that have been added to the workspace before this plug-in
- // was loaded - @see bug 231600
- ILaunchConfiguration[] configurations = getLaunchManager().getLaunchConfigurations();
- for (int j = 0; j < configurations.length; j++) {
- history.checkFavorites(configurations[j]);
- }
- }
- }
- }
- }
-
- /**
- * Restores a list of configurations.
- * @param root element
- * @return list of configurations under the element
- */
- private ILaunchConfiguration[] getLaunchConfigurations(Element root) {
- List configs = new ArrayList();
- NodeList nodes = root.getChildNodes();
- int length = nodes.getLength();
- for (int i = 0; i < length; i++) {
- Node node = nodes.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element element = (Element) node;
- if (element.getNodeName().equals(IConfigurationElementConstants.LAUNCH)) {
- String memento = element.getAttribute(IConfigurationElementConstants.MEMENTO);
- if (memento != null) {
- try {
- ILaunchConfiguration configuration = DebugPlugin.getDefault().getLaunchManager().getLaunchConfiguration(memento);
- //touch the config to see if its type exists
- configuration.getType();
- if (configuration.exists()) {
- configs.add(configuration);
- }
- } catch (CoreException e) {
- //do nothing as we don't care about non-existent, or configs with no type
- }
- }
- }
- }
- }
- return (ILaunchConfiguration[]) configs.toArray(new ILaunchConfiguration[configs.size()]);
- }
-
- /**
- * Construct a launch configuration corresponding to the specified XML
- * element, and place it in the appropriate history.
- */
- private void createHistoryElement(Element entry, LaunchHistory[] histories, boolean prepend) {
- String memento = entry.getAttribute(IConfigurationElementConstants.MEMENTO);
- String mode = entry.getAttribute(IConfigurationElementConstants.MODE);
- try {
- ILaunchConfiguration launchConfig = DebugPlugin.getDefault().getLaunchManager().getLaunchConfiguration(memento);
- //touch the type to see if its type exists
- launchConfig.getType();
- if (launchConfig.exists()) {
- LaunchHistory history = null;
- for (int i = 0; i < histories.length; i++) {
- history = histories[i];
- if (history.accepts(launchConfig) && history.getLaunchGroup().getMode().equals(mode)) {
- history.addHistory(launchConfig, prepend);
- }
- }
- }
- } catch (CoreException e) {
- //do nothing, as we want to throw away invalid launch history entries silently
- }
- }
-
- /**
- * Load all registered extensions of the 'launch shortcut' extension point.
- */
- private synchronized void loadLaunchShortcuts() {
- if(fLaunchShortcuts == null) {
- // Get the configuration elements
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_LAUNCH_SHORTCUTS);
- IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
-
- // Load the configuration elements into a Map
- fLaunchShortcuts = new ArrayList(infos.length);
- for (int i = 0; i < infos.length; i++) {
- fLaunchShortcuts.add(new LaunchShortcutExtension(infos[i]));
- }
- Collections.sort(fLaunchShortcuts, new ShortcutComparator());
- }
- }
-
- /**
- * Load all registered extensions of the 'launch groups' extension point.
- */
- private synchronized void loadLaunchGroups() {
- if (fLaunchGroups == null) {
- // Get the configuration elements
- IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_LAUNCH_GROUPS);
- IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
-
- // Load the configuration elements into a Map
- fLaunchGroups = new HashMap(infos.length);
- LaunchGroupExtension ext = null;
- for (int i = 0; i < infos.length; i++) {
- ext = new LaunchGroupExtension(infos[i]);
- fLaunchGroups.put(ext.getIdentifier(), ext);
- }
- }
- }
-
- /**
- * Returns all launch shortcuts
- *
- * @return all launch shortcuts
- */
- public List getLaunchShortcuts() {
- if (fLaunchShortcuts == null) {
- loadLaunchShortcuts();
- }
- return fLaunchShortcuts;
- }
-
- /**
- * Creates a listing of the launch shortcut extensions that are applicable to the underlying resource
- * @param resource the underlying resource
- * @return a listing of applicable launch shortcuts or an empty list, never <code>null</code>
- * @since 3.3
- */
- public List getLaunchShortcuts(IResource resource) {
- List list = new ArrayList();
- List sc = getLaunchShortcuts();
- List ctxt = new ArrayList();
- if(resource != null) {
- ctxt.add(resource);
- }
- IEvaluationContext context = new EvaluationContext(null, ctxt);
- context.addVariable("selection", ctxt); //$NON-NLS-1$
- LaunchShortcutExtension ext = null;
- for(Iterator iter = sc.iterator(); iter.hasNext();) {
- ext = (LaunchShortcutExtension) iter.next();
- try {
- if(ext.evalEnablementExpression(context, ext.getContextualLaunchEnablementExpression()) && !WorkbenchActivityHelper.filterItem(ext)) {
- if(!list.contains(ext)) {
- list.add(ext);
- }
- }
- }
- catch(CoreException ce) {/*do nothing*/}
- }
- return list;
- }
-
- /**
- * Returns an array of all of the ids of the <code>ILaunchConfigurationType</code>s that apply to the currently
- * specified <code>IResource</code>.
- *
- * @param resource the resource context
- * @return an array of applicable <code>ILaunchConfigurationType</code> ids, or an empty array, never <code>null</code>
- * @since 3.3
- * CONTEXTLAUNCHING
- */
- public String[] getApplicableConfigurationTypes(IResource resource) {
- List types = new ArrayList();
- List exts = getLaunchShortcuts();
- LaunchShortcutExtension ext = null;
- List list = new ArrayList();
- list.add(resource);
- IEvaluationContext context = new EvaluationContext(null, list);
- context.setAllowPluginActivation(true);
- context.addVariable("selection", list); //$NON-NLS-1$
- HashSet set = new HashSet();
- for(Iterator iter = exts.listIterator(); iter.hasNext();) {
- ext = (LaunchShortcutExtension) iter.next();
- try {
- if(ext.evalEnablementExpression(context, ext.getContextualLaunchEnablementExpression())) {
- set.addAll(ext.getAssociatedConfigurationTypes());
- }
- }
- catch(CoreException ce) {
- IStatus status = new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), "Launch shortcut '" + ext.getId() + "' enablement expression caused exception. Shortcut was removed.", ce); //$NON-NLS-1$ //$NON-NLS-2$
- DebugUIPlugin.log(status);
- iter.remove();
- }
- }
- LaunchManager lm = (LaunchManager) DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType type = null;
- for(Iterator iter = set.iterator(); iter.hasNext();) {
- type = lm.getLaunchConfigurationType((String)iter.next());
- if(type != null) {
- if(!types.contains(type) && type.isPublic() && !"org.eclipse.ui.externaltools.builder".equals(type.getCategory())) { //$NON-NLS-1$
- types.add(type.getIdentifier());
- }
- }
- }
- return (String[]) types.toArray(new String[types.size()]);
- }
-
- /**
- * Returns an array of the <code>ILaunchConfiguration</code>s that apply to the specified <code>IResource</code>
- * @param resource the resource
- * @return an array of applicable <code>ILaunchConfiguration</code>s for the specified <code>IResource</code> or an empty
- * array if none, never <code>null</code>
- * @since 3.3
- */
- public ILaunchConfiguration[] getApplicableLaunchConfigurations(String[] types, IResource resource) {
- ArrayList list = new ArrayList();
- try {
- if(resource != null) {
- String[] ctypes = types;
- if(ctypes == null) {
- ctypes = getApplicableConfigurationTypes(resource);
- }
- //copy into collection for hashcode matching
- HashSet typeset = new HashSet(ctypes.length);
- for(int i = 0; i < ctypes.length; i++) {
- typeset.add(ctypes[i]);
- }
- ILaunchConfiguration[] configurations = filterConfigs(getLaunchManager().getLaunchConfigurations());
- ILaunchConfiguration configuration = null;
- IResource[] resrcs = null;
- for(int i = 0; i < configurations.length; i++) {
- configuration = configurations[i];
- if(typeset.contains(configuration.getType().getIdentifier()) && acceptConfiguration(configuration)) {
- resrcs = configuration.getMappedResources();
- if (resrcs != null) {
- for (int j = 0; j < resrcs.length; j++) {
- if (resource.equals(resrcs[j]) || resource.getFullPath().isPrefixOf(resrcs[j].getFullPath())) {
- list.add(configuration);
- break;
- }
- }
- }
- else {
- //in the event the config has no mapping
- list.add(configuration);
- }
- }
- }
- }
- } catch (CoreException e) {
- list.clear();
- DebugPlugin.log(e);
- }
- return (ILaunchConfiguration[]) list.toArray(new ILaunchConfiguration[list.size()]);
- }
-
- /**
- * Returns if the specified configuration should be considered as a potential candidate
- * @param config
- * @return if the specified configuration should be considered as a potential candidate
- * @throws CoreException
- */
- private boolean acceptConfiguration(ILaunchConfiguration config) throws CoreException {
- if(config != null && !DebugUITools.isPrivate(config)) {
- if(!"org.eclipse.ui.externaltools".equals(config.getType().getCategory())) { //$NON-NLS-1$
- return true;
- }
- else {
- IResource[] res = config.getMappedResources();
- if(res != null) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Returns all launch shortcuts for the given category
- *
- * @return all launch shortcuts
- */
- public List getLaunchShortcuts(String category) {
- return filterShortcuts(getLaunchShortcuts(), category);
- }
-
- /**
- * Return a list of filtered launch shortcuts, based on the given category.
- *
- * @param unfiltered
- * @param category
- * @return List
- */
- protected List filterShortcuts(List unfiltered, String category) {
- List filtered = new ArrayList(unfiltered.size());
- Iterator iter = unfiltered.iterator();
- LaunchShortcutExtension extension = null;
- while (iter.hasNext()){
- extension = (LaunchShortcutExtension)iter.next();
- if (category == null) {
- if (extension.getCategory() == null) {
- filtered.add(extension);
- }
- } else if (category.equals(extension.getCategory())){
- filtered.add(extension);
- }
- }
- return filtered;
- }
-
- /**
- * Returns all launch shortcuts defined for the given perspective,
- * empty list if none.
- *
- * @param perpsective perspective identifier
- * @param category the category for the shortcut
- * @return all launch shortcuts defined for the given perspective,
- * empty list if none.
- * @deprecated the use of perspectives for launch shortcuts has been
- * deprecated since 3.1, use a contextualLaunch element instead
- */
- public List getLaunchShortcuts(String perpsective, String category) {
- if (fLaunchShortcutsByPerspective == null) {
- Iterator shortcuts = getLaunchShortcuts().iterator();
- fLaunchShortcutsByPerspective = new HashMap(10);
- LaunchShortcutExtension ext = null;
- Iterator perspectives = null;
- while (shortcuts.hasNext()) {
- ext = (LaunchShortcutExtension)shortcuts.next();
- perspectives = ext.getPerspectives().iterator();
- while (perspectives.hasNext()) {
- String id = (String)perspectives.next();
- List list = (List)fLaunchShortcutsByPerspective.get(id);
- if (list == null) {
- list = new ArrayList(4);
- fLaunchShortcutsByPerspective.put(id, list);
- }
- list.add(ext);
- }
- }
- }
- List list = (List)fLaunchShortcutsByPerspective.get(perpsective);
- if (list == null) {
- return new ArrayList();
- }
- return filterShortcuts(list, category);
- }
-
- /**
- * Returns the first occurrence of any one of the configurations in the provided list, if they are found in the launch history
- * for the corresponding launch group
- * @param configurations
- * @param mode
- * @param resource
- * @return the associated launch configuration from the MRU listing or <code>null</code> if there isn't one
- * @since 3.3
- */
- public ILaunchConfiguration getMRUConfiguration(List configurations, ILaunchGroup group, IResource resource) {
- if(group != null) {
- ArrayList candidates = new ArrayList();
- LaunchHistory history = getLaunchHistory(group.getIdentifier());
- if(history != null) {
- ILaunchConfiguration[] configs = history.getCompleteLaunchHistory();
- for(int i = 0; i < configs.length; i++) {
- if(configurations.contains(configs[i])) {
- if(resource instanceof IContainer) {
- return configs[i];
- }
- else {
- candidates.add(configs[i]);
- }
- }
- }
- ILaunchConfiguration config = null;
- if(resource != null) {
- //first try to find a config that exactly matches the resource mapping, and collect partial matches
- IResource[] res = null;
- for(Iterator iter = candidates.iterator(); iter.hasNext();) {
- config = (ILaunchConfiguration) iter.next();
- try {
- res = config.getMappedResources();
- if(res != null) {
- for(int i = 0; i < res.length; i++) {
- if(res[i].equals(resource)) {
- return config;
- }
- }
- }
- }
- catch(CoreException ce) {}
- }
- }
- for(int i = 0; i < configs.length; i++) {
- if(candidates.contains(configs[i])) {
- return configs[i];
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the shared config from the selected resource or <code>null</code> if the selected resources is not a shared config
- * @param receiver the object to test if it is a shared launch configuration
- * @return the shared config from the selected resource or <code>null</code> if the selected resources is not a shared config
- * @since 3.3
- */
- public ILaunchConfiguration isSharedConfig(Object receiver) {
- if(receiver instanceof IFile) {
- IFile file = (IFile) receiver;
- String ext = file.getFileExtension();
- if(ext == null) {
- return null;
- }
- if(ext.equals("launch")) { //$NON-NLS-1$
- ILaunchConfiguration config = DebugPlugin.getDefault().getLaunchManager().getLaunchConfiguration(file);
- if(config != null && config.exists()) {
- return config;
- }
- }
- }
- else if(receiver instanceof IFileEditorInput) {
- IFileEditorInput input = (IFileEditorInput) receiver;
- return isSharedConfig(input.getFile());
- }
- else if(receiver instanceof IEditorPart) {
- return isSharedConfig(((IEditorPart) receiver).getEditorInput());
- }
- return null;
- }
-
- /**
- * Returns the image used to display an error in the given tab
- */
- public Image getErrorTabImage(ILaunchConfigurationTab tab) {
- if (fErrorImages == null) {
- fErrorImages = new ImageRegistry();
- }
- String key = tab.getClass().getName();
- Image image = fErrorImages.get(key);
- if (image == null) {
- // create image
- Image base = tab.getImage();
- if (base == null) {
- base = DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_OVR_TRANSPARENT);
- }
- base = new Image(Display.getCurrent(), base, SWT.IMAGE_COPY);
- LaunchConfigurationTabImageDescriptor desc = new LaunchConfigurationTabImageDescriptor(base, LaunchConfigurationTabImageDescriptor.ERROR);
- image = desc.createImage();
- fErrorImages.put(key, image);
- }
- return image;
- }
-
- /**
- * Return the launch group with the given id, or <code>null</code>
- *
- * @return the launch group with the given id, or <code>null</code>
- */
- public LaunchGroupExtension getLaunchGroup(String id) {
- if (fLaunchGroups == null) {
- loadLaunchGroups();
- }
- return (LaunchGroupExtension)fLaunchGroups.get(id);
- }
-
- /**
- * Return all defined launch groups
- *
- * @return all defined launch groups
- */
- public ILaunchGroup[] getLaunchGroups() {
- if (fLaunchGroups == null) {
- loadLaunchGroups();
- }
- Collection groups = fLaunchGroups.values();
- return (ILaunchGroup[])groups.toArray(new ILaunchGroup[groups.size()]);
- }
-
- /**
- * Return the launch history with the given group id, or <code>null</code>
- *
- * @return the launch history with the given group id, or <code>null</code>
- */
- public LaunchHistory getLaunchHistory(String id) {
- loadLaunchHistories();
- return (LaunchHistory)fLaunchHistories.get(id);
- }
-
- /**
- * Returns the singleton instance of the launch manager
- * @return the singleton instance of the launch manager
- * @since 3.3
- */
- private LaunchManager getLaunchManager() {
- return (LaunchManager) DebugPlugin.getDefault().getLaunchManager();
- }
-
- /**
- * Restore launch history
- */
- private synchronized void loadLaunchHistories() {
- if (fLaunchHistories == null) {
- fRestoring = true;
- ILaunchGroup[] groups = getLaunchGroups();
- fLaunchHistories = new HashMap(groups.length);
- ILaunchGroup extension = null;
- for (int i = 0; i < groups.length; i++) {
- extension = groups[i];
- if (extension.isPublic()) {
- fLaunchHistories.put(extension.getIdentifier(), new LaunchHistory(extension));
- }
- }
- restoreLaunchHistory();
- fRestoring = false;
- }
- }
-
- /**
- * Returns the default launch group for the given mode.
- *
- * @param mode
- * @return launch group
- */
- public LaunchGroupExtension getDefaultLaunchGroup(String mode) {
- if (mode.equals(ILaunchManager.DEBUG_MODE)) {
- return getLaunchGroup(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP);
- }
- return getLaunchGroup(IDebugUIConstants.ID_RUN_LAUNCH_GROUP);
- }
-
- /**
- * Returns the launch group the given launch configuration type belongs to, in
- * the specified mode, or <code>null</code> if none.
- *
- * @param type the type
- * @param mode the mode
- * @return the launch group the given launch configuration belongs to, in
- * the specified mode, or <code>null</code> if none
- */
- public ILaunchGroup getLaunchGroup(ILaunchConfigurationType type, String mode) {
- if (!type.supportsMode(mode)) {
- return null;
- }
- String category = type.getCategory();
- ILaunchGroup[] groups = getLaunchGroups();
- ILaunchGroup extension = null;
- for (int i = 0; i < groups.length; i++) {
- extension = groups[i];
- if (category == null) {
- if (extension.getCategory() == null && extension.getMode().equals(mode)) {
- return extension;
- }
- } else if (category.equals(extension.getCategory())) {
- if (extension.getMode().equals(mode)) {
- return extension;
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the {@link ILaunchGroup} for the given mode set and
- * {@link ILaunchConfigurationType}.
- * @param type the type
- * @param modeset the set of modes, which are combined to one mode string
- * @return the associated {@link ILaunchGroup} or <code>null</code>
- *
- * @since 3.4.0
- */
- public ILaunchGroup getLaunchGroup(ILaunchConfigurationType type, Set modeset) {
- StringBuffer buff = new StringBuffer();
- Object item = null;
- for(Iterator iter = modeset.iterator(); iter.hasNext();) {
- item = iter.next();
- if(item instanceof String) {
- buff.append(item);
- if(iter.hasNext()) {
- buff.append(","); //$NON-NLS-1$
- }
- }
- }
- return getLaunchGroup(type, buff.toString());
- }
-
- /**
- * Returns the private launch configuration used as a place-holder to represent/store
- * the information associated with a launch configuration type.
- *
- * @param type launch configuration type
- * @return launch configuration
- * @since 3.0
- */
- public static ILaunchConfiguration getSharedTypeConfig(ILaunchConfigurationType type) throws CoreException {
- String id = type.getIdentifier();
- String name = id + ".SHARED_INFO"; //$NON-NLS-1$
- ILaunchConfiguration shared = null;
- ILaunchConfiguration[] configurations = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(type);
- ILaunchConfiguration configuration = null;
- for (int i = 0; i < configurations.length; i++) {
- configuration = configurations[i];
- if (configuration.getName().equals(name)) {
- shared = configuration;
- break;
- }
- }
-
- if (shared == null) {
- // create a new shared config
- ILaunchConfigurationWorkingCopy workingCopy;
- workingCopy = type.newInstance(null, name);
- workingCopy.setAttribute(IDebugUIConstants.ATTR_PRIVATE, true);
- // null entries indicate default settings
- // save
- shared = workingCopy.doSave();
- }
- return shared;
- }
-
-
- /**
- * @see org.eclipse.core.resources.ISaveParticipant#doneSaving(org.eclipse.core.resources.ISaveContext)
- */
- public void doneSaving(ISaveContext context) {}
-
- /**
- * @see org.eclipse.core.resources.ISaveParticipant#prepareToSave(org.eclipse.core.resources.ISaveContext)
- */
- public void prepareToSave(ISaveContext context) throws CoreException {}
-
- /**
- * @see org.eclipse.core.resources.ISaveParticipant#rollback(org.eclipse.core.resources.ISaveContext)
- */
- public void rollback(ISaveContext context) {}
-
- /**
- * @see org.eclipse.core.resources.ISaveParticipant#saving(org.eclipse.core.resources.ISaveContext)
- */
- public void saving(ISaveContext context) throws CoreException {
- try {
- persistLaunchHistory();
- } catch (IOException e) {
- throw new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), "Internal error saving launch history", e)); //$NON-NLS-1$
- } catch (ParserConfigurationException e) {
- throw new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), "Internal error saving launch history", e)); //$NON-NLS-1$
- }
- }
-
- /**
- * Sets the given launch to be the most recent launch in the launch
- * history (for applicable histories).
- * <p>
- * @param configuration configuration to be set as most recent
- * @since 3.3
- */
- public void setRecentLaunch(ILaunch launch) {
- ILaunchGroup[] groups = DebugUITools.getLaunchGroups();
- int size = groups.length;
- for (int i = 0; i < size; i++) {
- String id = groups[i].getIdentifier();
- LaunchHistory history = getLaunchHistory(id);
- if (history != null)
- history.launchAdded(launch);
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java
deleted file mode 100644
index 3ca3eb706..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java
+++ /dev/null
@@ -1,382 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchDelegate;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.ILaunchMode;
-import org.eclipse.debug.internal.core.IConfigurationElementConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.LaunchConfigurationTabExtension;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.activities.IWorkbenchActivitySupport;
-import org.eclipse.ui.activities.WorkbenchActivityHelper;
-
-/**
- * Manages contributed launch configuration tabs
- *
- * @see LaunchConfigurationTabGroupWrapper
- * @see LaunchConfigurationTabExtension
- * @see LaunchConfigurationTabGroupExtension
- */
-public class LaunchConfigurationPresentationManager {
-
- /**
- * The singleton launch configuration presentation manager
- */
- private static LaunchConfigurationPresentationManager fgDefault;
-
- /**
- * Collection of launch configuration tab group extensions
- * defined in plug-in xml. Entries are keyed by launch
- * configuration type identifier (<code>String</code>),
- * and entries are tables of launch modes (<code>String</code>)
- * to <code>LaunchConfigurationTabGroupExtension</code>. "*" is
- * used to represent the default tab group (i.e. unspecified mode).
- */
- private Hashtable fTabGroupExtensions;
-
- /**
- * contributed tabs are stored by the tab group id that they contribute to.
- * each entry is a <code>Hashtable</code> consisting of the corresponding
- * <code>LaunchConfigurationTabExtension</code> objects for each contributed tab stored by their
- * id
- *
- * @since 3.3
- */
- private Hashtable fContributedTabs;
-
- /**
- * Constructs the singleton launch configuration presentation
- * manager.
- */
- private LaunchConfigurationPresentationManager() {
- fgDefault = this;
- }
-
- /**
- * Returns the launch configuration presentation manager
- */
- public static LaunchConfigurationPresentationManager getDefault() {
- if (fgDefault == null) {
- fgDefault = new LaunchConfigurationPresentationManager();
- }
- return fgDefault;
- }
-
- /**
- * Creates launch configuration tab group extensions for each extension
- * defined in XML, and adds them to the table of tab group extensions.
- */
- private void initializeTabGroupExtensions() {
- if(fTabGroupExtensions == null) {
- fTabGroupExtensions = new Hashtable();
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_LAUNCH_CONFIGURATION_TAB_GROUPS);
- IConfigurationElement[] groups = extensionPoint.getConfigurationElements();
- LaunchConfigurationTabGroupExtension group = null;
- String typeId = null;
- Map map = null;
- List modes = null;
- for (int i = 0; i < groups.length; i++) {
- group = new LaunchConfigurationTabGroupExtension(groups[i]);
- typeId = group.getTypeIdentifier();
- map = (Map)fTabGroupExtensions.get(typeId);
- if (map == null) {
- map = new Hashtable();
- fTabGroupExtensions.put(typeId, map);
- }
- modes = group.getModes();
- if(modes.isEmpty()) {
- String mode = "*"; //$NON-NLS-1$
- reportReplacement((LaunchConfigurationTabGroupExtension) map.put(mode, group), group, mode);
- }
- Set ms = null;
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- ms = (Set) iter.next();
- reportReplacement((LaunchConfigurationTabGroupExtension) map.put(ms, group), group, ms);
- }
- }
- }
- }
-
- /**
- * Reports if a tab group extension has been replaced by another contribution
- * @param oldext the old tab group extension from the cache
- * @param newext the new one being cached
- * @param mode the mode(s) the group applies to
- *
- * @since 3.6
- */
- void reportReplacement(LaunchConfigurationTabGroupExtension oldext, LaunchConfigurationTabGroupExtension newext, Object mode) {
- if(oldext != null) {
- Status status = new Status(IStatus.ERROR,
- DebugUIPlugin.getUniqueIdentifier(),
- NLS.bind(LaunchConfigurationsMessages.LaunchConfigurationPresentationManager_0,
- new String[]{oldext.getIdentifier(), oldext.getTypeIdentifier(), mode.toString(), newext.getIdentifier()}));
- DebugUIPlugin.log(status);
- }
- }
-
- /**
- * This method is used to collect all of the contributed tabs defined by the <code>launchConfigurationTabs</code>
- * extension point
- *
- * @since 3.3
- */
- private void initializeContributedTabExtensions() {
- fContributedTabs = new Hashtable();
- IExtensionPoint epoint = Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_LAUNCH_TABS);
- IConfigurationElement[] elements = epoint.getConfigurationElements();
- LaunchConfigurationTabExtension tab = null;
- Hashtable element = null;
- for(int i = 0; i < elements.length; i++) {
- tab = new LaunchConfigurationTabExtension(elements[i]);
- element = (Hashtable) fContributedTabs.get(tab.getTabGroupId());
- if(element == null) {
- element = new Hashtable();
- element.put(tab.getIdentifier(), tab);
- fContributedTabs.put(tab.getTabGroupId(), element);
- }
- element.put(tab.getIdentifier(), tab);
- }
- }
-
- /**
- * Returns the tab group for the given launch configuration type and mode.
- *
- * @param type launch configuration type
- * @param mode launch mode
- * @return the tab group for the given type of launch configuration, or <code>null</code> if none
- * @exception CoreException if an exception occurs creating the group
- */
- public ILaunchConfigurationTabGroup getTabGroup(ILaunchConfigurationType type, String mode) throws CoreException {
- HashSet modes = new HashSet();
- modes.add(mode);
- LaunchConfigurationTabGroupExtension ext = getExtension(type.getIdentifier(), modes);
- if (ext == null) {
- IStatus status = new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "No tab group defined for launch configuration type " + type.getIdentifier(), null); //$NON-NLS-1$
- throw new CoreException(status);
- }
- return new LaunchConfigurationTabGroupWrapper(ext.newTabGroup(), ext.getIdentifier(), null);
- }
-
- /**
- * Returns the tab group for the given launch configuration and the mode the dialog opened in
- * @param type the type of the configuration
- * @param config
- * @param mode
- * @return
- * @throws CoreException
- */
- public ILaunchConfigurationTabGroup getTabGroup(ILaunchConfiguration config, String mode) throws CoreException {
- HashSet modes = new HashSet();
- modes.add(mode);
- LaunchConfigurationTabGroupExtension ext = getExtension(config.getType().getIdentifier(), modes);
- if (ext == null) {
- IStatus status = new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "No tab group defined for launch configuration type " + config.getType().getIdentifier(), null); //$NON-NLS-1$
- throw new CoreException(status);
- }
- return new LaunchConfigurationTabGroupWrapper(ext.newTabGroup(), ext.getIdentifier(), config);
- }
-
- /**
- * Returns the proxy elements for all contributed tabs for the specified tab group id
- * @param groupid the id of the tab group
- * @param config the config the tab group is opened on
- * @param mode the mode the associated launch dialog is opened on
- * @return the listing of all of the tab extensions or an empty array, never <code>null</code>
- *
- * @since 3.3
- */
- protected LaunchConfigurationTabExtension[] getTabExtensions(String groupid, ILaunchConfiguration config, String mode) throws CoreException {
- initializeContributedTabExtensions();
- Hashtable tabs = (Hashtable) fContributedTabs.get(groupid);
- if(tabs != null) {
- return filterLaunchTabExtensions((LaunchConfigurationTabExtension[]) tabs.values().toArray(new LaunchConfigurationTabExtension[tabs.size()]), config, mode);
- }
- return new LaunchConfigurationTabExtension[0];
- }
-
- /**
- * Returns a listing of <code>LaunchConfiguraitonTabExtension</code>s that does not contain any tabs
- * from disabled activities
- * <p>
- * There are thre ways that tabs can be filtered form the launch dialog:
- * <ol>
- * <li>The tabs can belong to tooling that is contributed via a specific type of workbench activity, and is therefore filtered with capabilities</li>
- * <li>The tabs can be filtered via the associatedDelegate extension point, if a tab is said to apply only to certain tooling, only show it in the instance when that tooling is used</li>
- * <li>A tab is not part of a workbench activity, nor specifies an associated launch delegate -- show the tab</li>
- * </ol>
- * </p>
- * @param tabs the raw listing of tabs to filter
- * @return the listing of filtered <code>LaunchConfigurationTabExtension</code>s or an empty array, never <code>null</code>
- *
- * @since 3.3
- */
- protected LaunchConfigurationTabExtension[] filterLaunchTabExtensions(LaunchConfigurationTabExtension[] tabs, ILaunchConfiguration config, String mode) throws CoreException {
- IWorkbenchActivitySupport as = PlatformUI.getWorkbench().getActivitySupport();
- if(as == null || config == null) {
- return tabs;
- }
- HashSet set = new HashSet();
- for(int i = 0; i < tabs.length; i ++) {
- //filter capabilities
- if(!WorkbenchActivityHelper.filterItem(new LaunchTabContribution(tabs[i]))) {
- //filter to preferred delegate (if there is one)
- HashSet modes = (HashSet) config.getModes();
- modes.add(mode);
- ILaunchDelegate delegate = config.getPreferredDelegate(modes);
- if(delegate == null) {
- delegate = config.getType().getPreferredDelegate(modes);
- }
- Set delegateSet = tabs[i].getDelegateSet();
- if(delegate != null) {
- if(delegateSet.isEmpty() || delegateSet.contains(delegate.getId())) {
- set.add(tabs[i]);
- }
- }
- else {
- //otherwise filter based on the collection of delegates for the modes
- ILaunchDelegate[] delegates = config.getType().getDelegates(modes);
- for(int j = 0; j < delegates.length; j++) {
- if(delegateSet.size() == 0 || delegateSet.contains(delegates[j].getId())) {
- //associated with all modes and tab groups or only specific ones if indicated
- set.add(tabs[i]);
- }
- }
- }
- }
- }
- return (LaunchConfigurationTabExtension[]) set.toArray(new LaunchConfigurationTabExtension[set.size()]);
- }
-
- /**
- * Returns the launch tab group extension for the given type and mode, or
- * <code>null</code> if none
- *
- * @param type launch configuration type identifier
- * @param mode launch mode identifier
- * @return launch tab group extension or <code>null</code>
- */
- protected LaunchConfigurationTabGroupExtension getExtension(String type, Set modes) {
- initializeTabGroupExtensions();
- Map map = (Map)fTabGroupExtensions.get(type);
- if (map != null) {
- Object extension = map.get(modes);
- if (extension == null) {
- // get the default tabs
- extension = map.get("*"); //$NON-NLS-1$
- }
- return (LaunchConfigurationTabGroupExtension)extension;
- }
- return null;
- }
-
- /**
- * Returns the identifier of the help context that is associated with the
- * specified launch configuration type and mode, or <code>null</code> if none.
- *
- * @param type launch config type
- * @param mode launch mode
- * @return the identifier for the help context associated with the given
- * type of launch configuration, or <code>null</code>
- * @exception CoreException if an exception occurs creating the group
- * @since 2.1
- */
- public String getHelpContext(ILaunchConfigurationType type, String mode) throws CoreException {
- HashSet modes = new HashSet();
- modes.add(mode);
- LaunchConfigurationTabGroupExtension ext = getExtension(type.getIdentifier(), modes);
- if (ext == null) {
- IStatus status = new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "No tab group defined for launch configuration type " + type.getIdentifier(), null); //$NON-NLS-1$
- throw new CoreException(status);
- }
- return ext.getHelpContextId();
- }
-
- /**
- * Returns the description of the given configuration type
- * in the specified mode or <code>null</code> if none.
- *
- * @param configType the config type
- * @param mode the launch mode
- * @return the description of the given configuration type, possible <code>null</code>
- */
- public String getDescription(ILaunchConfigurationType configType, String mode) {
- HashSet modes = new HashSet();
- modes.add(mode);
- LaunchConfigurationTabGroupExtension extension = getExtension(configType.getAttribute(IConfigurationElementConstants.ID), modes);
- return (extension != null ? extension.getDescription(modes) : null);
- }
-
- /**
- * Returns a sorted list of launch mode names corresponding to the given identifiers.
- *
- * @param modes set of launch mode identifiers
- * @return sorted list of launch mode names
- */
- public List getLaunchModeNames(Set modes) {
- List names = new ArrayList();
- Iterator iterator = modes.iterator();
- ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
- while (iterator.hasNext()) {
- String id = (String) iterator.next();
- ILaunchMode mode = manager.getLaunchMode(id);
- if (mode == null) {
- names.add(id);
- } else {
- names.add(DebugUIPlugin.removeAccelerators(mode.getLabel()));
- }
- }
- Collections.sort(names);
- return names;
- }
-
- /**
- * Returns the label of the mode id with all accelerators removed
- * @param modeid the id of the mode i.e. 'run'
- * @return the formatted label of the specified mode id with all accelerators removed, or <code>null</code> if no label is available
- * @since 3.3
- */
- public String getLaunchModeLabel(String modeid) {
- String mode = null;
- ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchMode lmode = manager.getLaunchMode(modeid);
- if(lmode != null) {
- return lmode.getLabel();
- }
- return mode;
- }
-
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPropertiesDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPropertiesDialog.java
deleted file mode 100644
index 0da0427f2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPropertiesDialog.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-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.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * A dialog used to edit a single launch configuration.
- */
-public class LaunchConfigurationPropertiesDialog extends LaunchConfigurationsDialog implements ILaunchConfigurationListener {
-
- /**
- * The launch configuration to display
- */
- private ILaunchConfiguration fLaunchConfiguration;
-
- /**
- * Whether to set default values when opened
- * @since 3.3
- */
- private boolean fSetDefaultOnOpen = false;
-
- /**
- * Constructs a new launch configuration dialog on the given
- * parent shell.
- *
- * @param shell the parent shell
- * @param selection the selection used to initialize this dialog, typically the
- * current workbench selection
- * @param group launch group
- */
- public LaunchConfigurationPropertiesDialog(Shell shell, ILaunchConfiguration launchConfiguration, LaunchGroupExtension group) {
- super(shell, group);
- fLaunchConfiguration = launchConfiguration;
- DebugPlugin.getDefault().getLaunchManager().addLaunchConfigurationListener(this);
- }
-
- /**
- * Constructs a new launch configuration dialog on the given
- * parent shell.
- *
- * @param shell the parent shell
- * @param selection the selection used to initialize this dialog, typically the
- * current workbench selection
- * @param reservednames a set of names of virtual launch configurations that need to be considered
- * when configuration names are generated
- * @param group launch group
- */
- public LaunchConfigurationPropertiesDialog(Shell shell, ILaunchConfiguration launchConfiguration, LaunchGroupExtension group, Set reservednames) {
- super(shell, group);
- fLaunchConfiguration = launchConfiguration;
- DebugPlugin.getDefault().getLaunchManager().addLaunchConfigurationListener(this);
- fReservedNames = reservednames;
- }
-
- /**
- * Returns the launch configuration being displayed.
- *
- * @return ILaunchConfiguration
- */
- protected ILaunchConfiguration getLaunchConfiguration() {
- return fLaunchConfiguration;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#initializeBounds()
- */
- protected void initializeBounds() {
- super.initializeBounds();
- resize();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#initializeContent()
- */
- protected void initializeContent() {
- ILaunchConfiguration launchConfiguration = getLaunchConfiguration();
- if (fSetDefaultOnOpen && launchConfiguration instanceof ILaunchConfigurationWorkingCopy) {
- ILaunchConfigurationWorkingCopy wc = (ILaunchConfigurationWorkingCopy) launchConfiguration;
- try {
- ILaunchConfigurationTabGroup tabGroup = LaunchConfigurationPresentationManager.getDefault().getTabGroup(wc, getMode());
- // this only works because this action is only present when the dialog is open
- ILaunchConfigurationDialog dialog = LaunchConfigurationsDialog.getCurrentlyVisibleLaunchConfigurationDialog();
- tabGroup.createTabs(dialog, dialog.getMode());
- ILaunchConfigurationTab[] tabs = tabGroup.getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].setLaunchConfigurationDialog(dialog);
- }
- tabGroup.setDefaults(wc);
- tabGroup.dispose();
- } catch (CoreException e) {
- DebugUIPlugin.log(e.getStatus());
- }
- }
- getTabViewer().setInput(launchConfiguration);
- IStatus status = getInitialStatus();
- if (status != null) {
- handleStatus(status);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#close()
- */
- public boolean close() {
- if (!isSafeToClose()) {
- return false;
- }
- DebugPlugin.getDefault().getLaunchManager().removeLaunchConfigurationListener(this);
- return super.close();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#addContent(org.eclipse.swt.widgets.Composite)
- */
- protected void addContent(Composite dialogComp) {
- GridData gd;
- Composite topComp = new Composite(dialogComp, SWT.NONE);
- gd = new GridData(GridData.FILL_BOTH);
- topComp.setLayoutData(gd);
- GridLayout topLayout = new GridLayout();
- topLayout.numColumns = 1;
- topLayout.marginHeight = 5;
- topLayout.marginWidth = 5;
- topComp.setLayout(topLayout);
- topComp.setFont(dialogComp.getFont());
-
- // Set the things that TitleAreaDialog takes care of
- setTitle(getTitleAreaTitle());
- setMessage(IInternalDebugCoreConstants.EMPTY_STRING);
- setModeLabelState();
-
- // Build the launch configuration edit area and put it into the composite.
- Composite editAreaComp = createLaunchConfigurationEditArea(topComp);
- gd = new GridData(GridData.FILL_BOTH);
- editAreaComp.setLayoutData(gd);
- editAreaComp.setFont(dialogComp.getFont());
-
- dialogComp.layout(true);
- applyDialogFont(dialogComp);
- }
-
- /**
- * returns the title area title of the dialog
- * @return the title area title
- */
- protected String getTitleAreaTitle() {
- return LaunchConfigurationsMessages.LaunchConfigurationPropertiesDialog_Edit_launch_configuration_properties_1;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
- */
- protected void createButtonsForButtonBar(Composite parent) {
- // create OK and Cancel buttons by default
- createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#getShellTitle()
- */
- protected String getShellTitle() {
- return LaunchConfigurationsMessages.LaunchConfigurationPropertiesDialog_Properties_for__0__2;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.LAUNCH_CONFIGURATION_PROPERTIES_DIALOG;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#updateButtons()
- */
- public void updateButtons() {
- getTabViewer().refresh();
- getButton(IDialogConstants.OK_ID).setEnabled(getTabViewer().canSave());
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- getTabViewer().handleApplyPressed();
- super.okPressed();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#open()
- */
- public int open() {
- setOpenMode(-1);
- return super.open();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#getDialogSettingsSectionName()
- */
- protected String getDialogSettingsSectionName() {
- return IDebugUIConstants.PLUGIN_ID + ".LAUNCH_CONFIGURATION_PROPERTIES_DIALOG_SECTION"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void launchConfigurationAdded(ILaunchConfiguration configuration) {
- ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
- if (getLaunchConfiguration().equals(manager.getMovedFrom(configuration))) {
- // this config was re-named, update the dialog with the new config
- fLaunchConfiguration = configuration;
- getTabViewer().setInput(getLaunchConfiguration());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void launchConfigurationChanged(ILaunchConfiguration configuration) {}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void launchConfigurationRemoved(ILaunchConfiguration configuration) {}
-
- /**
- * Sets whether the tab group should set default values in the launch configuration
- * when the dialog is opened. If this method is not called, default values are not
- * set.
- *
- * @param setDefaults whether to set default values
- */
- public void setDefaultsOnOpen(boolean setDefaults) {
- fSetDefaultOnOpen = setDefaults;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationSelectionDialog.java
deleted file mode 100644
index 6bc35fa84..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationSelectionDialog.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import org.eclipse.debug.internal.ui.AbstractDebugListSelectionDialog;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This class provides a dialog for selecting a given launch configuration from a listing
- *
- * @since 3.3.0
- * CONTEXTLAUNCHING
- */
-public class LaunchConfigurationSelectionDialog extends AbstractDebugListSelectionDialog {
-
- private static final String DIALOG_SETTINGS = IDebugUIConstants.PLUGIN_ID + ".SELECT_LAUNCH_CONFIGURATION_DIALOG"; //$NON-NLS-1$;
- private Object fInput;
-
- /**
- * Constructor
- * @param parent
- */
- public LaunchConfigurationSelectionDialog(Shell parent, Object input) {
- super(parent);
- fInput = input;
- setTitle(LaunchConfigurationsMessages.LaunchConfigurationSelectionDialog_0);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
- */
- protected String getDialogSettingsId() {
- return DIALOG_SETTINGS;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.SELECT_LAUNCH_CONFIGURATION_DIALOG;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
- */
- protected Object getViewerInput() {
- return fInput;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
- */
- protected String getViewerLabel() {
- return LaunchConfigurationsMessages.LaunchConfigurationSelectionDialog_1;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java
deleted file mode 100644
index 67cee23ba..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.debug.internal.core.IConfigurationElementConstants;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
-
-
-/**
- * Proxy to a launch configuration tab group element
- */
-public class LaunchConfigurationTabGroupExtension {
-
- /**
- * The configuration element defining this tab group.
- */
- private IConfigurationElement fConfig = null;
-
- /**
- * A list of sets of modes that this tab group supports
- * @since 3.3
- */
- private List fModes = null;
-
- /**
- * A map of mode sets to descriptions
- * @since 3.3
- */
- private Map fDescriptions = null;
-
- /**
- * Perspectives for each mode
- */
- private Map fPerspectives = null;
-
- /**
- * Constructs a launch configuration tab extension based
- * on the given configuration element
- *
- * @param element the configuration element defining the
- * attributes of this launch configuration tab extension
- * @return a new launch configuration tab extension
- */
- public LaunchConfigurationTabGroupExtension(IConfigurationElement element) {
- setConfigurationElement(element);
- }
-
- /**
- * Sets the configuration element that defines the attributes
- * for this launch configuration tab group extension.
- *
- * @param element configuration element
- */
- private void setConfigurationElement(IConfigurationElement element) {
- fConfig = element;
- }
-
- /**
- * Returns the configuration element that defines the attributes
- * for this launch configuration tab group extension.
- *
- * @param configuration element that defines the attributes
- * for this launch configuration tab extension
- */
- protected IConfigurationElement getConfigurationElement() {
- return fConfig;
- }
-
- /**
- * Returns the set of modes specified in the configuration data, or <code>null</code>
- * if none (i.e. default tab group)
- *
- * @return the set of modes specified in the configuration data, or
- * <code>null</code>
- */
- protected List getModes() {
- if (fModes == null) {
- fModes = new ArrayList();
- fPerspectives = new Hashtable();
- IConfigurationElement[] modes = fConfig.getChildren(IConfigurationElementConstants.LAUNCH_MODE);
- if (modes.length > 0) {
- IConfigurationElement element = null;
- String perspective = null, mode = null;
- Set mset = null;
- for (int i = 0; i < modes.length; i++) {
- element = modes[i];
- mode = element.getAttribute(IConfigurationElementConstants.MODE);
- mset = new HashSet();
- mset.add(mode);
- fModes.add(mset);
- perspective = element.getAttribute(IConfigurationElementConstants.PERSPECTIVE);
- if (perspective != null) {
- fPerspectives.put(mset, perspective);
- }
- }
- }
- }
- return fModes;
- }
-
- /**
- * Returns the perspective associated with the given launch
- * mode, as specified in plug-in XML, or <code>null</code> if none.
- *
- * @param modes the set of launch modes
- * @return perspective identifier, or <code>null</code>
- */
- protected String getPerspective(Set modes) {
- getModes();
- return (String)fPerspectives.get(modes);
- }
-
- /**
- * Returns the identifier of the type of launch configuration this
- * tab group is associated with
- *
- * @return the identifier of the type of launch configuration this
- * tab group is associated with
- */
- protected String getTypeIdentifier() {
- return getConfigurationElement().getAttribute(IConfigurationElementConstants.TYPE);
- }
-
- /**
- * Returns the identifier of the help context associated with this tab
- * group, or <code>null</code> if one was not specified.
- *
- * @return the identifier of this tab group's help context or
- * <code>null</code>
- * @since 2.1
- */
- protected String getHelpContextId() {
- return getConfigurationElement().getAttribute(IConfigurationElementConstants.HELP_CONTEXT_ID);
- }
-
- /**
- * Returns the identifier of the tab group
- * @return the id of the tab group
- *
- * @since 3.3
- */
- protected String getIdentifier() {
- return getConfigurationElement().getAttribute(IConfigurationElementConstants.ID);
- }
-
- /**
- * Returns a new tab group defined by this extension
- *
- * @return a new tab group defined by this extension
- * @exception CoreException if an exception occurs instantiating
- * the tab group
- */
- public ILaunchConfigurationTabGroup newTabGroup() throws CoreException {
- return (ILaunchConfigurationTabGroup)getConfigurationElement().createExecutableExtension(IConfigurationElementConstants.CLASS);
- }
-
- /**
- * Returns this tab group's description in the given mode set.
- *
- * @param modes the set of modes
- * @return a description of the Launch Mode if available. If not available, attempts to return
- * a description of the Launch Configuration. If no appropriate description is found an empty string is returned.
- */
- public String getDescription(Set modes) {
- String description = null;
- if(fDescriptions == null) {
- fDescriptions = new HashMap();
- IConfigurationElement[] children = fConfig.getChildren(IConfigurationElementConstants.LAUNCH_MODE);
- IConfigurationElement child = null;
- String mode = null;
- HashSet set = null;
- for (int i = 0; i < children.length; i++) {
- child = children[i];
- mode = child.getAttribute(IConfigurationElementConstants.MODE);
- if(mode != null) {
- set = new HashSet();
- set.add(mode);
- }
- description = child.getAttribute(IConfigurationElementConstants.DESCRIPTION);
- if(description != null) {
- fDescriptions.put(set, description);
- }
- }
-
- }
- description = (String) fDescriptions.get(modes);
- if(description == null) {
- description = fConfig.getAttribute(IConfigurationElementConstants.DESCRIPTION);
-
- }
- return (description == null ? IInternalDebugCoreConstants.EMPTY_STRING : description);
- }
-
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
deleted file mode 100644
index 4ad68114b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
+++ /dev/null
@@ -1,1412 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchDelegate;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.core.LaunchConfigurationWorkingCopy;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ColorRegistry;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.custom.ViewForm;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPreferenceConstants;
-import org.eclipse.ui.PlatformUI;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * A viewer that displays tabs for a launch configuration, with apply and revert
- * buttons.
- */
-public class LaunchConfigurationTabGroupViewer {
-
- /**
- * Containing launch dialog
- */
- private ILaunchConfigurationDialog fDialog;
-
- /**
- * The this viewer's input
- */
- private Object fInput;
-
- /**
- * The launch configuration (original) being edited
- */
- private ILaunchConfiguration fOriginal;
-
- /**
- * The working copy of the original
- */
- private ILaunchConfigurationWorkingCopy fWorkingCopy;
-
- /**
- * This view's control, which contains a composite area of controls
- */
- private Composite fViewerControl;
-
- /**
- * The composite which is hidden/displayed as tabs are required.
- */
- private Composite fVisibleArea;
-
- /**
- * Name label widget
- */
- private Label fNameLabel;
-
- /**
- * Name text widget
- */
- private Text fNameWidget;
-
- /**
- * Composite containing the launch config tab widgets
- */
- private Composite fTabComposite;
-
- /**
- * Tab folder
- */
- private CTabFolder fTabFolder;
-
- /**
- * The current tab group being displayed
- */
- private ILaunchConfigurationTabGroup fTabGroup;
-
- /**
- * The type of config tabs are currently displayed
- * for
- */
- private ILaunchConfigurationType fTabType;
-
- /**
- * Index of the active tab
- */
- private int fCurrentTabIndex = -1;
-
- /**
- * Apply & Revert buttons
- */
- private Button fApplyButton;
- private Button fRevertButton;
-
- /**
- * Whether tabs are currently being disposed or initialized
- */
- private boolean fDisposingTabs = false;
- private boolean fInitializingTabs = false;
-
- /**
- * The description of the currently selected launch configuration or
- * launch configuration type or <code>null</code> if none.
- */
- private String fDescription = null;
-
- /**
- * A place holder for switching between the tabs for a config and the getting started tab
- * @since 3.2
- */
- private Composite fTabPlaceHolder = null;
-
- /**
- * A link to allow users to select a valid set of launch options for the specified mode
- * @since 3.3
- */
- private Link fOptionsLink = null;
-
- /**
- * A label to indicate that the user needs to select an a launcher.
- * @since 3.5
- */
- private Label fOptionsErrorLabel = null;
-
- /**
- * A new composite replacing the perspectives tab
- * @since 3.2
- */
- private Composite fGettingStarted = null;
-
- private ViewForm fViewform;
-
- /**
- * Constructs a viewer in the given composite, contained by the given
- * launch configuration dialog.
- *
- * @param parent composite containing this viewer
- * @param dialog containing launch configuration dialog
- */
- public LaunchConfigurationTabGroupViewer(Composite parent, ILaunchConfigurationDialog dialog) {
- super();
- fDialog = dialog;
- createControl(parent);
- }
-
- /**
- * Cleanup
- */
- public void dispose() {
- disposeTabGroup();
- }
-
- /**
- * Dispose the active tab group, if any.
- */
- protected void disposeTabGroup() {
- if (fTabGroup != null) {
- fTabGroup.dispose();
- fTabGroup = null;
- fTabType = null;
- }
- }
-
- /**
- * Creates this viewer's control This area displays the name of the launch
- * configuration currently being edited, as well as a tab folder of tabs
- * that are applicable to the launch configuration.
- *
- * @return the composite used for launch configuration editing
- */
- private void createControl(Composite parent) {
- fViewerControl = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.horizontalSpacing = 0;
- layout.verticalSpacing = 0;
- fViewerControl.setLayout(layout);
- GridData gd = new GridData(GridData.FILL_BOTH);
- fViewerControl.setLayoutData(gd);
-
- fViewform = new ViewForm(fViewerControl, SWT.FLAT | SWT.BORDER);
- layout = new GridLayout(1, false);
- layout.horizontalSpacing = 0;
- layout.verticalSpacing = 0;
- fViewform.setLayout(layout);
- gd = new GridData(GridData.FILL_BOTH);
- fViewform.setLayoutData(gd);
- fVisibleArea = fViewform;
- fViewform.setTopLeft(null);
-
- Composite mainComp = new Composite(fViewform, SWT.FLAT);
- layout = new GridLayout(1, false);
- layout.verticalSpacing = 0;
- layout.horizontalSpacing = 0;
- mainComp.setLayout(layout);
- fViewform.setContent(mainComp);
-
- fTabPlaceHolder = new Composite(mainComp, SWT.NONE);
- fTabPlaceHolder.setLayout(new StackLayout());
- gd = new GridData(GridData.FILL_BOTH);
- fTabPlaceHolder.setLayoutData(gd);
-
- fGettingStarted = new Composite(fTabPlaceHolder, SWT.NONE);
- fGettingStarted.setLayout(new GridLayout());
- gd = new GridData(GridData.FILL_BOTH);
- fGettingStarted.setLayoutData(gd);
-
- createGettingStarted(fGettingStarted);
-
- fTabComposite = new Composite(fTabPlaceHolder, SWT.NONE);
- layout = new GridLayout(2, false);
- layout.verticalSpacing = 10;
- layout.horizontalSpacing = 5;
- fTabComposite.setLayout(layout);
- gd = new GridData(GridData.FILL_BOTH);
- fTabComposite.setLayoutData(gd);
-
- fNameLabel = new Label(fTabComposite, SWT.HORIZONTAL | SWT.LEFT);
- fNameLabel.setText(LaunchConfigurationsMessages.LaunchConfigurationDialog__Name__16);
- fNameLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- fNameWidget = new Text(fTabComposite, SWT.SINGLE | SWT.BORDER);
- fNameWidget.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- fNameWidget.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if(!fInitializingTabs) {
- handleNameModified();
- }
- }
- }
- );
-
- createTabFolder(fTabComposite);
-
- Composite blComp = SWTFactory.createComposite(mainComp, mainComp.getFont(), 2, 1, GridData.FILL_HORIZONTAL);
- Composite linkComp = SWTFactory.createComposite(blComp, blComp.getFont(), 2, 1, GridData.FILL_HORIZONTAL);
-
- //a link for launch options
- fOptionsErrorLabel = new Label(linkComp, SWT.NONE);
- gd = new GridData();
- fOptionsErrorLabel.setLayoutData(gd);
-
- fOptionsLink = new Link(linkComp, SWT.WRAP);
- fOptionsLink.setFont(linkComp.getFont());
- gd = new GridData(SWT.LEFT);
- gd.grabExcessHorizontalSpace = true;
- fOptionsLink.setLayoutData(gd);
- fOptionsLink.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- //collect the options available
- try {
- if(!canLaunchWithModes()) {
- SelectLaunchModesDialog sld = new SelectLaunchModesDialog(getShell(),
- getLaunchConfigurationDialog().getMode(), getWorkingCopy());
- if(sld.open() == IDialogConstants.OK_ID) {
- //set the options to the config
- Object[] res = sld.getResult();
- if(res != null) {
- Set modes = (Set) res[0];
- modes.remove(getLaunchConfigurationDialog().getMode());
- ILaunchConfigurationWorkingCopy wc = getWorkingCopy();
- wc.setModes(modes);
- refreshStatus();
- }
- }
- }
- else if(hasMultipleDelegates()) {
- SelectLaunchersDialog sldd = new SelectLaunchersDialog(getShell(),
- getWorkingCopy().getType().getDelegates(getCurrentModeSet()),
- getWorkingCopy(),
- getLaunchConfigurationDialog().getMode());
- if(sldd.open() == IDialogConstants.OK_ID) {
- displayInstanceTabs(true);
- refreshStatus();
- }
- }
- } catch (CoreException ex) {}
- }
- });
- fOptionsLink.setVisible(false);
-
- Composite buttonComp = new Composite(blComp, SWT.NONE);
- GridLayout buttonCompLayout = new GridLayout();
- buttonCompLayout.numColumns = 2;
- buttonComp.setLayout(buttonCompLayout);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
- buttonComp.setLayoutData(gd);
-
- fApplyButton = new Button(buttonComp, SWT.PUSH);
- fApplyButton.setText(LaunchConfigurationsMessages.LaunchConfigurationDialog__Apply_17);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
- fApplyButton.setLayoutData(gd);
- SWTFactory.setButtonDimensionHint(fApplyButton);
- fApplyButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleApplyPressed();
- }
- });
-
- fRevertButton = new Button(buttonComp, SWT.PUSH);
- fRevertButton.setText(LaunchConfigurationsMessages.LaunchConfigurationDialog_Revert_2);
- gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
- fRevertButton.setLayoutData(gd);
- SWTFactory.setButtonDimensionHint(fRevertButton);
- fRevertButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleRevertPressed();
- }
- });
- Dialog.applyDialogFont(parent);
- }
-
- /**
- * Creates some help text for the tab group launch types
- * @param parent the parent composite
- * @since 3.2
- */
- private void createGettingStarted(Composite parent) {
- Font font = parent.getFont();
- GridData gd = null;
- int width = parent.getBounds().width - 30;
- SWTFactory.createWrapLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_1, 1, width);
- SWTFactory.createWrapCLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_2, DebugUITools.getImage(IInternalDebugUIConstants.IMG_ELCL_NEW_CONFIG), 1, width);
- SWTFactory.createWrapCLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_6, DebugUITools.getImage(IInternalDebugUIConstants.IMG_ELCL_DUPLICATE_CONFIG), 1, width);
- SWTFactory.createWrapCLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_4, DebugUITools.getImage(IInternalDebugUIConstants.IMG_ELCL_DELETE_CONFIG), 1, width);
- SWTFactory.createWrapCLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_8, DebugUITools.getImage(IInternalDebugUIConstants.IMG_ELCL_FILTER_CONFIGS), 1, width);
- SWTFactory.createWrapCLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_3, DebugUITools.getImage(IInternalDebugUIConstants.IMG_OVR_TRANSPARENT), 1, width);
-
- SWTFactory.createHorizontalSpacer(parent, 2);
- Link link = new Link(parent, SWT.LEFT | SWT.WRAP);
- link.setText(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_5);
- link.setFont(font);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint = width;
- link.setLayoutData(gd);
- link.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- SWTFactory.showPreferencePage("org.eclipse.debug.ui.PerspectivePreferencePage"); //$NON-NLS-1$
- }
- });
- }
-
- /**
- * Creates the tab folder for displaying config instances
- * @param parent
- */
- private void createTabFolder(Composite parent) {
- if (fTabFolder == null) {
- ColorRegistry reg = JFaceResources.getColorRegistry();
- Color c1 = reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_BG_START"), //$NON-NLS-1$
- c2 = reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_BG_END"); //$NON-NLS-1$
- fTabFolder = new CTabFolder(parent, SWT.NO_REDRAW_RESIZE | SWT.NO_TRIM | SWT.FLAT);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.horizontalSpan = 2;
- fTabFolder.setSelectionBackground(new Color[] {c1, c2}, new int[] {100}, true);
- fTabFolder.setSelectionForeground(reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_TEXT_COLOR")); //$NON-NLS-1$
- fTabFolder.setSimple(PlatformUI.getPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS));
- fTabFolder.setLayoutData(gd);
- fTabFolder.setBorderVisible(true);
- fTabFolder.setFont(parent.getFont());
- fTabFolder.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- if (!fInitializingTabs) {
- handleTabSelected();
- refresh();
- }
- }
- });
- }
- }
-
- /**
- * Returns the apply button
- */
- protected Button getApplyButton() {
- return fApplyButton;
- }
-
- /**
- * Returns the revert button
- */
- protected Button getRevertButton() {
- return fRevertButton;
- }
-
- /**
- * Sets the current name
- */
- public void setName(String name) {
- if (getWorkingCopy() != null) {
- if (name == null) {
- fNameWidget.setText(IInternalDebugCoreConstants.EMPTY_STRING);
- }
- else {
- fNameWidget.setText(name.trim());
- }
- refreshStatus();
- }
- }
-
- /**
- * @see org.eclipse.jface.viewers.Viewer#getControl()
- */
- public Control getControl() {
- return fViewerControl;
- }
-
- /**
- * Returns the shell this viewer is contained in.
- */
- private Shell getShell() {
- return getControl().getShell();
- }
-
- /**
- * Returns the current input to the viewer. Input will
- * be one of {@link ILaunchConfiguration} or {@link ILaunchConfigurationType}
- *
- * @return returns the current input
- */
- public Object getInput() {
- return fInput;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.Viewer#refresh()
- */
- public void refresh() {
- if (fInitializingTabs) {
- return;
- }
- ILaunchConfigurationTab[] tabs = getTabs();
- if (tabs != null) {
- // update the working copy from the active tab
- boolean newwc = !getWorkingCopy().isDirty();
- ILaunchConfigurationTab tab = getActiveTab();
- if (tab != null) {
- tab.performApply(getWorkingCopy());
- }
- if((fOriginal instanceof ILaunchConfigurationWorkingCopy) && newwc) {
- try {
- ILaunchConfigurationWorkingCopy copy = getWorkingCopy();
- if(copy != null) {
- copy.doSave();
- }
- }
- catch (CoreException e) {DebugUIPlugin.log(e);}
- }
- updateButtons();
- // update error ticks
- CTabItem item = null;
- boolean error = false;
- Image image = null;
- for (int i = 0; i < tabs.length; i++) {
- item = fTabFolder.getItem(i);
- image = tabs[i].getImage();
- item.setImage(image);
- if(!tabs[i].isValid(getWorkingCopy())) {
- error = tabs[i].getErrorMessage() != null;
- if(error) {
- item.setImage(DebugUIPlugin.getDefault().getLaunchConfigurationManager().getErrorTabImage(tabs[i]));
- }
- }
- }
- showLink();
- getLaunchConfigurationDialog().updateMessage();
- }
- }
-
- /**
- * Shows the link for either multiple launch delegates or bad launch mode combinations
- *
- * @since 3.3
- */
- private void showLink() {
- String text = null;
- if(!canLaunchWithModes()) {
- text = LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_13;
- }
- else if(hasMultipleDelegates()) {
- ILaunchDelegate delegate = getPreferredDelegate();
- if(delegate != null) {
- String name = delegate.getName();
- if(name == null) {
- text = LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_15;
- }
- else {
- text = MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_16, new String[] {name});
- }
- }
- else {
- text = LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_17;
- }
- }
- if(text != null) {
- fOptionsLink.setText(text);
- }
- fOptionsLink.setVisible(!canLaunchWithModes() || hasMultipleDelegates());
- if (hasDuplicateDelegates()) {
- fOptionsErrorLabel.setImage(JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR));
- } else {
- fOptionsErrorLabel.setImage(null);
- }
- fViewform.layout(true, true);
- }
-
- /**
- * Returns the preferred launch delegate for the current launch configuration and mode set
- * @return the preferred launch delegate
- *
- * @since 3.3
- */
- protected ILaunchDelegate getPreferredDelegate() {
- ILaunchDelegate preferred = null;
- ILaunchConfigurationWorkingCopy config = getWorkingCopy();
- if(config != null) {
- try {
- Set modes = getCurrentModeSet();
- preferred = config.getPreferredDelegate(modes);
- if(preferred == null) {
- preferred = config.getType().getPreferredDelegate(modes);
- }
- }
- catch(CoreException ce) {DebugUIPlugin.log(ce);}
- }
- return preferred;
- }
-
- /**
- * Returns the listing of modes for the current config
- * @return the listing of modes for the current config
- * @since 3.3
- */
- private Set getCurrentModeSet() {
- Set set = new HashSet();
- ILaunchConfigurationWorkingCopy config = getWorkingCopy();
- if(config != null) {
- try {
- set.addAll(config.getModes());
- set.add(getLaunchConfigurationDialog().getMode());
- }
- catch(CoreException ce) {DebugUIPlugin.log(ce);}
- }
- return set;
- }
-
- /**
- * updates the button states
- */
- private void updateButtons() {
- boolean dirty = isDirty() && canSave();
- fApplyButton.setEnabled(dirty);
- fRevertButton.setEnabled(dirty);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.Viewer#setInput(java.lang.Object)
- */
- public void setInput(final Object input) {
- if(DebugUIPlugin.getStandardDisplay().getThread().equals(Thread.currentThread())) {
- setInput0(input);
- }
- else {
- DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
- public void run() {
- setInput0(input);
- }
- });
- }
-
- }
- /**
- * Sets the input to the tab group viewer
- * @param input the new input
- * @since 3.3
- */
- private void setInput0(Object input) {
- if (input == null) {
- if (fInput == null) {
- return;
- }
- inputChanged(input);
- } else {
- if (!input.equals(fInput)) {
- inputChanged(input);
- }
- }
- }
-
- /**
- * The input has changed to the given object, possibly <code>null</code>.
- *
- * @param input the new input, possibly <code>null</code>
- */
- protected void inputChanged(Object input) {
- fInput = input;
- Runnable r = new Runnable() {
- public void run() {
- try {
- fVisibleArea.setRedraw(false);
- if (fInput instanceof ILaunchConfiguration) {
- ILaunchConfiguration configuration = (ILaunchConfiguration)fInput;
- boolean refreshtabs = !delegatesEqual(fWorkingCopy, configuration);
- fOriginal = configuration;
- fWorkingCopy = configuration.getWorkingCopy();
- displayInstanceTabs(refreshtabs);
- } else if (fInput instanceof ILaunchConfigurationType) {
- fDescription = getDescription((ILaunchConfigurationType)fInput);
- setNoInput();
- } else {
- setNoInput();
- }
- } catch (CoreException ce) {
- errorDialog(ce);
- setNoInput();
- }
- finally {
- refreshStatus();
- fVisibleArea.setRedraw(true);
- }
- }
- };
- BusyIndicator.showWhile(getShell().getDisplay(), r);
- }
-
- /**
- * Sets the tab group viewer to have no input, this is the case when null is passed as an input type
- * Setting no input is equivalent to resetting all items, clearing any messages and showing the 'getting started' pane
- * @since 3.2
- */
- private void setNoInput() {
- fOriginal = null;
- fWorkingCopy = null;
- disposeExistingTabs();
- updateButtons();
- updateVisibleControls(false);
- ILaunchConfigurationDialog lcd = getLaunchConfigurationDialog();
- if(lcd instanceof LaunchConfigurationsDialog) {
- if(((LaunchConfigurationsDialog)lcd).isTreeSelectionEmpty()) {
- fDescription = IInternalDebugCoreConstants.EMPTY_STRING;
- }
- }
- }
-
- /**
- * Returns if the two configurations are using the same <code>ILaunchDelegate</code> or not
- * @param config1
- * @param config2
- * @return true if the configurations are using the same <code>ILaunchDelegate</code> or false if they are not
- * @since 3.3
- */
- protected boolean delegatesEqual(ILaunchConfiguration config1, ILaunchConfiguration config2) {
- try {
- if(config1 == null || config2 == null) {
- return false;
- }
- Set modes = getCurrentModeSet();
- ILaunchDelegate d1 = config1.getPreferredDelegate(modes);
- if(d1 == null) {
- d1 = config1.getType().getPreferredDelegate(modes);
- }
- ILaunchDelegate d2 = config2.getPreferredDelegate(modes);
- if(d2 == null) {
- d2 = config2.getType().getPreferredDelegate(modes);
- }
- if(d1 != null) {
- return d1.equals(d2);
- }
- }
- catch(CoreException ce) {DebugUIPlugin.log(ce);}
- return false;
- }
-
- /**
- * Updates the visibility of controls based on the status provided
- * @param visible the visibility status to be applied to the controls
- */
- private void updateVisibleControls(boolean visible) {
- fApplyButton.setVisible(visible);
- fRevertButton.setVisible(visible);
- fOptionsLink.setVisible(visible);
- if(visible) {
- ((StackLayout)fTabPlaceHolder.getLayout()).topControl = fTabComposite;
- }
- else {
- ((StackLayout)fTabPlaceHolder.getLayout()).topControl = fGettingStarted;
- }
- fTabPlaceHolder.layout(true, true);
- }
-
- /**
- * sets the current widget focus to the 'Name' widget
- */
- protected void setFocusOnName() {
- fNameWidget.setFocus();
- }
-
- /**
- * Displays tabs for the current working copy
- */
- protected void displayInstanceTabs(boolean redrawTabs) {
- // Turn on initializing flag to ignore message updates
- fInitializingTabs = true;
- ILaunchConfigurationType type = null;
- try {
- type = getWorkingCopy().getType();
- }
- catch (CoreException e) {
- errorDialog(e);
- fInitializingTabs = false;
- return;
- }
- if(redrawTabs) {
- showInstanceTabsFor(type);
- }
- // show the name area
- updateVisibleControls(true);
-
- // Retrieve the current tab group. If there is none, clean up and leave
- ILaunchConfigurationTabGroup tabGroup = getTabGroup();
- if (tabGroup == null) {
- IStatus status = new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_No_tabs_defined_for_launch_configuration_type__0__1, new String[]{type.getName()}), null);
- CoreException e = new CoreException(status);
- errorDialog(e);
- fInitializingTabs = false;
- return;
- }
-
- // Update the tabs with the new working copy
- tabGroup.initializeFrom(getWorkingCopy());
-
- // Update the name field
- fNameWidget.setText(getWorkingCopy().getName());
-
- fCurrentTabIndex = fTabFolder.getSelectionIndex();
-
- // Turn off initializing flag to update message
- fInitializingTabs = false;
-
- if (!fVisibleArea.isVisible()) {
- fVisibleArea.setVisible(true);
- }
- }
-
- /**
- * Populate the tabs in the configuration edit area to be appropriate to the current
- * launch configuration type.
- */
- private void showInstanceTabsFor(ILaunchConfigurationType configType) {
- // try to keep on same tab
- Class tabKind = null;
- if (getActiveTab() != null) {
- tabKind = getActiveTab().getClass();
- }
- // Build the new tabs
- ILaunchConfigurationTabGroup group = null;
- try {
- group = createGroup();
- } catch (CoreException ce) {
- DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.LaunchConfigurationDialog_Error_19, LaunchConfigurationsMessages.LaunchConfigurationDialog_Exception_occurred_creating_launch_configuration_tabs_27,ce); //
- return;
- }
- disposeExistingTabs();
- fTabGroup = group;
- fTabType = configType;
- ILaunchConfigurationTab[] tabs = getTabs();
- CTabItem tab = null;
- String name = IInternalDebugCoreConstants.EMPTY_STRING;
- Control control = null;
- for (int i = 0; i < tabs.length; i++) {
- tab = new CTabItem(fTabFolder, SWT.BORDER);
- name = tabs[i].getName();
- if (name == null) {
- name = LaunchConfigurationsMessages.LaunchConfigurationDialog_unspecified_28;
- }
- tab.setText(name);
- tab.setImage(tabs[i].getImage());
- tabs[i].createControl(tab.getParent());
- control = tabs[i].getControl();
- if (control != null) {
- tab.setControl(control);
- }
- }
- //set the default tab as the first one
- if (tabs.length > 0) {
- setActiveTab(tabs[0]);
- }
- // select same tab as before, if possible
- for (int i = 0; i < tabs.length; i++) {
- if (tabs[i].getClass().equals(tabKind)) {
- setActiveTab(tabs[i]);
- break;
- }
- }
- fDescription = getDescription(configType);
- }
-
- /**
- * Returns the description of the given configuration type
- * in the current mode or <code>null</code> if none.
- *
- * @param configType the config type
- * @return the description of the given configuration type or <code>null</code>
- */
- private String getDescription(ILaunchConfigurationType configType) {
- String description = null;
- if(configType != null) {
- String mode = fDialog.getMode();
- description = LaunchConfigurationPresentationManager.getDefault().getDescription(configType, mode);
- }
- if (description == null) {
- description = IInternalDebugCoreConstants.EMPTY_STRING;
- }
- return description;
- }
-
- /**
- * Returns tab group for the given type of launch configuration.
- * Tabs are initialized to be contained in this dialog.
- *
- * @exception CoreException if unable to instantiate a tab group
- */
- protected ILaunchConfigurationTabGroup createGroup() throws CoreException {
- // Use a final Object array to store the tab group and any exception that
- // results from the Runnable
- final Object[] finalArray = new Object[2];
- Runnable runnable = new Runnable() {
- public void run() {
- ILaunchConfigurationTabGroup tabGroup = null;
- try {
- tabGroup = LaunchConfigurationPresentationManager.getDefault().getTabGroup(getWorkingCopy(), getLaunchConfigurationDialog().getMode());
- finalArray[0] = tabGroup;
- } catch (CoreException ce) {
- finalArray[1] = ce;
- return;
- }
- tabGroup.createTabs(getLaunchConfigurationDialog(), getLaunchConfigurationDialog().getMode());
- ILaunchConfigurationTab[] tabs = tabGroup.getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].setLaunchConfigurationDialog(getLaunchConfigurationDialog());
- }
- }
- };
-
- // Creating the tabs can result in plug-in loading, so we show the busy cursor
- BusyIndicator.showWhile(getControl().getDisplay(), runnable);
-
- // Re-throw any CoreException if there was one
- if (finalArray[1] != null) {
- throw (CoreException)finalArray[1];
- }
-
- // Otherwise return the tab group
- return (ILaunchConfigurationTabGroup)finalArray[0];
- }
-
- /**
- * Returns the tabs currently being displayed, or
- * <code>null</code> if none.
- *
- * @return currently displayed tabs, or <code>null</code>
- */
- public ILaunchConfigurationTab[] getTabs() {
- if (getTabGroup() != null) {
- return getTabGroup().getTabs();
- }
- return null;
- }
-
- /**
- * Returns the currently active <code>ILaunchConfigurationTab</code>
- * being displayed, or <code>null</code> if there is none.
- *
- * @return currently active <code>ILaunchConfigurationTab</code>, or <code>null</code>.
- */
- public ILaunchConfigurationTab getActiveTab() {
- ILaunchConfigurationTab[] tabs = getTabs();
- if (fTabFolder != null && tabs != null) {
- int pageIndex = fTabFolder.getSelectionIndex();
- if (pageIndex >= 0) {
- return tabs[pageIndex];
- }
- }
- return null;
- }
-
- /**
- * Returns whether the launch configuration being edited is dirty (i.e.
- * needs saving)
- *
- * @return whether the launch configuration being edited needs saving
- */
- public boolean isDirty() {
- ILaunchConfigurationWorkingCopy workingCopy = getWorkingCopy();
- if (workingCopy == null) {
- return false;
- }
- if(workingCopy.getParent() != null) {
- return !workingCopy.getParent().contentsEqual(workingCopy);
- }
- // Working copy hasn't been saved
- if (workingCopy.getOriginal() == null) {
- return true;
- }
- return fOriginal != null && !fOriginal.contentsEqual(workingCopy);
- }
-
- /**
- * Update apply & revert buttons, as well as buttons and message on the
- * launch config dialog.
- */
- protected void refreshStatus() {
- if (!fInitializingTabs) {
- LaunchConfigurationsDialog lcd = (LaunchConfigurationsDialog) getLaunchConfigurationDialog();
- lcd.refreshStatus();
- }
- }
-
- /**
- * Returns the containing launch dialog
- */
- protected ILaunchConfigurationDialog getLaunchConfigurationDialog() {
- return fDialog;
- }
-
- /**
- * Returns the original launch configuration being edited, possibly
- * <code>null</code>.
- *
- * @return ILaunchConfiguration
- */
- protected ILaunchConfiguration getOriginal() {
- return fOriginal;
- }
-
- /**
- * Returns the working copy used to edit the original, possibly
- * <code>null</code>.
- */
- protected ILaunchConfigurationWorkingCopy getWorkingCopy() {
- return fWorkingCopy;
- }
-
- /**
- * Return whether the current configuration can be saved.
- * <p>
- * Note this is NOT the same thing as the config simply being valid. It
- * is possible to save a config that does not validate. This method
- * determines whether the config can be saved without causing a serious
- * error. For example, a shared config that has no specified location would
- * cause this method to return <code>false</code>.
- * </p>
- */
- public boolean canSave() {
- if (fInitializingTabs) {
- return false;
- }
- // First make sure that name doesn't prevent saving the config
- try {
- verifyName();
- } catch (CoreException ce) {
- return false;
- }
-
- // Next, make sure none of the tabs object to saving the config
- ILaunchConfigurationTab[] tabs = getTabs();
- if (tabs == null) {
- return false;
- }
- for (int i = 0; i < tabs.length; i++) {
- if (!tabs[i].canSave()) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * @see ILaunchConfigurationDialog#canLaunch()
- */
- public boolean canLaunch() {
- if(fInitializingTabs) {
- return false;
- }
- if (getWorkingCopy() == null) {
- return false;
- }
- try {
- verifyName();
- } catch (CoreException e) {
- return false;
- }
-
- ILaunchConfigurationTab[] tabs = getTabs();
- if (tabs == null) {
- return false;
- }
- for (int i = 0; i < tabs.length; i++) {
- if (!tabs[i].isValid(getWorkingCopy())) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Determines if the tab groups that is currently visible can launch with the currently selected
- * set of options.
- *
- * @return true if the dialog can launch with the given set of modes, false otherwise
- *
- * @since 3.3
- */
- public boolean canLaunchWithModes() {
- if(fInitializingTabs) {
- return false;
- }
- //check if selected options exist and that the selected combination can be launched
- try {
- ILaunchConfigurationWorkingCopy wc = getWorkingCopy();
- if(wc != null) {
- return wc.getType().supportsModeCombination(getCurrentModeSet());
- }
- } catch (CoreException e) {
- }
- return true;
- }
-
- /**
- * Returns if the type currently showing in the tab group viewer has duplicate launch delegates for the given set of modes.
- *
- * The given set of modes comprises the current mode that the launch dialog was opened in as well as any modes that have been set on the launch
- * configuration.
- * @return the true if there are duplicates, false otherwise
- *
- * @since 3.3
- */
- public boolean hasDuplicateDelegates() {
- if(fInitializingTabs) {
- return false;
- }
- ILaunchConfiguration config = getWorkingCopy();
- if(config != null) {
- if(hasMultipleDelegates()) {
- return getPreferredDelegate() == null;
- }
- }
- return false;
- }
-
- /**
- * Determines if the currently showing launch configuration has multiple launch delegates for the same mode set, but does not care
- * if there has been a default selected yet or not
- * @return true if the current launch configuration has multiple launch delegates, false otherwise
- */
- private boolean hasMultipleDelegates() {
- ILaunchConfiguration config = getWorkingCopy();
- if(config != null) {
- try {
- Set modes = getCurrentModeSet();
- ILaunchDelegate[] delegates = LaunchConfigurationManager.filterLaunchDelegates(fTabType, modes);
- return delegates.length > 1;
- }
- catch (CoreException ce) {DebugUIPlugin.log(ce);}
- }
- return false;
- }
-
- /**
- * Returns the current error message or <code>null</code> if none.
- */
- public String getErrorMesssage() {
- if (fInitializingTabs) {
- return null;
- }
-
- if (getWorkingCopy() == null) {
- return null;
- }
- try {
- verifyName();
- } catch (CoreException ce) {
- return ce.getStatus().getMessage();
- }
-
- if(hasDuplicateDelegates()) {
- return LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_18;
- }
-
- String message = null;
- ILaunchConfigurationTab activeTab = getActiveTab();
- if (activeTab == null) {
- return null;
- }
- message = activeTab.getErrorMessage();
- if (message != null) {
- return message;
- }
-
- ILaunchConfigurationTab[] allTabs = getTabs();
- for (int i = 0; i < allTabs.length; i++) {
- ILaunchConfigurationTab tab = allTabs[i];
- if (tab == activeTab) {
- continue;
- }
- message = tab.getErrorMessage();
- if (message != null) {
- StringBuffer temp= new StringBuffer();
- temp.append('[');
- temp.append(DebugUIPlugin.removeAccelerators(tab.getName()));
- temp.append("]: "); //$NON-NLS-1$
- temp.append(message);
- return temp.toString();
- }
- }
- if(!canLaunchWithModes()) {
- Set modes = getCurrentModeSet();
- List names = LaunchConfigurationPresentationManager.getDefault().getLaunchModeNames(modes);
- return MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_14, new String[]{names.toString()});
- }
- return null;
- }
-
- /**
- * Returns the current message or <code>null</code> if none.
- * @return Returns an appropriate message for display to user. The message returned will be:
- * The message defined by the visible tab,
- * or The tab group description for the particular launch mode,
- * or The generic tab group description,
- * or <code>null</code> if no message is defined
- */
- public String getMessage() {
- if (fInitializingTabs) {
- return null;
- }
-
- String message = fDescription;
-
- ILaunchConfigurationTab tab = getActiveTab();
- if (tab != null) {
- String tabMessage = tab.getMessage();
- if (tabMessage != null) {
- message = tabMessage;
- }
- }
-
- return message;
- }
-
- /**
- * Verify that the launch configuration name is valid.
- */
- protected void verifyName() throws CoreException {
- if (fNameWidget.isVisible()) {
- ILaunchManager mgr = DebugPlugin.getDefault().getLaunchManager();
- String currentName = fNameWidget.getText().trim();
-
- // If there is no name, complain
- if (currentName.length() < 1) {
- throw new CoreException(new Status(IStatus.ERROR,
- DebugUIPlugin.getUniqueIdentifier(),
- 0,
- LaunchConfigurationsMessages.LaunchConfigurationDialog_Name_required_for_launch_configuration_11,
- null));
- }
- try {
- mgr.isValidLaunchConfigurationName(currentName);
- }
- catch(IllegalArgumentException iae) {
- throw new CoreException(new Status(IStatus.ERROR,
- DebugUIPlugin.getUniqueIdentifier(),
- 0,
- iae.getMessage(),
- null));
- }
- // Otherwise, if there's already a config with the same name, complain
- if (fOriginal != null && !fOriginal.getName().equals(currentName)) {
- Set reservednames = ((LaunchConfigurationsDialog)getLaunchConfigurationDialog()).getReservedNameSet();
- if (mgr.isExistingLaunchConfigurationName(currentName) || (reservednames != null ? reservednames.contains(currentName) : false)) {
- throw new CoreException(new Status(IStatus.ERROR,
- DebugUIPlugin.getUniqueIdentifier(),
- 0,
- LaunchConfigurationsMessages.LaunchConfigurationDialog_Launch_configuration_already_exists_with_this_name_12,
- null));
- }
- }
- }
- }
-
- /**
- * Remove the existing tabs that are showing
- */
- private void disposeExistingTabs() {
- fDisposingTabs = true;
- fTabFolder.dispose();
- fTabFolder = null;
- createTabFolder(fTabComposite);
- disposeTabGroup();
- fDisposingTabs = false;
- }
-
- /**
- * Returns the current tab group
- *
- * @return the current tab group, or <code>null</code> if none
- */
- public ILaunchConfigurationTabGroup getTabGroup() {
- return fTabGroup;
- }
-
- /**
- * Notification that a tab has been selected
- *
- * Disallow tab changing when the current tab is invalid.
- * Update the config from the tab being left, and refresh
- * the tab being entered.
- */
- protected void handleTabSelected() {
- if (fDisposingTabs || fInitializingTabs) {
- return;
- }
- ILaunchConfigurationTab[] tabs = getTabs();
- if (fCurrentTabIndex == fTabFolder.getSelectionIndex() || tabs == null || tabs.length == 0 || fCurrentTabIndex > (tabs.length - 1)) {
- return;
- }
- if (fCurrentTabIndex != -1) {
- ILaunchConfigurationTab tab = tabs[fCurrentTabIndex];
- ILaunchConfigurationWorkingCopy wc = getWorkingCopy();
- if (wc != null) {
- tab.deactivated(wc);
- getActiveTab().activated(wc);
- }
- }
- fCurrentTabIndex = fTabFolder.getSelectionIndex();
- }
-
- /**
- * Notification the name field has been modified
- */
- protected void handleNameModified() {
- getWorkingCopy().rename(fNameWidget.getText().trim());
- refreshStatus();
- }
-
- /**
- * Notification that the 'Apply' button has been pressed
- */
- protected boolean handleApplyPressed() {
- if(fOriginal != null && fOriginal.isReadOnly()) {
- IStatus status = ResourcesPlugin.getWorkspace().validateEdit(new IFile[] {fOriginal.getFile()}, fViewerControl.getShell());
- if(!status.isOK()) {
- return false;
- }
- }
- Exception exception = null;
- try {
- // update launch config
- fInitializingTabs = true;
- // trim name
- String trimmed = fNameWidget.getText().trim();
- fNameWidget.setText(trimmed);
- if(fWorkingCopy == null) {
- fWorkingCopy = fOriginal.getWorkingCopy();
- }
- fWorkingCopy.rename(trimmed);
- getTabGroup().performApply(fWorkingCopy);
- if (isDirty()) {
- if(!fWorkingCopy.isLocal()) {
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- fOriginal = ((LaunchConfigurationWorkingCopy)fWorkingCopy).doSave(monitor);
- }
- catch (CoreException e) {DebugUIPlugin.log(e);}
- }
- };
- getLaunchConfigurationDialog().run(true, false, runnable);
- }
- else {
- fOriginal = fWorkingCopy.doSave();
- }
- }
- updateButtons();
- fInitializingTabs = false;
- }
- catch (CoreException e) {exception = e;}
- catch (InvocationTargetException e) {exception = e;}
- catch (InterruptedException e) {exception = e;}
- if(exception != null) {
- DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.LaunchConfigurationDialog_Launch_Configuration_Error_46, LaunchConfigurationsMessages.LaunchConfigurationDialog_Exception_occurred_while_saving_launch_configuration_47, exception); //
- return false;
- } else {
- return true;
- }
- }
-
- /**
- * Notification that the 'Revert' button has been pressed
- */
- protected void handleRevertPressed() {
- try {
- if(fTabGroup != null) {
- fTabGroup.initializeFrom(fOriginal);
- fNameWidget.setText(fOriginal.getName());
- fWorkingCopy = fOriginal.getWorkingCopy();
- refreshStatus();
- }
- }
- catch (CoreException e) {DebugUIPlugin.log(e);}
- }
-
- /**
- * Show an error dialog on the given exception.
- *
- * @param exception
- */
- protected void errorDialog(CoreException exception) {
- ErrorDialog.openError(getShell(), null, null, exception.getStatus());
- }
-
- /**
- * Sets the displayed tab to the given tab. Has no effect if the specified
- * tab is not one of the tabs being displayed in the dialog currently.
- *
- * @param tab the tab to display/activate
- */
- public void setActiveTab(ILaunchConfigurationTab tab) {
- ILaunchConfigurationTab[] tabs = getTabs();
- if(tabs != null) {
- for (int i = 0; i < tabs.length; i++) {
- if (tabs[i].getClass().equals(tab.getClass())) {
- setActiveTab(i);
- return;
- }
- }
- }
- }
-
- /**
- * Sets the displayed tab to the tab with the given index. Has no effect if
- * the specified index is not within the limits of the tabs returned by
- * <code>getTabs()</code>.
- *
- * @param index the index of the tab to display
- */
- public void setActiveTab(int index) {
- ILaunchConfigurationTab[] tabs = getTabs();
- if (index >= 0 && index < tabs.length) {
- fTabFolder.setSelection(index);
- handleTabSelected();
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java
deleted file mode 100644
index 4afaa2150..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Doug <doug.satchwell@btinternet.com> - Bug 243053
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.LaunchConfigurationTabExtension;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
-
-/**
- * This class is used to wrap a contributed <code>ILaunchConfigurationTabGroup</code> with any contributed tabs
- * for that group (from a <code>launchConfigurationTabs</code> extension point).
- *
- * @since 3.3
- */
-public class LaunchConfigurationTabGroupWrapper implements ILaunchConfigurationTabGroup {
-
- /**
- * Collects all tabs and contributed tabs in the correct ordering
- *
- * @since 3.5
- */
- class TabCollector implements Iterator {
-
- private HashSet idSet = null;
- private ArrayList tabList = null;
- private ArrayList extList = null;
-
- public TabCollector(List tabs, List exts) {
- tabList = new ArrayList(tabs);
- extList = new ArrayList(exts);
- idSet = new HashSet(tabList.size() + extList.size());
- }
-
- /**
- * Get the tab for any extension that is 'relative' to any of the previously returned tabs
- *
- * @return the next tab extension tab
- */
- private ILaunchConfigurationTab nextExtensionTab() {
- for (Iterator iterator = extList.iterator(); iterator.hasNext();) {
- LaunchConfigurationTabExtension launchConfigurationTabExtension = (LaunchConfigurationTabExtension)iterator.next();
- String relativeTab = launchConfigurationTabExtension.getRelativeTabId();
- if (relativeTab == null || idSet.contains(relativeTab)) {
- iterator.remove();
- return launchConfigurationTabExtension.getTab();
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see java.util.Iterator#hasNext()
- */
- public boolean hasNext() {
- return extList.size() > 0 || tabList.size() > 0;
- }
-
- /* (non-Javadoc)
- * @see java.util.Iterator#next()
- */
- public Object next() {
- ILaunchConfigurationTab nextTab = nextExtensionTab();
- if (nextTab == null) {
- if (tabList.size() > 0) {
- nextTab = (ILaunchConfigurationTab)tabList.remove(0);
- }
- else {
- LaunchConfigurationTabExtension launchConfigurationTabExtension = (LaunchConfigurationTabExtension)extList.remove(0);
- nextTab = launchConfigurationTabExtension.getTab();
- }
- }
- if (nextTab instanceof AbstractLaunchConfigurationTab) {
- String id = ((AbstractLaunchConfigurationTab)nextTab).getId();
- if (id != null) {
- idSet.add(id);
- }
- }
- return nextTab;
- }
-
- /* (non-Javadoc)
- * @see java.util.Iterator#remove()
- */
- public void remove() {
- throw new UnsupportedOperationException();
- }
- }
-
- private ILaunchConfigurationTabGroup fGroup = null;
- private String fGroupId = null;
- /**
- * listing of tab extensions that we have to create
- */
- private List fTabs = null;
- private String fMode = null;
- private ILaunchConfiguration fConfig = null;
-
- /**
- * Constructor
- * @param group the existing group to wrapper
- * @param groupId the string id of the associated tab group
- * @param config the launch configuration this tab group is opened on
- */
- public LaunchConfigurationTabGroupWrapper(ILaunchConfigurationTabGroup group, String groupId, ILaunchConfiguration config) {
- fGroup = group;
- fGroupId = groupId;
- fConfig = config;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String)
- */
- public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
- if(fGroup != null) {
- fGroup.createTabs(dialog, mode);
- fMode = mode;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#dispose()
- */
- public void dispose() {
- fGroup.dispose();
- if(fTabs != null) {
- List tabs = Arrays.asList(fGroup.getTabs());
- ILaunchConfigurationTab tab = null;
- for(int i = 0; i < fTabs.size(); i++) {
- tab = (ILaunchConfigurationTab)fTabs.get(i);
- if(!tabs.contains(tab)) {
- tab.dispose();
- }
- }
- fTabs.clear();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#getTabs()
- */
- public ILaunchConfigurationTab[] getTabs() {
- if(fTabs == null) {
- try {
- fTabs = new ArrayList();
- LaunchConfigurationTabExtension[] ext = LaunchConfigurationPresentationManager.getDefault().getTabExtensions(fGroupId, fConfig, fMode);
- //if there are no extensions bypass and do a raw copy into
- if(ext.length > 0) {
- TabCollector collector = new TabCollector(Arrays.asList(fGroup.getTabs()), Arrays.asList(ext));
- while(collector.hasNext()) {
- Object next = collector.next();
- if (next != null) {
- fTabs.add(next);
- }
- }
- }
- else {
- ILaunchConfigurationTab[] tabs = fGroup.getTabs();
- for(int i = 0; i < tabs.length; i++) {
- fTabs.add(tabs[i]);
- }
- }
- }
- catch (CoreException ce) {DebugUIPlugin.log(ce);}
- }
- return (ILaunchConfigurationTab[]) fTabs.toArray(new ILaunchConfigurationTab[fTabs.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- fGroup.initializeFrom(configuration);
- if(fTabs != null) {
- List tabs = Arrays.asList(fGroup.getTabs());
- ILaunchConfigurationTab tab = null;
- for(int i = 0; i < fTabs.size(); i++) {
- tab = (ILaunchConfigurationTab)fTabs.get(i);
- if(!tabs.contains(tab)) {
- tab.initializeFrom(configuration);
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#launched(org.eclipse.debug.core.ILaunch)
- */
- public void launched(ILaunch launch) {
- if(fGroup != null) {
- fGroup.launched(launch);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- fGroup.performApply(configuration);
- if(fTabs != null) {
- List tabs = Arrays.asList(fGroup.getTabs());
- ILaunchConfigurationTab tab = null;
- for(int i = 0; i < fTabs.size(); i++) {
- tab = (ILaunchConfigurationTab)fTabs.get(i);
- if(!tabs.contains(tab)) {
- tab.performApply(configuration);
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- fGroup.setDefaults(configuration);
- if(fTabs != null) {
- List tabs = Arrays.asList(fGroup.getTabs());
- ILaunchConfigurationTab tab = null;
- for(int i = 0; i < fTabs.size(); i++) {
- tab = (ILaunchConfigurationTab)fTabs.get(i);
- if(!tabs.contains(tab)) {
- tab.setDefaults(configuration);
- }
- }
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabImageDescriptor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabImageDescriptor.java
deleted file mode 100644
index 1cb7e1674..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabImageDescriptor.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.resource.CompositeImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.Point;
-
-/**
- * A JDIImageDescriptor consists of a main icon and several adornments. The adornments
- * are computed according to flags set on creation of the descriptor.
- */
-public class LaunchConfigurationTabImageDescriptor extends CompositeImageDescriptor {
-
- /** Flag to render the error adornment */
- public final static int ERROR= 0x001;
-
- private Image fBaseImage;
- private int fFlags;
- private Point fSize;
-
- /**
- * Create a new JDIImageDescriptor.
- *
- * @param baseImage an image descriptor used as the base image
- * @param flags flags indicating which adornments are to be rendered
- *
- */
- public LaunchConfigurationTabImageDescriptor(Image baseImage, int flags) {
- setBaseImage(baseImage);
- setFlags(flags);
- }
-
- /**
- * @see CompositeImageDescriptor#getSize()
- */
- protected Point getSize() {
- if (fSize == null) {
- ImageData data= getBaseImage().getImageData();
- setSize(new Point(data.width, data.height));
- }
- return fSize;
- }
-
- /**
- * @see Object#equals(java.lang.Object)
- */
- public boolean equals(Object object) {
- if (!(object instanceof LaunchConfigurationTabImageDescriptor)){
- return false;
- }
-
- LaunchConfigurationTabImageDescriptor other= (LaunchConfigurationTabImageDescriptor)object;
- return (getBaseImage().equals(other.getBaseImage()) && getFlags() == other.getFlags());
- }
-
- /**
- * @see Object#hashCode()
- */
- public int hashCode() {
- return getBaseImage().hashCode() | getFlags();
- }
-
- /**
- * @see CompositeImageDescriptor#drawCompositeImage(int, int)
- */
- protected void drawCompositeImage(int width, int height) {
- ImageData bg= getBaseImage().getImageData();
- if (bg == null) {
- bg= DEFAULT_IMAGE_DATA;
- }
- drawImage(bg, 0, 0);
- drawOverlays();
- }
-
- /**
- * Add any overlays to the image as specified in the flags.
- */
- protected void drawOverlays() {
- int flags= getFlags();
- ImageData data= null;
- if ((flags & ERROR) != 0) {
- data= DebugUITools.getImage(IDebugUIConstants.IMG_OVR_ERROR).getImageData();
- drawImage(data, 0, 0);
- }
- }
-
- protected Image getBaseImage() {
- return fBaseImage;
- }
-
- protected void setBaseImage(Image baseImage) {
- fBaseImage = baseImage;
- }
-
- protected int getFlags() {
- return fFlags;
- }
-
- protected void setFlags(int flags) {
- fFlags = flags;
- }
-
- protected void setSize(Point size) {
- fSize = size;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTreeContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTreeContentProvider.java
deleted file mode 100644
index 09cdd709b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTreeContentProvider.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.activities.WorkbenchActivityHelper;
-
-/**
- * Content provider for representing launch configuration types & launch configurations in a tree.
- *
- * @since 2.1
- */
-public class LaunchConfigurationTreeContentProvider implements ITreeContentProvider {
-
- /**
- * Empty Object array
- */
- private static final Object[] EMPTY_ARRAY = new Object[0];
-
- /**
- * The mode in which the tree is being shown, one of <code>RUN_MODE</code>
- * or <code>DEBUG_MODE</code> defined in <code>ILaunchManager</code>.
- * If this is <code>null</code>, then it means both modes are being shown.
- */
- private String fMode;
-
- /**
- * The Shell context
- */
- private Shell fShell;
-
- /**
- * Constructor
- * @param mode the mode
- * @param shell the parent shell
- */
- public LaunchConfigurationTreeContentProvider(String mode, Shell shell) {
- setMode(mode);
- setShell(shell);
- }
-
- /**
- * Actual launch configurations have no children. Launch configuration types have
- * all configurations of that type as children, minus any configurations that are
- * marked as private.
- * <p>
- * In 2.1, the <code>category</code> attribute was added to launch config
- * types. The debug UI only displays those configs that do not specify a
- * category.
- * </p>
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- */
- public Object[] getChildren(Object parentElement) {
- if (parentElement instanceof ILaunchConfiguration) {
- return EMPTY_ARRAY;
- } else if (parentElement instanceof ILaunchConfigurationType) {
- try {
- ILaunchConfigurationType type = (ILaunchConfigurationType)parentElement;
- return getLaunchManager().getLaunchConfigurations(type);
- } catch (CoreException e) {
- DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.LaunchConfigurationDialog_Error_19, LaunchConfigurationsMessages.LaunchConfigurationDialog_An_exception_occurred_while_retrieving_launch_configurations_20, e); //
- }
- } else {
- return getLaunchManager().getLaunchConfigurationTypes();
- }
- return EMPTY_ARRAY;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- */
- public Object getParent(Object element) {
- if (element instanceof ILaunchConfiguration) {
- if (!((ILaunchConfiguration)element).exists()) {
- return null;
- }
- try {
- return ((ILaunchConfiguration)element).getType();
- } catch (CoreException e) {
- DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.LaunchConfigurationDialog_Error_19, LaunchConfigurationsMessages.LaunchConfigurationDialog_An_exception_occurred_while_retrieving_launch_configurations_20, e); //
- }
- } else if (element instanceof ILaunchConfigurationType) {
- return ResourcesPlugin.getWorkspace().getRoot();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- */
- public boolean hasChildren(Object element) {
- if (element instanceof ILaunchConfiguration) {
- return false;
- }
- return getChildren(element).length > 0;
- }
-
- /**
- * Return only the launch configuration types that support the current mode AND
- * are marked as 'public'.
- *
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object inputElement) {
- ILaunchConfigurationType[] allTypes = getLaunchManager().getLaunchConfigurationTypes();
- return filterTypes(allTypes).toArray();
- }
-
- /**
- * Returns a list containing the given types minus any types that
- * should not be visible. A type should not be visible if it doesn't match
- * the current mode or if it matches a disabled activity.
- *
- * @param allTypes the types
- * @return the given types minus any types that should not be visible.
- */
- private List filterTypes(ILaunchConfigurationType[] allTypes) {
- List filteredTypes= new ArrayList();
- String mode = getMode();
- LaunchConfigurationTypeContribution contribution;
- for (int i = 0; i < allTypes.length; i++) {
- ILaunchConfigurationType type = allTypes[i];
- contribution= new LaunchConfigurationTypeContribution(type);
- if (isVisible(type, mode) && !WorkbenchActivityHelper.filterItem(contribution)) {
- filteredTypes.add(type);
- }
- }
- return filteredTypes;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- /**
- * Return <code>true</code> if the specified launch configuration type should
- * be visible in the specified mode, <code>false</code> otherwise.
- */
- private boolean isVisible(ILaunchConfigurationType configType, String mode) {
- if (!configType.isPublic()) {
- return false;
- }
- if (mode == null) {
- return true;
- }
- return configType.supportsMode(mode);
- }
-
- /**
- * Convenience method to get the singleton launch manager.
- */
- private ILaunchManager getLaunchManager() {
- return DebugPlugin.getDefault().getLaunchManager();
- }
-
- /**
- * Write accessor for the mode value
- */
- private void setMode(String mode) {
- fMode = mode;
- }
-
- /**
- * Read accessor for the mode value
- */
- private String getMode() {
- return fMode;
- }
-
- /**
- * Write accessor for the shell value
- */
- private void setShell(Shell shell) {
- fShell = shell;
- }
-
- /**
- * Read accessor for the shell value
- */
- private Shell getShell() {
- return fShell;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeContribution.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeContribution.java
deleted file mode 100644
index 8a7b3c627..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeContribution.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.ui.IPluginContribution;
-
-/**
- * A plug-in contribution (UI element) which contains a launch configuration
- * type (Core element). Plug-in contributions are passed to the workbench
- * activity support to filter elements from the UI.
- */
-class LaunchConfigurationTypeContribution implements IPluginContribution {
-
- protected ILaunchConfigurationType type;
-
- /**
- * Creates a new plug-in contribution for the given type
- *
- * @param type the launch configuration type
- */
- public LaunchConfigurationTypeContribution(ILaunchConfigurationType type) {
- this.type= type;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPluginContribution#getLocalId()
- */
- public String getLocalId() {
- return type.getIdentifier();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPluginContribution#getPluginId()
- */
- public String getPluginId() {
- return type.getPluginIdentifier();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeFilter.java
deleted file mode 100644
index 86d5d6035..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeFilter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-/**
- * Provides the implementation of the filter for filtering the launch configuration viewer based on the preference
- * <code>IInternalDebugUIConstants.PREF_FILTER_LAUNCH_TYPES</code>
- *
- * @since 3.2
- */
-public class LaunchConfigurationTypeFilter extends ViewerFilter {
-
- /**
- * Constructor
- */
- public LaunchConfigurationTypeFilter() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if(element instanceof ILaunchConfiguration) {
- return true;
- }
- //we only care about launch configuration types
- if(element instanceof ILaunchConfigurationType) {
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- String[] types = store.getString(IInternalDebugUIConstants.PREF_FILTER_TYPE_LIST).split("\\,"); //$NON-NLS-1$
- for(int i = 0; i < types.length; i++) {
- if(types[i].equals(((ILaunchConfigurationType)element).getIdentifier())) {
- return false;
- }
- }
- return true;
- }
- return false;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java
deleted file mode 100644
index bd9685314..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java
+++ /dev/null
@@ -1,435 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationListener;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.ui.AbstractDebugView;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.IDebugView;
-import org.eclipse.help.HelpSystem;
-import org.eclipse.help.IContext;
-import org.eclipse.help.IContextProvider;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PatternFilter;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * A tree view of launch configurations
- */
-public class LaunchConfigurationView extends AbstractDebugView implements ILaunchConfigurationListener {
-
- /**
- * the filtering tree viewer
- *
- * @since 3.2
- */
- private LaunchConfigurationFilteredTree fTree;
-
- /**
- * a handle to the launch manager
- *
- * @since 3.2
- */
- private ILaunchManager fLaunchManager = DebugPlugin.getDefault().getLaunchManager();
-
- /**
- * The launch group to display
- */
- private LaunchGroupExtension fLaunchGroup;
-
- /**
- * Actions
- */
- private CreateLaunchConfigurationAction fCreateAction;
- private DeleteLaunchConfigurationAction fDeleteAction;
- private DuplicateLaunchConfigurationAction fDuplicateAction;
- private CollapseAllLaunchConfigurationAction fCollapseAllAction;
-
- /**
- * Action for providing filtering to the Launch Configuration Dialog
- * @since 3.2
- */
- private FilterLaunchConfigurationAction fFilterAction;
-
- /**
- * This label is used to notify users that items (possibly) have been filtered from the
- * launch configuration view
- * @since 3.3
- */
- private Label fFilteredNotice = null;
-
- /**
- * Whether to automatically select configs that are added
- */
- private boolean fAutoSelect = true;
-
- /**
- * the group of additional filters to be added to the viewer
- * @since 3.2
- */
- private ViewerFilter[] fFilters = null;
-
- /**
- * Constructs a launch configuration view for the given launch group
- */
- public LaunchConfigurationView(LaunchGroupExtension launchGroup) {
- super();
- fLaunchGroup = launchGroup;
- }
-
- /**
- * Constructor
- * @param launchGroup
- * @param filters
- */
- public LaunchConfigurationView(LaunchGroupExtension launchGroup, ViewerFilter[] filters) {
- super();
- fLaunchGroup = launchGroup;
- fFilters = filters;
- }
-
- /**
- * Returns the launch group this view is displaying.
- *
- * @return the launch group this view is displaying
- */
- protected LaunchGroupExtension getLaunchGroup() {
- return fLaunchGroup;
- }
-
- /**
- * @see org.eclipse.debug.ui.AbstractDebugView#createViewer(org.eclipse.swt.widgets.Composite)
- */
- protected Viewer createViewer(Composite parent) {
- fTree = new LaunchConfigurationFilteredTree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL, new PatternFilter(), fLaunchGroup, fFilters);
- fTree.createViewControl();
- getLaunchManager().addLaunchConfigurationListener(this);
- LaunchConfigurationViewer viewer = fTree.getLaunchConfigurationViewer();
- viewer.setLaunchConfigurationView(this);
- return viewer;
- }
-
- /**
- * @see org.eclipse.debug.ui.AbstractDebugView#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class key) {
- if (key == IContextProvider.class) {
- return new IContextProvider () {
- public int getContextChangeMask() {
- return SELECTION;
- }
-
- public IContext getContext(Object target) {
- String id = fTree.computeContextId();
- if (id!=null)
- return HelpSystem.getContext(id);
- return null;
- }
-
- public String getSearchExpression(Object target) {
- return null;
- }
- };
- }
- return super.getAdapter(key);
- }
-
- /**
- * Returns the filtering text control from the viewer or <code>null</code>
- * if the text control was not created.
- *
- * @return the filtering text control or <code>null</code>
- * @since 3.2
- */
- public Text getFilteringTextControl() {
- return fTree.getFilterControl();
- }
-
- /**
- * @see org.eclipse.debug.ui.AbstractDebugView#createActions()
- */
- protected void createActions() {
- fCreateAction = new CreateLaunchConfigurationAction(getViewer(), getLaunchGroup().getMode());
- setAction(CreateLaunchConfigurationAction.ID_CREATE_ACTION, fCreateAction);
-
- fDeleteAction = new DeleteLaunchConfigurationAction(getViewer(), getLaunchGroup().getMode());
- setAction(DeleteLaunchConfigurationAction.ID_DELETE_ACTION, fDeleteAction);
- setAction(IDebugView.REMOVE_ACTION, fDeleteAction);
-
- fDuplicateAction = new DuplicateLaunchConfigurationAction(getViewer(), getLaunchGroup().getMode());
- setAction(DuplicateLaunchConfigurationAction.ID_DUPLICATE_ACTION, fDuplicateAction);
-
- fCollapseAllAction = new CollapseAllLaunchConfigurationAction((TreeViewer)getViewer());
- setAction(CollapseAllLaunchConfigurationAction.ID_COLLAPSEALL_ACTION, fCollapseAllAction);
-
- fFilterAction = new FilterLaunchConfigurationAction();
- setAction(FilterLaunchConfigurationAction.ID_FILTER_ACTION, fFilterAction);
-
- }
-
- /**
- * @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.LAUNCH_CONFIGURATION_VIEW;
- }
-
- /**
- * @see org.eclipse.debug.ui.AbstractDebugView#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
- protected void fillContextMenu(IMenuManager menu) {
- menu.add(fCreateAction);
- menu.add(fDuplicateAction);
- menu.add(fDeleteAction);
- menu.add(new Separator());
- }
-
- /**
- * @see org.eclipse.debug.ui.AbstractDebugView#configureToolBar(org.eclipse.jface.action.IToolBarManager)
- */
- protected void configureToolBar(IToolBarManager tbm) {}
-
- /**
- * Returns this view's tree viewer
- *
- * @return this view's tree viewer
- */
- protected TreeViewer getTreeViewer() {
- return fTree.getLaunchConfigurationViewer();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPart#dispose()
- */
- public void dispose() {
- fCreateAction.dispose();
- fDeleteAction.dispose();
- fDuplicateAction.dispose();
- fFilterAction = null;
- fCollapseAllAction = null;
- getLaunchManager().removeLaunchConfigurationListener(this);
- }
-
- /**
- * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void launchConfigurationAdded(final ILaunchConfiguration configuration) {
- if(isSupportedConfiguration(configuration)) {
- //due to notification and async messages we need to collect the moved from config
- //now, else it is null'd out before the following async job runs
- //@see bug 211235 - making local config shared creates "non-existant dup" in LCD
- final ILaunchConfiguration from = getLaunchManager().getMovedFrom(configuration);
- // handle asynchronously: @see bug 198428 - Deadlock deleting launch configuration
- Display display = DebugUIPlugin.getStandardDisplay();
- display.asyncExec(new Runnable() {
- public void run() {
- if(!fTree.isDisposed()) {
- handleConfigurationAdded(configuration, from);
- }
- }
- });
- }
- }
-
- /**
- * The given launch configuration has been added. Add it to the tree.
- * @param configuration the added configuration
- */
- private void handleConfigurationAdded(ILaunchConfiguration configuration, ILaunchConfiguration from) {
- TreeViewer viewer = getTreeViewer();
- if (viewer != null) {
- try {
- viewer.add(configuration.getType(), configuration);
- // if moved, remove original now
- if (from != null) {
- viewer.remove(from);
- }
- if (isAutoSelect()) {
- viewer.setSelection(new StructuredSelection(configuration), true);
- }
- updateFilterLabel();
- }
- catch (CoreException e) {}
- }
- }
-
- /**
- * Returns if the specified configuration is supported by this instance of the view.
- * Supported means that:
- * <ul>
- * <li>The configuration is not private</li>
- * <li>AND that the configurations' type supports the mode of the current launch group</li>
- * <li>AND that the category of the configurations' type matches that of the current launch group</li>
- * </ul>
- * @param configuration the configuration
- * @return true if the configuration is supported by this instance of the view, false otherwise
- *
- * @since 3.4
- */
- protected boolean isSupportedConfiguration(ILaunchConfiguration configuration) {
- try {
- ILaunchConfigurationType type = configuration.getType();
- return !configuration.getAttribute(IDebugUIConstants.ATTR_PRIVATE, false) &&
- type.supportsMode(getLaunchGroup().getMode()) &&
- equalCategories(type.getCategory(), getLaunchGroup().getCategory());
- }
- catch(CoreException ce) {
- DebugUIPlugin.log(ce);
- }
- return false;
- }
-
- /**
- * Returns whether the given categories are equal.
- *
- * @param c1 category identifier or <code>null</code>
- * @param c2 category identifier or <code>null</code>
- * @return boolean
- *
- * @since 3.4
- */
- private boolean equalCategories(String c1, String c2) {
- if (c1 == null || c2 == null) {
- return c1 == c2;
- }
- return c1.equals(c2);
- }
-
- /**
- * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void launchConfigurationChanged(ILaunchConfiguration configuration) {}
-
- /**
- * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void launchConfigurationRemoved(final ILaunchConfiguration configuration) {
- // if moved, ignore
- ILaunchConfiguration to = getLaunchManager().getMovedTo(configuration);
- if (to != null) {
- return;
- }
- // handle asynchronously: @see bug 198428 - Deadlock deleting launch configuration
- Display display = DebugUIPlugin.getStandardDisplay();
- display.asyncExec(new Runnable() {
- public void run() {
- if(!fTree.isDisposed()) {
- handleConfigurationRemoved(configuration);
- }
- }
- });
- }
-
- /**
- * The given launch configuration has been removed. Remove it from the tree.
- * @param configuration the deleted configuration
- */
- private void handleConfigurationRemoved(ILaunchConfiguration configuration) {
- getTreeViewer().remove(configuration);
- updateFilterLabel();
- }
-
- /**
- * This is similar to IWorkbenchPart#createPartControl(Composite), but it is
- * called by the launch dialog when creating the launch config tree view.
- * Since this view is not contained in the workbench, we cannot do all the
- * usual initialization (toolbars, etc).
- */
- public void createLaunchDialogControl(Composite parent) {
- createViewer(parent);
- createActions();
- createContextMenu(getViewer().getControl());
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, getHelpContextId());
- getViewer().getControl().addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- handleKeyPressed(e);
- }
- });
- if (getViewer() instanceof StructuredViewer) {
- ((StructuredViewer)getViewer()).addDoubleClickListener(this);
- }
- fFilteredNotice = SWTFactory.createLabel(parent, IInternalDebugCoreConstants.EMPTY_STRING, 1);
- fFilteredNotice.setBackground(parent.getBackground());
- }
-
- /**
- * @see org.eclipse.debug.ui.IDebugView#getViewer()
- */
- public Viewer getViewer() {
- return fTree.getLaunchConfigurationViewer();
- }
-
- /**
- * Updates the filter notification label
- * @since 3.3
- */
- public void updateFilterLabel() {
- LaunchConfigurationViewer viewer = (LaunchConfigurationViewer) getViewer();
- fFilteredNotice.setText(MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationView_0, new String[] {Integer.toString(viewer.getNonFilteredChildCount()), Integer.toString(viewer.getTotalChildCount())}));
- }
-
- /**
- * returns the launch manager
- * @return
- */
- protected ILaunchManager getLaunchManager() {
- return fLaunchManager;
- }
-
- /**
- * Sets whether to automatically select configs that are
- * added into the view (newly created).
- *
- * @param select whether to automatically select configs that are
- * added into the view (newly created)
- */
- public void setAutoSelect(boolean select) {
- fAutoSelect = select;
- }
-
- /**
- * Returns whether this view is currently configured to
- * automatically select newly created configs that are
- * added into the view.
- *
- * @return whether this view is currently configured to
- * automatically select newly created configs
- */
- protected boolean isAutoSelect() {
- return fAutoSelect;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationViewer.java
deleted file mode 100644
index dd4eba627..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationViewer.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.swt.widgets.Widget;
-
-/**
- * This class allow the notion of the viewer to be abstracted from the launch configuration view, as well as allowing the over-riding of
- * selection preservation when filtering/deletion occurs
- * @since 3.3
- */
-public class LaunchConfigurationViewer extends TreeViewer {
-
- private int fTotalCount = 0;
- private LaunchConfigurationView fView = null;
-
- /**
- * Constructor
- * @param tree the tree to create the viewer on
- */
- public LaunchConfigurationViewer(Tree tree) {
- super(tree);
- }
-
- /**
- * Constructor
- * @param parent
- * @param style
- */
- public LaunchConfigurationViewer(Composite parent, int style) {
- this(new Tree(parent, style));
- }
-
- /**
- * @see org.eclipse.jface.viewers.StructuredViewer#preservingSelection(java.lang.Runnable)
- */
- protected void preservingSelection(Runnable updateCode) {
- IStructuredSelection selection = (IStructuredSelection) getSelection();
- if(!selection.isEmpty()) {
- int[] indices = collectIndices(selection.getFirstElement());
- updateCode.run();
- ArrayList set = new ArrayList();
- Object o = null;
- for(Iterator iter = selection.iterator(); iter.hasNext();) {
- o = iter.next();
- if(o instanceof ILaunchConfiguration) {
- if(!((ILaunchConfiguration)o).exists()) {
- continue;
- }
- }
- if(internalGetWidgetToSelect(o) != null) {
- if(!set.contains(o)) {
- set.add(o);
- }
- }
- }
- if(set.isEmpty()) {
- //make a new selection based on the first item in the structured selection
- Tree tree = getTree();
- if(tree.getItemCount() > 0) {
- int index = selectIndex(tree.getItemCount(), indices[0]);
- if(index > -1) {
- TreeItem pitem = null;
- if(indices[0] > tree.getItemCount()-1) {
- pitem = tree.getItem(tree.getItemCount()-1);
- }
- else {
- pitem = tree.getItem(indices[0]);
- }
- if(pitem != null) {
- o = pitem.getData();
- if(indices[1] > -1) {
- index = selectIndex(pitem.getItemCount(), indices[1]);
- if(index > -1) {
- ILaunchConfiguration config = null;
- for(int i = index; i > -1; i--) {
- config = (ILaunchConfiguration) pitem.getItem(i).getData();
- if(config != null && config.exists()) {
- o = config;
- break;
- }
- }
- }
- else {
- if(pitem.getItemCount() > 0) {
- o = pitem.getItem((indices[1]-1 > -1 ? indices[1]-1 : 0)).getData();
- if(o == null) {
- o = pitem.getData();
- }
- }
- }
- }
- }
- }
- if(!set.contains(o)) {
- set.add(o);
- }
- }
- }
- setSelection(new StructuredSelection(set), true);
- }
- else {
- super.preservingSelection(updateCode);
- }
- getTree().getHorizontalBar().setSelection(0);
- }
-
- /**
- * Covers the case of an outlier indice
- * @param count the count to compare the index to
- * @param index the index to compare against the count
- * @return the adjusted index in the event index is an outlier, or -1 if it falls within the 'count' range
- */
- private int selectIndex(int count, int index) {
- if(index < count) {
- return index;
- }
- if(index > count-1) {
- return count-1;
- }
- if(index < 0) {
- return 0;
- }
- return -1;
- }
-
- /**
- * Returns the total count of all of the children that <i>could</i> be visible at
- * the time the input was set to the viewer
- * @return the total number of elements
- */
- protected int getTotalChildCount() {
- return fTotalCount;
- }
-
- /**
- * @see org.eclipse.jface.viewers.AbstractTreeViewer#remove(java.lang.Object)
- */
- public void remove(Object elementsOrTreePaths) {
- super.remove(elementsOrTreePaths);
- fTotalCount--;
- }
-
- /**
- * @see org.eclipse.jface.viewers.TreeViewer#internalAdd(org.eclipse.swt.widgets.Widget, java.lang.Object, java.lang.Object[])
- */
- protected void internalAdd(Widget widget, Object parentElement, Object[] childElements) {
- super.internalAdd(widget, parentElement, childElements);
- fTotalCount++;
- }
-
- /**
- * @see org.eclipse.jface.viewers.AbstractTreeViewer#inputChanged(java.lang.Object, java.lang.Object)
- */
- protected void inputChanged(Object input, Object oldInput) {
- super.inputChanged(input, oldInput);
- //calc the total number of items that could be visible in the view
- LaunchConfigurationTreeContentProvider cp = (LaunchConfigurationTreeContentProvider) getContentProvider();
- Object[] types = cp.getElements(null);
- LaunchGroupFilter filter = new LaunchGroupFilter(((LaunchConfigurationsDialog)LaunchConfigurationsDialog.getCurrentlyVisibleLaunchConfigurationDialog()).getLaunchGroup());
- ILaunchConfiguration[] configs = null;
- for(int i = 0; i < types.length; i++) {
- if(filter.select(this, types[i], null)) {
- fTotalCount++;
- configs = (ILaunchConfiguration[]) cp.getChildren(types[i]);
- for(int j = 0; j < configs.length; j++) {
- if(LaunchConfigurationManager.isVisible(configs[j])) {
- fTotalCount++;
- }
- }
- }
- }
- }
-
- /**
- * returns the number of children that are remaining in the view.
- * Note that this method will force the loading of all children
- * @return the count of all children in the viewer
- *
- * @since 3.3
- */
- protected int getNonFilteredChildCount() {
- int count = 0;
- getTree().setRedraw(false);
- TreeItem[] items = getTree().getItems();
- count += items.length;
- boolean expanded = false;
- TreeItem item = null;
- for(int i = 0; i < items.length; i++) {
- item = items[i];
- expanded = item.getExpanded();
- setExpandedState(item.getData(), true);
- count += item.getItems().length;
- item.setExpanded(expanded);
- }
- getTree().setRedraw(true);
- return count;
- }
-
- /**
- * Collects the indices of the child and parent items for the specified element
- * @param object the element to collect indices for
- * @return an array of indices for the specified element
- */
- private int[] collectIndices(Object object) {
- int[] indices = {-1, -1};
- if(object != null) {
- TreeItem item = (TreeItem) findItem(object);
- if(item != null) {
- TreePath path = getTreePathFromItem(item);
- item = (TreeItem) findItem(path.getFirstSegment());
- if(item != null) {
- indices[0] = getTree().indexOf(item);
- if(path.getSegmentCount() == 2) {
- indices[1] = indexOf(item.getItems(), path.getLastSegment());
- }
- }
- }
- }
- return indices;
- }
-
- /**
- * Finds the index of the specified object in the given array of tree items
- * @param items the items to search for the specified object
- * @param object the object to find the index of
- * @return the index of the specified object in the listing of tree items, or -1 if not found
- */
- private int indexOf(TreeItem[] items, Object object) {
- if(object != null) {
- for(int i = 0; i < items.length; i++) {
- if(object.equals(items[i].getData())) {
- return i;
- }
- }
- }
- return -1;
- }
-
- /**
- * The filter changed due to text typing - update the filter count
- */
- protected void filterChanged() {
- if (fView != null) {
- fView.updateFilterLabel();
- }
-
- }
-
- /**
- * @param launchConfigurationView
- */
- protected void setLaunchConfigurationView(LaunchConfigurationView launchConfigurationView) {
- fView = launchConfigurationView;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
deleted file mode 100644
index 4a43a5052..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
+++ /dev/null
@@ -1,1501 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Sebastian Davids - Bug 137923
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.IStatusHandler;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.core.LaunchManager;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.IDebugView;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.operation.ModalContext;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.wizard.ProgressMonitorPart;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.custom.ViewForm;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.WorkbenchJob;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * The dialog used to edit and launch launch configurations.
- */
-public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaunchConfigurationDialog, IPropertyChangeListener {
-
- /**
- * Keep track of the currently visible dialog instance
- */
- private static ILaunchConfigurationDialog fgCurrentlyVisibleLaunchConfigurationDialog;
- /**
- * Id for 'Launch' button.
- */
- protected static final int ID_LAUNCH_BUTTON = IDialogConstants.CLIENT_ID + 1;
-
- /**
- * Id for 'Close' button.
- */
- protected static final int ID_CLOSE_BUTTON = IDialogConstants.CLIENT_ID + 2;
- /**
- * Id for 'Cancel' button.
- */
- protected static final int ID_CANCEL_BUTTON = IDialogConstants.CLIENT_ID + 3;
-
- /**
- * The id for the 'No' button on the discard changes message box
- * @since 3.3
- */
- protected static final int ID_DISCARD_BUTTON = IDialogConstants.CLIENT_ID + 4;
-
- /**
- * Constant specifying how wide this dialog is allowed to get (as a percentage of
- * total available screen width) as a result of tab labels in the edit area.
- */
- protected static final float MAX_DIALOG_WIDTH_PERCENT = 0.75f;
- /**
- * Constant specifying how tall this dialog is allowed to get (as a percentage of
- * total available screen height) as a result of preferred tab size.
- */
- protected static final float MAX_DIALOG_HEIGHT_PERCENT = 0.60f;
- /**
- * Size of this dialog if there is no preference specifying a size.
- */
- protected static final Point DEFAULT_INITIAL_DIALOG_SIZE = new Point(800, 640);
- /**
- * defines some default sash weights when we have a new workspace
- * @since 3.2
- */
- private static final int[] DEFAULT_SASH_WEIGHTS = new int[] {190, 610};
- /**
- * Constant specifying that this dialog should be opened with the last configuration launched
- * in the workspace selected.
- */
- public static final int LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_LAST_LAUNCHED = 2;
- /**
- * Constant specifying that this dialog should be opened with the value specified via
- * <code>setInitialSelection()</code> selected.
- */
- public static final int LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION = 3;
- /**
- * Constant specifying that a new launch configuration dialog was not opened. Instead
- * an existing launch configuration dialog was used.
- */
- public static final int LAUNCH_CONFIGURATION_DIALOG_REUSE_OPEN = 4;
- /**
- * defines the delimiter used in the persistence of the expanded state
- * @since 3.2
- */
- private static final String DELIMITER = ", "; //$NON-NLS-1$
- /**
- * Specifies how this dialog behaves when opened. Value is one of the
- * 'LAUNCH_CONFIGURATION_DIALOG' constants defined in this class.
- */
- private int fOpenMode = LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_LAST_LAUNCHED;
-
- /**
- * dialog settings
- */
- private static final String DIALOG_SASH_WEIGHTS_1 = IDebugUIConstants.PLUGIN_ID + ".DIALOG_SASH_WEIGHTS_1"; //$NON-NLS-1$
- private static final String DIALOG_SASH_WEIGHTS_2 = IDebugUIConstants.PLUGIN_ID + ".DIALOG_SASH_WEIGHTS_2"; //$NON-NLS-1$
- private static final String DIALOG_EXPANDED_NODES = IDebugUIConstants.PLUGIN_ID + ".EXPANDED_NODES"; //$NON-NLS-1$
-
- /**
- * Returns the currently visible dialog
- * @return the currently visible launch dialog
- */
- public static ILaunchConfigurationDialog getCurrentlyVisibleLaunchConfigurationDialog() {
- return fgCurrentlyVisibleLaunchConfigurationDialog;
- }
- /**
- * Sets which launch dialog is currently the visible one
- * @param dialog the dialog to set as the visible one
- */
- public static void setCurrentlyVisibleLaunchConfigurationDialog(ILaunchConfigurationDialog dialog) {
- fgCurrentlyVisibleLaunchConfigurationDialog = dialog;
- }
-
- /**
- * widgets
- */
- private Control fLastControl;
- private Composite fButtonComp;
- private SashForm fSashForm;
- private LaunchConfigurationView fLaunchConfigurationView;
- private LaunchConfigurationTabGroupViewer fTabViewer;
- private Button fProgressMonitorCancelButton;
- private ProgressMonitorPart fProgressMonitorPart;
- private LaunchGroupExtension fGroup;
- private Image fBannerImage;
-
- /**
- * When this dialog is opened in <code>LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION</code>
- * mode, this specifies the selection that is initially shown in the dialog.
- */
- private IStructuredSelection fInitialSelection;
-
- /**
- * The status to open the dialog on, or <code>null</code> if none.
- */
- private IStatus fInitialStatus;
-
- /**
- * The number of 'long-running' operations currently taking place in this dialog
- */
- private long fActiveRunningOperations = 0;
-
- /**
- * Double-click action
- */
- private IAction fDoubleClickAction;
-
- /**
- * Filters for the LCD
- * @since 3.2
- */
- private ClosedProjectFilter fClosedProjectFilter;
- private DeletedProjectFilter fDeletedProjectFilter;
- private LaunchConfigurationTypeFilter fLCTFilter;
- private WorkingSetsFilter fWorkingSetsFilter;
-
- /**
- * set of reserved names that should not be considered when generating a new name for a launch configuration
- */
- protected Set fReservedNames = null;
-
- /**
- * Constructs a new launch configuration dialog on the given
- * parent shell.
- *
- * @param shell the parent shell
- * @param group the group of launch configuration to display
- */
- public LaunchConfigurationsDialog(Shell shell, LaunchGroupExtension group) {
- super(shell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- setLaunchGroup(group);
- }
-
- /**
- * Adds content to the dialog area
- *
- * @param dialogComp
- */
- protected void addContent(Composite dialogComp) {
- GridData gd;
- Composite topComp = new Composite(dialogComp, SWT.NONE);
- gd = new GridData(GridData.FILL_BOTH);
- topComp.setLayoutData(gd);
- GridLayout topLayout = new GridLayout(2, false);
- topLayout.marginHeight = 5;
- topLayout.marginWidth = 5;
- topComp.setLayout(topLayout);
-
- // Set the things that TitleAreaDialog takes care of
- setTitle(LaunchConfigurationsMessages.LaunchConfigurationDialog_Create__manage__and_run_launch_configurations_8);
- setMessage(LaunchConfigurationsMessages.LaunchConfigurationDialog_Ready_to_launch_2);
- setModeLabelState();
-
- // Create the SashForm that contains the selection area on the left,
- // and the edit area on the right
- gd = new GridData(GridData.FILL_BOTH);
- gd.horizontalSpan = 2;
- SashForm sash = new SashForm(topComp, SWT.SMOOTH);
- sash.setOrientation(SWT.HORIZONTAL);
- sash.setLayoutData(gd);
- sash.setFont(dialogComp.getFont());
- sash.setVisible(true);
- fSashForm = sash;
-
- // Build the launch configuration selection area and put it into the composite.
- Control launchConfigSelectionArea = createLaunchConfigurationSelectionArea(fSashForm);
- gd = new GridData(GridData.FILL_VERTICAL);
- launchConfigSelectionArea.setLayoutData(gd);
-
- // Build the launch configuration edit area and put it into the composite.
- Composite editAreaComp = createLaunchConfigurationEditArea(fSashForm);
- gd = new GridData(GridData.FILL_BOTH);
- editAreaComp.setLayoutData(gd);
-
- dialogComp.layout(true);
- applyDialogFont(dialogComp);
- }
-
- /**
- * Handle the 'close' & 'launch' buttons here, all others are handled
- * in <code>Dialog</code>
- *
- * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
- */
- protected void buttonPressed(int buttonId) {
- if (buttonId == ID_LAUNCH_BUTTON) {
- handleLaunchPressed();
- }
- else if (buttonId == ID_CLOSE_BUTTON) {
- handleClosePressed();
- }
- else {
- super.buttonPressed(buttonId);
- }
- }
-
- /**
- * Return whether the current configuration should be saved or discarded. This involves determining
- * if it is dirty, and if it is, asking the user what to do.
- *
- * @return if we can discard the current config or not
- */
- protected int shouldSaveCurrentConfig() {
- if (fTabViewer.isDirty()) {
- if (fTabViewer.canSave()) {
- return showSaveChangesDialog();
- }
- return showUnsavedChangesDialog();
- }
- return IDialogConstants.NO_ID;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#close()
- */
- public boolean close() {
- if (!isSafeToClose()) {
- return false;
- }
- persistSashWeights();
- persistExpansion();
- setCurrentlyVisibleLaunchConfigurationDialog(null);
- getBannerImage().dispose();
- fTabViewer.dispose();
- if (fLaunchConfigurationView != null) {
- fLaunchConfigurationView.dispose();
- }
- DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
- return super.close();
- }
-
- /**
- * Sets the title for the dialog, and establishes the help context.
- *
- * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell);
- */
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(getShellTitle());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#create()
- */
- public void create() {
- super.create();
- if (fTabViewer.getInput() == null) {
- fTabViewer.inputChanged(null);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createButtonBar(org.eclipse.swt.widgets.Composite)
- */
- protected Control createButtonBar(Composite parent) {
- Font font = parent.getFont();
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- layout.marginLeft = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- composite.setFont(font);
- // create help control if needed
- if (isHelpAvailable()) {
- createHelpControl(composite);
- }
- Composite monitorComposite = new Composite(composite, SWT.NULL);
- layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.numColumns = 2;
- monitorComposite.setLayout(layout);
- monitorComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- GridLayout pmLayout = new GridLayout();
- fProgressMonitorPart = new ProgressMonitorPart(monitorComposite, pmLayout);
- fProgressMonitorPart.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- fProgressMonitorPart.setFont(font);
- fProgressMonitorCancelButton = createButton(monitorComposite, ID_CANCEL_BUTTON, LaunchConfigurationsMessages.LaunchConfigurationDialog_Cancel_3, true);
- fProgressMonitorCancelButton.setFont(font);
- monitorComposite.setVisible(false);
-
- /*
- * Create the rest of the button bar, but tell it not to
- * create a help button (we've already created it).
- */
- boolean helpAvailable = isHelpAvailable();
- setHelpAvailable(false);
- fButtonComp = (Composite) super.createButtonBar(composite);
- setHelpAvailable(helpAvailable);
- return composite;
- }
-
-
-
- /**
- * A launch configuration dialog overrides this method
- * to create a custom set of buttons in the button bar.
- * This dialog has 'Launch' and 'Cancel'
- * buttons.
- *
- * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
- */
- protected void createButtonsForButtonBar(Composite parent) {
- Button button = createButton(parent, ID_LAUNCH_BUTTON, getLaunchButtonText(), true);
- button.setEnabled(false);
- createButton(parent, ID_CLOSE_BUTTON, LaunchConfigurationsMessages.LaunchConfigurationDialog_Close_1, false);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Control contents = super.createContents(parent);
- initializeContent();
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getShell(), getHelpContextId());
- return contents;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- Composite dialogComp = (Composite)super.createDialogArea(parent);
- addContent(dialogComp);
- if(fLaunchConfigurationView != null) {
- fLaunchConfigurationView.updateFilterLabel();
- }
- return dialogComp;
- }
-
- /**
- * Creates the launch configuration edit area of the dialog.
- * This area displays the name of the launch configuration
- * currently being edited, as well as a tab folder of tabs
- * that are applicable to the launch configuration.
- *
- * @return the composite used for launch configuration editing
- */
- protected Composite createLaunchConfigurationEditArea(Composite parent) {
- setTabViewer(new LaunchConfigurationTabGroupViewer(parent, this));
- return (Composite)fTabViewer.getControl();
- }
-
- /**
- * Creates all of the actions for the toolbar
- * @param toolbar
- * @since 3.2
- */
- protected void createToolbarActions(ToolBarManager tmanager) {
- tmanager.add(getNewAction());
- tmanager.add(getDuplicateAction());
- tmanager.add(getDeleteAction());
- tmanager.add(new Separator());
- tmanager.add(getCollapseAllAction());
- tmanager.add(getFilterAction());
- tmanager.update(true);
- DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
- }
-
- /**
- * Creates the launch configuration selection area of the dialog.
- * This area displays a tree of launch configurations that the user
- * may select, and allows users to create new configurations, and
- * delete and duplicate existing configurations.
- *
- * @return the composite used for launch configuration selection area
- */
- protected Control createLaunchConfigurationSelectionArea(Composite parent) {
- Composite comp = new Composite(parent, SWT.FLAT);
- GridLayout gridLayout = new GridLayout(1, false);
- gridLayout.marginHeight = 0;
- gridLayout.marginWidth = 0;
- comp.setLayout(gridLayout);
- comp.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- ViewForm viewForm = new ViewForm(comp, SWT.FLAT | SWT.BORDER);
- ToolBar toolBar = new ToolBar(viewForm, SWT.FLAT);
- toolBar.setBackground(parent.getBackground());
- ToolBarManager toolBarManager= new ToolBarManager(toolBar);
- viewForm.setTopLeft(toolBar);
- viewForm.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Composite viewFormContents = new Composite(viewForm, SWT.FLAT);
- gridLayout = new GridLayout();
- gridLayout.marginHeight = 5;
- gridLayout.marginWidth = 5;
- viewFormContents.setLayout(gridLayout);
- viewFormContents.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
- fLaunchConfigurationView = new LaunchConfigurationView(getLaunchGroup(), createViewerFilters());
- fLaunchConfigurationView.createLaunchDialogControl(viewFormContents);
-
- //create toolbar actions, we reuse the actions from the view so we wait until after
- //the view is created to add them to the toolbar
- createToolbarActions(toolBarManager);
- fDoubleClickAction = new Action() {
- public void run() {
- IStructuredSelection selection = (IStructuredSelection)fLaunchConfigurationView.getViewer().getSelection();
- Object target = selection.getFirstElement();
- if (target instanceof ILaunchConfiguration) {
- if (fTabViewer.canLaunch() & fTabViewer.canLaunchWithModes() & !fTabViewer.hasDuplicateDelegates()) {
- handleLaunchPressed();
- }
- } else {
- getNewAction().run();
- }
- }
- };
- fLaunchConfigurationView.setAction(IDebugView.DOUBLE_CLICK_ACTION, fDoubleClickAction);
- Viewer viewer = fLaunchConfigurationView.getViewer();
-
- Control control = viewer.getControl();
- GridData gd = new GridData(GridData.FILL_BOTH);
- control.setLayoutData(gd);
- viewForm.setContent(viewFormContents);
- AbstractLaunchConfigurationAction.IConfirmationRequestor requestor = new AbstractLaunchConfigurationAction.IConfirmationRequestor() {
- public boolean getConfirmation() {
- int status = shouldSaveCurrentConfig();
- if(status == IDialogConstants.YES_ID) {
- fTabViewer.handleApplyPressed();
- return true;
- }
- else if(status == IDialogConstants.NO_ID) {
- fTabViewer.handleRevertPressed();
- return true;
- }
- return false;
- }
- };
- getDuplicateAction().setConfirmationRequestor(requestor);
- getNewAction().setConfirmationRequestor(requestor);
- ((StructuredViewer) viewer).addPostSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- handleLaunchConfigurationSelectionChanged(event);
- getNewAction().setEnabled(getNewAction().isEnabled());
- getDeleteAction().setEnabled(getDeleteAction().isEnabled());
- getDuplicateAction().setEnabled(getDuplicateAction().isEnabled());
- }
- });
- return comp;
- }
-
- /**
- * Create the filters to be initially applied to the viewer.
- * The initial filters are based on the persisted preferences
- * @return the array of initial filters
- * @since 3.2
- */
- private ViewerFilter[] createViewerFilters() {
- ArrayList filters = new ArrayList();
- fClosedProjectFilter = new ClosedProjectFilter();
- if(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_CLOSED)) {
- filters.add(fClosedProjectFilter);
- }
- fDeletedProjectFilter = new DeletedProjectFilter();
- if(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_DELETED)) {
- filters.add(fDeletedProjectFilter);
- }
- fLCTFilter = new LaunchConfigurationTypeFilter();
- if(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_TYPES)) {
- filters.add(fLCTFilter);
- }
- fWorkingSetsFilter = new WorkingSetsFilter();
- if(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_FILTER_WORKING_SETS)) {
- filters.add(fWorkingSetsFilter);
- }
- return (ViewerFilter[]) filters.toArray(new ViewerFilter[filters.size()]);
- }
-
- /**
- * Set the initial selection in the tree.
- */
- public void doInitialTreeSelection() {
- fLaunchConfigurationView.getViewer().setSelection(fInitialSelection);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationDialog#generateName(java.lang.String)
- */
- public String generateName(String name) {
- if (name == null) {
- name = IInternalDebugCoreConstants.EMPTY_STRING;
- }
- return getLaunchManager().generateLaunchConfigurationName(name);
- }
-
- /**
- * Generates and returns a unique name using the specified name as a prefix in the event
- * the specified name already exists or is contained in the set of reserved names.
- * @param name the name to use as a prefix for generating a new name
- * @param reservednames a listing of names that should be considered as 'taken' and cannot be generated
- * by this method
- * @return a new name based on the specified name.
- *
- * @since 3.3
- */
- public String generateName(String name, Set reservednames) {
- if(name == null) {
- name = IInternalDebugCoreConstants.EMPTY_STRING;
- }
- return ((LaunchManager)getLaunchManager()).generateUniqueLaunchConfigurationNameFrom(name, reservednames);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationDialog#getActiveTab()
- */
- public ILaunchConfigurationTab getActiveTab() {
- return fTabViewer.getActiveTab();
- }
-
- /**
- * Returns the banner image to display in the title area
- */
- protected Image getBannerImage() {
- if (fBannerImage == null) {
- ImageDescriptor descriptor = getLaunchGroup().getBannerImageDescriptor();
- if (descriptor != null) {
- fBannerImage = descriptor.createImage();
- }
- }
- return fBannerImage;
- }
-
- /**
- * Gets the delete menu action
- *
- * @return the delete menu action
- */
- protected AbstractLaunchConfigurationAction getDeleteAction() {
- return (AbstractLaunchConfigurationAction)fLaunchConfigurationView.getAction(DeleteLaunchConfigurationAction.ID_DELETE_ACTION);
- }
-
- /**
- * Gets the filter action
- * @return the filter menu action
- * @since 3.2
- */
- protected IAction getFilterAction() {
- return fLaunchConfigurationView.getAction(FilterLaunchConfigurationAction.ID_FILTER_ACTION);
- }
-
- /**
- * Gets the collapse all action
- * @return the collapse all action
- * @since 3.2
- */
- protected IAction getCollapseAllAction() {
- return fLaunchConfigurationView.getAction(CollapseAllLaunchConfigurationAction.ID_COLLAPSEALL_ACTION);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
- * @since 3.2
- */
- protected IDialogSettings getDialogBoundsSettings() {
- return getDialogSettings();
- }
-
- /**
- * Returns the dialog settings for this dialog. Subclasses should override
- * <code>getDialogSettingsSectionName()</code>.
- *
- * @return IDialogSettings
- */
- protected IDialogSettings getDialogSettings() {
- IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(getDialogSettingsSectionName());
- if (section == null) {
- section = settings.addNewSection(getDialogSettingsSectionName());
- }
- return section;
- }
-
- /**
- * Returns the name of the section that this dialog stores its settings in
- *
- * @return String
- */
- protected String getDialogSettingsSectionName() {
- return IDebugUIConstants.PLUGIN_ID + ".LAUNCH_CONFIGURATIONS_DIALOG_SECTION"; //$NON-NLS-1$
- }
-
- /**
- * Gets the current display
- *
- * @return the display
- */
- protected Display getDisplay() {
- Shell shell = getShell();
- if (shell != null) {
- return shell.getDisplay();
- }
- return DebugUIPlugin.getStandardDisplay();
- }
-
- /**
- * Gets the duplicate menu action
- *
- * @return the duplicate menu action
- */
- protected AbstractLaunchConfigurationAction getDuplicateAction() {
- return (AbstractLaunchConfigurationAction)fLaunchConfigurationView.getAction(DuplicateLaunchConfigurationAction.ID_DUPLICATE_ACTION);
- }
-
- /**
- * Gets the help context id
- *
- * @return the help context id
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG;
- }
-
- /**
- * Returns the status the dialog was opened on or <code>null</code> if none.
- *
- * @return IStatus
- */
- protected IStatus getInitialStatus() {
- return fInitialStatus;
- }
-
- /**
- * Return the last launched configuration in the workspace.
- *
- * @return the last launched configuration
- */
- protected ILaunchConfiguration getLastLaunchedWorkbenchConfiguration() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLastLaunch(getLaunchGroup().getIdentifier());
- }
-
- /**
- * Returns the appropriate text for the launch button - run or debug.
- *
- * @return the launch button text
- */
- protected String getLaunchButtonText() {
- return DebugPlugin.getDefault().getLaunchManager().getLaunchMode(getMode()).getLabel();
- }
-
- /**
- * Returns the launch group being displayed.
- *
- * @return launch group
- */
- public LaunchGroupExtension getLaunchGroup() {
- return fGroup;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationDialog#getMode()
- */
- public String getMode() {
- return getLaunchGroup().getMode();
- }
-
- /**
- * Gets the new menu action
- *
- * @return the new menu action
- */
- protected AbstractLaunchConfigurationAction getNewAction() {
- return (AbstractLaunchConfigurationAction)fLaunchConfigurationView.getAction(CreateLaunchConfigurationAction.ID_CREATE_ACTION);
- }
-
- /**
- * Returns the reserved name set (if there is one), <code>null</code> otherwise
- * @return the reserved name set or <code>null</code>
- * @since 3.3
- *
- */
- public Set getReservedNameSet() {
- return fReservedNames;
- }
-
- /**
- * returns the open mode
- *
- * @return the open mode
- */
- protected int getOpenMode() {
- return fOpenMode;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IPageChangeProvider#getSelectedPage()
- */
- public Object getSelectedPage() {
- return getActiveTab();
- }
-
- /**
- * Returns the title of the shell
- * @return the shell title
- */
- protected String getShellTitle() {
- String title = null;
- if(getLaunchGroup() != null) {
- title = MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationsDialog_configurations, new String[] {DebugUIPlugin.removeAccelerators(getLaunchGroup().getLabel())});
- }
- if (title == null) {
- title = LaunchConfigurationsMessages.LaunchConfigurationDialog_Launch_Configurations_18;
- }
- return title;
- }
-
- /**
- * Returns the current tab group
- *
- * @return the current tab group, or <code>null</code> if none
- */
- public ILaunchConfigurationTabGroup getTabGroup() {
- if (fTabViewer != null) {
- return fTabViewer.getTabGroup();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationDialog#getTabs()
- */
- public ILaunchConfigurationTab[] getTabs() {
- if (getTabGroup() == null) {
- return null;
- }
- return getTabGroup().getTabs();
- }
-
- /**
- * Returns the viewer used to display the tabs for a launch configuration.
- *
- * @return LaunchConfigurationTabGroupViewer
- */
- protected LaunchConfigurationTabGroupViewer getTabViewer() {
- return fTabViewer;
- }
-
- /**
- * Notification the 'Close' button has been pressed.
- */
- protected void handleClosePressed() {
- if(fTabViewer.canSave()) {
- int status = shouldSaveCurrentConfig();
- if(status != IDialogConstants.CANCEL_ID) {
- if(status != ID_DISCARD_BUTTON) {
- if(status == IDialogConstants.YES_ID) {
- fTabViewer.handleApplyPressed();
- }
- cancelPressed();
- }
- }
- }
- else {
- cancelPressed();
- }
- }
-
- /**
- * Notification that selection has changed in the launch configuration tree.
- * <p>
- * If the currently displayed configuration is not saved,
- * prompt for saving before moving on to the new selection.
- * </p>
- *
- * @param event selection changed event
- */
- protected void handleLaunchConfigurationSelectionChanged(SelectionChangedEvent event) {
- Object input = fTabViewer.getInput();
- Object newInput = null;
- IStructuredSelection selection = (IStructuredSelection) event.getSelection();
- if (selection.size() == 1) {
- newInput = selection.getFirstElement();
- }
- if (!isEqual(input, newInput)) {
- ILaunchConfiguration original = fTabViewer.getOriginal();
- if (original != null && newInput == null && getLaunchManager().getMovedTo(original) != null) {
- return;
- }
- boolean deleted = false;
- if (original != null) {
- deleted = !original.exists();
- }
- boolean renamed = false;
- if (newInput instanceof ILaunchConfiguration) {
- renamed = getLaunchManager().getMovedFrom((ILaunchConfiguration)newInput) != null;
- }
- if (fTabViewer.canSave() && fTabViewer.isDirty() && !deleted && !renamed) {
- if(fLaunchConfigurationView != null) {
- fLaunchConfigurationView.setAutoSelect(false);
- }
- int ret = showUnsavedChangesDialog();
- if(ret == IDialogConstants.YES_ID) {
- fTabViewer.handleApplyPressed();
- fTabViewer.setInput(newInput);
- }
- else if(ret == IDialogConstants.NO_ID) {
- fTabViewer.handleRevertPressed();
- fTabViewer.setInput(newInput);
- }
- else {
- fLaunchConfigurationView.getViewer().setSelection(new StructuredSelection(input));
- }
- fLaunchConfigurationView.setAutoSelect(true);
- }
- else {
- fTabViewer.setInput(newInput);
- if(fTabViewer.isDirty()) {
- fTabViewer.handleApplyPressed();
- }
- if (getShell() != null && getShell().isVisible()) {
- resize();
- }
- }
- }
- }
-
- /**
- * Notification the 'launch' button has been pressed.
- * Save and launch.
- */
- protected void handleLaunchPressed() {
- ILaunchConfiguration config = fTabViewer.getOriginal();
- if (fTabViewer.isDirty() && fTabViewer.canSave()) {
- if (fTabViewer.handleApplyPressed())
- config = fTabViewer.getOriginal();
- else config = null;
- }
- if(config != null) {
- close();
- DebugUITools.launch(config, getMode());
- }
- }
-
- /**
- * Consult a status handler for the given status, if any. The status handler
- * is passed this launch config dialog as an argument.
- *
- * @param status the status to be handled
- */
- public void handleStatus(IStatus status) {
- IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(status);
- if (handler != null) {
- try {
- handler.handleStatus(status, this);
- return;
- }
- catch (CoreException e) {status = e.getStatus();}
- }
- // if no handler, or handler failed, display error/warning dialog
- String title = null;
- switch (status.getSeverity()) {
- case IStatus.ERROR:
- title = LaunchConfigurationsMessages.LaunchConfigurationsDialog_Error_1;
- break;
- case IStatus.WARNING:
- title = LaunchConfigurationsMessages.LaunchConfigurationsDialog_Warning_2;
- break;
- default:
- title = LaunchConfigurationsMessages.LaunchConfigurationsDialog_Information_3;
- break;
- }
- ErrorDialog.openError(getShell(), title, null, status);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#initializeBounds()
- */
- protected void initializeBounds() {
- IDialogSettings settings = getDialogSettings();
- if (fSashForm != null) {
- int w1, w2;
- try {
- w1 = settings.getInt(DIALOG_SASH_WEIGHTS_1);
- if(w1 < 10) {
- w1 = DEFAULT_SASH_WEIGHTS[0];
- }
- w2 = settings.getInt(DIALOG_SASH_WEIGHTS_2);
- if(w2 < 10) {
- w2 = DEFAULT_SASH_WEIGHTS[1];
- }
- }
- catch(NumberFormatException nfe) {
- w1 = DEFAULT_SASH_WEIGHTS[0];
- w2 = DEFAULT_SASH_WEIGHTS[1];
- }
- fSashForm.setWeights(new int[] {w1, w2});
- }
- super.initializeBounds();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.TitleAreaDialog#getInitialSize()
- */
- protected Point getInitialSize() {
- IDialogSettings settings = getDialogSettings();
- if(settings.get(DIALOG_SASH_WEIGHTS_1) != null) {
- return super.getInitialSize();
- }
- return DEFAULT_INITIAL_DIALOG_SIZE;
- }
-
- /**
- * Performs initialization of the content by setting the initial tree selection
- */
- protected void initializeContent() {
- doInitialTreeSelection();
- IStatus status = getInitialStatus();
- if (status != null) {
- handleStatus(status);
- }
- Text filterText = fLaunchConfigurationView.getFilteringTextControl();
- if (filterText != null){
- filterText.setFocus();
- }
- restoreExpansion();
- }
-
- /**
- * Compares two objects to determine their equality
- *
- * @param o1 the first object
- * @param o2 the object to compare to object one
- * @return true if they are equal, false if object 1 is null, the result of o1.equals(o2) otherwise
- */
- protected boolean isEqual(Object o1, Object o2) {
- if (o1 == o2) {
- return true;
- } else if (o1 == null) {
- return false;
- } else {
- return o1.equals(o2);
- }
- }
-
- /**
- * Returns whether the dialog can be closed
- *
- * @return whether the dialog can be closed
- */
- protected boolean isSafeToClose() {
- return fActiveRunningOperations == 0;
- }
-
- /**
- * Determine the initial configuration for this dialog.
- * Open the dialog in the mode set using #setOpenMode(int) and return one of
- * <code>Window. OK</code> or <code>Window.CANCEL</code>.
- *
- * @see org.eclipse.jface.window.Window#open()
- * @return the int status of opening the dialog
- */
- public int open() {
- int mode = getOpenMode();
- setCurrentlyVisibleLaunchConfigurationDialog(this);
- if (mode == LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_LAST_LAUNCHED) {
- ILaunchConfiguration lastLaunchedConfig = getLastLaunchedWorkbenchConfiguration();
- if (lastLaunchedConfig != null) {
- setInitialSelection(new StructuredSelection(lastLaunchedConfig));
- }
- }
- return super.open();
- }
-
- /**
- * saves which of the nodes are expanded at the time the dialog is closed
- * @since 3.2
- */
- protected void persistExpansion() {
- if(fLaunchConfigurationView != null) {
- IDialogSettings settings = getDialogSettings();
- TreeItem[] items = fLaunchConfigurationView.getTreeViewer().getTree().getItems();
- String value = settings.get(DIALOG_EXPANDED_NODES);
- if(value == null) {
- value = IInternalDebugCoreConstants.EMPTY_STRING;
- }
- ArrayList list = new ArrayList();
- String[] persisted = value.split(DELIMITER);
- for(int i = 0; i < persisted.length; i++) {
- list.add(persisted[i]);
- }
- String type = IInternalDebugCoreConstants.EMPTY_STRING;
- //if the item is not in the list and is expanded add it, otherwise if it
- //is not expanded do a remove...either way for the else we query the list
- for(int i = 0; i < items.length; i++) {
- type = ((ILaunchConfigurationType)items[i].getData()).getIdentifier();
- if(!list.contains(type) & items[i].getExpanded()) {
- list.add(type);
- }
- else if(!items[i].getExpanded()) {
- list.remove(type);
- }
- }
- value = IInternalDebugCoreConstants.EMPTY_STRING;
- //build the preference string
- for(Iterator iter = list.iterator(); iter.hasNext();) {
- value += iter.next() + DELIMITER;
- }
- settings.put(DIALOG_EXPANDED_NODES, value);
- }
- }
-
- /**
- * Restore the original expansion state of the nodes in the viewer
- * @since 3.2
- */
- protected void restoreExpansion() {
- if(fLaunchConfigurationView != null) {
- IDialogSettings settings = getDialogSettings();
- String value = settings.get(DIALOG_EXPANDED_NODES);
- if(value != null) {
- String[] nodes = value.split(DELIMITER);
- TreeItem[] items = fLaunchConfigurationView.getTreeViewer().getTree().getItems();
- ArrayList toexpand = new ArrayList();
- // if we have a selection make sure it is expanded
- if(fInitialSelection != null && !fInitialSelection.isEmpty()) {
- Object obj = fInitialSelection.getFirstElement();
- if(obj instanceof ILaunchConfigurationType) {
- toexpand.add(obj);
- }
- else if(obj instanceof ILaunchConfiguration) {
- try {
- toexpand.add(((ILaunchConfiguration) obj).getType());
- }
- catch (CoreException e) {DebugUIPlugin.log(e);}
- }
- }
- for(int i = 0; i < nodes.length; i++) {
- for(int k = 0; k < items.length; k++) {
- ILaunchConfigurationType type = (ILaunchConfigurationType)items[k].getData();
- if(type.getIdentifier().equals(nodes[i])) {
- toexpand.add(type);
- }
- }
- }
- fLaunchConfigurationView.getTreeViewer().setExpandedElements(toexpand.toArray());
- }
- }
- }
-
- /**
- * Save the current sash weights
- */
- protected void persistSashWeights() {
- IDialogSettings settings = getDialogSettings();
- if (fSashForm != null) {
- int[] sashWeights = fSashForm.getWeights();
- settings.put(DIALOG_SASH_WEIGHTS_1, (sashWeights[0] < 10 ? DEFAULT_SASH_WEIGHTS[0] : sashWeights[0]));
- settings.put(DIALOG_SASH_WEIGHTS_2, (sashWeights[1] < 10 ? DEFAULT_SASH_WEIGHTS[1] : sashWeights[1]));
- }
- }
-
- /**
- * Update buttons and message.
- */
- protected void refreshStatus() {
- updateMessage();
- updateButtons();
- }
-
- /**
- * resize the dialog to show all relevant content, maintains aspect in all resolutions down to 1024x768
- */
- protected void resize() {
- if(getTabGroup() != null) {
- Point shell = getShell().getSize();
- int maxx = (int)(getDisplay().getBounds().width * MAX_DIALOG_WIDTH_PERCENT),
- maxy = (int) (getDisplay().getBounds().height * MAX_DIALOG_HEIGHT_PERCENT);
- maxx = (maxx < DEFAULT_INITIAL_DIALOG_SIZE.x ? DEFAULT_INITIAL_DIALOG_SIZE.x : maxx);
- maxy = (maxy < DEFAULT_INITIAL_DIALOG_SIZE.y ? DEFAULT_INITIAL_DIALOG_SIZE.y : maxy);
- Point psize = getShell().computeSize(SWT.DEFAULT, maxy);
- if((psize.x > maxx ? maxx : psize.x) > shell.x || (psize.y > maxy ? maxy : psize.y) > shell.y) {
- setShellSize(Math.min(psize.x, maxx), Math.min(psize.y, maxy));
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.operation.IRunnableContext#run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress)
- */
- public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
- if (getShell() != null && getShell().isVisible()) {
- // Save focus control
- fLastControl = getShell().getDisplay().getFocusControl();
- if (fLastControl != null && fLastControl.getShell() != getShell()) {
- fLastControl = null;
- }
- fProgressMonitorCancelButton.setEnabled(cancelable);
- // Attach the progress monitor part to the cancel button
- fProgressMonitorPart.attachToCancelComponent(fProgressMonitorCancelButton);
- fProgressMonitorPart.getParent().setVisible(true);
- fProgressMonitorCancelButton.setFocus();
- fActiveRunningOperations++;
-
- //do work here collecting enabled states, otherwise to get these states we would need to
- //perform the validation of the dialog again, which is expensive and would cause flashing of widgets.
- Control[] children = ((Composite)fButtonComp.getChildren()[0]).getChildren();
- boolean[] prev = new boolean[children.length+2];
- prev[0] = fTabViewer.getApplyButton().isEnabled();
- prev[1] = fTabViewer.getRevertButton().isEnabled();
- for(int i = 0; i < children.length; i++) {
- prev[i+2] = children[i].isEnabled();
- }
- try {
- updateRunnnableControls(false, prev);
- ModalContext.run(runnable, fork, fProgressMonitorPart, getShell().getDisplay());
- }
- finally {
- fActiveRunningOperations--;
- updateRunnnableControls(true, prev);
- if (getShell() != null) {
- fProgressMonitorPart.getParent().setVisible(false);
- fProgressMonitorPart.removeFromCancelComponent(fProgressMonitorCancelButton);
- if (fLastControl != null) {
- fLastControl.setFocus();
- }
- }
- }
- }
- else {
- PlatformUI.getWorkbench().getProgressService().run(fork, cancelable, runnable);
- }
- }
-
- /**
- * Updates the enablement of the runnable controls to appear disabled as a job is running
- * @param enabled the desired enable status of the dialog area, revert//apply buttons, and
- * @param prev the previous settings for the apply and revert buttons to be reset to, only takes effect if enable is set to true
- * any children of the button bar
- * @since 3.3.0
- */
- private void updateRunnnableControls(boolean enabled, boolean[] prev) {
- fTabViewer.getApplyButton().setEnabled(enabled ? prev[0] : enabled);
- fTabViewer.getRevertButton().setEnabled(enabled ? prev[1] : enabled);
- //the arrangement never differs: button comp has one child that holds all the buttons
- Control[] children = ((Composite)fButtonComp.getChildren()[0]).getChildren();
- for(int i = 0; i < children.length; i++) {
- children[i].setEnabled(enabled ? prev[i+2] : enabled);
- }
- getDialogArea().setEnabled(enabled);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationDialog#setActiveTab(org.eclipse.debug.ui.ILaunchConfigurationTab)
- */
- public void setActiveTab(ILaunchConfigurationTab tab) {
- fTabViewer.setActiveTab(tab);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationDialog#setActiveTab(int)
- */
- public void setActiveTab(int index) {
- fTabViewer.setActiveTab(index);
- }
-
- /**
- * Sets the initial selection for the dialog when opened in
- * <code>LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION</code> mode.
- */
- public void setInitialSelection(IStructuredSelection selection) {
- fInitialSelection = selection;
- }
-
- /**
- * Sets the status to open the dialog on.
- *
- * @param status the initial status for the dialog
- */
- public void setInitialStatus(IStatus status) {
- fInitialStatus = status;
- }
-
- /**
- * Sets the launch group to display.
- *
- * @param group launch group
- */
- protected void setLaunchGroup(LaunchGroupExtension group) {
- fGroup = group;
- }
-
- /**
- * Set the title area image based on the mode this dialog was initialized with
- */
- protected void setModeLabelState() {
- setTitleImage(getBannerImage());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationDialog#setName(java.lang.String)
- */
- public void setName(String name) {
- fTabViewer.setName(name);
- }
-
- /**
- * Returns the current launch manager
- * @return the current launch manager
- */
- protected ILaunchManager getLaunchManager() {
- return DebugPlugin.getDefault().getLaunchManager();
- }
-
- /**
- * Set the flag indicating how this dialog behaves when the <code>open()</code> method is called.
- * Valid values are defined by the LAUNCH_CONFIGURATION_DIALOG... constants in this class.
- */
- public void setOpenMode(int mode) {
- fOpenMode = mode;
- }
-
- /**
- * Increase the size of this dialog's <code>Shell</code> by the specified amounts.
- * Do not increase the size of the Shell beyond the bounds of the Display.
- */
- protected void setShellSize(int width, int height) {
- Rectangle bounds = getShell().getMonitor().getBounds();
- getShell().setSize(Math.min(width, bounds.width), Math.min(height, bounds.height));
- }
-
- /**
- * Sets the viewer used to display the tabs for a launch configuration.
- *
- * @param viewer the new view to set
- */
- protected void setTabViewer(LaunchConfigurationTabGroupViewer viewer) {
- fTabViewer = viewer;
- }
-
- /**
- * Create and return a dialog that asks the user whether they want to discard
- * unsaved changes.
- *
- * @return the return code based on the button selected.
- * The value will be one of <code>YES_ID</code> or <code>NO_ID</code> from
- * <code>IDialogConstants</code>.
- */
- private int showDiscardChangesDialog() {
- StringBuffer buffer = new StringBuffer(MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationDialog_The_configuration___35, new String[]{fTabViewer.getWorkingCopy().getName()}));
- buffer.append(fTabViewer.getErrorMesssage());
- buffer.append(LaunchConfigurationsMessages.LaunchConfigurationDialog_Do_you_wish_to_discard_changes_37);
- MessageDialog dialog = new MessageDialog(getShell(),
- LaunchConfigurationsMessages.LaunchConfigurationDialog_Discard_changes__38,
- null,
- buffer.toString(),
- MessageDialog.QUESTION,
- new String[] {LaunchConfigurationsMessages.LaunchConfigurationDialog_Yes_32,
- LaunchConfigurationsMessages.LaunchConfigurationDialog_No_33},
- 1);
- int val = IDialogConstants.NO_ID;
- if (dialog.open() == 0) {
- if (fLaunchConfigurationView != null) {
- fLaunchConfigurationView.setAutoSelect(false);
- }
- fTabViewer.handleRevertPressed();
- val = IDialogConstants.YES_ID;
- if (fLaunchConfigurationView != null) {
- fLaunchConfigurationView.setAutoSelect(true);
- }
- }
- if(val == IDialogConstants.NO_ID) {
- val = ID_DISCARD_BUTTON;
- }
- return val;
- }
-
- /**
- * Create and return a dialog that asks the user whether they want to save
- * unsaved changes.
- *
- * @return the return code based on the button selected.
- * The value will be one of <code>YES_ID</code>, <code>NO_ID</code>, or <code>CANCEL_ID</code>, from
- * <code>IDialogConstants</code>.
- */
- private int showSaveChangesDialog() {
- String message = MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationDialog_The_configuration___29, new String[]{fTabViewer.getWorkingCopy().getName()});
- MessageDialog dialog = new MessageDialog(getShell(),
- LaunchConfigurationsMessages.LaunchConfigurationFilteredTree_save_changes,
- null,
- message,
- MessageDialog.QUESTION,
- new String[] {LaunchConfigurationsMessages.LaunchConfigurationDialog_Yes_32,
- LaunchConfigurationsMessages.LaunchConfigurationDialog_No_33,
- LaunchConfigurationsMessages.LaunchConfigurationsDialog_c_ancel},
- 0);
- int ret = dialog.open();
- int val = IDialogConstants.CANCEL_ID;
- if (ret == 0 || ret == 1) {
- if (ret == 0) {
- val = IDialogConstants.YES_ID;
- }
- else {
- val = IDialogConstants.NO_ID;
- }
- }
- return val;
- }
-
- /**
- * Show the user a dialog appropriate to whether the unsaved changes in the current config
- * can be saved or not. Return <code>true</code> if the user indicated that they wish to replace
- * the current config, either by saving changes or by discarding the, return <code>false</code>
- * otherwise.
- *
- * @return returns the <code>showSaveChangesDialog</code> return value
- */
- private int showUnsavedChangesDialog() {
- if (fTabViewer.canSave()) {
- return showSaveChangesDialog();
- }
- return showDiscardChangesDialog();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationDialog#updateButtons()
- */
- public void updateButtons() {
- // New, Delete, & Duplicate toolbar actions
- getNewAction().setEnabled(getNewAction().isEnabled());
- getDeleteAction().setEnabled(getDeleteAction().isEnabled());
- getDuplicateAction().setEnabled(getDuplicateAction().isEnabled());
- fTabViewer.refresh();
- getButton(ID_LAUNCH_BUTTON).setEnabled(fTabViewer.canLaunch() & fTabViewer.canLaunchWithModes() & !fTabViewer.hasDuplicateDelegates());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationDialog#updateMessage()
- */
- public void updateMessage() {
- setErrorMessage(fTabViewer.getErrorMesssage());
- setMessage(fTabViewer.getMessage());
- }
-
- /**
- * Returns if there is a selection in the tree viewer or not
- * @return true if something in the tree is selected, false otherwise
- * @since 3.2
- */
- public boolean isTreeSelectionEmpty() {
- return fLaunchConfigurationView.getTreeViewer().getSelection().isEmpty();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(final PropertyChangeEvent event) {
- WorkbenchJob job = new WorkbenchJob(IInternalDebugCoreConstants.EMPTY_STRING) {
- public IStatus runInUIThread(IProgressMonitor monitor) {
- TreeViewer viewer = fLaunchConfigurationView.getTreeViewer();
- boolean newvalue = Boolean.valueOf(event.getNewValue().toString()).booleanValue();
- if(event.getProperty().equals(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_CLOSED)) {
- updateFilter(newvalue, fClosedProjectFilter);
- }
- else if(event.getProperty().equals(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_DELETED)) {
- updateFilter(newvalue, fDeletedProjectFilter);
- }
- else if(event.getProperty().equals(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_TYPES)) {
- updateFilter(newvalue, fLCTFilter);
- }
- else if(event.getProperty().equals(IInternalDebugUIConstants.PREF_FILTER_WORKING_SETS)) {
- updateFilter(newvalue, fWorkingSetsFilter);
- }
- else if(event.getProperty().equals(IInternalDebugUIConstants.PREF_FILTER_TYPE_LIST)) {
- if(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_TYPES)) {
- viewer.refresh();
- fLaunchConfigurationView.updateFilterLabel();
- }
- }
-
- return Status.OK_STATUS;
- }
- };
- job.runInUIThread(new NullProgressMonitor());
- }
-
- /**
- * Updates the state of a filter based on the state variable
- * @param state if the filter needs to be added or removed, true indicates add, false indicates remove
- * @param filter the filter to update
- */
- private void updateFilter(boolean state, ViewerFilter filter) {
- TreeViewer viewer = (TreeViewer)fLaunchConfigurationView.getViewer();
- if(state) {
- viewer.addFilter(filter);
- }
- else {
- viewer.removeFilter(filter);
- }
- fLaunchConfigurationView.updateFilterLabel();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
deleted file mode 100644
index 71bac4e32..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import org.eclipse.osgi.util.NLS;
-
-public class LaunchConfigurationsMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages";//$NON-NLS-1$
-
- public static String CommonTab__Browse_6;
- public static String CommonTab__Common_15;
- public static String CommonTab_Display_in_favorites_menu__10;
- public static String CommonTab_Invalid_shared_configuration_location_14;
- public static String CommonTab_L_ocal_3;
- public static String CommonTab_S_hared_4;
- public static String CommonTab_Select_a_location_for_the_launch_configuration_13;
- public static String CommonTab_Cannot_save_launch_configuration_in_a_closed_project__1;
- public static String CommonTab_10;
- public static String CommonTab_11;
- public static String CommonTab_12;
- public static String CommonTab_13;
- public static String CommonTab_14;
- public static String CommonTab_0;
- public static String CommonTab_1;
- public static String CommonTab_2;
- public static String CommonTab_3;
- public static String CommonTab_4;
- public static String CommonTab_5;
- public static String CommonTab_6;
- public static String CommonTab_7;
- public static String CommonTab_8;
- public static String CommonTab_9;
-
- public static String CompileErrorProjectPromptStatusHandler_0;
- public static String CompileErrorProjectPromptStatusHandler_1;
- public static String CompileErrorPromptStatusHandler_0;
- public static String CompileErrorPromptStatusHandler_1;
- public static String CompileErrorPromptStatusHandler_2;
- public static String EnvironmentTab_22;
-
- public static String EnvironmentTab_7;
-
- public static String LaunchConfigurationDialog__Apply_17;
- public static String LaunchConfigurationDialog__Name__16;
- public static String LaunchConfigurationDialog_An_exception_occurred_while_retrieving_launch_configurations_20;
- public static String LaunchConfigurationEditDialog_0;
- public static String LaunchConfigurationEditDialog_1;
- public static String LaunchConfigurationFilteredTree_discard_changes;
- public static String LaunchConfigurationFilteredTree_save_changes;
-
- public static String LaunchConfigurationFilteredTree_search_with_changes;
- public static String LaunchConfigurationFilteredTree_search_with_errors;
- public static String LaunchConfigurationTabGroupViewer_0;
- public static String LaunchConfigurationDialog_Create__manage__and_run_launch_configurations_8;
- public static String LaunchConfigurationDialog_Discard_changes__38;
- public static String LaunchConfigurationDialog_Do_you_wish_to_discard_changes_37;
- public static String LaunchConfigurationDialog_Error_19;
- public static String LaunchConfigurationDialog_Exception_occurred_creating_launch_configuration_tabs_27;
- public static String LaunchConfigurationDialog_Exception_occurred_while_saving_launch_configuration_47;
- public static String LaunchConfigurationDialog_Launch_configuration_already_exists_with_this_name_12;
- public static String LaunchConfigurationDialog_Launch_Configuration_Error_46;
- public static String LaunchConfigurationDialog_Launch_Configurations_18;
- public static String LaunchConfigurationDialog_Name_required_for_launch_configuration_11;
- public static String LaunchConfigurationDialog_No_33;
- public static String LaunchConfigurationDialog_Ready_to_launch_2;
- public static String LaunchConfigurationDialog_The_configuration___29;
- public static String LaunchConfigurationDialog_The_configuration___35;
- public static String LaunchConfigurationDialog_unspecified_28;
- public static String LaunchConfigurationDialog_Yes_32;
- public static String LaunchConfigurationDialog_Do_you_wish_to_delete_the_selected_launch_configurations__1;
- public static String LaunchConfigurationDialog_Do_you_wish_to_delete_the_selected_launch_configuration__2;
- public static String LaunchConfigurationDialog_Confirm_Launch_Configuration_Deletion_3;
- public static String LaunchConfigurationDialog_Close_1;
- public static String LaunchConfigurationDialog_Revert_2;
- public static String LaunchConfigurationDialog_Cancel_3;
- public static String LaunchConfigurationsDialog_Error_1;
- public static String LaunchConfigurationsDialog_Warning_2;
- public static String LaunchConfigurationsDialog_Information_3;
- public static String LaunchConfigurationSelectionDialog_0;
- public static String LaunchConfigurationSelectionDialog_1;
-
- public static String LaunchConfigurationTabGroupViewer_14;
-
- public static String LaunchConfigurationTabGroupViewer_15;
-
- public static String LaunchConfigurationTabGroupViewer_16;
-
- public static String LaunchConfigurationTabGroupViewer_17;
-
- public static String LaunchConfigurationTabGroupViewer_18;
- public static String LaunchConfigurationTabGroupViewer_13;
-
- public static String LaunchConfigurationTabGroupViewer_19;
-
- public static String LaunchConfigurationView_0;
-
- public static String LaunchShortcutSelectionDialog_0;
-
- public static String LaunchShortcutSelectionDialog_1;
-
- public static String LaunchShortcutSelectionDialog_2;
-
- public static String LaunchShortcutSelectionDialog_3;
-
- public static String LaunchShortcutSelectionDialog_4;
-
- public static String PerspectiveManager_Error_1;
- public static String PerspectiveManager_Unable_to_switch_perpsectives_as_specified_by_launch___0__4;
- public static String PerspectiveManager_Unable_to_switch_to_perspective___0__2;
-
- public static String LaunchConfigurationPresentationManager_0;
-
- public static String LaunchConfigurationPropertiesDialog_Edit_launch_configuration_properties_1;
- public static String LaunchConfigurationPropertiesDialog_Properties_for__0__2;
-
- public static String LaunchConfigurationDialog_Modify_attributes_and_launch__1;
-
- public static String LaunchConfigurationTabGroupViewer_No_tabs_defined_for_launch_configuration_type__0__1;
-
- public static String DuplicateLaunchConfigurationAction__Duplicate_1;
-
- public static String DeleteLaunchConfigurationAction_Dele_te_1;
-
- public static String CreateLaunchConfigurationAction_Ne_w_1;
- public static String CreateLaunchConfigurationAction_New_configuration_2;
-
- public static String EnvironmentTab_Variable_1;
- public static String EnvironmentTab_Value_2;
- public static String EnvironmentTab_Environment_variables_to_set__3;
- public static String EnvironmentTab_New_4;
- public static String EnvironmentTab_Edit_5;
- public static String EnvironmentTab_Remove_6;
- public static String EnvironmentTab_Environment_7;
- public static String EnvironmentTab_8;
- public static String EnvironmentTab_9;
- public static String EnvironmentTab_11;
- public static String EnvironmentTab_12;
- public static String EnvironmentTab_13;
- public static String EnvironmentTab_16;
- public static String EnvironmentTab_17;
- public static String EnvironmentTab_18;
- public static String EnvironmentTab_19;
- public static String EnvironmentTab_20;
-
- public static String FavoritesDialog_1;
- public static String FavoritesDialog_2;
- public static String FavoritesDialog_3;
- public static String FavoritesDialog_4;
- public static String FavoritesDialog_5;
- public static String FavoritesDialog_6;
- public static String FavoritesDialog_7;
- public static String FavoritesDialog_0;
-
- public static String OrganizeFavoritesAction_0;
- public static String PerspectiveManager_12;
- public static String PerspectiveManager_13;
- public static String PerspectiveManager_15;
- public static String PerspectiveManager_suspend_description;
- public static String PerspectiveManager_launch_description;
-
- public static String DebugModePromptStatusHandler_0;
- public static String DebugModePromptStatusHandler_1;
-
- public static String CommonTab_No_Encoding_Selected;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, LaunchConfigurationsMessages.class);
- }
-
- public static String LaunchConfigurationTabGroupViewer_1;
- public static String LaunchConfigurationTabGroupViewer_2;
- public static String LaunchConfigurationTabGroupViewer_3;
- public static String LaunchConfigurationTabGroupViewer_4;
- public static String LaunchConfigurationTabGroupViewer_5;
- public static String LaunchConfigurationTabGroupViewer_6;
-
- public static String SaveScopeResourcesHandler_1;
- public static String SaveScopeResourcesHandler_2;
- public static String SaveScopeResourcesHandler_3;
-
- public static String FavoritesDialog_8;
-
- public static String LaunchConfigurationsDialog_0;
- public static String LaunchConfigurationsDialog_1;
- public static String LaunchConfigurationsDialog_4;
- public static String LaunchConfigurationsDialog_5;
- public static String FilterLaunchConfigurationAction_0;
-
-
- public static String LaunchConfigurationTabGroupViewer_8;
-
- public static String FilterDropDownMenuCreator_0;
- public static String FilterDropDownMenuCreator_1;
- public static String FilterDropDownMenuCreator_2;
- public static String FilterDropDownMenuCreator_3;
- public static String FilterDropDownMenuCreator_4;
-
- public static String LaunchConfigurationsDialog_c_ancel;
-
- public static String LaunchConfigurationsDialog_configurations;
-
- public static String CollapseAllLaunchConfigurationAction_0;
- public static String CollapseAllLaunchConfigurationAction_1;
- public static String CollapseAllLaunchConfigurationAction_2;
-
- public static String SelectLaunchersDialog_0;
- public static String SelectLaunchersDialog_1;
- public static String SelectLaunchersDialog_2;
- public static String SelectLaunchersDialog_4;
- public static String SelectLaunchersDialog_5;
-
- public static String SelectLaunchersDialog_launchers;
- public static String SelectLaunchOptionsDialog_3;
- public static String SelectLaunchOptionsDialog_4;
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
deleted file mode 100644
index e472e436d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
+++ /dev/null
@@ -1,208 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2009 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-CommonTab_No_Encoding_Selected=Console encoding not selected
-CommonTab__Browse_6=&Browse...
-CommonTab__Common_15=&Common
-CommonTab_Display_in_favorites_menu__10=Display in favor&ites menu
-CommonTab_Invalid_shared_configuration_location_14=Invalid shared configuration location
-CommonTab_L_ocal_3=L&ocal file
-CommonTab_S_hared_4=S&hared file:
-CommonTab_Select_a_location_for_the_launch_configuration_13=Select a location for the launch configuration
-CommonTab_Cannot_save_launch_configuration_in_a_closed_project__1=Cannot save launch configuration in a closed project.
-CommonTab_10=Launch in bac&kground
-CommonTab_11=A&ppend
-CommonTab_12=&Workspace...
-CommonTab_13=Select a Resource:
-CommonTab_14=Select a resource to redirect output to:
-CommonTab_0=Save as
-CommonTab_1=Console Encoding
-CommonTab_2=Defa&ult - inherited ({0})
-CommonTab_3=Oth&er
-CommonTab_4=Standard Input and Output
-CommonTab_5=&Allocate Console (necessary for input)
-CommonTab_6=Fi&le:
-CommonTab_7=File Syste&m...
-CommonTab_8=No file specified for process output
-CommonTab_9=Variable&s...
-
-CompileErrorPromptStatusHandler_0=Errors in Workspace
-CompileErrorPromptStatusHandler_1=Errors exist in a required project. Continue launch?
-CompileErrorPromptStatusHandler_2=Errors exist in required project(s):\n\n{0}\n\nProceed with launch?
-CompileErrorProjectPromptStatusHandler_1=&Always launch without asking
-# {0} is replaced with a comma separated list of project names
-CompileErrorProjectPromptStatusHandler_0={0}...
-
-EnvironmentTab_22=New Environment Variable
-
-LaunchConfigurationDialog__Apply_17=Appl&y
-LaunchConfigurationDialog__Name__16=&Name:
-LaunchConfigurationDialog_An_exception_occurred_while_retrieving_launch_configurations_20=An exception occurred while retrieving launch configurations
-
-LaunchConfigurationTabGroupViewer_0=''{0}'' is an invalid character in a configuration name
-LaunchConfigurationTabGroupViewer_1=Configure launch settings from this dialog:
-LaunchConfigurationTabGroupViewer_2=- Press the 'New' button to create a configuration of the selected type.
-LaunchConfigurationTabGroupViewer_3=- Edit or view an existing configuration by selecting it.
-LaunchConfigurationTabGroupViewer_4=- Press the 'Delete' button to remove the selected configuration.
-LaunchConfigurationTabGroupViewer_6=- Press the 'Duplicate' button to copy the selected configuration.
-LaunchConfigurationTabGroupViewer_5=Configure launch perspective settings from the <a>Perspectives</a> preference page.
-LaunchConfigurationTabGroupViewer_8=- Press the 'Filter' button to configure filtering options.
-LaunchConfigurationTabGroupViewer_13=Select a supported <a>launch mode</a>.
-LaunchConfigurationTabGroupViewer_14=Mixed launch mode not supported: {0}
-LaunchConfigurationTabGroupViewer_15=More than one launcher available - <a>Select other...</a>
-LaunchConfigurationTabGroupViewer_16=Using {0} - <a>Select other...</a>
-LaunchConfigurationTabGroupViewer_17=Multiple launchers available - <a>Select one...</a>
-LaunchConfigurationTabGroupViewer_18=Multiple launchers available - select one to continue
-LaunchConfigurationTabGroupViewer_19={0} is an invalid configuration name
-
-LaunchConfigurationDialog_Create__manage__and_run_launch_configurations_8=Create, manage, and run configurations
-LaunchConfigurationDialog_Discard_changes__38=Discard changes?
-LaunchConfigurationDialog_Do_you_wish_to_discard_changes_37=\nDo you wish to discard changes?\n
-LaunchConfigurationDialog_Error_19=Error
-LaunchConfigurationDialog_Exception_occurred_creating_launch_configuration_tabs_27=Exception occurred creating launch configuration tabs
-LaunchConfigurationDialog_Exception_occurred_while_saving_launch_configuration_47=Exception occurred while saving launch configuration
-LaunchConfigurationDialog_Launch_configuration_already_exists_with_this_name_12=A configuration with this name already exists
-LaunchConfigurationDialog_Launch_Configuration_Error_46=Launch Configuration Error
-LaunchConfigurationDialog_Launch_Configurations_18=Launch Configurations
-LaunchConfigurationFilteredTree_save_changes=Save Changes
-LaunchConfigurationFilteredTree_search_with_changes=You cannot perform a text search when the current configuration has pending changes.\n\nDo you want to save the changes and continue searching?
-LaunchConfigurationFilteredTree_search_with_errors=You cannot perform a text search when the current configuration has errors.\n\nDo you want to discard the changes and continue searching?
-LaunchConfigurationDialog_Name_required_for_launch_configuration_11=A name is required for the configuration
-LaunchConfigurationDialog_No_33=No
-LaunchConfigurationEditDialog_0=Modify configuration and continue.
-LaunchConfigurationEditDialog_1=Con&tinue
-LaunchConfigurationDialog_Ready_to_launch_2=Ready to launch
-LaunchConfigurationDialog_The_configuration___29=The configuration "{0}" has unsaved changes. Do you wish to save them?
-LaunchConfigurationDialog_The_configuration___35=The configuration "{0}" has unsaved changes that CANNOT be saved because of the following error:\n\n
-LaunchConfigurationFilteredTree_discard_changes=Discard Changes
-LaunchConfigurationDialog_unspecified_28=unspecified
-LaunchConfigurationDialog_Yes_32=Yes
-LaunchConfigurationDialog_Do_you_wish_to_delete_the_selected_launch_configurations__1=Do you wish to delete the selected launch configurations?
-LaunchConfigurationDialog_Do_you_wish_to_delete_the_selected_launch_configuration__2=Do you wish to delete the selected launch configuration?
-LaunchConfigurationDialog_Confirm_Launch_Configuration_Deletion_3=Confirm Launch Configuration Deletion
-LaunchConfigurationDialog_Close_1=Close
-LaunchConfigurationDialog_Revert_2=Re&vert
-LaunchConfigurationDialog_Cancel_3=Cance&l
-LaunchConfigurationsDialog_Error_1=Error
-LaunchConfigurationsDialog_Warning_2=Warning
-LaunchConfigurationsDialog_Information_3=Information
-LaunchConfigurationsDialog_0=New launch configuration
-LaunchConfigurationsDialog_1=Delete selected launch configuration(s)
-LaunchConfigurationsDialog_4=Filter launch configurations...
-LaunchConfigurationsDialog_5=Duplicates the currently selected launch configuration
-LaunchConfigurationSelectionDialog_0=Select Configuration
-LaunchConfigurationSelectionDialog_1=&Select a configuration to launch:
-LaunchConfigurationView_0=Filter matched {0} of {1} items
-LaunchConfigurationsDialog_c_ancel=Cancel
-
-# {0} is substituted with a launch mode - possible values include run, debug, profile, or
-# any label of a contributed ILaunchMode.
-LaunchConfigurationsDialog_configurations={0} Configurations
-PerspectiveManager_Error_1=Error
-PerspectiveManager_Unable_to_switch_perpsectives_as_specified_by_launch___0__4=Unable to open perspectives as specified by launch: {0}
-PerspectiveManager_Unable_to_switch_to_perspective___0__2=Unable to open perspective: {0}
-
-# {0} is substituted with a launch mode - possible values include Run, Debug, Profile,
-# or any label of a contributed ILaunchMode.
-LaunchShortcutSelectionDialog_0={0} As
-
-# {0} is substituted with a launch mode - possible values include run, debug, profile, or
-# any label of a contributed ILaunchMode.
-#
-# {1} is the name of the resource being launched (run or debugged, etc.).
-# Possible values can be the name of any IResource in the current workspace: for example
-# if you tried to launch a class named Main in the file Main.java and you were presented
-# with the selection dialog, the value of {1} would be Main.java (the name of the IResource)
-LaunchShortcutSelectionDialog_1=&Select a way to {0} ''{1}'':
-LaunchShortcutSelectionDialog_2=Description
-LaunchShortcutSelectionDialog_3=Description not available
-# {0} is substituted with a launch mode - possible values include Run, Debug, Profile,
-# or any label of a contributed ILaunchMode.
-LaunchShortcutSelectionDialog_4=&Select what to {0}:
-
-LaunchConfigurationPresentationManager_0=Tab group extension: {0} for type {1} for the {2} mode has been replaced by extension: {3}
-LaunchConfigurationPropertiesDialog_Edit_launch_configuration_properties_1=Edit launch configuration properties
-LaunchConfigurationPropertiesDialog_Properties_for__0__2=Edit Configuration
-
-LaunchConfigurationDialog_Modify_attributes_and_launch__1=Edit configuration and launch.
-
-LaunchConfigurationTabGroupViewer_No_tabs_defined_for_launch_configuration_type__0__1=No tabs defined for launch configuration type {0}
-
-DuplicateLaunchConfigurationAction__Duplicate_1=&Duplicate
-
-DeleteLaunchConfigurationAction_Dele_te_1=Dele&te
-
-CreateLaunchConfigurationAction_Ne_w_1=Ne&w
-CreateLaunchConfigurationAction_New_configuration_2=New_configuration
-
-EnvironmentTab_Variable_1=Variable
-EnvironmentTab_Value_2=Value
-EnvironmentTab_Environment_variables_to_set__3=Environment variables to &set:
-EnvironmentTab_New_4=N&ew...
-EnvironmentTab_Edit_5=E&dit...
-EnvironmentTab_Remove_6=Rem&ove
-EnvironmentTab_Environment_7=Environment
-EnvironmentTab_8=&Name:
-EnvironmentTab_9=&Value:
-
-# This externalized string is used in the select environment variables dialog's label provider.
-# Each item in the dialog is a single environment variable.
-# {0} is replaced with the name of the environment variable
-# {1} is replaced with the current value of the environment variable
-EnvironmentTab_7={0} [ {1} ]
-EnvironmentTab_11=Edit Environment Variable
-EnvironmentTab_12=Overwrite variable?
-EnvironmentTab_13=A variable named {0} already exists. Overwrite?
-EnvironmentTab_16=&Append environment to native environment
-EnvironmentTab_17=Re&place native environment with specified environment
-EnvironmentTab_18=Se&lect...
-EnvironmentTab_19=Select &environment variables to add:
-EnvironmentTab_20=Select Environment Variables
-
-FavoritesDialog_1=Organize {0} Favorites
-FavoritesDialog_2=Fa&vorites:
-FavoritesDialog_3=Ad&d...
-FavoritesDialog_4=Re&move
-FavoritesDialog_5=U&p
-FavoritesDialog_6=Do&wn
-FavoritesDialog_7=Select &Launch Configurations:
-FavoritesDialog_0=Add {0} Favorites
-FavoritesDialog_8=Updating Favorites...
-
-OrganizeFavoritesAction_0=Organize Fa&vorites...
-PerspectiveManager_12=Confirm Perspective Switch
-PerspectiveManager_13=This kind of launch is configured to open the {0} perspective when it suspends. Do you want to open this perspective now?
-PerspectiveManager_15=This kind of launch is associated with the {0} perspective. Do you want to open this perspective now?
-PerspectiveManager_suspend_description=This kind of launch is configured to open the {0} perspective when it suspends.\n\n{1}\n\nDo you want to open this perspective now?
-PerspectiveManager_launch_description=This kind of launch is associated with the {0} perspective.\n\n{1}\n\nDo you want to open this perspective now?
-
-DebugModePromptStatusHandler_0=Breakpoints in Workspace
-DebugModePromptStatusHandler_1=There are breakpoints enabled in the workspace. Would you rather launch in debug mode?
-SaveScopeResourcesHandler_2=Select resources to save:
-SaveScopeResourcesHandler_3=Save and Launch
-SaveScopeResourcesHandler_1=Always save &resources before launching
-FilterLaunchConfigurationAction_0=Filter
-FilterDropDownMenuCreator_0=Filter &Closed Projects
-FilterDropDownMenuCreator_1=Filter &Deleted/Unavailable Projects
-FilterDropDownMenuCreator_2=Filter Configuration &Types
-FilterDropDownMenuCreator_3=Filtering &Preferences...
-FilterDropDownMenuCreator_4=Apply Window &Working Set(s)
-CollapseAllLaunchConfigurationAction_0=Collapse All
-CollapseAllLaunchConfigurationAction_1=Collapses all expanded launch configurations.
-CollapseAllLaunchConfigurationAction_2=This action collapses all of the launch configurations currently visible and expanded.
-SelectLaunchOptionsDialog_3=Select Launch Mode
-SelectLaunchOptionsDialog_4=&Select a supported mode combination:
-SelectLaunchersDialog_0=Select Preferred Launcher
-SelectLaunchersDialog_1=&Use configuration specific settings
-SelectLaunchersDialog_2=This dialog allows you to specify which launcher to use when multiple launchers are available for a configuration and launch mode.
-SelectLaunchersDialog_4=<a href="ws">Change Workspace Settings...</a>
-SelectLaunchersDialog_5=Description
-SelectLaunchersDialog_launchers=Launc&hers:
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateContribution.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateContribution.java
deleted file mode 100644
index de7828eb3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateContribution.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import org.eclipse.debug.core.ILaunchDelegate;
-import org.eclipse.ui.IPluginContribution;
-
-/**
- * This class provides a wrapper for a launch delegate so tht it can be filtered from UI and launching choices
- * @since 3.3
- */
-public class LaunchDelegateContribution implements IPluginContribution {
-
- private ILaunchDelegate fDelegate = null;
-
- /**
- * Constructor
- * @param delegate
- */
- public LaunchDelegateContribution(ILaunchDelegate delegate) {
- fDelegate = delegate;
- }
-
- /**
- * @see org.eclipse.ui.IPluginContribution#getLocalId()
- */
- public String getLocalId() {
- return fDelegate.getId();
- }
-
- /**
- * @see org.eclipse.ui.IPluginContribution#getPluginId()
- */
- public String getPluginId() {
- return fDelegate.getPluginIdentifier();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java
deleted file mode 100644
index f81f75084..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.IStatusHandler;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This class provides a mechanism to prompt users in the UI thread from debug.core in the case where
- * a launch delegate has gone missing and a new choice needs to be made in the launch dialog.
- *
- * @since 3.3
- */
-public class LaunchDelegateNotAvailableHandler implements IStatusHandler {
-
- /**
- * @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
- */
- public Object handleStatus(IStatus status, Object source) throws CoreException {
- if(source instanceof Object[]) {
- Object[] infos = (Object[]) source;
- if(infos.length == 2) {
- final ILaunchConfiguration config = (ILaunchConfiguration) infos[0];
- final String mode = (String) infos[1];
- final Shell shell = DebugUIPlugin.getShell();
- Runnable runnable = new Runnable() {
- public void run() {
- DebugUITools.openLaunchConfigurationDialog(shell, config, DebugUITools.getLaunchGroup(config, mode).getIdentifier(), null);
- }
- };
- DebugUIPlugin.getStandardDisplay().asyncExec(runnable);
- }
- }
- return Status.OK_STATUS;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupExtension.java
deleted file mode 100644
index b1e9beb2f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupExtension.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-
-/**
- * Proxy to a launch group extension
- */
-public class LaunchGroupExtension implements ILaunchGroup {
-
- /**
- * The configuration element defining this launch group.
- */
- private IConfigurationElement fConfig;
-
- /**
- * The image for this group
- */
- private ImageDescriptor fImageDescriptor;
-
- /**
- * The banner image for this group
- */
- private ImageDescriptor fBannerImageDescriptor;
-
- /**
- * Constructs a launch group extension based on the given configuration
- * element
- *
- * @param element the configuration element defining the
- * attributes of this launch group extension
- * @return a new launch group extension
- */
- public LaunchGroupExtension(IConfigurationElement element) {
- setConfigurationElement(element);
- }
-
- /**
- * Sets the configuration element that defines the attributes
- * for this launch group extension.
- *
- * @param element configuration element
- */
- private void setConfigurationElement(IConfigurationElement element) {
- fConfig = element;
- }
-
- /**
- * Returns the configuration element that defines the attributes
- * for this launch group extension.
- *
- * @param configuration element that defines the attributes
- * for this launch group extension
- */
- protected IConfigurationElement getConfigurationElement() {
- return fConfig;
- }
-
- /**
- * Returns the image for this launch group, or <code>null</code> if none
- *
- * @return the image for this launch group, or <code>null</code> if none
- */
- public ImageDescriptor getImageDescriptor() {
- if (fImageDescriptor == null) {
- fImageDescriptor = createImageDescriptor("image"); //$NON-NLS-1$
- }
- return fImageDescriptor;
- }
-
- /**
- * Returns the banner image for this launch group, or <code>null</code> if
- * none
- *
- * @return the banner image for this launch group, or <code>null</code> if
- * none
- */
- public ImageDescriptor getBannerImageDescriptor() {
- if (fBannerImageDescriptor == null) {
- fBannerImageDescriptor = createImageDescriptor("bannerImage"); //$NON-NLS-1$
- }
- return fBannerImageDescriptor;
- }
-
- /**
- * Returns the label for this launch group
- *
- * @return the label for this launch group
- */
- public String getLabel() {
- return getConfigurationElement().getAttribute("label"); //$NON-NLS-1$
- }
-
- /**
- * Returns the id for this launch group
- *
- * @return the id for this launch group
- */
- public String getIdentifier() {
- return getConfigurationElement().getAttribute("id"); //$NON-NLS-1$
- }
-
- /**
- * Returns the category for this launch group, possibly <code>null</code>
- *
- * @return the category for this launch group, possibly <code>null</code>
- */
- public String getCategory() {
- return getConfigurationElement().getAttribute("category"); //$NON-NLS-1$
- }
-
- /**
- * Returns the mode for this launch group
- *
- * @return the mode for this launch group
- */
- public String getMode() {
- return getConfigurationElement().getAttribute("mode"); //$NON-NLS-1$
- }
-
- /**
- * Creates an image descriptor based on the given attribute name
- *
- * @param attribute
- * @return ImageDescriptor
- */
- protected ImageDescriptor createImageDescriptor(String attribute) {
- return DebugUIPlugin.getImageDescriptor(getConfigurationElement(), attribute);
- }
-
- /**
- * Returns whether this launch group is public
- *
- * @return boolean
- */
- public boolean isPublic() {
- String string = getConfigurationElement().getAttribute("public"); //$NON-NLS-1$
- if (string == null) {
- return true;
- }
- return string.equals("true"); //$NON-NLS-1$
- }
-
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupFilter.java
deleted file mode 100644
index 6fcb9a11a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupFilter.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.ui.activities.WorkbenchActivityHelper;
-
-/**
- * Displays launch configurations for a specific launch group
- */
-public class LaunchGroupFilter extends ViewerFilter {
-
- private ILaunchGroup fGroup;
-
- /**
- * Constructor
- * @param groupExtension
- */
- public LaunchGroupFilter(ILaunchGroup groupExtension) {
- super();
- fGroup = groupExtension;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- ILaunchConfigurationType type = null;
- ILaunchConfiguration config = null;
- if (parentElement instanceof ILaunchConfigurationType) {
- type = (ILaunchConfigurationType)parentElement;
- }
- if (element instanceof ILaunchConfigurationType) {
- type = (ILaunchConfigurationType)element;
- }
- if (element instanceof ILaunchConfiguration) {
- config = (ILaunchConfiguration)element;
- try {
- type = config.getType();
- }
- catch (CoreException e) {}
- }
- boolean priv = false;
- if (config != null) {
- try {
- priv = config.getAttribute(IDebugUIConstants.ATTR_PRIVATE, false);
- } catch (CoreException e) {
- }
- }
- if (type != null) {
- return !priv && type.supportsMode(fGroup.getMode()) && equalCategories(type.getCategory(), fGroup.getCategory()) && !WorkbenchActivityHelper.filterItem(new LaunchConfigurationTypeContribution(type));
- }
- return false;
- }
-
- /**
- * Returns whether the given categories are equal.
- *
- * @param c1 category identifier or <code>null</code>
- * @param c2 category identifier or <code>null</code>
- * @return boolean
- */
- private boolean equalCategories(String c1, String c2) {
- if (c1 == null || c2 == null) {
- return c1 == c2;
- }
- return c1.equals(c2);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchHistory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchHistory.java
deleted file mode 100644
index 4657cdc93..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchHistory.java
+++ /dev/null
@@ -1,489 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * rob li <antelope424@gmail.com> - Bug 203907
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationListener;
-import org.eclipse.debug.core.ILaunchListener;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.ui.activities.WorkbenchActivityHelper;
-
-/**
- * A history of launches and favorites for a launch group
- */
-public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListener {
-
- /**
- * Listing of the complete launch history, which includes favorites in the launched ordering
- */
- private Vector fCompleteHistory = new Vector();
-
- /**
- * The launch group this history is provided for
- */
- private ILaunchGroup fGroup;
-
- /**
- * Ordered listing of the favorites of this history
- */
- private Vector fFavorites = new Vector();
-
- /**
- * A new saved flag to prevent save participants from serializing unchanged launch histories.
- * @since 3.3.1
- */
- private boolean fSaved = true;
-
- /**
- * List of instances of this launch history
- */
- private static List fgLaunchHistoryInstances = new ArrayList();
-
- /**
- * Creates a new launch history for the given launch group
- */
- public LaunchHistory(ILaunchGroup group) {
- fGroup = group;
- ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
- manager.addLaunchListener(this);
- manager.addLaunchConfigurationListener(this);
- fgLaunchHistoryInstances.add(this);
- }
-
- /**
- * Disposes this history
- */
- public void dispose() {
- ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
- manager.removeLaunchListener(this);
- manager.removeLaunchConfigurationListener(this);
- fgLaunchHistoryInstances.remove(this);
- }
-
- /**
- * @see org.eclipse.debug.core.ILaunchListener#launchAdded(org.eclipse.debug.core.ILaunch)
- */
- public void launchAdded(ILaunch launch) {
- ILaunchConfiguration configuration = launch.getLaunchConfiguration();
- if (configuration != null && !configuration.isWorkingCopy() && DebugUIPlugin.doLaunchConfigurationFiltering(configuration) && accepts(configuration)) {
- addHistory(configuration, true);
- }
- }
-
- /**
- * Returns if the current history contains the specified <code>ILaunchConfiguration</code>
- * @param config the configuration to look for
- * @return true if the current history contains the specified configuration, false otherwise
- * @since 3.3
- */
- public synchronized boolean contains(ILaunchConfiguration configuration) {
- return fCompleteHistory.contains(configuration);
- }
-
- /**
- * Adds the given configuration to this history
- *
- * @param configuration
- * @param prepend whether the configuration should be added to the beginning of
- * the history list
- */
- protected void addHistory(ILaunchConfiguration configuration, boolean prepend) {
- synchronized (this) {
- if(configuration.isWorkingCopy()) {
- return;
- }
- checkFavorites(configuration);
- int index = fCompleteHistory.indexOf(configuration);
- if(index == 0) {
- return;
- }
- if(index < 0) {
- if(prepend) {
- fCompleteHistory.add(0, configuration);
- }
- else {
- fCompleteHistory.add(configuration);
- }
- }
- else {
- fCompleteHistory.add(0, fCompleteHistory.remove(index));
- }
- resizeHistory();
- }
- fireLaunchHistoryChanged();
- }
-
- /**
- * Notifies all <code>ILaunchHistoryChangedListener</code>s that the launch history has been modified
- *
- * @since 3.3
- */
- private void fireLaunchHistoryChanged() {
- DebugUIPlugin.getDefault().getLaunchConfigurationManager().fireLaunchHistoryChanged();
- setSaved(false);
- }
-
- /**
- * Returns if the launch history requires saving or not
- * @return true if the history needs to be saved, false otherwise
- * @since 3.3.1
- */
- public boolean needsSaving() {
- return !fSaved;
- }
-
- /**
- * Allows the dirty flag for this launch history to be set.
- * It is the clients of this class that must set the saved flag to true
- * if they have persisted the launch history
- * @param saved
- * @since 3.3.1
- */
- public void setSaved(boolean saved) {
- fSaved = saved;
- }
-
- /**
- * @see org.eclipse.debug.core.ILaunchListener#launchChanged(org.eclipse.debug.core.ILaunch)
- */
- public void launchChanged(ILaunch launch) {}
-
- /**
- * @see org.eclipse.debug.core.ILaunchListener#launchRemoved(org.eclipse.debug.core.ILaunch)
- */
- public void launchRemoved(ILaunch launch) {}
-
- /**
- * Returns the most recently launched configuration in this history, or
- * <code>null</code> if none.
- *
- * @return the most recently launched configuration in this history, or
- * <code>null</code> if none
- */
- public synchronized ILaunchConfiguration getRecentLaunch() {
- ILaunchConfiguration[] history = getCompleteLaunchHistory();
- if(history.length > 0) {
- return history[0];
- }
- return null;
- }
-
- /**
- * Returns the launch configurations in this history, in most recently
- * launched order, not including any entries from the favorites listing.
- *
- * @return launch history
- */
- public synchronized ILaunchConfiguration[] getHistory() {
- Vector history = new Vector();
- try {
- ILaunchConfiguration config = null;
- for(Iterator iter = fCompleteHistory.iterator(); iter.hasNext();) {
- config = (ILaunchConfiguration) iter.next();
- if(config.exists() && !fFavorites.contains(config) &&
- DebugUIPlugin.doLaunchConfigurationFiltering(config) &&
- !WorkbenchActivityHelper.filterItem(new LaunchConfigurationTypeContribution(config.getType()))) {
- history.add(config);
- }
- }
- //size it to the max specified history size
- if(history.size() > getMaxHistorySize()) {
- history.setSize(getMaxHistorySize());
- }
- }
- catch(CoreException ce) {DebugUIPlugin.log(ce);}
- return (ILaunchConfiguration[]) history.toArray(new ILaunchConfiguration[history.size()]);
- }
-
- /**
- * Returns the complete launch history in the order they were last launched, this listing includes all
- * entries including those from the favorites listing, but not those that have been filtered via
- * launch configuration filtering or capabilities filtering
- * @return the list of last launched <code>ILaunchConfiguration</code>s
- *
- * @since 3.3
- */
- public synchronized ILaunchConfiguration[] getCompleteLaunchHistory() {
- Vector history = new Vector();
- try {
- ILaunchConfiguration config = null;
- for(Iterator iter = fCompleteHistory.listIterator(); iter.hasNext();){
- config = (ILaunchConfiguration) iter.next();
- if(config.exists() && DebugUIPlugin.doLaunchConfigurationFiltering(config) &&
- !WorkbenchActivityHelper.filterItem(new LaunchConfigurationTypeContribution(config.getType()))) {
- history.add(config);
- }
- }
- }
- catch (CoreException ce) {DebugUIPlugin.log(ce);}
- return (ILaunchConfiguration[]) history.toArray(new ILaunchConfiguration[history.size()]);
- }
-
- /**
- * Returns the favorite launch configurations in this history, in the order
- * they were created.
- *
- * @return launch favorites
- */
- public synchronized ILaunchConfiguration[] getFavorites() {
- return (ILaunchConfiguration[])fFavorites.toArray(new ILaunchConfiguration[fFavorites.size()]);
- }
-
- /**
- * Sets this container's favorites.
- *
- * @param favorites
- */
- public synchronized void setFavorites(ILaunchConfiguration[] favorites) {
- fFavorites = new Vector(Arrays.asList(favorites));
- setSaved(false);
- fireLaunchHistoryChanged();
- }
-
- /**
- * Adds the given configuration to the favorites list.
- *
- * @param configuration
- */
- public synchronized void addFavorite(ILaunchConfiguration configuration) {
- if (!fFavorites.contains(configuration)) {
- fFavorites.add(configuration);
- setSaved(false);
- fireLaunchHistoryChanged();
- }
- }
-
- /**
- * Returns the launch group associated with this history
- *
- * @return group
- */
- public ILaunchGroup getLaunchGroup() {
- return fGroup;
- }
-
- /**
- * Returns whether the given configuration is included in the group
- * associated with this launch history.
- *
- * @param launch
- * @return boolean
- */
- public boolean accepts(ILaunchConfiguration configuration) {
- try {
- if (!LaunchConfigurationManager.isVisible(configuration)) {
- return false;
- }
- if (configuration.getType().supportsMode(getLaunchGroup().getMode())) {
- String launchCategory = null;
- launchCategory = configuration.getCategory();
- String category = getLaunchGroup().getCategory();
- if (launchCategory == null || category == null) {
- return launchCategory == category;
- }
- return category.equals(launchCategory);
- }
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- return false;
- }
-
- /**
- * Notifies all launch histories that the launch history size has changed.
- */
- public static void launchHistoryChanged() {
- for(Iterator iter = fgLaunchHistoryInstances.iterator(); iter.hasNext();) {
- ((LaunchHistory) iter.next()).resizeHistory();
- }
- }
-
- /**
- * The max history size has changed - remove any histories if current
- * collection is too long.
- */
- protected synchronized void resizeHistory() {
- int max = getMaxHistorySize() + fFavorites.size();
- if (fCompleteHistory.size() > max) {
- fCompleteHistory.setSize(max);
- }
- }
-
- /**
- * Returns the maximum number of entries allowed in this history
- *
- * @return the maximum number of entries allowed in this history
- */
- protected int getMaxHistorySize() {
- return DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugUIConstants.PREF_MAX_HISTORY_SIZE);
- }
-
- /**
- * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void launchConfigurationAdded(ILaunchConfiguration configuration) {
- checkFavorites(configuration);
- }
-
- /**
- * This method checks if the specified <code>ILaunchConfiguration</code> is a favorite of the launch group
- * with the specified id
- * @param configuration
- * @param launchgroup
- * @return true if the configuration is a favorite of the launch group with the given id, false otherwise
- * @throws CoreException
- *
- * @since 3.4
- */
- protected boolean isFavorite(ILaunchConfiguration configuration, String launchgroup) throws CoreException {
- List favoriteGroups = configuration.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List)null);
- if (favoriteGroups == null) {
- // check deprecated attributes for backwards compatibility
- if (launchgroup.equals(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP)) {
- return configuration.getAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, false);
- } else if (launchgroup.equals(IDebugUIConstants.ID_RUN_LAUNCH_GROUP)) {
- return configuration.getAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, false);
- }
- }
- else if (favoriteGroups.contains(getLaunchGroup().getIdentifier())) {
- return true;
- }
- return false;
- }
-
- /**
- * Adds the given config to the favorites list if it is a favorite, and
- * returns whether the config was added to the favorites list.
- *
- * @param configuration
- * @return whether added to the favorites list
- */
- protected boolean checkFavorites(ILaunchConfiguration configuration) {
- // update favorites
- if (configuration.isWorkingCopy()) {
- return false;
- }
- try {
- List favoriteGroups = configuration.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List)null);
- if (favoriteGroups == null) {
- // check deprecated attributes for backwards compatibility
- String groupId = getLaunchGroup().getIdentifier();
- boolean fav = false;
- if (groupId.equals(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP)) {
- fav = configuration.getAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, false);
- } else if (groupId.equals(IDebugUIConstants.ID_RUN_LAUNCH_GROUP)) {
- fav = configuration.getAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, false);
- }
- if (fav) {
- addFavorite(configuration);
- return true;
- }
- removeFavorite(configuration);
- return false;
- }
- else if (favoriteGroups.contains(getLaunchGroup().getIdentifier())) {
- addFavorite(configuration);
- return true;
- }
- else {
- removeFavorite(configuration);
- return false;
- }
- }
- catch (CoreException e) {
- //in the event touching the config throws an error, remove it
- removeFavorite(configuration);
- }
- return false;
- }
-
- /**
- * Removes the given config from the favorites list, if needed.
- *
- * @param configuration
- */
- protected synchronized void removeFavorite(ILaunchConfiguration configuration) {
- fFavorites.remove(configuration);
- setSaved(false);
- fireLaunchHistoryChanged();
- }
-
- /**
- * This method removes the specified <code>ILaunchConfiguration</code> from this launch history (if present)
- * If the launch configuration does not exist in the history nothing is changed. If the configuration does exist
- * in the history and was removed all history listeners are notified.
- * @param configuration the configuration to remove
- *
- * @since 3.4
- */
- public synchronized void removeFromHistory(ILaunchConfiguration configuration) {
- try {
- boolean removed = fCompleteHistory.remove(configuration);
- if(isFavorite(configuration, getLaunchGroup().getIdentifier())) {
- removed |= fFavorites.remove(configuration);
- }
- if(removed) {
- setSaved(false);
- fireLaunchHistoryChanged();
- }
- }
- catch(CoreException ce) {}
- }
-
- /**
- * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void launchConfigurationChanged(ILaunchConfiguration configuration) {
- checkFavorites(configuration);
- }
-
- /**
- * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
- synchronized (this) {
- ILaunchConfiguration newConfig = DebugPlugin.getDefault().getLaunchManager().getMovedTo(configuration);
- if (newConfig == null) {
- //deleted
- fCompleteHistory.remove(configuration);
- fFavorites.remove(configuration);
- } else {
- // moved/renamed
- int index = fCompleteHistory.indexOf(configuration);
- if (index >= 0) {
- fCompleteHistory.remove(index);
- fCompleteHistory.add(index, newConfig);
- }
- index = fFavorites.indexOf(configuration);
- if (index >= 0) {
- fFavorites.remove(index);
- fFavorites.add(index, newConfig);
- }
- checkFavorites(newConfig);
- }
- }
- fireLaunchHistoryChanged();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java
deleted file mode 100644
index 2d3065476..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java
+++ /dev/null
@@ -1,544 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.core.expressions.EvaluationResult;
-import org.eclipse.core.expressions.Expression;
-import org.eclipse.core.expressions.ExpressionConverter;
-import org.eclipse.core.expressions.ExpressionTagNames;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.internal.core.IConfigurationElementConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.Pair;
-import org.eclipse.debug.internal.ui.actions.LaunchShortcutAction;
-import org.eclipse.debug.ui.ILaunchShortcut;
-import org.eclipse.debug.ui.ILaunchShortcut2;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IPluginContribution;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.handlers.IHandlerService;
-
-/**
- * Proxy to a launch shortcut extension
- */
-public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContribution {
-
- private ImageDescriptor fImageDescriptor = null;
- private List fPerspectives = null;
- private ILaunchShortcut fDelegate = null;
- private Set fModes = null;
- private Set fAssociatedTypes = null;
- private Map fDescriptions = null;
- private IConfigurationElement fContextualLaunchConfigurationElement = null;
- private Expression fContextualLaunchExpr = null;
- private Expression fStandardLaunchExpr = null;
-
- /**
- * Command handler for launch shortcut key binding.
- */
- private class LaunchCommandHandler extends AbstractHandler {
- // the shortcut to invoke
- private LaunchShortcutExtension fShortcut;
- private String fMode;
-
- /**
- * Constructs a new command handler for the given shortcut
- *
- * @param shortcut
- */
- public LaunchCommandHandler(LaunchShortcutExtension shortcut, String mode) {
- fShortcut = shortcut;
- fMode = mode;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- LaunchShortcutAction action = new LaunchShortcutAction(fMode, fShortcut);
- if (action.isEnabled()) {
- action.run();
- } else {
- fShortcut.launch(new StructuredSelection(), fMode);
- }
- return null;
- }
- }
-
- /**
- * The configuration element defining this tab.
- */
- private IConfigurationElement fConfig;
- private /* <Pair> */ List fContextLabels;
-
- /**
- * Constructs a launch configuration tab extension based
- * on the given configuration element
- *
- * @param element the configuration element defining the
- * attributes of this launch configuration tab extension
- * @return a new launch configuration tab extension
- */
- public LaunchShortcutExtension(IConfigurationElement element) {
- setConfigurationElement(element);
- registerLaunchCommandHandlers();
- }
-
- /**
- * Registers command handlers for launch shortcut key bindings
- */
- private void registerLaunchCommandHandlers() {
- Iterator modes = getModes().iterator();
- IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getAdapter(IHandlerService.class);
- if(handlerService != null) {
- while (modes.hasNext()) {
- String mode = (String) modes.next();
- String id = getId() + "." + mode; //$NON-NLS-1$
- IHandler handler = new LaunchCommandHandler(this, mode);
- handlerService.activateHandler(id, handler);
- }
- }
- }
-
- /**
- * Sets the configuration element that defines the attributes
- * for this extension.
- *
- * @param element configuration element
- */
- private void setConfigurationElement(IConfigurationElement element) {
- fConfig = element;
- }
-
- /**
- * Returns the configuration element that defines the attributes
- * for this extension.
- *
- * @param configuration element that defines the attributes
- * for this launch configuration tab extension
- */
- public IConfigurationElement getConfigurationElement() {
- return fConfig;
- }
-
- /**
- * Returns the label of this shortcut
- *
- * @return the label of this shortcut, or <code>null</code> if not
- * specified
- */
- public String getLabel() {
- return getConfigurationElement().getAttribute(IConfigurationElementConstants.LABEL);
- }
-
- /**
- * Returns the configuration element for the optional Contextual Launch
- * element of this Launch Configuration description.
- * @return contextualLaunch element
- */
- public IConfigurationElement getContextualLaunchConfigurationElement() {
- if (fContextualLaunchConfigurationElement == null) {
- IConfigurationElement[] elements = getConfigurationElement().getChildren(IConfigurationElementConstants.CONTEXTUAL_LAUNCH);
- if (elements.length > 0) {
- // remember so we don't have to hunt again
- fContextualLaunchConfigurationElement = elements[0];
- }
- }
- return fContextualLaunchConfigurationElement;
- }
- /**
- * Returns the contextual launch label of this shortcut for the named mode.
- * <p>
- * <samp>
- * <launchShortcut...>
- * <contextualLaunch>
- * <contextLabel mode="run" label="Run Java Application"/>
- * <contextLabel mode="debug" label="Debug Java Application"/>
- * ...
- * </contextualLaunch>
- * </launchShortcut>
- * </samp>
- *
- * @return the contextual label of this shortcut, or <code>null</code> if not
- * specified
- */
- public String getContextLabel(String mode) {
- // remember the list of context labels for this shortcut
- if (fContextLabels == null) {
- IConfigurationElement context = getContextualLaunchConfigurationElement();
- if (context == null) {
- return null;
- }
- IConfigurationElement[] labels = context.getChildren(IConfigurationElementConstants.CONTEXT_LABEL);
- fContextLabels = new ArrayList(labels.length);
- for (int i = 0; i < labels.length; i++) {
- fContextLabels.add(new Pair(labels[i].getAttribute(IConfigurationElementConstants.MODE),
- labels[i].getAttribute(IConfigurationElementConstants.LABEL)));
- }
- }
- // pick out the first occurance of the "name" bound to "mode"
- Iterator iter = fContextLabels.iterator();
- while (iter.hasNext()) {
- Pair p = (Pair) iter.next();
- if (p.firstAsString().equals(mode)) {
- return p.secondAsString();
- }
- }
- return getLabel();
- }
-
- /**
- * Returns the set of associated launch configuration type ids.
- *
- * @return the set of associated launch configuration type ids
- * @since 3.3
- */
- public Set getAssociatedConfigurationTypes() {
- if(fAssociatedTypes == null) {
- fAssociatedTypes = new HashSet();
- IConfigurationElement[] children = fConfig.getChildren(IConfigurationElementConstants.CONFIGURATION_TYPES);
- String id = null;
- for (int i = 0; i < children.length; i++) {
- id = children[i].getAttribute(IConfigurationElementConstants.ID);
- if(id != null) {
- fAssociatedTypes.add(id);
- }
- }
- }
- return fAssociatedTypes;
- }
-
- /**
- * Returns the contributed description of the launch delegate or <code>null</code>
- * if one has not been provided
- * @param mode the mode to get the description for
- * @return the description of the shortcut for that specific mode or <code>null</code> if one was not provided
- *
- * @since 3.3
- */
- public String getShortcutDescription(String mode) {
- if(mode == null) {
- return null;
- }
- if(fDescriptions == null) {
- fDescriptions = new HashMap();
- //get the description for the main element first
- String descr = fConfig.getAttribute(IConfigurationElementConstants.DESCRIPTION);
- String lmode = null;
- Set modes = getModes();
- if(descr != null) {
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- lmode = (String) iter.next();
- fDescriptions.put(lmode, descr);
- }
- }
- //load descriptions for child description elements
- IConfigurationElement[] children = fConfig.getChildren(IConfigurationElementConstants.DESCRIPTION);
- for(int i = 0; i < children.length; i++) {
- lmode = children[i].getAttribute(IConfigurationElementConstants.MODE);
- descr = children[i].getAttribute(IConfigurationElementConstants.DESCRIPTION);
- fDescriptions.put(lmode, descr);
- }
- }
- return (String) fDescriptions.get(mode);
- }
-
- /**
- * Evaluate the given expression within the given context and return
- * the result. Returns <code>true</code> iff result is either TRUE or NOT_LOADED.
- * This allows optimistic inclusion of shortcuts before plugins are loaded.
- * Returns <code>false</code> if exp is <code>null</code>.
- *
- * @param exp the enablement expression to evaluate or <code>null</code>
- * @param context the context of the evaluation. Usually, the
- * user's selection.
- * @return the result of evaluating the expression
- * @throws CoreException
- */
- public boolean evalEnablementExpression(IEvaluationContext context, Expression exp) throws CoreException {
- return (exp != null) ? ((exp.evaluate(context)) != EvaluationResult.FALSE) : false;
- }
-
- /**
- * Returns an expression that represents the enablement logic for the
- * contextual launch element of this launch shortcut description or
- * <code>null</code> if none.
- * @return an evaluatable expression or <code>null</code>
- * @throws CoreException if the configuration element can't be
- * converted. Reasons include: (a) no handler is available to
- * cope with a certain configuration element or (b) the XML
- * expression tree is malformed.
- */
- public Expression getContextualLaunchEnablementExpression() throws CoreException {
- // all of this stuff is optional, so...tedious testing is required
- if (fContextualLaunchExpr == null) {
- IConfigurationElement contextualLaunchElement = getContextualLaunchConfigurationElement();
- if (contextualLaunchElement == null) {
- // not available
- return null;
- }
- IConfigurationElement[] elements = contextualLaunchElement.getChildren(ExpressionTagNames.ENABLEMENT);
- IConfigurationElement enablement = elements.length > 0 ? elements[0] : null;
-
- if (enablement != null) {
- fContextualLaunchExpr= ExpressionConverter.getDefault().perform(enablement);
- }
- }
- return fContextualLaunchExpr;
- }
-
- /**
- * Returns an expression that represents the enablement logic for the
- * launch shortcut description or <code>null</code> if none.
- * @return an evaluatable expression or <code>null</code>
- * @throws CoreException if the configuration element can't be
- * converted. Reasons include: (a) no handler is available to
- * cope with a certain configuration element or (b) the XML
- * expression tree is malformed.
- */
- public Expression getShortcutEnablementExpression() throws CoreException {
- // all of this stuff is optional, so...tedious testing is required
- if (fStandardLaunchExpr == null) {
- IConfigurationElement[] elements = getConfigurationElement().getChildren(ExpressionTagNames.ENABLEMENT);
- IConfigurationElement enablement = elements.length > 0 ? elements[0] : null;
- if (enablement != null) {
- fStandardLaunchExpr= ExpressionConverter.getDefault().perform(enablement);
- }
- }
- return fStandardLaunchExpr;
- }
-
- /**
- * Returns the id of this shortcut
- *
- * @return the id of this shortcut, or <code>null</code> if not specified
- */
- public String getId() {
- return getConfigurationElement().getAttribute(IConfigurationElementConstants.ID);
- }
-
- /**
- * Returns the identifier of the help context associated with this launch
- * shortcut, or <code>null</code> if one was not specified.
- *
- * @return the identifier of this launch shortcut's help context or
- * <code>null</code>
- * @since 2.1
- */
- public String getHelpContextId() {
- return getConfigurationElement().getAttribute(IConfigurationElementConstants.HELP_CONTEXT_ID);
- }
-
- /**
- * Returns the category of this shortcut
- *
- * @return the category of this shortcut, or <code>null</code> if not
- * specified
- */
- public String getCategory() {
- return getConfigurationElement().getAttribute(IConfigurationElementConstants.CATEGORY);
- }
-
- /**
- * Returns the image for this shortcut, or <code>null</code> if none
- *
- * @return the image for this shortcut, or <code>null</code> if none
- */
- public ImageDescriptor getImageDescriptor() {
- if (fImageDescriptor == null) {
- fImageDescriptor = DebugUIPlugin.getImageDescriptor(getConfigurationElement(), "icon"); //$NON-NLS-1$
- if (fImageDescriptor == null) {
- fImageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
- }
- return fImageDescriptor;
- }
-
- /**
- * Returns the perspectives this shortcut is registered for.
- *
- * @return list of Strings representing perspective identifiers
- * @deprecated The use of the perspectives element has been deprecated since 3.1.
- */
- public List getPerspectives() {
- if (fPerspectives == null) {
- IConfigurationElement[] perspectives = getConfigurationElement().getChildren(IConfigurationElementConstants.PERSPECTIVE);
- fPerspectives = new ArrayList(perspectives.length);
- for (int i = 0; i < perspectives.length; i++) {
- fPerspectives.add(perspectives[i].getAttribute(IConfigurationElementConstants.ID));
- }
- }
- return fPerspectives;
- }
-
- /**
- * Returns this shortcut's delegate, or <code>null</code> if none
- *
- * @return this shortcut's delegate, or <code>null</code> if none
- */
- protected ILaunchShortcut getDelegate() {
- if (fDelegate == null) {
- try {
- fDelegate = (ILaunchShortcut)fConfig.createExecutableExtension(IConfigurationElementConstants.CLASS);
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- return fDelegate;
- }
-
- /**
- * @see ILaunchShortcut#launch(IEditorPart, String)
- */
- public void launch(IEditorPart editor, String mode) {
- ILaunchShortcut shortcut = getDelegate();
- if (shortcut != null) {
- shortcut.launch(editor, mode);
- }
- }
-
- /**
- * @see ILaunchShortcut#launch(ISelection, String)
- */
- public void launch(ISelection selection, String mode) {
- ILaunchShortcut shortcut = getDelegate();
- if (shortcut != null) {
- shortcut.launch(selection, mode);
- }
- }
-
- /**
- * Returns the set of modes this shortcut supports.
- *
- * @return the set of modes this shortcut supports
- */
- public Set getModes() {
- if (fModes == null) {
- String modes= getConfigurationElement().getAttribute(IConfigurationElementConstants.MODES);
- if (modes == null) {
- return new HashSet(0);
- }
- StringTokenizer tokenizer= new StringTokenizer(modes, ","); //$NON-NLS-1$
- fModes = new HashSet(tokenizer.countTokens());
- while (tokenizer.hasMoreTokens()) {
- fModes.add(tokenizer.nextToken().trim());
- }
- }
- return fModes;
- }
-
- /**
- * Returns the menu path attribute this shortcut, or <code>null</code> if none
- *
- * @return the menu path attribute this shortcut, or <code>null</code> if none
- * @since 3.0.1
- */
- public String getMenuPath() {
- return getConfigurationElement().getAttribute(IConfigurationElementConstants.PATH);
- }
-
- /*
- * Only for debugging
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return getId();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPluginContribution#getLocalId()
- */
- public String getLocalId() {
- return getId();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPluginContribution#getPluginId()
- */
- public String getPluginId() {
- return fConfig.getContributor().getName();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchConfigurations(org.eclipse.jface.viewers.ISelection)
- */
- public ILaunchConfiguration[] getLaunchConfigurations(ISelection selection) {
- ILaunchShortcut delegate = getDelegate();
- if(delegate instanceof ILaunchShortcut2) {
- return ((ILaunchShortcut2)delegate).getLaunchConfigurations(selection);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchConfigurations(org.eclipse.ui.IEditorPart)
- */
- public ILaunchConfiguration[] getLaunchConfigurations(IEditorPart editorpart) {
- ILaunchShortcut delegate = getDelegate();
- if(delegate instanceof ILaunchShortcut2) {
- return ((ILaunchShortcut2)delegate).getLaunchConfigurations(editorpart);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchableResource(org.eclipse.jface.viewers.ISelection)
- */
- public IResource getLaunchableResource(ISelection selection) {
- ILaunchShortcut delegate = getDelegate();
- if(delegate instanceof ILaunchShortcut2) {
- return ((ILaunchShortcut2)delegate).getLaunchableResource(selection);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchableResource(org.eclipse.ui.IEditorPart)
- */
- public IResource getLaunchableResource(IEditorPart editorpart) {
- ILaunchShortcut delegate = getDelegate();
- if(delegate instanceof ILaunchShortcut2) {
- return ((ILaunchShortcut2)delegate).getLaunchableResource(editorpart);
- }
- return null;
- }
-
- /**
- * Returns if the underlying delegate is a <code>ILaunchShortcut2</code>
- * @return if the underlying delegate is a <code>ILaunchShortcut2</code>
- *
- * @since 3.4
- */
- public boolean isParticipant() {
- return getDelegate() instanceof ILaunchShortcut2;
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutSelectionDialog.java
deleted file mode 100644
index 0a4b61e00..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutSelectionDialog.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchMode;
-import org.eclipse.debug.internal.ui.AbstractDebugListSelectionDialog;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Text;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Specialized dialog for showing/selecting a specific launch shortcut extension, and allowing it
- * to be marked to be set as the default
- *
- * @see {@link org.eclipse.debug.internal.ui.actions.ContextLaunchingAction}
- *
- * @since 3.3
- * CONTEXTLAUNCHING
- */
-public class LaunchShortcutSelectionDialog extends AbstractDebugListSelectionDialog {
-
- private static final String DIALOG_SETTINGS = IDebugUIConstants.PLUGIN_ID + ".SELECT_LAUNCH_SHORTCUT_DIALOG"; //$NON-NLS-1$;
-
- /**
- * The list of input for the dialog
- */
- private String fModeName = null;
- private String fMode = null;
- private IResource fResource = null;
- private List fShortcuts = null;
- private Text fDescriptionText = null;
-
- /**
- * Constructor
- * @param input
- * @param resource
- * @param mode
- */
- public LaunchShortcutSelectionDialog(List shortcuts, IResource resource, String mode) {
- super(DebugUIPlugin.getShell());
- setShellStyle(getShellStyle() | SWT.RESIZE);
- fShortcuts = shortcuts;
- fResource = resource;
- fMode = mode;
- ILaunchMode lmode = DebugPlugin.getDefault().getLaunchManager().getLaunchMode(mode);
- fModeName = mode;
- if (lmode != null) {
- fModeName = DebugUIPlugin.removeAccelerators(lmode.getLabel());
- }
- setTitle(MessageFormat.format(LaunchConfigurationsMessages.LaunchShortcutSelectionDialog_0, new String[] {fModeName}));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.SELECT_LAUNCH_METHOD_DIALOG;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
- */
- protected String getDialogSettingsId() {
- return DIALOG_SETTINGS;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugListSelectionDialog#addViewerListeners(org.eclipse.jface.viewers.StructuredViewer)
- */
- protected void addViewerListeners(StructuredViewer viewer) {
- super.addViewerListeners(viewer);
- viewer.addSelectionChangedListener(new ISelectionChangedListener(){
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
- if (!selection.isEmpty()) {
- LaunchShortcutExtension shortcutSource = (LaunchShortcutExtension) ((IStructuredSelection)selection).getFirstElement();
- String description = shortcutSource.getShortcutDescription(fMode);
- fDescriptionText.setText((description == null ? LaunchConfigurationsMessages.LaunchShortcutSelectionDialog_3 : description));
- }
- }
- });
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#addCustomFooterControls(org.eclipse.swt.widgets.Composite)
- */
- protected void addCustomFooterControls(Composite parent) {
- super.addCustomFooterControls(parent);
- Group group = SWTFactory.createGroup(parent, LaunchConfigurationsMessages.LaunchShortcutSelectionDialog_2, 1, 1, GridData.FILL_BOTH);
- GridData gd = (GridData) group.getLayoutData();
- gd.heightHint = 100;
- fDescriptionText = SWTFactory.createText(group, SWT.WRAP | SWT.READ_ONLY, 1, GridData.FILL_HORIZONTAL);
- fDescriptionText.setBackground(group.getBackground());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
- */
- protected Object getViewerInput() {
- return fShortcuts;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
- */
- protected String getViewerLabel() {
- if(fResource == null) {
- return MessageFormat.format(LaunchConfigurationsMessages.LaunchShortcutSelectionDialog_4, new String[] {fModeName.toLowerCase()});
- }
- else {
- return MessageFormat.format(LaunchConfigurationsMessages.LaunchShortcutSelectionDialog_1, new String[] {fModeName.toLowerCase(), fResource.getName()});
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugListSelectionDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
- */
- protected void createButtonsForButtonBar(Composite parent) {
- super.createButtonsForButtonBar(parent);
- getButton(IDialogConstants.OK_ID).setEnabled(!getViewer().getSelection().isEmpty());
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchTabContribution.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchTabContribution.java
deleted file mode 100644
index b6bfec2b0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchTabContribution.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import org.eclipse.debug.internal.ui.LaunchConfigurationTabExtension;
-import org.eclipse.ui.IPluginContribution;
-
-/**
- * This class provides a wrapper for a launch tab contribution so that it can be filtered from the UI
- * via the use of capabilities
- *
- * @since 3.3
- */
-public class LaunchTabContribution implements IPluginContribution {
-
- LaunchConfigurationTabExtension fTab = null;
-
- public LaunchTabContribution(LaunchConfigurationTabExtension tab) {
- fTab = tab;
- }
-
- /**
- * @see org.eclipse.ui.IPluginContribution#getLocalId()
- */
- public String getLocalId() {
- return fTab.getIdentifier();
- }
-
- /**
- * @see org.eclipse.ui.IPluginContribution#getPluginId()
- */
- public String getPluginId() {
- return fTab.getPluginIdentifier();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/OrganizeFavoritesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/OrganizeFavoritesAction.java
deleted file mode 100644
index 5991d5ea7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/OrganizeFavoritesAction.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.action.Action;
-
-/**
- * OrganizeFavoritesAction
- */
-public class OrganizeFavoritesAction extends Action {
-
- // launch group identifier
- private String fGroupId;
-
- /**
- * @param text
- */
- public OrganizeFavoritesAction(String launchGroupId) {
- super(LaunchConfigurationsMessages.OrganizeFavoritesAction_0);
- fGroupId = launchGroupId;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- LaunchHistory history = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchHistory(fGroupId);
- FavoritesDialog dialog = new FavoritesDialog(DebugUIPlugin.getShell(), history);
- dialog.open();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
deleted file mode 100644
index ded997be9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
+++ /dev/null
@@ -1,1094 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.core.commands.contexts.Context;
-import org.eclipse.core.resources.ISaveContext;
-import org.eclipse.core.resources.ISaveParticipant;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.jobs.Job;
-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.ILaunchDelegate;
-import org.eclipse.debug.core.ILaunchListener;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.core.IConfigurationElementConstants;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.core.LaunchManager;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.views.ViewContextManager;
-import org.eclipse.debug.internal.ui.views.ViewContextService;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.contexts.ISuspendTrigger;
-import org.eclipse.debug.ui.contexts.ISuspendTriggerListener;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.WorkbenchException;
-import org.eclipse.ui.contexts.IContextActivation;
-import org.eclipse.ui.contexts.IContextService;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * The perspective manager manages the 'perspective' settings
- * defined by launch configurations. Specifically it:
- * <ul>
- * <li>changes perspectives as launches are registered</li>
- * <li>change perspective when a thread suspends</li>
- * </ul>
- *
- * Since 3.3 the Perspectives Manager is an <code>ISaveParticipant</code>, allowing it to participate in
- * workspace persistence life-cycles.
- *
- * @see IDebugUIContants.ATTR_RUN_PERSPECTIVE
- * @see IDebugUIContants.ATTR_DEBUG_PERSPECTIVE
- * @see ISaveParticipant
- * @see ISuspendTriggerListener
- * @see ILaunchListener
- * @see org.eclipse.debug.internal.ui.preferences.LaunchPerspectivePreferencePage
- * @see DebugUIPlugin
- */
-public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListener, ISaveParticipant {
-
- /**
- * Lock used to synchronize perspective switching with view activation.
- * Clients wanting to perform an action after a perspective switch should
- * schedule jobs with the perspective manager via #schedulePostSwitch(..)
- */
- public class PerspectiveSwitchLock {
-
- private int fSwitch = 0;
- private List fJobs = new ArrayList();
-
- public synchronized void startSwitch() {
- fSwitch++;
- }
-
- public synchronized void endSwitch() {
- fSwitch--;
- if (fSwitch == 0) {
- Iterator jobs = fJobs.iterator();
- while (jobs.hasNext()) {
- ((Job)jobs.next()).schedule();
- }
- fJobs.clear();
- }
- }
-
- public synchronized void schedulePostSwitch(Job job) {
- if (fSwitch > 0) {
- fJobs.add(job);
- }
- else {
- job.schedule();
- }
- }
- }
-
- /**
- * Describes exactly one perspective context, which is composed of an <code>ILaunchCOnfigurationType</code>, and set of modes
- * and an <code>ILaunchDelegate</code>. Perspective ids are then cached for a context based on mode set.
- *
- * @since 3.3
- */
- class PerspectiveContext {
-
- private ILaunchConfigurationType fType = null;
- private ILaunchDelegate fDelegate = null;
- private Map fPerspectives = null;
-
- /**
- * Constructor
- * @param type
- * @param delegate
- * @param modes
- */
- public PerspectiveContext(ILaunchConfigurationType type, ILaunchDelegate delegate, Set modes) {
- fType = type;
- fDelegate = delegate;
- fPerspectives = new HashMap();
- fPerspectives.put(modes, null);
- }
-
- /**
- * We can specially compare two cases:
- * <ol>
- * <li>a launch object</li>
- * <li>an object array of the form [IlaunchConfigurationType, ILaunchDelegate, Set]</li>
- * </ol>
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object object) {
- ILaunchDelegate delegate = null;
- ILaunchConfigurationType type = null;
- if(object instanceof ILaunch) {
- try {
- ILaunch launch = (ILaunch) object;
- type = launch.getLaunchConfiguration().getType();
- delegate = resolveLaunchDelegate(launch);
- }
- catch (CoreException e) {return false;}
- }
- else if(object instanceof PerspectiveContext) {
- PerspectiveContext context = (PerspectiveContext) object;
- type = context.getLaunchConfigurationType();
- delegate = context.getLaunchDelegate();
- }
- if(fType != null && type != null && fType.getIdentifier().equals(type.getIdentifier())) {
- if(fDelegate == null) {
- return delegate == null;
- }
- else {
- return fDelegate.equals(delegate);
- }
- }
- return super.equals(object);
- }
-
- public ILaunchConfigurationType getLaunchConfigurationType() {return fType;}
- public ILaunchDelegate getLaunchDelegate() {return fDelegate;}
- public Map getPersepctiveMap() {return fPerspectives;}
-
- /**
- * Creates a new mapping of the specified perspective id to the specified mode set.
- * If a mapping for the modeset already exists it is over-written.
- * @param modes the set of modes
- * @param pid the id of the perspective
- */
- public void setPerspective(Set modes, String pid) {
- if(fPerspectives == null) {
- fPerspectives = new HashMap();
- }
- fPerspectives.put(modes, pid);
- }
-
- /**
- * Returns the perspective id associated with the given mode set
- * @param modes the set of mode
- * @return the perspective id associated with the given mode set, or
- * <code>null</code>, if there isn't one
- */
- public String getPerspective(Set modes) {
- if(fPerspectives != null) {
- return (String) fPerspectives.get(modes);
- }
- return null;
- }
- }
-
- /**
- * A listing of <code>PerspectiveContext</code>s
- *
- * @since 3.3
- */
- private Set fPerspectiveContexts = null;
-
- /**
- * id for the 'delegate' attribute
- *
- * @since 3.3
- */
- public static final String ATTR_DELEGATE_ID = "delegate"; //$NON-NLS-1$
-
- /**
- * Flag used to indicate that the user is already being prompted to
- * switch perspectives. This flag allows us to not open multiple
- * prompts at the same time.
- */
- private boolean fPrompting;
-
- /**
- * Lock to sync other jobs on the perspective switch
- */
- private PerspectiveSwitchLock fPerspectiveSwitchLock = new PerspectiveSwitchLock();
-
- /**
- * Maps each launch to its perspective context activation. These
- * are disabled when a launch terminates.
- */
- private Map fLaunchToContextActivations = new HashMap();
-
- /**
- * Called by the debug ui plug-in on startup.
- * The perspective manager starts listening for
- * launches to be registered.
- */
- public void startup() {
- DebugUIPlugin.getDefault().addSaveParticipant(this);
- DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
- initPerspectives();
- }
-
- /**
- * Called by the debug ui plug-in on shutdown.
- * The perspective manager de-registers as a
- * launch listener.
- */
- public void shutdown() {
- DebugUIPlugin.getDefault().removeSaveParticipant(this);
- DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
- }
-
- /**
- * If there are no launches, remove the Suspend Trigger Listener
- *
- * @see ILaunchListener#launchRemoved(ILaunch)
- */
- public synchronized void launchRemoved(final ILaunch launch) {
- ISuspendTrigger trigger = (ISuspendTrigger) launch.getAdapter(ISuspendTrigger.class);
- if (trigger != null) {
- trigger.removeSuspendTriggerListener(this);
- }
- Runnable r= new Runnable() {
- public void run() {
- IContextActivation[] activations = (IContextActivation[]) fLaunchToContextActivations.remove(launch);
- if (activations != null) {
- for (int i = 0; i < activations.length; i++) {
- IContextActivation activation = activations[i];
- activation.getContextService().deactivateContext(activation);
- }
- }
- }
- };
- async(r);
- }
-
- /**
- * Do nothing.
- *
- * @see ILaunchListener#launchChanged(ILaunch)
- */
- public void launchChanged(ILaunch launch) {}
-
- /**
- * Switch to the perspective specified by the
- * launch configuration.
- *
- * @see ILaunchListener#launchAdded(ILaunch)
- */
- public synchronized void launchAdded(ILaunch launch) {
- ISuspendTrigger trigger = (ISuspendTrigger) launch.getAdapter(ISuspendTrigger.class);
- if (trigger != null) {
- trigger.addSuspendTriggerListener(this);
- }
- fPerspectiveSwitchLock.startSwitch();
- String perspectiveId = null;
- // check event filters
- try {
- perspectiveId = getPerspectiveId(launch);
- }
- catch (CoreException e) {
- String name = DebugUIPlugin.getModelPresentation().getText(launch);
- switchFailed(e, name);
- }
- // don't switch if a private config
- ILaunchConfiguration configuration = launch.getLaunchConfiguration();
- if (configuration != null) {
- if (!LaunchConfigurationManager.isVisible(configuration)) {
- perspectiveId = null;
- }
- }
- final String id = perspectiveId;
- // switch
- async(new Runnable() {
- public void run() {
- try {
- IWorkbenchWindow window = getWindowForPerspective(id);
- if (id != null && window != null && shouldSwitchPerspective(window, id, IInternalDebugUIConstants.PREF_SWITCH_TO_PERSPECTIVE)) {
- switchToPerspective(window, id);
- }
- }
- finally {
- fPerspectiveSwitchLock.endSwitch();
- }
- }
- });
- }
-
-
- /**
- * Switches to the specified perspective
- *
- * @param id perspective identifier
- */
- protected void switchToPerspective(IWorkbenchWindow window, String id) {
- try {
- // don't loose the focus dialog if there is one
- Shell dialog = getModalDialogOpen(window.getShell());
- window.getWorkbench().showPerspective(id, window);
- if (dialog != null) {
- dialog.setFocus();
- }
- } catch (WorkbenchException e) {
- DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(),
- LaunchConfigurationsMessages.PerspectiveManager_Error_1,
- MessageFormat.format(LaunchConfigurationsMessages.PerspectiveManager_Unable_to_switch_to_perspective___0__2, new String[]{id}),
- e);
- }
- }
-
- /**
- * Utility method to submit an asynchronous runnable to the UI
- */
- protected void async(Runnable r) {
- Display d = DebugUIPlugin.getStandardDisplay();
- if (d != null && !d.isDisposed()) {
- d.asyncExec(r);
- }
- }
-
- /**
- * Utility method to submit a synchronous runnable to the UI
- */
- protected void sync(Runnable r) {
- Display d = DebugUIPlugin.getStandardDisplay();
- if (d != null && !d.isDisposed()) {
- d.syncExec(r);
- }
- }
-
- /**
- * Reports failure to switch perspectives to the user
- *
- * @param status exception status describing failure
- * @param launchName the name of the launch that the
- * failure is associated with
- */
- protected void switchFailed(final Throwable t, final String launchName) {
- sync(new Runnable() {
- public void run() {
- DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), LaunchConfigurationsMessages.PerspectiveManager_Error_1,
- MessageFormat.format(LaunchConfigurationsMessages.PerspectiveManager_Unable_to_switch_perpsectives_as_specified_by_launch___0__4, new String[] {launchName}),
- t);
- }});
- }
-
- /**
- * A breakpoint has been hit. Carry out perspective switching
- * as appropriate for the given debug event.
- *
- * @param event the suspend event
- */
- private void handleBreakpointHit(final ILaunch launch) {
-
- // Must be called here to indicate that the perspective
- // may be switching.
- // Putting this in the async UI call will cause the Perspective
- // Manager to turn on the lock too late. Consequently, LaunchViewContextListener
- // may not know that the perspective will switch and will open view before
- // the perspective switch.
- fPerspectiveSwitchLock.startSwitch();
-
- String perspectiveId = null;
- try {
- perspectiveId = getPerspectiveId(launch);
- }
- catch (CoreException e) {DebugUIPlugin.log(e);}
- // if no perspective specified, always switch to debug
- // perspective
-
- // this has to be done in an async, such that the workbench
- // window can be accessed
- final String targetId = perspectiveId;
- Runnable r = new Runnable() {
- public void run() {
- IWorkbenchWindow window = null;
- try{
- if (targetId != null) {
- // get the window to open the perspective in
- window = getWindowForPerspective(targetId);
- if (window == null) {
- return;
- }
-
- // switch the perspective if user preference is set
- if (shouldSwitchPerspective(window, targetId, IInternalDebugUIConstants.PREF_SWITCH_PERSPECTIVE_ON_SUSPEND)) {
- switchToPerspective(window, targetId);
- window = getWindowForPerspective(targetId);
- if (window == null) {
- return;
- }
- }
-
- // make sure the shell is active
- Shell shell= window.getShell();
- if (shell != null) {
- if (DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugUIConstants.PREF_ACTIVATE_WORKBENCH)) {
- Shell dialog = getModalDialogOpen(shell);
- if (shell.getMinimized()) {
- shell.setMinimized(false);
- if (dialog != null) {
- dialog.setFocus();
- }
- }
- // If a model dialog is open on the shell, don't activate it
- if (dialog == null) {
- shell.forceActive();
- }
- }
- }
-
- // Activate a context for the launch
- Object ca = fLaunchToContextActivations.get(launch);
- if (ca == null) {
- ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration();
- if (launchConfiguration != null) {
- try {
- String type = launchConfiguration.getType().getIdentifier();
- ViewContextService service = ViewContextManager.getDefault().getService(window);
- if (service != null) {
- IContextService contextServce = (IContextService) PlatformUI.getWorkbench().getAdapter(IContextService.class);
- String[] ids = service.getEnabledPerspectives();
- IContextActivation[] activations = new IContextActivation[ids.length];
- for (int i = 0; i < ids.length; i++) {
- // Include the word '.internal.' so the context is filtered from the key binding pref page (Bug 144019) also see ViewContextService.contextActivated()
- Context context = contextServce.getContext(type + ".internal." + ids[i]); //$NON-NLS-1$
- if (!context.isDefined()) {
- context.define(context.getId(), null, null);
- }
- IContextActivation activation = contextServce.activateContext(context.getId());
- activations[i] = activation;
- }
- fLaunchToContextActivations.put(launch, activations);
- }
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- }
-
- }
- if (window != null && DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_ACTIVATE_DEBUG_VIEW)) {
- ViewContextService service = ViewContextManager.getDefault().getService(window);
- service.showViewQuiet(IDebugUIConstants.ID_DEBUG_VIEW);
- }
- }
- finally
- {
- fPerspectiveSwitchLock.endSwitch();
- }
- }
- };
- async(r);
- }
-
- /**
- * Returns a modal dialog currently open on the given shell or <code>null</code> if none.
- *
- * @param shell shell to check
- * @return a modal dialog currently open on the given shell or <code>null</code> if none
- */
- private Shell getModalDialogOpen(Shell shell) {
- Shell[] shells = shell.getShells();
- for (int i = 0; i < shells.length; i++) {
- Shell dialog = shells[i];
- if ((dialog.getStyle() & (SWT.APPLICATION_MODAL | SWT.PRIMARY_MODAL | SWT.SYSTEM_MODAL)) > 0) {
- return dialog;
- }
- }
- return null;
- }
-
- /**
- * Returns the workbench window in which the given perspective
- * should be shown. First, check the current window to see if it
- * is already showing the perspective. Then check any other windows.
- *
- * @param perspectiveId the perspective identifier
- * @return which window the given perspective should be shown in
- * or <code>null</code> if there are no windows available
- */
- private IWorkbenchWindow getWindowForPerspective(String perspectiveId) {
- IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
- if (isWindowShowingPerspective(window, perspectiveId)) {
- return window;
- }
- IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
- for (int i = 0; i < windows.length; i++) {
- window = windows[i];
- if (isWindowShowingPerspective(window, perspectiveId)) {
- return window;
- }
- }
- window = DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- return window;
- }
- if (windows.length > 0) {
- return windows[0];
- }
- return null;
- }
-
- /**
- * Returns if the specified window is showing the perspective denoted by the specified id
- * @param window the window to query
- * @param perspectiveId the perspective to ask about
- * @return true if the specified window is showing the perspective, false otherwise
- */
- private boolean isWindowShowingPerspective(IWorkbenchWindow window, String perspectiveId) {
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IPerspectiveDescriptor perspectiveDescriptor = page.getPerspective();
- if (perspectiveDescriptor != null && perspectiveDescriptor.getId().equals(perspectiveId)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Returns whether or not the user wishes to switch to the specified
- * perspective when a launch occurs.
- *
- * @param perspectiveName the name of the perspective that will be presented
- * to the user for confirmation if they've asked to be prompted about
- * perspective switching
- * @param message a message to be presented to the user. This message is expected to
- * contain a slot for the perspective name to be inserted ("{0}").
- * @param preferenceKey the preference key of the perspective switching preference
- * @return whether or not the user wishes to switch to the specified perspective
- * automatically
- */
- private boolean shouldSwitchPerspective(IWorkbenchWindow window, String perspectiveId, String preferenceKey) {
- if (isCurrentPerspective(window, perspectiveId)) {
- return false;
- }
- String perspectiveName = getPerspectiveLabel(perspectiveId);
- if (perspectiveName == null) {
- return false;
- }
- String perspectiveDesc = getPerspectiveDescription(perspectiveId);
- String[] args;
- if (perspectiveDesc != null) {
- args = new String[] { perspectiveName , perspectiveDesc };
- }
- else {
- args = new String[] { perspectiveName };
- }
- String switchPerspective = DebugUIPlugin.getDefault().getPreferenceStore().getString(preferenceKey);
- if (MessageDialogWithToggle.ALWAYS.equals(switchPerspective)) {
- return true;
- } else if (MessageDialogWithToggle.NEVER.equals(switchPerspective)) {
- return false;
- }
-
- Shell shell= window.getShell();
- if (shell == null || fPrompting) {
- return false;
- }
- fPrompting= true;
- // Activate the shell if necessary so the prompt is visible
- Shell modal = getModalDialogOpen(shell);
- if (shell.getMinimized()) {
- shell.setMinimized(false);
- if (modal != null) {
- modal.setFocus();
- }
- }
- if (DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugUIConstants.PREF_ACTIVATE_WORKBENCH)) {
- if (modal == null) {
- shell.forceActive();
- }
- }
- String message = IInternalDebugCoreConstants.EMPTY_STRING;
- if(IInternalDebugUIConstants.PREF_SWITCH_PERSPECTIVE_ON_SUSPEND.equals(preferenceKey)) {
- if (getPerspectiveDescription(perspectiveId) != null) {
- message = LaunchConfigurationsMessages.PerspectiveManager_suspend_description;
- }
- else {
- message = LaunchConfigurationsMessages.PerspectiveManager_13;
- }
- }
- else if(IInternalDebugUIConstants.PREF_SWITCH_TO_PERSPECTIVE.equals(preferenceKey)) {
- if (getPerspectiveDescription(perspectiveId) != null) {
- message = LaunchConfigurationsMessages.PerspectiveManager_launch_description;
- }
- else {
- message = LaunchConfigurationsMessages.PerspectiveManager_15;
- }
- }
- MessageDialogWithToggle dialog = MessageDialogWithToggle.openYesNoQuestion(shell, LaunchConfigurationsMessages.PerspectiveManager_12, MessageFormat.format(message, args), null, false, DebugUIPlugin.getDefault().getPreferenceStore(), preferenceKey);
- boolean answer = (dialog.getReturnCode() == IDialogConstants.YES_ID);
- synchronized (this) {
- fPrompting= false;
- notifyAll();
- }
- if (isCurrentPerspective(window, perspectiveId)) {
- answer = false;
- }
- return answer;
- }
-
- /**
- * Returns whether the given perspective identifier matches the
- * identifier of the current perspective.
- *
- * @param perspectiveId the identifier
- * @return whether the given perspective identifier matches the
- * identifier of the current perspective
- */
- protected boolean isCurrentPerspective(IWorkbenchWindow window, String perspectiveId) {
- boolean isCurrent= false;
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IPerspectiveDescriptor perspectiveDescriptor = page.getPerspective();
- if (perspectiveDescriptor != null) {
- isCurrent= perspectiveId.equals(perspectiveDescriptor.getId());
- }
- }
- }
- return isCurrent;
- }
-
- /**
- * Returns the label of the perspective with the given identifier or
- * <code>null</code> if no such perspective exists.
- *
- * @param perspectiveId the identifier
- * @return the label of the perspective with the given identifier or
- * <code>null</code> if no such perspective exists
- */
- protected String getPerspectiveLabel(String perspectiveId) {
- IPerspectiveDescriptor newPerspective = PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(perspectiveId);
- if (newPerspective == null) {
- return null;
- }
- return newPerspective.getLabel();
- }
-
-
- /**
- * Returns the label of the perspective with the given identifier or
- * <code>null</code> if no such perspective exists.
- *
- * @param perspectiveId the identifier
- * @return the label of the perspective with the given identifier or
- * <code>null</code> if no such perspective exists
- */
- protected String getPerspectiveDescription(String perspectiveId) {
- IPerspectiveDescriptor newPerspective = PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(perspectiveId);
- if (newPerspective == null) {
- return null;
- }
- return newPerspective.getDescription();
- }
-
- /**
- * Returns the perspective associated with the
- * given launch, or <code>null</code> if none.
- *
- * @param launch a launch
- * @return the perspective associated with the launch,
- * or <code>null</code>
- * @exception CoreException if unable to retrieve a required
- * launch configuration attribute
- */
- protected String getPerspectiveId(ILaunch launch) throws CoreException {
- if (launch == null) {
- return null;
- }
- ILaunchConfiguration config = launch.getLaunchConfiguration();
- if (config == null) {
- return null;
- }
- Set modes = launch.getLaunchConfiguration().getModes();
- modes.add(launch.getLaunchMode());
- String perspectiveId = getLaunchPerspective(config.getType(), modes, resolveLaunchDelegate(launch));
- if (perspectiveId != null && perspectiveId.equals(IDebugUIConstants.PERSPECTIVE_NONE)) {
- perspectiveId = null;
- }
- return perspectiveId;
- }
-
- /**
- * Returns the id of the perspective associated with the given type and set of modes. Passing <code>null</code> for
- * the launch delegate results in the default perspective id being returned (if there is one).
- * @param type the type we are launching
- * @param modes the set of modes the type was launched with
- * @param delegate the delegate performing the launch for this type and modeset
- * @return the id of the perspective for the given launch configuration type, modeset and launch delegate
- *
- * @since 3.3
- */
- public String getLaunchPerspective(ILaunchConfigurationType type, Set modes, ILaunchDelegate delegate) {
- String id = null;
- PerspectiveContext context = findContext(new PerspectiveContext(type, delegate, modes));
- if(context == null || (context != null && !context.getPersepctiveMap().containsKey(modes))) {
- //try with a null delegate, denoting the perspective for the type
- context = findContext(new PerspectiveContext(type, null, modes));
- if(context == null || (context != null && !context.getPersepctiveMap().containsKey(modes))) {
- //last resort, try the default perspective
- return getDefaultLaunchPerspective(type, delegate, modes);
- }
- }
- if(context != null) {
- id = context.getPerspective(modes);
- }
- return id;
- }
-
- /**
- * Returns the perspective to switch to when a configuration of the given type
- * is launched in the given mode, or <code>null</code> if no switch should take
- * place.
- * <p>
- * This method is equivalent to calling <code>getLaunchPerspective(ILaunchConfigurationType type, Set modes, ILaunchDelegate delegate)</code>,
- * with the 'mode' parameter comprising a single element set and passing <code>null</code> as the launch delegate.
- * </p>
- * @param type launch configuration type
- * @param mode launch mode identifier
- * @return perspective identifier or <code>null</code>
- * @since 3.0
- */
- public String getLaunchPerspective(ILaunchConfigurationType type, String mode) {
- HashSet modes = new HashSet();
- modes.add(mode);
- return getLaunchPerspective(type, modes, null);
- }
-
- /**
- * Sets the perspective to switch to when a configuration of the given type
- * is launched in the given mode. <code>PERSPECTIVE_NONE</code> indicates no
- * perspective switch should take place. <code>PERSPECTIVE_DEFAULT</code> indicates
- * a default perspective switch should take place, as defined by the associated
- * launch tab group extension.
- * <p>
- * Calling this method is equivalent to calling <code>setLaunchPerspective(ILaunchConfigurationType type, Set modes, ILaunchDelegate delegate, String perspectiveid)</code>,
- * with the parameter 'mode' used in the set modes, and null passed as the delegate
- * </p>
- * @param type launch configuration type
- * @param mode launch mode identifier
- * @param perspective identifier, <code>PERSPECTIVE_NONE</code>, or
- * <code>PERSPECTIVE_DEFAULT</code>
- * @since 3.0
- */
- public void setLaunchPerspective(ILaunchConfigurationType type, String mode, String perspective) {
- HashSet modes = new HashSet();
- modes.add(mode);
- setLaunchPerspective(type, modes, null, perspective);
- }
-
- /**
- * Sets the perspective that should be switched to when a configuration of the given type is launched with the
- * specified modes set by the given launch delegate.
- * <p>
- * Passing <code>null</code> as a launch delegate will set the default perspective switch for that type and modeset, where
- * <code>PERSPECTIVE_NONE</code> indicates no perspective switch should take place.
- * </p>
- * @param type the type to set a perspective context for
- * @param modes the set of modes
- * @param delegate the delegate, or <code>null</code> if the default perspective should be used
- *
- * @since 3.3
- */
- public void setLaunchPerspective(ILaunchConfigurationType type, Set modes, ILaunchDelegate delegate, String perspectiveid) {
- PerspectiveContext context = new PerspectiveContext(type, delegate, modes);
- String id = null;
- if(!IDebugUIConstants.PERSPECTIVE_NONE.equals(perspectiveid)) {
- if(IDebugUIConstants.PERSPECTIVE_DEFAULT.equals(perspectiveid)) {
- id = getDefaultLaunchPerspective(type, delegate, modes);
- }
- else {
- id = perspectiveid;
- }
- }
- PerspectiveContext item = findContext(context);
- if(item != null) {
- item.setPerspective(modes, id);
- }
- else {
- context.setPerspective(modes, id);
- item = context;
- }
- fPerspectiveContexts.add(item);
- }
-
- /**
- * Searches the listing of perspective contexts to see if the specified one already exists
- * @param context the context to compare
- * @return the matching <code>PerspectiveContext</code> or <code>null</code> if none
- *
- * @since 3.3
- */
- private PerspectiveContext findContext(PerspectiveContext context) {
- PerspectiveContext item = null;
- Object o = null;
- for(Iterator iter = fPerspectiveContexts.iterator(); iter.hasNext();) {
- o = iter.next();
- if(context.equals(o)) {
- item = (PerspectiveContext) o;
- return item;
- }
- }
- return item;
- }
-
- /**
- * Generates XML for the user specified perspective settings.
- *
- * @return XML
- * @exception IOException if unable to generate the XML
- * @exception TransformerException if unable to generate the XML
- * @exception ParserConfigurationException if unable to generate the XML
- */
- private String generatePerspectiveXML() throws ParserConfigurationException, CoreException {
- Document doc = DebugUIPlugin.getDocument();
- Element root = doc.createElement(IConfigurationElementConstants.LAUNCH_PERSPECTIVES);
- doc.appendChild(root);
- PerspectiveContext context = null;
- Map modesets = null;
- Element element = null;
- Set modes = null;
- String id = null;
- ILaunchDelegate delegate = null;
- for(Iterator iter = fPerspectiveContexts.iterator(); iter.hasNext();) {
- context = (PerspectiveContext) iter.next();
- modesets = context.getPersepctiveMap();
- for(Iterator iter2 = modesets.keySet().iterator(); iter2.hasNext();) {
- modes = (Set) iter2.next();
- id = context.getPerspective(modes);
- if(id != null) {
- element = doc.createElement(IConfigurationElementConstants.LAUNCH_PERSPECTIVE);
- element.setAttribute(IConfigurationElementConstants.MODE, createModesetString(modes));
- delegate = context.getLaunchDelegate();
- if(delegate != null) {
- element.setAttribute(ATTR_DELEGATE_ID, delegate.getId());
- }
- element.setAttribute(IConfigurationElementConstants.CONFIGURATION_TYPES, context.getLaunchConfigurationType().getIdentifier());
- element.setAttribute(IConfigurationElementConstants.PERSPECTIVE, id);
- root.appendChild(element);
- }
- }
-
- }
- return DebugPlugin.serializeDocument(doc);
- }
-
- /**
- * Returns the default perspective to switch to when a configuration of the given
- * type is launched in the given mode, or <code>null</code> if none.
- *
- * <p>
- * Calling this method is equivalent to using the new method <code>getDefaultLaunchPerspective(ILaunchConfigurationType type, ILaunchDelegate delegate, Set modes)</code>
- * with a null delegate and the specified mode comprising a set of one mode
- * </p>
- *
- * @param type launch configuration type
- * @param mode launch mode
- * @return perspective identifier, or <code>null</code>
- */
- public String getDefaultLaunchPerspective(ILaunchConfigurationType type, String mode) {
- HashSet modes = new HashSet();
- modes.add(mode);
- return getDefaultLaunchPerspective(type, null, modes);
- }
-
- /**
- * Returns the default perspective to switch to when a configuration of the given type is launched by the specified
- * launch delegate in the given mode set, or <code>null</code> if none
- * @param type the type
- * @param delegate the associated delegate, or <code>null</code> to specify that the default perspective id for that given type and mode set should be returned
- * @param modes the set of modes this applies to
- * @return the default perspective id for the given type, delegate and mode set combination, or <code>null</code> if none
- *
- * @since 3.3
- */
- public String getDefaultLaunchPerspective(ILaunchConfigurationType type, ILaunchDelegate delegate, Set modes) {
- String id = null;
- if(delegate != null) {
- id = delegate.getPerspectiveId(modes);
- }
- if(id == null) {
- LaunchConfigurationTabGroupExtension extension = LaunchConfigurationPresentationManager.getDefault().getExtension(type.getIdentifier(), modes);
- if (extension != null) {
- id = extension.getPerspective(modes);
- if (id == null) {
- if (modes.contains(ILaunchManager.DEBUG_MODE)) {
- id = IDebugUIConstants.ID_DEBUG_PERSPECTIVE;
- }
- }
- }
- }
- return id;
- }
-
- /**
- * Resolves the <code>ILaunchDelegate</code> from the given <code>ILaunch</code>
- * @param launch the launch
- * @return
- * @throws CoreException
- */
- private ILaunchDelegate resolveLaunchDelegate(ILaunch launch) throws CoreException {
- Set modes = launch.getLaunchConfiguration().getModes();
- modes.add(launch.getLaunchMode());
- ILaunchConfigurationType type = launch.getLaunchConfiguration().getType();
- ILaunchDelegate[] delegates = LaunchConfigurationManager.filterLaunchDelegates(type, modes);
- ILaunchDelegate delegate = null;
- if(delegates.length == 1) {
- delegate = delegates[0];
- }
- else if(delegates.length > 1) {
- delegate = launch.getLaunchConfiguration().getPreferredDelegate(modes);
- if(delegate == null) {
- delegate = type.getPreferredDelegate(modes);
- }
- }
- return delegate;
- }
-
- /**
- * Initialize the preference set with settings from user preferences
- */
- private void initPerspectives() {
- if(fPerspectiveContexts == null) {
- fPerspectiveContexts = new HashSet();
- String xml = DebugUIPlugin.getDefault().getPreferenceStore().getString(IInternalDebugUIConstants.PREF_LAUNCH_PERSPECTIVES);
- if (xml != null && xml.length() > 0) {
- try {
- Element root = DebugPlugin.parseDocument(xml);
- NodeList list = root.getChildNodes();
- LaunchManager lm = (LaunchManager) DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType lctype = null;
- ILaunchDelegate ldelegate = null;
- Set modes = null;
- Node node = null;
- Element element = null;
- for (int i = 0; i < list.getLength(); ++i) {
- node = list.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- element = (Element) node;
- String nodeName = element.getNodeName();
- if (nodeName.equalsIgnoreCase(IConfigurationElementConstants.LAUNCH_PERSPECTIVE)) {
- String type = element.getAttribute(IConfigurationElementConstants.CONFIGURATION_TYPES);
- String mode = element.getAttribute(IConfigurationElementConstants.MODE);
- String perspective = element.getAttribute(IConfigurationElementConstants.PERSPECTIVE);
- String delegate = element.getAttribute(ATTR_DELEGATE_ID);
- lctype = lm.getLaunchConfigurationType(type);
- ldelegate = lm.getLaunchDelegate(delegate);
- modes = parseModes(mode);
- if(lctype != null && !modes.isEmpty() && !IInternalDebugCoreConstants.EMPTY_STRING.equals(perspective)) {
- setLaunchPerspective(lctype, modes, ldelegate, perspective);
- }
- }
- }
- }
- }
- catch (CoreException e) {DebugUIPlugin.log(e);}
- }
- }
- }
-
- /**
- * Parses a string argument into a set of modes
- * @param modes the string to parse
- * @return a set of modes parsed from the specified string of the empty set, never null
- *
- * @since 3.3
- */
- private Set parseModes(String modes) {
- HashSet modeset = new HashSet();
- String[] ms = modes.split(","); //$NON-NLS-1$
- for(int i = 0; i < ms.length; i++) {
- modeset.add(ms[i].trim());
- }
- return modeset;
- }
-
- /**
- * Creates a standard comma separated list of the modes from the specified set
- * @param modes the set to write to string
- * @return the
- */
- private String createModesetString(Set modes) {
- String str = IInternalDebugCoreConstants.EMPTY_STRING;
- if(modes != null) {
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- str += iter.next();
- if(iter.hasNext()) {
- str += ","; //$NON-NLS-1$
- }
- }
- }
- return str;
- }
-
- /**
- * Schedules the given job after perspective switching is complete, or
- * immediately if a perspective switch is not in progress.
- *
- * @param job job to run after perspective switching
- */
- public void schedulePostSwitch(Job job) {
- fPerspectiveSwitchLock.schedulePostSwitch(job);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.ISuspendTriggerListener#suspended(org.eclipse.debug.core.ILaunch, java.lang.Object)
- */
- public void suspended(ILaunch launch, Object context) {
- handleBreakpointHit(launch);
- }
-
- /**
- * @see org.eclipse.core.resources.ISaveParticipant#doneSaving(org.eclipse.core.resources.ISaveContext)
- */
- public void doneSaving(ISaveContext context) {}
-
- /**
- * @see org.eclipse.core.resources.ISaveParticipant#prepareToSave(org.eclipse.core.resources.ISaveContext)
- */
- public void prepareToSave(ISaveContext context) throws CoreException {}
-
- /**
- * @see org.eclipse.core.resources.ISaveParticipant#rollback(org.eclipse.core.resources.ISaveContext)
- */
- public void rollback(ISaveContext context) {}
-
- /**
- * @see org.eclipse.core.resources.ISaveParticipant#saving(org.eclipse.core.resources.ISaveContext)
- */
- public void saving(ISaveContext context) throws CoreException {
- try {
- DebugUIPlugin.getDefault().getPreferenceStore().putValue(IInternalDebugUIConstants.PREF_LAUNCH_PERSPECTIVES, generatePerspectiveXML());
- } catch (ParserConfigurationException e) {
- throw new CoreException(DebugUIPlugin.newErrorStatus("Exception occurred while generating launch perspectives preference XML", e)); //$NON-NLS-1$
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java
deleted file mode 100644
index 5e692cc09..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import java.util.HashSet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.IStatusHandler;
-import org.eclipse.debug.internal.ui.AbstractDebugCheckboxSelectionDialog;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.model.AdaptableList;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-/**
- * Status handler to prompt for saving of resources prior to launching.
- * <p>
- * This class provides a behavior breaking function from 3.1. We now perform pre-launch saving for resources
- * scoped to the affected projects of the launch instead of all unsaved resources from within the current workspace.
- * </p>
- * <p>
- * The 'breaking' occurs as the saving is moved from <code>DebugUIPlugin</code> to the launch configuration delegate, which will require
- * implementors of <code>LaunchConfigurationDelegate</code> to incorporate the use of this status handler to perform any pre-launch saving.
- * </p>
- * @since 3.2
- */
-public class SaveScopeResourcesHandler implements IStatusHandler {
-
- /**
- * Opens a resizable dialog listing possible files to save, the user can select none, some or all of the files before pressing OK.
- * @since 3.2
- */
- class ScopedResourcesSelectionDialog extends AbstractDebugCheckboxSelectionDialog {
-
- private final String SETTINGS_ID = IDebugUIConstants.PLUGIN_ID + ".SCOPED_SAVE_SELECTION_DIALOG"; //$NON-NLS-1$
- Button fSavePref;
- Object fInput;
- IStructuredContentProvider fContentProvider;
- ILabelProvider fLabelProvider;
-
- public ScopedResourcesSelectionDialog(Shell parentShell, Object input, IStructuredContentProvider contentProvider, ILabelProvider labelProvider) {
- super(parentShell);
- fInput = input;
- fContentProvider = contentProvider;
- fLabelProvider = labelProvider;
- setShellStyle(getShellStyle() | SWT.RESIZE);
- setShowSelectAllButtons(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getContentProvider()
- */
- protected IContentProvider getContentProvider() {
- return fContentProvider;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getLabelProvider()
- */
- protected IBaseLabelProvider getLabelProvider() {
- return fLabelProvider;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
- */
- protected String getDialogSettingsId() {
- return SETTINGS_ID;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.SELECT_RESOURCES_TO_SAVE_DIALOG;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
- */
- protected Object getViewerInput() {
- return fInput;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
- */
- protected String getViewerLabel() {
- return LaunchConfigurationsMessages.SaveScopeResourcesHandler_2;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugCheckboxSelectionDialog#addCustomFooterControls(org.eclipse.swt.widgets.Composite)
- */
- protected void addCustomFooterControls(Composite parent) {
- super.addCustomFooterControls(parent);
- fSavePref = new Button(parent, SWT.CHECK);
- fSavePref.setText(LaunchConfigurationsMessages.SaveScopeResourcesHandler_1);
- fSavePref.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- getCheckBoxTableViewer().setAllChecked(fSavePref.getSelection());
- }
- });
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugCheckboxSelectionDialog#okPressed()
- */
- protected void okPressed() {
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- String val = (fSavePref.getSelection() ? MessageDialogWithToggle.ALWAYS : MessageDialogWithToggle.PROMPT);
- store.setValue(IInternalDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH, val);
- super.okPressed();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugCheckboxSelectionDialog#addViewerListeners(org.eclipse.jface.viewers.StructuredViewer)
- */
- protected void addViewerListeners(StructuredViewer viewer) {
- // Override to remove listener that affects the ok button
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.AbstractDebugCheckboxSelectionDialog#isValid()
- */
- protected boolean isValid() {
- return true;
- }
- }
-
- /**
- * The objects to save (if any)
- */
- IResource[] fSaves = null;
-
- /* (non-Javadoc)
- *
- * Source object is an array - a launch configuration and an array of projects to save resources for.
- *
- * @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
- */
- public Object handleStatus(IStatus status, Object source) throws CoreException {
- // retrieve config and projects
- ILaunchConfiguration config = null;
- IProject[] projects = null;
- if (source instanceof Object[]) {
- Object[] objects = (Object[]) source;
- if (objects.length == 2) {
- config = (ILaunchConfiguration) objects[0];
- projects = (IProject[]) objects[1];
- }
- }
- if (config != null) {
- if (DebugUITools.isPrivate(config)) {
- return Boolean.TRUE;
- }
- }
- if (projects != null) {
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- String save = store.getString(IInternalDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH);
- int ret = showSaveDialog(projects, !save.equals(MessageDialogWithToggle.NEVER), save.equals(MessageDialogWithToggle.PROMPT));
- if(ret == IDialogConstants.OK_ID) {
- doSave();
- return Boolean.TRUE;
- }
- return Boolean.FALSE;
- }
- else {
- boolean cancel = DebugUIPlugin.preLaunchSave();
- return Boolean.valueOf(cancel);
- }
- }
-
- /**
- *
- * Builds the list of editors that apply to this build that need to be saved
- *
- * @param projects the projects involved in this build, used to scope the searching process
- * @return the list of dirty editors for this launch to save, never null
- */
- protected IResource[] getScopedDirtyResources(IProject[] projects) {
- HashSet dirtyres = new HashSet();
- IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
- for(int l = 0; l < windows.length; l++) {
- IWorkbenchPage[] pages = windows[l].getPages();
- for(int i = 0; i < pages.length; i++) {
- IEditorPart[] eparts = pages[i].getDirtyEditors();
- for(int j = 0; j < eparts.length; j++) {
- IResource resource = (IResource)eparts[j].getEditorInput().getAdapter(IResource.class);
- if(resource != null) {
- for(int k = 0; k < projects.length; k++) {
- if(projects[k].equals(resource.getProject())) {
- dirtyres.add(resource);
- }
- }
- }
- }
- }
- }
- return (IResource[])dirtyres.toArray(new IResource[dirtyres.size()]);
- }
-
- /**
- * Performs the save of the editor parts returned by getScopedResources
- */
- protected void doSave() {
- if(fSaves != null) {
- IDE.saveAllEditors(fSaves, false);
- }
- }
-
- /**
- * show the save dialog with a list of editors to save (if any)
- * The dialog is also not shown if the the preference for automatically saving dirty before launch is set to always
- * @param projects the projects to consider for the save
- * @param save if we should save
- * @param prompt if we should prompt to save or do it automatically
- * @return the dialog status, to be propagated back to the <code>handleStatus</code> method
- */
- protected int showSaveDialog(IProject[] projects, boolean save, boolean prompt) {
- if(save) {
- IResource[] resources = getScopedDirtyResources(projects);
- if(prompt && (resources.length > 0)) {
- ScopedResourcesSelectionDialog lsd = new ScopedResourcesSelectionDialog(DebugUIPlugin.getShell(),
- new AdaptableList(resources),
- new WorkbenchContentProvider(),
- new WorkbenchLabelProvider());
- lsd.setInitialSelections(resources);
- lsd.setTitle(LaunchConfigurationsMessages.SaveScopeResourcesHandler_3);
- if(lsd.open() == IDialogConstants.CANCEL_ID) {
- return IDialogConstants.CANCEL_ID;
- }
- Object[] objs = lsd.getResult();
- fSaves = new IResource[objs.length];
- for (int i = 0; i < objs.length; i++) {
- fSaves[i] = (IResource) objs[i];
- }
- }
- else {
- fSaves = resources;
- }
- }
- return IDialogConstants.OK_ID;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java
deleted file mode 100644
index a01a608b8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.internal.ui.AbstractDebugCheckboxSelectionDialog;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.model.WorkbenchViewerComparator;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * This dialog is used to select one or more launch configurations to add to your favorites
- *
- * @since 3.3.0
- */
-public class SelectFavoritesDialog extends AbstractDebugCheckboxSelectionDialog {
-
- /**
- * Content provider for table
- */
- protected class LaunchConfigurationContentProvider implements IStructuredContentProvider {
- public Object[] getElements(Object inputElement) {
- ILaunchConfiguration[] all = null;
- try {
- all = LaunchConfigurationManager.filterConfigs(DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations());
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- return new ILaunchConfiguration[0];
- }
- List list = new ArrayList(all.length);
- ViewerFilter filter = new LaunchGroupFilter(fHistory.getLaunchGroup());
- for (int i = 0; i < all.length; i++) {
- if (filter.select(null, null, all[i])) {
- list.add(all[i]);
- }
- }
- list.removeAll(fCurrentFavoriteSet);
- Object[] objs = list.toArray();
- new WorkbenchViewerComparator().sort(getCheckBoxTableViewer(), objs);
- return objs;
- }
-
- public void dispose() {}
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
- }
-
- private LaunchHistory fHistory;
- private List fCurrentFavoriteSet;
-
- /**
- * Constructor
- * @param parentShell
- * @param history
- * @param favorites
- */
- public SelectFavoritesDialog(Shell parentShell, LaunchHistory history, List favorites) {
- super(parentShell);
- fHistory = history;
- fCurrentFavoriteSet = favorites;
- setTitle(MessageFormat.format(LaunchConfigurationsMessages.FavoritesDialog_0, new String[]{getModeLabel()}));
- setShowSelectAllButtons(true);
- }
-
- /**
- * Returns a label to use for launch mode with accelerators removed.
- *
- * @return label to use for launch mode with accelerators removed
- */
- private String getModeLabel() {
- return DebugUIPlugin.removeAccelerators(fHistory.getLaunchGroup().getLabel());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
- */
- protected String getDialogSettingsId() {
- return IDebugUIConstants.PLUGIN_ID + ".SELECT_FAVORITESS_DIALOG"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
- */
- protected Object getViewerInput() {
- return fHistory.getLaunchGroup().getMode();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getContentProvider()
- */
- protected IContentProvider getContentProvider() {
- return new LaunchConfigurationContentProvider();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.SELECT_FAVORITES_DIALOG;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
- */
- protected String getViewerLabel() {
- return LaunchConfigurationsMessages.FavoritesDialog_7;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java
deleted file mode 100644
index d4d63ea9b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.internal.ui.AbstractDebugListSelectionDialog;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This class provides a dialog to present the user with a list of of viable launch options in the event
- * the plug-in that provides either a launch option or a contributed launch delegate is no longer available.
- * The user can select one of the launch mode/option configuration from this dialog and repair the option
- * configuration state of the the current launch configuration
- *
- * @since 3.3
- */
-public class SelectLaunchModesDialog extends AbstractDebugListSelectionDialog{
-
- /**
- * Builds labels for list control
- */
- class OptionsLabelProvider implements ILabelProvider {
- public Image getImage(Object element) {return null;}
- public String getText(Object element) {
- Set modes = (Set) element;
- List names = LaunchConfigurationPresentationManager.getDefault().getLaunchModeNames(modes);
- return names.toString();
- }
- public void addListener(ILabelProviderListener listener) {}
- public void dispose() {}
- public boolean isLabelProperty(Object element, String property) {return false;}
- public void removeListener(ILabelProviderListener listener) {}
- }
-
- private List fValidModes = null;
-
- /**
- * Constructor
- * @param parentShell the parent shell
- * @param mode the current mode context
- * @param configuration the current launch configuration context
- *
- * @throws CoreException
- */
- public SelectLaunchModesDialog(Shell parentShell, String mode, ILaunchConfiguration configuration) throws CoreException {
- super(parentShell);
- super.setTitle(LaunchConfigurationsMessages.SelectLaunchOptionsDialog_3);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- fValidModes = new ArrayList();
- Set modes = configuration.getType().getSupportedModeCombinations();
- Set modeset = null;
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- modeset = (Set) iter.next();
- if(modeset.contains(mode)) {
- fValidModes.add(modeset);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
- */
- protected String getDialogSettingsId() {
- return IDebugUIConstants.PLUGIN_ID + ".SELECT_LAUNCH_MODES_DIALOG"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getLabelProvider()
- */
- protected IBaseLabelProvider getLabelProvider() {
- return new OptionsLabelProvider();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
- */
- protected Object getViewerInput() {
- return fValidModes.toArray();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.SELECT_LAUNCH_MODES_DIALOG;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
- */
- protected String getViewerLabel() {
- return LaunchConfigurationsMessages.SelectLaunchOptionsDialog_4;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java
deleted file mode 100644
index 5f4e403db..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchDelegate;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.AbstractDebugListSelectionDialog;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * This dialog is used to select a preferred launcher, and also provides access to the
- * workspace defaults for preferred launchers
- *
- * @since 3.3
- */
-public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
-
- /**
- * Builds labels for table control
- */
- class DelegatesLabelProvider implements ILabelProvider {
- public Image getImage(Object element) {return null;}
- public String getText(Object element) {
- if(element instanceof ILaunchDelegate) {
- ILaunchDelegate ldp = (ILaunchDelegate) element;
- String name = ldp.getName();
- if(name == null) {
- name = ldp.getContributorName();
- }
- return name;
- }
- return element.toString();
- }
- public void addListener(ILabelProviderListener listener) {}
- public void dispose() {}
- public boolean isLabelProperty(Object element, String property) {return false;}
- public void removeListener(ILabelProviderListener listener) {}
- }
-
- Text description = null;
- Button configspecific = null;
- private ILaunchDelegate[] fDelegates = null;
- private ILaunchConfigurationWorkingCopy fConfiguration = null;
- private String fLaunchMode = null;
-
- /**
- * Constructor
- * @param parentShell
- */
- public SelectLaunchersDialog(Shell parentShell, ILaunchDelegate[] delegates, ILaunchConfigurationWorkingCopy configuration, String launchmode) {
- super(parentShell);
- super.setTitle(LaunchConfigurationsMessages.SelectLaunchersDialog_0);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- fDelegates = delegates;
- fConfiguration = configuration;
- fLaunchMode = launchmode;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#getInitialSize()
- */
- protected Point getInitialSize() {
- IDialogSettings settings = getDialogBoundsSettings();
- if(settings != null) {
- try {
- int width = settings.getInt("DIALOG_WIDTH"); //$NON-NLS-1$
- int height = settings.getInt("DIALOG_HEIGHT"); //$NON-NLS-1$
- if(width > 0 & height > 0) {
- return new Point(width, height);
- }
- }
- catch (NumberFormatException nfe) {
- return new Point(450, 450);
- }
- }
- return new Point(450, 450);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
- */
- protected String getDialogSettingsId() {
- return IDebugUIConstants.PLUGIN_ID + ".SELECT_LAUNCHERS_DIALOG"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.SELECT_LAUNCHERS_DIALOG;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getLabelProvider()
- */
- protected IBaseLabelProvider getLabelProvider() {
- return new DelegatesLabelProvider();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
- */
- protected Object getViewerInput() {
- return fDelegates;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#addCustomHeaderControls(org.eclipse.swt.widgets.Composite)
- */
- protected void addCustomHeaderControls(Composite parent) {
- Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 2, 1, GridData.FILL_HORIZONTAL, 0, 0);
- SWTFactory.createWrapLabel(comp, LaunchConfigurationsMessages.SelectLaunchersDialog_2, 2);
-
- SWTFactory.createVerticalSpacer(comp, 1);
-
- this.configspecific = SWTFactory.createCheckButton(comp, LaunchConfigurationsMessages.SelectLaunchersDialog_1, null, true, 1);
- this.configspecific.setSelection(false);
- GridData gd = (GridData) this.configspecific.getLayoutData();
- gd.grabExcessHorizontalSpace = true;
- this.configspecific.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- boolean checked = ((Button)e.widget).getSelection();
- getViewer().getControl().setEnabled(checked);
- resetDelegate();
- }
- });
-
- Link link = new Link(comp, SWT.WRAP);
- link.setText(LaunchConfigurationsMessages.SelectLaunchersDialog_4);
- link.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));
- link.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- SWTFactory.showPreferencePage("org.eclipse.debug.ui.LaunchDelegatesPreferencePage"); //$NON-NLS-1$
- if(!SelectLaunchersDialog.this.configspecific.getSelection()) {
- resetDelegate();
- }
- }
- });
- }
-
- /**
- * Returns the currently checked launch delegate
- * @return the currently selected launch delegate or <code>null</code> if none are checked
- */
- protected ILaunchDelegate getSelectedDelegate() {
- IStructuredSelection selection = (IStructuredSelection) getViewer().getSelection();
- return (ILaunchDelegate) selection.getFirstElement();
- }
-
- /**
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- ILaunchDelegate delegate = null;
- Set modes = getCurrentModeSet();
- if(configspecific.getSelection()) {
- delegate = getSelectedDelegate();
- if(delegate != null) {
- fConfiguration.setPreferredLaunchDelegate(modes, delegate.getId());
- }
- }
- else {
- fConfiguration.setPreferredLaunchDelegate(modes, null);
- }
- if(fConfiguration.isDirty()) {
- try {
- fConfiguration.doSave();
- }
- catch (CoreException e) {DebugUIPlugin.log(e);}
- }
- super.okPressed();
- }
-
- /**
- * Resets the selected and checked delegate in the preferred launcher view part to be the one from the workspace
- */
- private void resetDelegate() {
- try {
- ILaunchDelegate preferred = fConfiguration.getType().getPreferredDelegate(getCurrentModeSet());
- Viewer viewer = getViewer();
- if(preferred != null) {
- viewer.setSelection(new StructuredSelection(preferred));
- }
- else {
- viewer.setSelection(new StructuredSelection());
- }
- getButton(IDialogConstants.OK_ID).setEnabled(isValid());
- }
- catch (CoreException ce) {DebugUIPlugin.log(ce);}
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#addCustomFooterControls(org.eclipse.swt.widgets.Composite)
- */
- protected void addCustomFooterControls(Composite parent) {
- Group group = SWTFactory.createGroup(parent, LaunchConfigurationsMessages.SelectLaunchersDialog_5, 1, 1, GridData.FILL_BOTH);
- this.description = SWTFactory.createText(group, SWT.WRAP | SWT.READ_ONLY, 1, GridData.FILL_BOTH);
- this.description.setBackground(group.getBackground());
- }
-
- /**
- * @return the complete set of modes that the associated launch configuration is concerned with
- */
- protected Set getCurrentModeSet() {
- Set modes = new HashSet();
- try {
- modes = fConfiguration.getModes();
- modes.add(fLaunchMode);
- }
- catch (CoreException ce) {DebugUIPlugin.log(ce);}
- return modes;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.AbstractDebugCheckboxSelectionDialog#addViewerListeners(org.eclipse.jface.viewers.StructuredViewer)
- */
- protected void addViewerListeners(StructuredViewer viewer) {
- // Override super to use custom listeners
- viewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection ss = (IStructuredSelection) event.getSelection();
- if(ss != null && !ss.isEmpty()) {
- SelectLaunchersDialog.this.description.setText(((ILaunchDelegate)ss.getFirstElement()).getDescription());
- }
- else {
- SelectLaunchersDialog.this.description.setText(IInternalDebugCoreConstants.EMPTY_STRING);
- }
- }
- });
- super.addViewerListeners(viewer);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#initializeControls()
- */
- protected void initializeControls() {
- final Viewer viewer = getViewer();
- try {
- ILaunchDelegate delegate = fConfiguration.getPreferredDelegate(getCurrentModeSet());
- if(delegate != null) {
- viewer.setSelection(new StructuredSelection(delegate));
- configspecific.setSelection(true);
- }
- else {
- viewer.getControl().setEnabled(false);
- resetDelegate();
- }
- }
- catch (CoreException ce) {DebugUIPlugin.log(ce);}
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
- */
- protected String getViewerLabel() {
- return LaunchConfigurationsMessages.SelectLaunchersDialog_launchers;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetComparator.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetComparator.java
deleted file mode 100644
index d1a89c6af..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetComparator.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import java.util.Comparator;
-
-import org.eclipse.debug.ui.RefreshTab;
-import org.eclipse.ui.IWorkingSet;
-
-/**
- * Comparator for refresh scope launch configuration attribute
- * <code>ATTR_REFRESH_SCOPE</code>.
- */
-public class WorkingSetComparator implements Comparator {
-
- /* (non-Javadoc)
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- */
- public int compare(Object o1, Object o2) {
- String one= (String)o1;
- String two= (String)o2;
- if (one == null || two == null) {
- if (one == two) {
- return 0;
- }
- return -1;
- }
- if (one.startsWith("${working_set:") && two.startsWith("${working_set:")) { //$NON-NLS-1$//$NON-NLS-2$
- IWorkingSet workingSet1 = RefreshTab.getWorkingSet(one);
- IWorkingSet workingSet2 = RefreshTab.getWorkingSet(two);
- if (workingSet1 == null || workingSet2 == null) {
- if (workingSet1 == workingSet2) {
- return 0;
- }
- return -1;
- }
- if (workingSet1.equals(workingSet2)) {
- return 0;
- }
- return -1;
- }
- return one.compareTo(two);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java
deleted file mode 100644
index 7220e1cfd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.launchConfigurations;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkingSet;
-
-/**
- * creates a filter for the current working sets in use on the workbench to be applied in the launch configuration
- * dialog and the launch history/last launched
- *
- * @since 3.2
- */
-public class WorkingSetsFilter extends ViewerFilter {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if(element instanceof ILaunchConfigurationType) {
- return true;
- }
- if(element instanceof ILaunchConfiguration) {
- ILaunchConfiguration config = (ILaunchConfiguration)element;
- try {
- IResource[] resources = config.getMappedResources();
- if(resources == null) {
- return true;
- }
- IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
- if(window == null) {
- return true;
- }
- IWorkbenchPage page = window.getActivePage();
- if(page == null) {
- return true;
- }
- IWorkingSet[] wsets = page.getWorkingSets();
- if(wsets.length < 1) {
- return true;
- }
- //remove breakpoint working sets
- ArrayList ws = new ArrayList();
- for (int i = 0; i < wsets.length; i++) {
- if(!IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(wsets[i].getId())) {
- ws.add(wsets[i]);
- }
- }
- if(ws.isEmpty()) {
- return true;
- }
- for (int i = 0; i < resources.length; i++) {
- if(workingSetContains((IWorkingSet[]) ws.toArray(new IWorkingSet[ws.size()]), resources[i])) {
- return true;
- }
- }
- }
- catch (CoreException e) {}
- }
- return false;
- }
-
- /**
- * Determines if the specified group of working sets contains the specified resource.
- * @param wsets the set of working sets to examine
- * @param res the resource to check for containment
- * @return true iff any one of the specified working sets contains the specified resource
- * @since 3.2
- */
- public static boolean workingSetContains(IWorkingSet[] wsets, IResource res) {
- ArrayList parents = new ArrayList();
- parents.add(res);
- while(res != null) {
- res = res.getParent();
- if(res != null) {
- parents.add(res);
- }
- }
- IResource lres = null;
- for(int i = 0; i < wsets.length; i++) {
- IAdaptable[] elements = wsets[i].getElements();
- for(int j = 0; j < elements.length; j++) {
- lres = (IResource)elements[j].getAdapter(IResource.class);
- if(lres != null) {
- if(parents.contains(lres)) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IMemoryBlockConnection.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IMemoryBlockConnection.java
deleted file mode 100644
index 2a30b8deb..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IMemoryBlockConnection.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.memory;
-
-/**
- * Represents a connection to a memory block. An IMemoryRenderingUpdater can call
- * a connection to update instead of relying on a rendering to listen
- * for CHANGE / SUSPEND debug event to trigger an update.
- *
- * This interface is EXPERIMENTAL.
- *
- */
-public interface IMemoryBlockConnection {
-
- /**
- * Update the content of a memory block in a connection.
- */
- public void update();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IMemoryRenderingUpdater.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IMemoryRenderingUpdater.java
deleted file mode 100644
index 874a43636..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IMemoryRenderingUpdater.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.memory;
-
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-
-
-/**
- * Represents an object that will manage the update of an IMemoryRendering
- * based on connections. If the memory block implements this interface or returns
- * an object of this type when getAdapter(...) is called, a rendering would
- * call #supportsManagedUpdate to determine if it should handle and refresh
- * upon a debug event.
- *
- * If the client wants to manage its own update, it would return true when
- * #supportsManagedUpdate is called. The rendering will not get refreshed
- * upon any debug events. Instead, the rendering will update when
- * <code>IMemoryBlockConnection.update</code> is called.
- *
- * This interface is EXPERIMENTAL.
- *
- */
-public interface IMemoryRenderingUpdater extends IMemoryBlockExtension {
-
- /**
- * @return true if the updater will manage the update of a rendering
- */
- public boolean supportsManagedUpdate(IMemoryRendering rendering);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IPersistableDebugElement.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IPersistableDebugElement.java
deleted file mode 100644
index 338db1a96..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/IPersistableDebugElement.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.memory;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
-
-/**
- * Represents an element that is capable of persisting properties.
- * @since 3.2
- */
-public interface IPersistableDebugElement {
-
- /**
- * Return the property with the specified propertyId.
- * @param context is the context who is asking for this property.
- * @param propertyId is the property id of the property.
- * @return the value of the specified property
- * @throws CoreException when an error has occurred getting this property
- */
- public Object getProperty(Object context, String propertyId) throws CoreException;
-
- /**
- * Sets the property with the specified propertyId. Clients are expected
- * to save the properties specified.
- * @param context is the context who is asking for this property to be saved.
- * @param propertyId is the id of the property to be saved
- * @param value is the value of the property
- * @throws CoreException when an error has occurred setting this property
- */
- public void setProperty(Object context, String propertyId, Object value) throws CoreException;
-
- /**
- * @param context is the contex who is asking if this property is supported
- * @param propertyId
- * @return true if the peristable debug element wishes to handle persistence of
- * the specified property.
- */
- public boolean supportsProperty(Object context, String propertyId);
-
- /**
- * Add the property change listener to the persistable. The listener will
- * be notified when properties have changed from the peristable element.
- * @param listener is the listener to add
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener);
-
- /**
- * Remove the property change listener from the persistable. The listener will
- * no longer be notified when properties are changed from the persistable element.
- * @param listener is the listener to remove
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingManager.java
deleted file mode 100644
index 8590ebb0e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingManager.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.memory;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.memory.AbstractMemoryRenderingBindingsProvider;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingBindingsListener;
-import org.eclipse.debug.ui.memory.IMemoryRenderingManager;
-import org.eclipse.debug.ui.memory.IMemoryRenderingType;
-
-/**
- * The memory rendering manager.
- *
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingManager
- * @since 3.1
- */
-public class MemoryRenderingManager extends AbstractMemoryRenderingBindingsProvider implements IMemoryRenderingManager {
-
- // map of rendering type ids to valid rendering types
- private Map fRenderingTypes = new HashMap();
-
- // list of renderingBindings
- private List fBindings = new ArrayList();
-
- // singleton manager
- private static MemoryRenderingManager fgDefault;
-
- // elements in the memory renderings extension point
- public static final String ELEMENT_MEMORY_RENDERING_TYPE = "renderingType"; //$NON-NLS-1$
- public static final String ELEMENT_RENDERING_BINDINGS = "renderingBindings"; //$NON-NLS-1$
-
- /**
- * Returns the memory rendering manager.
- *
- * @return the memory rendering manager
- */
- public static IMemoryRenderingManager getDefault() {
- if (fgDefault == null) {
- fgDefault = new MemoryRenderingManager();
- }
- return fgDefault;
- }
- /**
- * Construts a new memory rendering manager. Only to be called by DebugUIPlugin.
- */
- private MemoryRenderingManager() {
- initializeRenderings();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingManager#createRendering(java.lang.String)
- */
- public IMemoryRendering createRendering(String id) throws CoreException {
- IMemoryRenderingType type = getRenderingType(id);
- if (type != null) {
- return type.createRendering();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingManager#getRenderingTypes()
- */
- public IMemoryRenderingType[] getRenderingTypes() {
- Collection types = fRenderingTypes.values();
- return (IMemoryRenderingType[]) types.toArray(new IMemoryRenderingType[types.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingManager#getRenderingType(java.lang.String)
- */
- public IMemoryRenderingType getRenderingType(String id) {
- return (IMemoryRenderingType) fRenderingTypes.get(id);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#getDefaultRenderingTypes(org.eclipse.debug.core.model.IMemoryBlock)
- */
- public IMemoryRenderingType[] getDefaultRenderingTypes(IMemoryBlock block) {
- List allTypes = new ArrayList();
- Iterator iterator = fBindings.iterator();
- while (iterator.hasNext()) {
- RenderingBindings binding = (RenderingBindings)iterator.next();
- IMemoryRenderingType[] renderingTypes = binding.getDefaultRenderingTypes(block);
- for (int i = 0; i < renderingTypes.length; i++) {
- IMemoryRenderingType type = renderingTypes[i];
- if (!allTypes.contains(type)) {
- allTypes.add(type);
- }
- }
- }
- return (IMemoryRenderingType[]) allTypes.toArray(new IMemoryRenderingType[allTypes.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#getPrimaryRenderingType(org.eclipse.debug.core.model.IMemoryBlock)
- */
- public IMemoryRenderingType getPrimaryRenderingType(IMemoryBlock block) {
- Iterator iterator = fBindings.iterator();
- while (iterator.hasNext()) {
- RenderingBindings binding = (RenderingBindings)iterator.next();
- IMemoryRenderingType renderingType = binding.getPrimaryRenderingType(block);
- if (renderingType != null) {
- return renderingType;
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#getRenderingTypes(org.eclipse.debug.core.model.IMemoryBlock)
- */
- public IMemoryRenderingType[] getRenderingTypes(IMemoryBlock block) {
- List allTypes = new ArrayList();
- Iterator iterator = fBindings.iterator();
- while (iterator.hasNext()) {
- RenderingBindings binding = (RenderingBindings)iterator.next();
- IMemoryRenderingType[] renderingTypes = binding.getRenderingTypes(block);
- for (int i = 0; i < renderingTypes.length; i++) {
- IMemoryRenderingType type = renderingTypes[i];
- if (!allTypes.contains(type)) {
- allTypes.add(type);
- }
- }
- }
- return (IMemoryRenderingType[]) allTypes.toArray(new IMemoryRenderingType[allTypes.size()]);
- }
-
- /**
- * Processes memory rendering contributions.
- */
- private void initializeRenderings() {
- IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_MEMORY_RENDERINGS);
- IConfigurationElement[] configurationElements = extensionPoint.getConfigurationElements();
- for (int i = 0; i < configurationElements.length; i++) {
- IConfigurationElement element= configurationElements[i];
- String name = element.getName();
- if (name.equals(ELEMENT_MEMORY_RENDERING_TYPE)) {
- MemoryRenderingType type = new MemoryRenderingType(element);
- try {
- type.validate();
- fRenderingTypes.put(type.getId(), type);
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- } else if (name.equals(ELEMENT_RENDERING_BINDINGS)) {
- RenderingBindings bindings = new RenderingBindings(element);
- try {
- bindings.validate();
- fBindings.add(bindings);
- bindings.addListener(new IMemoryRenderingBindingsListener() {
- public void memoryRenderingBindingsChanged() {
- fireBindingsChanged();
- }});
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingType.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingType.java
deleted file mode 100644
index 85a743eed..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingType.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.memory;
-
-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.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingType;
-import org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate;
-
-/**
- * A contributed memory rendering type.
- *
- * @since 3.1
- */
-class MemoryRenderingType implements IMemoryRenderingType {
-
- private IConfigurationElement fConfigurationElement;
- private IMemoryRenderingTypeDelegate fDelegate;
-
- // attributes for a memoryRenderingType
- static final String ATTR_MEM_RENDERING_TYPE_NAME = "name"; //$NON-NLS-1$
- static final String ATTR_MEM_RENDERING_TYPE_ID = "id"; //$NON-NLS-1$
- static final String ATTR_MEM_RENDERING_TYPE_DELEGATE = "class"; //$NON-NLS-1$
-
- /**
- * Constructs a rendering type from a contribution.
- */
- MemoryRenderingType(IConfigurationElement element) {
- fConfigurationElement = element;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingType#getLabel()
- */
- public String getLabel() {
- return fConfigurationElement.getAttribute(ATTR_MEM_RENDERING_TYPE_NAME);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingType#getId()
- */
- public String getId() {
- return fConfigurationElement.getAttribute(ATTR_MEM_RENDERING_TYPE_ID);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingType#createRendering()
- */
- public IMemoryRendering createRendering() throws CoreException {
- if (fDelegate == null) {
- fDelegate = (IMemoryRenderingTypeDelegate) fConfigurationElement.createExecutableExtension(ATTR_MEM_RENDERING_TYPE_DELEGATE);
- }
- return fDelegate.createRendering(getId());
- }
-
- /**
- * Validates this contribution.
- *
- * @exception CoreException if invalid
- */
- void validate() throws CoreException {
- verifyPresent(ATTR_MEM_RENDERING_TYPE_ID);
- verifyPresent(ATTR_MEM_RENDERING_TYPE_NAME);
- verifyPresent(ATTR_MEM_RENDERING_TYPE_DELEGATE);
- }
-
- private void verifyPresent(String attrName) throws CoreException {
- if (fConfigurationElement.getAttribute(attrName) == null) {
- Status status = new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR,
- "<memoryRenderingType> element missing required attribute: " + attrName, null); //$NON-NLS-1$
- throw new CoreException(status);
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/RenderingBindings.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/RenderingBindings.java
deleted file mode 100644
index 3a4f15b9f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/RenderingBindings.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.memory;
-
-import java.util.ArrayList;
-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.ExpressionTagNames;
-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.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.memory.AbstractMemoryRenderingBindingsProvider;
-import org.eclipse.debug.ui.memory.IMemoryRenderingBindingsListener;
-import org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider;
-import org.eclipse.debug.ui.memory.IMemoryRenderingManager;
-import org.eclipse.debug.ui.memory.IMemoryRenderingType;
-
-/**
- * Represents a renderingBindings element of a memoryRenderings
- * contribution.
- *
- * @since 3.1
- */
-class RenderingBindings extends AbstractMemoryRenderingBindingsProvider implements IMemoryRenderingBindingsProvider {
-
- // element
- protected IConfigurationElement fConfigurationElement;
-
- // cached rendering ids
- private IMemoryRenderingType[] fAllTypes;
- private IMemoryRenderingType[] fRenderingTypes;
- private IMemoryRenderingType[] fDefaultTypes;
-
- // rendering type provider, or null (optional)
- private IMemoryRenderingBindingsProvider fProvider;
-
- // optional exprssion
- private Expression fExpression;
-
- // element attribute
- public static final String ATTR_RENDERING_IDS = "renderingIds"; //$NON-NLS-1$
- public static final String ATTR_DEFAULT_IDS = "defaultIds"; //$NON-NLS-1$
- public static final String ATTR_PRIMARY = "primaryId"; //$NON-NLS-1$
- public static final String ATTR_PROVIDER = "class"; //$NON-NLS-1$
-
- // empty bindings
- private static final IMemoryRenderingType[] EMPTY = new IMemoryRenderingType[0];
-
- /**
- * Constructs a bindings element from the given contribution.
- *
- * @param element contribution
- */
- RenderingBindings(IConfigurationElement element) {
- fConfigurationElement = element;
- }
-
- /**
- * Returns the non-default bindings specified by this contribution.
- *
- * @return the non-default bindings specified by this contribution
- */
- private IMemoryRenderingType[] getBindings() {
- if (fRenderingTypes == null) {
- String ids = fConfigurationElement.getAttribute(ATTR_RENDERING_IDS);
- List list = new ArrayList();
- IMemoryRenderingManager manager = getManager();
- if (ids != null) {
- String[] strings = ids.split(","); //$NON-NLS-1$
- for (int i = 0; i < strings.length; i++) {
- String id = strings[i].trim();
- IMemoryRenderingType type = manager.getRenderingType(id);
- if (type != null) {
- list.add(type);
- }
- }
- }
- // remove any default bindings, in case of duplicate specification
- IMemoryRenderingType[] defaultBindings = getDefaultBindings();
- for (int i = 0; i < defaultBindings.length; i++) {
- list.remove(defaultBindings[i]);
- }
- fRenderingTypes = (IMemoryRenderingType[]) list.toArray(new IMemoryRenderingType[list.size()]);
- }
- return fRenderingTypes;
- }
-
- /**
- * Returns the default bindings specified by this contribution.
- *
- * @return the default bindings specified by this contribution
- */
- private IMemoryRenderingType[] getDefaultBindings() {
- if (fDefaultTypes == null) {
- String ids = fConfigurationElement.getAttribute(ATTR_DEFAULT_IDS);
- List list = new ArrayList();
- IMemoryRenderingManager manager = getManager();
- if (ids != null) {
- String[] strings = ids.split(","); //$NON-NLS-1$
- for (int i = 0; i < strings.length; i++) {
- String id = strings[i].trim();
- IMemoryRenderingType type = manager.getRenderingType(id);
- if (type != null) {
- list.add(type);
- }
- }
- }
- // the primary is also considered a default rendering
- String primaryId = getPrimaryId();
- if (primaryId != null) {
- IMemoryRenderingType type = manager.getRenderingType(primaryId);
- if (type != null) {
- list.add(type);
- }
- }
- fDefaultTypes = (IMemoryRenderingType[]) list.toArray(new IMemoryRenderingType[list.size()]);
- }
- return fDefaultTypes;
- }
-
- /**
- * Returns the primary id, or <code>null</code> if none.
- *
- * @return the primary id, or <code>null</code> if none
- */
- private String getPrimaryId() {
- return fConfigurationElement.getAttribute(ATTR_PRIMARY);
- }
-
- /**
- * Returns the provider for this binding or <code>null</code> of none.
- *
- * @return the provider for this binding or <code>null</code> of none
- */
- protected IMemoryRenderingBindingsProvider getProvider(IMemoryBlock memoryBlock) {
- if (isBound(memoryBlock))
- {
- if (fProvider == null) {
- String name = fConfigurationElement.getAttribute(ATTR_PROVIDER);
- if (name != null) {
- try {
- fProvider = (IMemoryRenderingBindingsProvider) fConfigurationElement.createExecutableExtension(ATTR_PROVIDER);
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
-
- if (fProvider != null)
- {
- fProvider.addListener(new IMemoryRenderingBindingsListener() {
- public void memoryRenderingBindingsChanged() {
- fireBindingsChanged();
- }});
- }
- }
- }
- return fProvider;
- }
-
- /**
- * Returns whether this binding is applies to the given memory block.
- *
- * @param block memory block
- * @return whether this binding is applies to the given memory block
- */
- private boolean isBound(IMemoryBlock block) {
- Expression expression = getExpression();
- if (expression != null) {
- IEvaluationContext context = new EvaluationContext(null, block);
- try {
- return expression.evaluate(context) == EvaluationResult.TRUE;
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- return false;
- }
- }
- return true;
- }
-
- /**
- * Validates this contribution.
- *
- * @exception CoreException if invalid
- */
- void validate() throws CoreException {
- if (fConfigurationElement.getAttribute(ATTR_PROVIDER) != null) {
- if (fConfigurationElement.getAttribute(ATTR_RENDERING_IDS) != null ||
- fConfigurationElement.getAttribute(ATTR_DEFAULT_IDS) != null ||
- fConfigurationElement.getAttribute(ATTR_PRIMARY) != null) {
- Status status = new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR,
- "<renderingBindings> element cannot specify other attributes when " + ATTR_PROVIDER + " is present", null); //$NON-NLS-1$ //$NON-NLS-2$
- throw new CoreException(status);
- }
- }
- }
-
- /**
- * Returns this binding's enablement expression, or <code>null</code> if none.
- *
- * @return enablement expression, or <code>null</code> if none
- */
- private Expression getExpression() {
- if (fExpression == null) {
- IConfigurationElement[] elements = fConfigurationElement.getChildren(ExpressionTagNames.ENABLEMENT);
- IConfigurationElement enablement = elements.length > 0 ? elements[0] : null;
- if (enablement != null) {
- try {
- fExpression = ExpressionConverter.getDefault().perform(enablement);
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- }
- return fExpression;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#getRenderingTypes(org.eclipse.debug.core.model.IMemoryBlock)
- */
- public IMemoryRenderingType[] getRenderingTypes(IMemoryBlock block) {
- if (isBound(block)) {
- IMemoryRenderingBindingsProvider provider = getProvider(block);
- if (provider == null) {
- if (fAllTypes == null) {
- IMemoryRenderingType[] defaultBindings = getDefaultBindings();
- IMemoryRenderingType[] bindings = getBindings();
- fAllTypes = new IMemoryRenderingType[defaultBindings.length + bindings.length];
- for (int i = 0; i < defaultBindings.length; i++) {
- fAllTypes[i] = defaultBindings[i];
- }
- for (int i = 0, j = defaultBindings.length; i < bindings.length; i++, j++) {
- fAllTypes[j] = bindings[i];
- }
- }
- return fAllTypes;
- }
- return provider.getRenderingTypes(block);
- }
- return EMPTY;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#getDefaultRenderingTypes(org.eclipse.debug.core.model.IMemoryBlock)
- */
- public IMemoryRenderingType[] getDefaultRenderingTypes(IMemoryBlock block) {
- if (isBound(block)) {
- IMemoryRenderingBindingsProvider provider = getProvider(block);
- if (provider == null) {
- return getDefaultBindings();
- }
- return provider.getDefaultRenderingTypes(block);
- }
- return EMPTY;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#getPrimaryRenderingType(org.eclipse.debug.core.model.IMemoryBlock)
- */
- public IMemoryRenderingType getPrimaryRenderingType(IMemoryBlock block) {
- if (isBound(block)) {
- IMemoryRenderingBindingsProvider provider = getProvider(block);
- if (provider == null) {
- String primaryId = getPrimaryId();
- if (primaryId != null) {
- return getManager().getRenderingType(primaryId);
- }
- } else {
- return provider.getPrimaryRenderingType(block);
- }
- }
- return null;
- }
-
- private IMemoryRenderingManager getManager() {
- return DebugUITools.getMemoryRenderingManager();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
deleted file mode 100644
index cacf33d08..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
+++ /dev/null
@@ -1,3304 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Teodor Madan (Freescale) - Bug 292360 - [Memory View] platform renderings do not implement correctly IMemoryRendering#getControl
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.memory.provisional;
-
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.Command;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.memory.IPersistableDebugElement;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IStatusMonitor;
-import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
-import org.eclipse.debug.internal.ui.views.memory.renderings.AbstractBaseTableRendering;
-import org.eclipse.debug.internal.ui.views.memory.renderings.AbstractVirtualContentTableModel;
-import org.eclipse.debug.internal.ui.views.memory.renderings.AsyncCopyTableRenderingAction;
-import org.eclipse.debug.internal.ui.views.memory.renderings.AsyncPrintTableRenderingAction;
-import org.eclipse.debug.internal.ui.views.memory.renderings.AsyncTableRenderingCellModifier;
-import org.eclipse.debug.internal.ui.views.memory.renderings.AsyncTableRenderingViewer;
-import org.eclipse.debug.internal.ui.views.memory.renderings.AsyncVirtualContentTableViewer;
-import org.eclipse.debug.internal.ui.views.memory.renderings.CopyTableRenderingToClipboardAction;
-import org.eclipse.debug.internal.ui.views.memory.renderings.FormatTableRenderingAction;
-import org.eclipse.debug.internal.ui.views.memory.renderings.FormatTableRenderingDialog;
-import org.eclipse.debug.internal.ui.views.memory.renderings.GoToAddressAction;
-import org.eclipse.debug.internal.ui.views.memory.renderings.GoToAddressComposite;
-import org.eclipse.debug.internal.ui.views.memory.renderings.IPresentationErrorListener;
-import org.eclipse.debug.internal.ui.views.memory.renderings.IVirtualContentListener;
-import org.eclipse.debug.internal.ui.views.memory.renderings.MemorySegment;
-import org.eclipse.debug.internal.ui.views.memory.renderings.PendingPropertyChanges;
-import org.eclipse.debug.internal.ui.views.memory.renderings.PrintTableRenderingAction;
-import org.eclipse.debug.internal.ui.views.memory.renderings.ReformatAction;
-import org.eclipse.debug.internal.ui.views.memory.renderings.ResetToBaseAddressAction;
-import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingContentDescriptor;
-import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingLine;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.memory.AbstractTableRendering;
-import org.eclipse.debug.ui.memory.IMemoryBlockTablePresentation;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
-import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
-import org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService;
-import org.eclipse.debug.ui.memory.IMemoryRenderingType;
-import org.eclipse.debug.ui.memory.IResettableMemoryRendering;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.TextViewer;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.IBasicPropertyConstants;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.jface.viewers.IFontProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseTrackAdapter;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.contexts.IContextService;
-import org.eclipse.ui.dialogs.PropertyDialogAction;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * Abstract implementation of a table rendering.
- * <p>
- * Clients should subclass from this class if they wish to provide a
- * table rendering.
- * </p>
- * <p>
- *
- * The label of the rendering is constructed by retrieving the expression from
- * <code>IMemoryBlockExtension</code>. For IMemoryBlock, the label is constructed
- * using the memory block's start address.
- *
- * This rendering manages the change states of its memory bytes if the memory
- * block does not opt to manage the change states. For IMemoryBlockExtension, if
- * the memory block returns false when #supportsChangeManagement() is called, this
- * rendering will calculate the change state for each byte when its content is updated.
- * Clients may manages the change states of its memory block by returning true when
- * #supportsChangeManagement() is called. This will cause this rendering to stop
- * calculating the change states of the memory block. Instead it would rely on the
- * attributes returned in the MemoryByte array to determine if a byte has changed.
- * For IMemoryBlock, this rendering will manage the change states its content.
- *
- * When firing change event, be aware of the following:
- * - whenever a change event is fired, the content provider for Memory View
- * view checks to see if memory has actually changed.
- * - If memory has actually changed, a refresh will commence. Changes to the memory block
- * will be computed and will be shown with the delta icons.
- * - If memory has not changed, content will not be refreshed. However, previous delta information
- * will be erased. The screen will be refreshed to show that no memory has been changed. (All
- * delta icons will be removed.)
- *
- * Please note that these APIs will be called multiple times by the Memory View.
- * To improve performance, debug adapters need to cache the content of its memory block and only
- * retrieve updated data when necessary.
- * </p>
-
- * @since 3.2
- */
-public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRendering implements IPropertyChangeListener, IResettableMemoryRendering {
-
- /**
- * Property identifier for the selected address in a table rendering
- * This property is used for synchronization between renderings.
- */
- public static final String PROPERTY_SELECTED_ADDRESS = AbstractTableRendering.PROPERTY_SELECTED_ADDRESS;
-
- /**
- * Property identifier for the column size in a table rendering
- * This property is used for synchronization between renderings.
- */
- public static final String PROPERTY_COL_SIZE = AbstractTableRendering.PROPERTY_COL_SIZE;
-
- /**
- * Property identifier for the top row address in a table rendering.
- * This property is used for synchronization between renderings.
- */
- public static final String PROPERTY_TOP_ADDRESS = AbstractTableRendering.PROPERTY_TOP_ADDRESS;
-
- private static final String ID_ASYNC_TABLE_RENDERING_CONTEXT = "org.eclipse.debug.ui.memory.abstractasynctablerendering"; //$NON-NLS-1$
- private static final String ID_GO_TO_ADDRESS_COMMAND = "org.eclipse.debug.ui.command.gotoaddress"; //$NON-NLS-1$
- private static final String ID_NEXT_PAGE_COMMAND = "org.eclipse.debug.ui.command.nextpage"; //$NON-NLS-1$
- private static final String ID_PREV_PAGE_COMMAND = "org.eclipse.debug.ui.command.prevpage"; //$NON-NLS-1$
-
- /**
- * Property identifier for the row size in a table rendering
- * This property is used for synchronization between renderings.
- */
- public static final String PROPERTY_ROW_SIZE = AbstractTableRendering.PROPERTY_ROW_SIZE;
-
- private static final int DEFAULT_BUFFER_THRESHOLD = 1;
-
- private boolean fActivated = false;
-
-// TODO: review use of MemorySegment, need to be careful to ensure flexible hierarchy
-
- private class ToggleAddressColumnAction extends Action {
-
- public ToggleAddressColumnAction() {
- super();
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID
- + ".ShowAddressColumnAction_context"); //$NON-NLS-1$
- updateActionLabel();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- fIsShowAddressColumn = !fIsShowAddressColumn;
- if (!fIsShowAddressColumn)
- {
- fTableViewer.getTable().getColumn(0).setWidth(0);
- }
- else
- {
- fTableViewer.getTable().getColumn(0).pack();
- }
- updateActionLabel();
- }
-
- /**
- *
- */
- private void updateActionLabel() {
- if (fIsShowAddressColumn) {
- setText(DebugUIMessages.ShowAddressColumnAction_0);
- } else {
- setText(DebugUIMessages.ShowAddressColumnAction_1);
- }
- }
- }
-
- private class NextPageAction extends Action
- {
- private NextPageAction()
- {
- super();
- setText(DebugUIMessages.AbstractTableRendering_4);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".NextPageAction_context"); //$NON-NLS-1$
- }
-
- public void run() {
- BigInteger address = fContentDescriptor.getLoadAddress();
- address = address.add(BigInteger.valueOf(getPageSizeInUnits()));
- handlePageStartAddressChanged(address);
- }
- }
-
- private class PrevPageAction extends Action
- {
- private PrevPageAction()
- {
- super();
- setText(DebugUIMessages.AbstractTableRendering_6);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".PrevPageAction_context"); //$NON-NLS-1$
- }
-
- public void run() {
- BigInteger address = fContentDescriptor.getLoadAddress();
- address = address.subtract(BigInteger.valueOf(getPageSizeInUnits()));
- handlePageStartAddressChanged(address);
- }
- }
-
- private class RenderingGoToAddressAction extends GoToAddressAction
- {
- public RenderingGoToAddressAction(AbstractBaseTableRendering rendering) {
- super(rendering);
- }
-
- public void run() {
- showGoToAddressComposite();
- }
- }
-
- private class SwitchPageJob extends UIJob {
- private Object fLock = new Object();
- private boolean fShowMessagePage = false;
- private String fMessage = IInternalDebugCoreConstants.EMPTY_STRING;
-
- private SwitchPageJob() {
- super("SwitchPageJob");//$NON-NLS-1$
- setSystem(true);
- }
-
- private void setShowMessagePage(boolean showMsg) {
- synchronized(fLock)
- {
- fShowMessagePage = showMsg;
- }
- }
-
- private void setMessage(String message) {
- synchronized(fLock)
- {
- fMessage = message;
- }
- }
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
-
- if (fPageBook.isDisposed())
- return Status.OK_STATUS;
-
- String msgToShow = null;
- boolean showMsgPage = false;
- synchronized (fLock) {
- msgToShow = fMessage;
- showMsgPage = fShowMessagePage;
- }
-
- if (showMsgPage) {
- StyledText styleText = null;
- fShowMessage = true;
-
- styleText = fTextViewer.getTextWidget();
-
- if (styleText != null)
- styleText.setText(msgToShow);
- fPageBook.showPage(fTextViewer.getControl());
- } else {
- fShowMessage = false;
- fPageBook.showPage(fTableViewer.getControl().getParent());
- }
- return Status.OK_STATUS;
- }
- }
-
-
- private class SerialByObjectRule implements ISchedulingRule
- {
- private Object fObject = null;
-
- public SerialByObjectRule(Object lock) {
- fObject = lock;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.ISchedulingRule#contains(org.eclipse.core.runtime.jobs.ISchedulingRule)
- */
- public boolean contains(ISchedulingRule rule) {
- return rule == this;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.ISchedulingRule#isConflicting(org.eclipse.core.runtime.jobs.ISchedulingRule)
- */
- public boolean isConflicting(ISchedulingRule rule) {
- if (rule instanceof SerialByObjectRule) {
- SerialByObjectRule rRule = (SerialByObjectRule) rule;
- return fObject == rRule.fObject;
- }
- return false;
- }
- }
-
- private PageBook fPageBook;
- private AsyncTableRenderingViewer fTableViewer;
- private TextViewer fTextViewer;
- private Shell fToolTipShell;
- private MemoryViewPresentationContext fPresentationContext;
- private int fAddressableSize;
- private TableRenderingContentDescriptor fContentDescriptor;
- private int fBytePerLine;
- private int fColumnSize;
- private boolean fShowMessage = false;
- private String fLabel;
- private IWorkbenchAdapter fWorkbenchAdapter;
- private int fPageSize;
- private int fPreBufferSize = -1;
- private int fPostBufferSize = -1;
- private SashForm fSashForm;
- private GoToAddressComposite fGoToAddressComposite;
-
- // actions
- private GoToAddressAction fGoToAddressAction;
- private PrintTableRenderingAction fPrintViewTabAction;
- private CopyTableRenderingToClipboardAction fCopyToClipboardAction;
- private FormatTableRenderingAction fFormatRenderingAction;
- private ReformatAction fReformatAction;
- private ToggleAddressColumnAction fToggleAddressColumnAction;
- private ResetToBaseAddressAction fResetMemoryBlockAction;
- private PropertyDialogAction fPropertiesDialogAction;
- private NextPageAction fNextAction;
- private PrevPageAction fPrevAction;
-
- private ArrayList fContext = new ArrayList();
- private AbstractHandler fGoToAddressHandler;
-
- private AbstractHandler fNextPageHandler;
- private AbstractHandler fPrevPageHandler;
-
- private boolean fIsCreated = false;
- private boolean fIsDisposed = false;
- private boolean fIsShowAddressColumn = true;
-
- private SwitchPageJob fSwitchPageJob = new SwitchPageJob();
- private boolean fError = false;
-
- private PendingPropertyChanges fPendingSyncProperties;
-
- // list of menu listeners for popupMenuMgr.
- private ArrayList fMenuListeners;
- private MenuManager fMenuMgr;
-
- private ISchedulingRule serialByRenderingRule = new SerialByObjectRule(this);
-
- /**
- * Identifier for an empty group preceding all context menu actions
- * (value <code>"popUpBegin"</code>).
- */
- public static final String EMPTY_MEMORY_GROUP = "popUpBegin"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group following navigation actions in the rendering
- * (value <code>navigationGroup</code>).
- */
- public static final String EMPTY_NAVIGATION_GROUP = "navigationGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group following actions that are only applicable in
- * non-auto loading mode
- * (value <code>nonAutoLoadGroup</code>).
- */
- public static final String EMPTY_NON_AUTO_LOAD_GROUP = "nonAutoLoadGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group following properties actions
- * (value <code>propertyGroup</code>).
- */
- public static final String EMPTY_PROPERTY_GROUP = "propertyGroup"; //$NON-NLS-1$
-
- private ISelectionChangedListener fViewerSelectionChangedListener = new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateSyncTopAddress(getTopVisibleAddress());
- updateSyncSelectedAddress(getSelectedAddress());
- }
- };
-
- private SelectionAdapter fScrollBarSelectionListener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateSyncTopAddress(getTopVisibleAddress());
- }
- };
-
- private IModelChangedListener fModelChangedListener = new IModelChangedListener() {
- public void modelChanged(IModelDelta delta, IModelProxy proxy) {
- if (delta.getElement() == getMemoryBlock())
- {
- showTable();
- updateRenderingLabel(isVisible());
- }
- }};
-
- private IVirtualContentListener fViewerListener = new IVirtualContentListener() {
-
- private int startThreshold;
- private int endThreshold;
-
- public void handledAtBufferStart() {
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- if (isDynamicLoad() && startThreshold != 0)
- {
- BigInteger address = getTopVisibleAddress();
- if (address != null && !isAtTopLimit())
- reloadTable(address);
- }
- }
- }
-
- public void handleAtBufferEnd() {
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- if (isDynamicLoad() && endThreshold != 0)
- {
- BigInteger address = getTopVisibleAddress();
- if (address != null && !isAtBottomLimit())
- reloadTable(address);
- }
- }
- }
-
- public int getThreshold(int bufferEndOrStart) {
-
- int threshold = DEFAULT_BUFFER_THRESHOLD;
-
- if (bufferEndOrStart == IVirtualContentListener.BUFFER_START)
- {
- if (threshold > getPreBufferSize())
- {
- threshold = getPreBufferSize();
- }
- }
- else
- {
- if (threshold > getPostBufferSize())
- {
- threshold = getPostBufferSize();
- }
- }
-
- if (bufferEndOrStart == IVirtualContentListener.BUFFER_START)
- startThreshold = threshold;
- else
- endThreshold = threshold;
-
- return threshold;
- }};
-
- private IPresentationErrorListener fPresentationErrorListener = new IPresentationErrorListener() {
- public void handlePresentationFailure(IStatusMonitor monitor, IStatus status) {
- showMessage(status.getMessage());
- }};
-
-
- /**
- * Constructs a new table rendering of the specified type.
- *
- * @param renderingId memory rendering type identifier
- */
- public AbstractAsyncTableRendering(String renderingId) {
- super(renderingId);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IResettableMemoryRendering#resetRendering()
- */
- public void resetRendering() throws DebugException {
- BigInteger baseAddress = fContentDescriptor.getContentBaseAddress();
-
- fTableViewer.setSelection(baseAddress);
- reloadTable(baseAddress);
- fTableViewer.setTopIndex(baseAddress);
- if (!isDynamicLoad())
- {
- updateSyncPageStartAddress(baseAddress);
- }
-
- updateSyncSelectedAddress(baseAddress);
- updateSyncTopAddress(baseAddress);
- }
-
- public Control createControl(Composite parent) {
-
- fPageBook = new PageBook(parent, SWT.NONE);
- createMessagePage(fPageBook);
- createTableViewer(fPageBook);
- addListeners();
-
- return fPageBook;
- }
-
- /**
- * Create the error page of this rendering
- * @param parent
- */
- private void createMessagePage(Composite parent)
- {
- if (fTextViewer == null)
- {
- fTextViewer = new TextViewer(parent, SWT.WRAP);
- fTextViewer.setDocument(new Document());
- StyledText styleText = fTextViewer.getTextWidget();
- styleText.setEditable(false);
- styleText.setEnabled(false);
- }
- }
-
- /**
- * @param parent
- */
- private void createTableViewer(final Composite parent)
- {
- StringBuffer buffer = new StringBuffer();
- IMemoryRenderingType type = DebugUITools.getMemoryRenderingManager().getRenderingType(getRenderingId());
- buffer.append(type.getLabel());
- buffer.append(": "); //$NON-NLS-1$
- buffer.append(DebugUIMessages.AbstractAsyncTableRendering_2);
-
- Job job = new Job(buffer.toString()) {
-
- protected IStatus run(IProgressMonitor monitor) {
-
- // gather information from memory block
- initAddressableSize();
- final BigInteger topVisibleAddress = getInitialTopVisibleAddress();
- BigInteger mbBaseAddress = null;
- try {
- mbBaseAddress = getMemoryBlockBaseAddress();
- } catch (DebugException e) {
- fError = true;
- showMessage(e.getMessage());
- }
-
- // if it takes too long to get the base address, and user has canceled
- // remove this rendering.
- if (monitor.isCanceled())
- {
- getMemoryRenderingContainer().removeMemoryRendering(AbstractAsyncTableRendering.this);
- return Status.CANCEL_STATUS;
- }
-
- final BigInteger finalMbBaseAddress = mbBaseAddress;
- final BigInteger initialSelectedAddress = getInitialSelectedAddress();
-
- if (monitor.isCanceled())
- {
- getMemoryRenderingContainer().removeMemoryRendering(AbstractAsyncTableRendering.this);
- return Status.CANCEL_STATUS;
- }
-
- createContentDescriptor(topVisibleAddress);
-
- // if it takes too long to get other information, and user has canceled
- // remove this rendering.
- if (monitor.isCanceled())
- {
- getMemoryRenderingContainer().removeMemoryRendering(AbstractAsyncTableRendering.this);
- return Status.CANCEL_STATUS;
- }
-
- // batch update on UI thread
- UIJob uiJob = new UIJob("Create Table Viewer UI Job"){ //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor progressMonitor) {
-
- if (fPageBook.isDisposed())
- return Status.OK_STATUS;
-
- fSashForm = new SashForm(parent, SWT.VERTICAL);
- fTableViewer = new AsyncTableRenderingViewer(AbstractAsyncTableRendering.this, fSashForm, SWT.VIRTUAL | SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.HIDE_SELECTION | SWT.BORDER);
-
- GridData data = new GridData(GridData.FILL_BOTH);
- fTableViewer.getControl().setLayoutData(data);
-
- createGoToAddressComposite(fSashForm);
- hideGotoAddressComposite();
-
- IMemoryRenderingSite site = getMemoryRenderingContainer().getMemoryRenderingSite();
- IMemoryRenderingContainer container = getMemoryRenderingContainer();
- fPresentationContext = new MemoryViewPresentationContext(site, container, AbstractAsyncTableRendering.this);
- fTableViewer.setContext(fPresentationContext);
-
- // must call this after the context is created as the information is stored in the context
- getDynamicLoadFromPreference();
- getPageSizeFromPreference();
-
- int numberOfLines = getNumLinesToLoad();
- fContentDescriptor.setNumLines(numberOfLines);
-
- if (numberOfLines == 0)
- {
- // if the table viewer is not initialized yet, add listener
- // and load table when we can get the height of the table
- fTableViewer.getTable().addPaintListener(new PaintListener() {
- public void paintControl(PaintEvent e) {
- fTableViewer.getTable().removePaintListener(this);
- fContentDescriptor.setNumLines(getNumLinesToLoad());
- refresh();
- }});
- }
-
- BigInteger baseAddress = finalMbBaseAddress;
- if (baseAddress == null)
- baseAddress = BigInteger.ZERO;
-
- if (!(getMemoryBlock() instanceof IMemoryBlockExtension) || !isDynamicLoad())
- {
- // If not extended memory block, do not create any buffer
- // no scrolling
- fContentDescriptor.setPreBuffer(0);
- fContentDescriptor.setPostBuffer(0);
- }
-
- setupInitialFormat();
- fTableViewer.setCellModifier(newInternalCellModifier());
- fTableViewer.getTable().setHeaderVisible(true);
- fTableViewer.getTable().setLinesVisible(true);
- fTableViewer.addPresentationErrorListener(fPresentationErrorListener);
- fTableViewer.setInput(getMemoryBlock());
- fTableViewer.resizeColumnsToPreferredSize();
- fTableViewer.setTopIndex(topVisibleAddress);
-
- fTableViewer.setSelection(initialSelectedAddress);
-
- // SET UP FONT
- // set to a non-proportional font
- fTableViewer.getTable().setFont(JFaceResources.getFont(IInternalDebugUIConstants.FONT_NAME));
-
- if (!fError)
- showTable();
-
- fTableViewer.addVirtualContentListener(fViewerListener);
-
- // create context menu
- // create pop up menu for the rendering
- createActions();
- IMenuListener menuListener = new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- fillContextMenu(mgr);
- }
- };
- createPopupMenu(fTableViewer.getControl(), menuListener);
- createPopupMenu(fTableViewer.getCursor(), menuListener);
-
- fTableViewer.addSelectionChangedListener(fViewerSelectionChangedListener);
- fTableViewer.getTable().getVerticalBar().addSelectionListener(fScrollBarSelectionListener);
-
- // add resize listener to figure out number of visible lines
- // so that the viewer get refreshed with the correct number of lines on the
- // next refresh request
- fTableViewer.getTable().addListener(SWT.Resize, new Listener() {
- public void handleEvent(Event event) {
- if (!fTableViewer.getTable().isDisposed())
- fContentDescriptor.setNumLines(getNumLinesToLoad());
- }});
-
- createToolTip();
-
- if (isActivated())
- {
- activatePageActions();
- }
-
- // now the rendering is successfully created
- fIsCreated = true;
-
- return Status.OK_STATUS;
- }};
- uiJob.setSystem(true);
- uiJob.schedule();
-
- return Status.OK_STATUS;
-
- }};
-
- job.schedule();
- }
-
- /**
- * Create popup menu for this rendering
- * @param control - control to create the popup menu for
- * @param menuListener - listener to notify when popup menu is about to show
- */
- private void createPopupMenu(Control control, IMenuListener menuListener)
- {
- IMemoryRenderingContainer container = getMemoryRenderingContainer();
- if (fMenuMgr == null)
- {
- fMenuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
- fMenuMgr.setRemoveAllWhenShown(true);
- IMemoryRenderingSite site = container.getMemoryRenderingSite();
- String menuId = container.getId();
-
- ISelectionProvider selProvider = site.getSite().getSelectionProvider();
-
- addMenuListener(menuListener);
-
- site.getSite().registerContextMenu(menuId, fMenuMgr, selProvider);
- }
-
- addMenuListener(menuListener);
-
- Menu popupMenu = fMenuMgr.createContextMenu(control);
- control.setMenu(popupMenu);
- }
-
-
- private void addMenuListener(IMenuListener menuListener) {
- if (fMenuListeners == null)
- fMenuListeners = new ArrayList();
-
- if (!fMenuListeners.contains(menuListener))
- {
- fMenuMgr.addMenuListener(menuListener);
- fMenuListeners.add(menuListener);
- }
- }
-
- private BigInteger getInitialSelectedAddress() {
- // figure out selected address
- BigInteger selectedAddress = (BigInteger) getSynchronizedProperty(AbstractAsyncTableRendering.PROPERTY_SELECTED_ADDRESS);
- if (selectedAddress == null)
- {
- if (getMemoryBlock() instanceof IMemoryBlockExtension) {
- try {
- selectedAddress = ((IMemoryBlockExtension) getMemoryBlock()).getBigBaseAddress();
- } catch (DebugException e) {
- selectedAddress = BigInteger.ZERO;
- }
-
- if (selectedAddress == null) {
- selectedAddress =BigInteger.ZERO;
- }
-
- } else {
- long address = getMemoryBlock().getStartAddress();
- selectedAddress = BigInteger.valueOf(address);
- }
- }
- return selectedAddress;
- }
-
- private void addListeners()
- {
- DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
- addRenderingToSyncService();
- JFaceResources.getFontRegistry().addListener(this);
- }
-
- private void removeListeners()
- {
- DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
- removeRenderingFromSyncService();
- JFaceResources.getFontRegistry().removeListener(this);
-
- if (fMenuListeners != null)
- {
- Iterator iter = fMenuListeners.iterator();
- while (iter.hasNext())
- {
- fMenuMgr.removeMenuListener((IMenuListener)iter.next());
- }
-
- fMenuListeners.clear();
- }
- }
-
- private void addRenderingToSyncService()
- {
- IMemoryRenderingSynchronizationService syncService = getMemoryRenderingContainer().getMemoryRenderingSite().getSynchronizationService();
-
- if (syncService == null)
- return;
-
- syncService.addPropertyChangeListener(this, null);
- }
-
- private void removeRenderingFromSyncService()
- {
- IMemoryRenderingSynchronizationService syncService = getMemoryRenderingContainer().getMemoryRenderingSite().getSynchronizationService();
-
- if (syncService == null)
- return;
-
- syncService.removePropertyChangeListener(this);
- }
-
- private void initAddressableSize()
- {
- // set up addressable size and figure out number of bytes required per line
- fAddressableSize = -1;
- try {
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- fAddressableSize = ((IMemoryBlockExtension)getMemoryBlock()).getAddressableSize();
- else
- fAddressableSize = 1;
- } catch (DebugException e1) {
- DebugUIPlugin.log(e1);
- // log error and default to 1
- fAddressableSize = 1;
- return;
-
- }
- if (fAddressableSize < 1)
- {
- DebugUIPlugin.logErrorMessage("Invalid addressable size"); //$NON-NLS-1$
- fAddressableSize = 1;
- }
- }
-
- private BigInteger getInitialTopVisibleAddress() {
- BigInteger topVisibleAddress = (BigInteger) getSynchronizedProperty(AbstractAsyncTableRendering.PROPERTY_TOP_ADDRESS);
- if (topVisibleAddress == null)
- {
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- try {
- topVisibleAddress = ((IMemoryBlockExtension)getMemoryBlock()).getBigBaseAddress();
- } catch (DebugException e1) {
- topVisibleAddress = new BigInteger("0"); //$NON-NLS-1$
- }
- }
- else
- {
- topVisibleAddress = BigInteger.valueOf(getMemoryBlock().getStartAddress());
- }
- }
- return topVisibleAddress;
- }
-
- private void setupInitialFormat() {
-
- boolean validated = validateInitialFormat();
-
- if (!validated)
- {
- // pop up dialog to ask user for default values
- StringBuffer msgBuffer = new StringBuffer(DebugUIMessages.AbstractTableRendering_20);
- msgBuffer.append(" "); //$NON-NLS-1$
- msgBuffer.append(this.getLabel());
- msgBuffer.append("\n\n"); //$NON-NLS-1$
- msgBuffer.append(DebugUIMessages.AbstractTableRendering_16);
- msgBuffer.append("\n"); //$NON-NLS-1$
- msgBuffer.append(DebugUIMessages.AbstractTableRendering_18);
- msgBuffer.append("\n\n"); //$NON-NLS-1$
-
- int bytePerLine = fBytePerLine;
- int columnSize = fColumnSize;
-
- // initialize this value to populate the dialog properly
- fBytePerLine = getDefaultRowSize() / getAddressableSize();
- fColumnSize = getDefaultColumnSize() / getAddressableSize();
-
- FormatTableRenderingDialog dialog = new FormatTableRenderingDialog(this, DebugUIPlugin.getShell());
- dialog.openError(msgBuffer.toString());
-
- // restore to original value before formatting
- fBytePerLine = bytePerLine;
- fColumnSize = columnSize;
-
- bytePerLine = dialog.getRowSize() * getAddressableSize();
- columnSize = dialog.getColumnSize() * getAddressableSize();
-
- format(bytePerLine, columnSize);
- }
- else
- {
- // Row size is stored as number of addressable units in preference store
- int bytePerLine = getDefaultRowSize();
- // column size is now stored as number of addressable units
- int columnSize = getDefaultColumnSize();
-
- // format memory block with specified "bytesPerLine" and "columnSize"
- boolean ok = format(bytePerLine, columnSize);
-
- if (!ok)
- {
- // this is to ensure that the rest of the rendering can be created
- // and we can recover from a format error
- format(bytePerLine, bytePerLine);
- }
- }
- }
-
- private boolean validateInitialFormat()
- {
- int rowSize = getDefaultRowSize();
- int columnSize = getDefaultColumnSize();
-
- if (rowSize < columnSize || rowSize % columnSize != 0 || rowSize == 0 || columnSize == 0)
- {
- return false;
- }
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#getControl()
- */
- public Control getControl() {
- return fPageBook;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if (!fIsCreated)
- return;
-
- // if memory view table font has changed
- if (event.getProperty().equals(IInternalDebugUIConstants.FONT_NAME))
- {
- if (!fIsDisposed)
- {
- Font memoryViewFont = JFaceResources.getFont(IInternalDebugUIConstants.FONT_NAME);
- setFont(memoryViewFont);
- }
- return;
- }
-
- Object evtSrc = event.getSource();
-
- // always update page size, only refresh if the table is visible
- if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE)) {
- getPageSizeFromPreference();
- }
- if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PRE_BUFFER_SIZE))
- {
- getPreBufferSizeFromPreference();
- fContentDescriptor.setPreBuffer(getPreBufferSize());
- }
- if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_POST_BUFFER_SIZE))
- {
- getPostBufferSizeFromPreference();
- fContentDescriptor.setPostBuffer(getPostBufferSize());
- }
-
- // do not handle event if the rendering is displaying an error
- // or if it's not visible
- if (isDisplayingError() || !isVisible())
- {
- handlePropertiesChangeWhenHidden(event);
- return;
- }
-
-
- if (event.getProperty().equals(IDebugUIConstants.PREF_PADDED_STR) ||
- event.getProperty().equals(IDebugUIConstants.PREF_CHANGED_DEBUG_ELEMENT_COLOR) ||
- event.getProperty().equals(IDebugUIConstants.PREF_MEMORY_HISTORY_KNOWN_COLOR) ||
- event.getProperty().equals(IDebugUIConstants.PREF_MEMORY_HISTORY_UNKNOWN_COLOR))
- {
- if (!fIsDisposed)
- {
- fTableViewer.refresh(false);
- }
- return;
- }
-
- if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PRE_BUFFER_SIZE) ||
- event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_POST_BUFFER_SIZE))
- {
- if (!fIsDisposed)
- {
- fTableViewer.refresh(true);
- }
- return;
- }
-
- if (event.getProperty().equals(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM)) {
- handleDyanicLoadChanged();
- return;
- }
-
- if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE)) {
- if (!isDynamicLoad())
- {
- int pageSize = DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE);
- handlePageSizeChanged(pageSize);
- }
- return;
- }
-
- if (evtSrc == this)
- return;
-
- if (evtSrc instanceof IMemoryRendering)
- {
- IMemoryRendering rendering = (IMemoryRendering)evtSrc;
- IMemoryBlock memoryBlock = rendering.getMemoryBlock();
-
- // do not handle event from renderings displaying other memory blocks
- if (memoryBlock != getMemoryBlock())
- return;
- }
-
- String propertyName = event.getProperty();
- Object value = event.getNewValue();
-
- if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_SELECTED_ADDRESS) && value instanceof BigInteger)
- {
- selectedAddressChanged((BigInteger)value);
- }
- else if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_COL_SIZE) && value instanceof Integer)
- {
- columnSizeChanged(((Integer)value).intValue());
- }
- else if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_ROW_SIZE) && value instanceof Integer)
- {
- rowSizeChanged(((Integer)value).intValue());
- }
- else if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_TOP_ADDRESS) && value instanceof BigInteger)
- {
- topVisibleAddressChanged((BigInteger)value);
- }
- else if (propertyName.equals(IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS) && value instanceof BigInteger)
- {
- handlePageStartAddressChanged((BigInteger)value);
- }
- }
-
- /**
- *
- */
- private void handlePageSizeChanged(int pageSize) {
- fPageSize = pageSize;
- // only refresh if in non-auto-load mode
- fContentDescriptor.setNumLines(pageSize);
- refresh();
- }
-
- private void handlePropertiesChangeWhenHidden(PropertyChangeEvent event)
- {
- if (fPendingSyncProperties == null)
- return;
-
- String propertyName = event.getProperty();
- Object value = event.getNewValue();
-
- if (event.getSource() instanceof IMemoryRendering)
- {
- IMemoryRendering rendering = (IMemoryRendering)event.getSource();
- if (rendering == this || rendering.getMemoryBlock() != getMemoryBlock())
- {
- return;
- }
- }
-
- if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_COL_SIZE) && value instanceof Integer)
- {
- fPendingSyncProperties.setColumnSize(((Integer)value).intValue());
- }
- else if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_ROW_SIZE) && value instanceof Integer)
- {
- fPendingSyncProperties.setRowSize(((Integer)value).intValue());
- }
-
- else if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_SELECTED_ADDRESS) && value instanceof BigInteger)
- {
- fPendingSyncProperties.setSelectedAddress((BigInteger)value);
- }
- else if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_TOP_ADDRESS) && value instanceof BigInteger)
- {
- fPendingSyncProperties.setTopVisibleAddress((BigInteger)value);
- }
- else if (propertyName.equals(IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS) && value instanceof BigInteger)
- {
- fPendingSyncProperties.setPageStartAddress((BigInteger)value);
- }
- else if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE)) {
- int pageSize = DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE);
- fPendingSyncProperties.setPageSize(pageSize);
- }
- }
-
- private void topVisibleAddressChanged(final BigInteger address)
- {
- final Runnable runnable = new Runnable() {
- public void run() {
- if (fTableViewer.getTable().isDisposed())
- return;
-
- doTopVisibleAddressChanged(address);
- }};
- runOnUIThread(runnable);
- }
-
- /**
- * @param address
- */
- private void doTopVisibleAddressChanged(final BigInteger address) {
- if (fIsDisposed)
- return;
-
- if (!isDynamicLoad())
- {
- fTableViewer.setTopIndex(address);
- fTableViewer.topIndexChanged();
- return;
- }
-
- if (!isAtTopBuffer(address) && !isAtBottomBuffer(address))
- {
- fTableViewer.setTopIndex(address);
- fTableViewer.topIndexChanged();
- }
- else
- {
- reloadTable(address);
- }
- }
-
- private boolean isAtBottomBuffer(BigInteger address)
- {
- int idx = fTableViewer.indexOf(address);
- if (idx < 0)
- return true;
-
- int bottomIdx = idx + getNumberOfVisibleLines();
- int elementsCnt = fTableViewer.getVirtualContentModel().getElements().length;
- int numLinesLeft = elementsCnt - bottomIdx;
-
- if (numLinesLeft < fViewerListener.getThreshold(IVirtualContentListener.BUFFER_END))
- return true;
-
- return false;
- }
-
- private boolean isAtTopBuffer(BigInteger address)
- {
- int topIdx = fTableViewer.indexOf(address);
- if (topIdx < fViewerListener.getThreshold(IVirtualContentListener.BUFFER_START))
- return true;
-
- return false;
- }
-
- private void runOnUIThread(final Runnable runnable)
- {
- if (Display.getCurrent() != null)
- {
- runnable.run();
- }
- else
- {
- UIJob job = new UIJob("Async Table Rendering UI Job"){ //$NON-NLS-1$
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- runnable.run();
- return Status.OK_STATUS;
- }};
- job.setSystem(true);
- job.schedule();
- }
- }
-
- private void selectedAddressChanged(final BigInteger address)
- {
- Runnable runnable = new Runnable() {
-
- public void run() {
-
- if (fTableViewer.getTable().isDisposed())
- return;
-
- // call this to make the table viewer to reload when needed
- int i = fTableViewer.indexOf(address);
- if (i < 0)
- {
- // the model may not have been populated yet,
- // try to predict if the address will be in the buffer
- boolean contained = isAddressBufferred(address);
- if (!contained)
- topVisibleAddressChanged(address);
- }
- fTableViewer.setSelection(address);
- }
- };
-
- runOnUIThread(runnable);
- }
-
- private boolean isAddressBufferred(BigInteger address)
- {
- // figure out the buffer top address
- BigInteger loadAddress = fContentDescriptor.getLoadAddress();
- loadAddress = MemoryViewUtil.alignToBoundary(loadAddress, getAddressableUnitPerLine());
- int unitPerLine = getAddressableUnitPerLine();
-
- loadAddress = loadAddress.subtract(BigInteger.valueOf(getPreBufferSize() * unitPerLine));
-
- // figure out the buffer end address
- int numLines = fContentDescriptor.getNumLines();
- BigInteger bufferEnd = loadAddress.add(BigInteger.valueOf(fContentDescriptor.getPostBuffer()*unitPerLine));
- bufferEnd = bufferEnd.add(BigInteger.valueOf(numLines*unitPerLine + unitPerLine));
-
- // see if the address is contained based on current content descriptor
- if (address.compareTo(loadAddress) >= 0 && address.compareTo(bufferEnd) <= 0)
- return true;
-
- return false;
- }
-
- private void setFont(Font font)
- {
- // set font
- fTableViewer.getTable().setFont(font);
- fTableViewer.getCursor().setFont(font);
- }
-
- private int getDefaultColumnSize() {
-
- // default to global preference store
- IPreferenceStore prefStore = DebugUITools.getPreferenceStore();
- int columnSize = prefStore.getInt(IDebugPreferenceConstants.PREF_COLUMN_SIZE);
- // actual column size is number of addressable units * size of the addressable unit
- columnSize = columnSize * getAddressableSize();
-
- // check synchronized col size
- Integer colSize = (Integer)getSynchronizedProperty(AbstractAsyncTableRendering.PROPERTY_COL_SIZE);
- if (colSize != null)
- {
- // column size is stored as actual number of bytes in synchronizer
- int syncColSize = colSize.intValue();
- if (syncColSize > 0)
- {
- columnSize = syncColSize;
- }
- }
- else
- {
- IPersistableDebugElement elmt = (IPersistableDebugElement)getMemoryBlock().getAdapter(IPersistableDebugElement.class);
- int defaultColSize = -1;
-
- if (elmt != null)
- {
- if (elmt.supportsProperty(this, IDebugPreferenceConstants.PREF_COL_SIZE_BY_MODEL))
- defaultColSize = getDefaultFromPersistableElement(IDebugPreferenceConstants.PREF_COL_SIZE_BY_MODEL);
- }
-
- if (defaultColSize <= 0)
- {
- // if not provided, get default by model
- defaultColSize = getDefaultColumnSizeByModel(getMemoryBlock().getModelIdentifier());
- }
-
- if (defaultColSize > 0)
- columnSize = defaultColSize * getAddressableSize();
- }
- return columnSize;
- }
-
- private int getDefaultRowSize() {
-
- int rowSize = DebugUITools.getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_ROW_SIZE);
- int bytePerLine = rowSize * getAddressableSize();
-
- // check synchronized row size
- Integer size = (Integer)getSynchronizedProperty(AbstractAsyncTableRendering.PROPERTY_ROW_SIZE);
- if (size != null)
- {
- // row size is stored as actual number of bytes in synchronizer
- int syncRowSize = size.intValue();
- if (syncRowSize > 0)
- {
- bytePerLine = syncRowSize;
- }
- }
- else
- {
- int defaultRowSize = -1;
- IPersistableDebugElement elmt = (IPersistableDebugElement)getMemoryBlock().getAdapter(IPersistableDebugElement.class);
- if (elmt != null)
- {
- if (elmt.supportsProperty(this, IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL))
- {
- defaultRowSize = getDefaultFromPersistableElement(IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL);
- return defaultRowSize * getAddressableSize();
- }
- }
-
- if (defaultRowSize <= 0)
- // no synchronized property, ask preference store by id
- defaultRowSize = getDefaultRowSizeByModel(getMemoryBlock().getModelIdentifier());
-
- if (defaultRowSize > 0)
- bytePerLine = defaultRowSize * getAddressableSize();
- }
- return bytePerLine;
- }
-
- /**
- * Returns the addressable size of this rendering's memory block in bytes.
- *
- * @return the addressable size of this rendering's memory block in bytes
- */
- public int getAddressableSize() {
- return fAddressableSize;
- }
-
- private Object getSynchronizedProperty(String propertyId)
- {
- IMemoryRenderingSynchronizationService syncService = getMemoryRenderingContainer().getMemoryRenderingSite().getSynchronizationService();
-
- if (syncService == null)
- return null;
-
- return syncService.getProperty(getMemoryBlock(), propertyId);
- }
-
- private int getDefaultFromPersistableElement(String propertyId) {
- int defaultValue = -1;
- IPersistableDebugElement elmt = (IPersistableDebugElement)getMemoryBlock().getAdapter(IPersistableDebugElement.class);
- if (elmt != null)
- {
- try {
- Object valueMB = elmt.getProperty(this, propertyId);
- if (valueMB != null && !(valueMB instanceof Integer))
- {
- IStatus status = DebugUIPlugin.newErrorStatus("Model returned invalid type on " + propertyId, null); //$NON-NLS-1$
- DebugUIPlugin.log(status);
- }
-
- if (valueMB != null)
- {
- Integer value = (Integer)valueMB;
- defaultValue = value.intValue();
- }
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- return defaultValue;
- }
-
- /**
- * @param modelId
- * @return default number of addressable units per line for the model
- */
- private int getDefaultRowSizeByModel(String modelId)
- {
- int row = DebugUITools.getPreferenceStore().getInt(getRowPrefId(modelId));
- if (row == 0)
- {
- DebugUITools.getPreferenceStore().setValue(getRowPrefId(modelId), IDebugPreferenceConstants.PREF_ROW_SIZE_DEFAULT);
- }
-
- row = DebugUITools.getPreferenceStore().getInt(getRowPrefId(modelId));
- return row;
-
- }
-
- /**
- * @param modelId
- * @return default number of addressable units per column for the model
- */
- private int getDefaultColumnSizeByModel(String modelId)
- {
- int col = DebugUITools.getPreferenceStore().getInt(getColumnPrefId(modelId));
- if (col == 0)
- {
- DebugUITools.getPreferenceStore().setValue(getColumnPrefId(modelId), IDebugPreferenceConstants.PREF_COLUMN_SIZE_DEFAULT);
- }
-
- col = DebugUITools.getPreferenceStore().getInt(getColumnPrefId(modelId));
- return col;
- }
-
-
- private String getRowPrefId(String modelId) {
- String rowPrefId = IDebugPreferenceConstants.PREF_ROW_SIZE + ":" + modelId; //$NON-NLS-1$
- return rowPrefId;
- }
-
- private String getColumnPrefId(String modelId) {
- String colPrefId = IDebugPreferenceConstants.PREF_COLUMN_SIZE + ":" + modelId; //$NON-NLS-1$
- return colPrefId;
- }
-
- /**
- * Format view tab based on the bytes per line and column.
- *
- * @param bytesPerLine - number of bytes per line, possible values: (1 / 2 / 4 / 8 / 16 / 32 / 64/ 128) * addressableSize
- * @param columnSize - number of bytes per column, possible values: (1 / 2 / 4 / 8 / 16 / 32/ 64 / 128) * addressableSize
- * @return true if format is successful, false, otherwise
- */
- public boolean format(int bytesPerLine, int columnSize)
- {
-
- // bytes per cell must be divisible to bytesPerLine
- if (bytesPerLine % columnSize != 0)
- {
- return false;
- }
-
- if (bytesPerLine < columnSize)
- {
- return false;
- }
-
- // do not format if the view tab is already in that format
- if(fBytePerLine == bytesPerLine && fColumnSize == columnSize){
- return false;
- }
-
- fBytePerLine = bytesPerLine;
- fColumnSize = columnSize;
- formatViewer();
-
- updateSyncRowSize();
- updateSyncColSize();
-
- return true;
- }
-
-
- /**
- * Returns the number of addressable units per row.
- *
- * @return number of addressable units per row
- */
- public int getAddressableUnitPerLine() {
- return fBytePerLine / getAddressableSize();
- }
-
- /**
- * Returns the number of addressable units per column.
- *
- * @return number of addressable units per column
- */
- public int getAddressableUnitPerColumn() {
- return fColumnSize / getAddressableSize();
- }
-
-
- /**
- * This method estimates the number of visible lines in the rendering
- * table.
- * @return estimated number of visible lines in the table
- */
- private int getNumberOfVisibleLines()
- {
- if(fTableViewer == null)
- return -1;
-
- Table table = fTableViewer.getTable();
- int height = fTableViewer.getTable().getSize().y;
-
- // when table is not yet created, height is zero
- if (height == 0)
- {
- // make use of the table viewer to estimate table size
- height = fTableViewer.getTable().getParent().getSize().y;
- }
-
- if (height == 0)
- {
- return 0;
- }
-
- // height of border
- int border = fTableViewer.getTable().getHeaderHeight();
-
- // height of scroll bar
- int scroll = fTableViewer.getTable().getHorizontalBar().getSize().y;
-
- // height of table is table's area minus border and scroll bar height
- height = height-border-scroll;
-
- // calculate number of visible lines
- int lineHeight = getMinTableItemHeight(table);
-
- int numberOfLines = height/lineHeight;
-
- if (numberOfLines <= 0)
- return 0;
-
- return numberOfLines;
- }
-
- private int getMinTableItemHeight(Table table){
-
- // Hack to get around Linux GTK problem.
- // On Linux GTK, table items have variable item height as
- // carriage returns are actually shown in a cell. Some rows will be
- // taller than others. When calculating number of visible lines, we
- // need to find the smallest table item height. Otherwise, the rendering
- // underestimates the number of visible lines. As a result the rendering
- // will not be able to get more memory as needed.
- if (MemoryViewUtil.isLinuxGTK())
- {
- // check each of the items and find the minimum
- TableItem[] items = table.getItems();
- int minHeight = table.getItemHeight();
- for (int i=0; i<items.length; i++)
- {
- if (items[i].getData() != null)
- minHeight = Math.min(items[i].getBounds(0).height, minHeight);
- }
-
- return minHeight;
-
- }
- return table.getItemHeight();
- }
-
- private BigInteger getMemoryBlockBaseAddress() throws DebugException
- {
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- return ((IMemoryBlockExtension)getMemoryBlock()).getBigBaseAddress();
- else
- return BigInteger.valueOf(getMemoryBlock().getStartAddress());
- }
-
- /**
- * Displays the given message on the error page
- * @param message - the message to display
- */
- protected void showMessage(final String message)
- {
- fSwitchPageJob.setShowMessagePage(true);
- fSwitchPageJob.setMessage(message);
- fSwitchPageJob.schedule();
- }
-
- /**
- * Returns the number of bytes displayed in a single column cell.
- *
- * @return the number of bytes displayed in a single column cell
- */
- public int getBytesPerColumn()
- {
- return fColumnSize;
- }
-
- /**
- * Returns the number of bytes displayed in a row.
- *
- * @return the number of bytes displayed in a row
- */
- public int getBytesPerLine()
- {
- return fBytePerLine;
- }
-
- /**
- * Returns whether the error page is displayed.
- *
- * @return whether the error page is displayed
- */
- public boolean isDisplayingError()
- {
- return fShowMessage;
- }
-
- /**
- * Displays the content of the table viewer.
- */
- public void showTable()
- {
- fSwitchPageJob.setShowMessagePage(false);
- fSwitchPageJob.schedule();
- }
-
- private BigInteger getTopVisibleAddress() {
-
- if (fTableViewer == null)
- return BigInteger.valueOf(0);
-
- Table table = fTableViewer.getTable();
- int topIndex = table.getTopIndex();
-
- if (topIndex < 0) { return null; }
-
- if (table.getItemCount() > topIndex)
- {
- MemorySegment topItem = (MemorySegment)table.getItem(topIndex).getData();
- if (topItem != null)
- {
- return topItem.getAddress();
- }
- }
- return null;
- }
-
- private synchronized void reloadTable(final BigInteger topAddress) {
-
- if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING)
- System.out.println(this + " reload at: " + topAddress.toString(16)); //$NON-NLS-1$
-
- fContentDescriptor.setLoadAddress(topAddress);
- fContentDescriptor.setNumLines(getNumLinesToLoad());
- fTableViewer.setTopIndex(topAddress);
- fTableViewer.refresh();
-
- }
-
- private boolean isAtTopLimit()
- {
- BigInteger startAddress = fContentDescriptor.getStartAddress();
- startAddress = MemoryViewUtil.alignToBoundary(startAddress, getAddressableUnitPerLine());
- AbstractVirtualContentTableModel model = fTableViewer.getVirtualContentModel();
-
- if (model != null)
- {
- Object key = model.getKey(0);
- if (key instanceof BigInteger)
- {
- BigInteger startBufferAddress = (BigInteger)key;
- startBufferAddress = MemoryViewUtil.alignToBoundary(startBufferAddress, getAddressableUnitPerLine());
-
- if (startAddress.compareTo(startBufferAddress) == 0)
- return true;
- }
- }
- return false;
- }
-
- private boolean isAtBottomLimit()
- {
- BigInteger endAddress = fContentDescriptor.getEndAddress();
- endAddress = MemoryViewUtil.alignToBoundary(endAddress, getAddressableUnitPerLine());
-
- AbstractVirtualContentTableModel model = fTableViewer.getVirtualContentModel();
- if (model != null)
- {
- int numElements = model.getElements().length;
- Object key = model.getKey(numElements-1);
- if (key instanceof BigInteger)
- {
- BigInteger endBufferAddress = (BigInteger)key;
- endBufferAddress = MemoryViewUtil.alignToBoundary(endBufferAddress, getAddressableUnitPerLine());
-
- if (endAddress.compareTo(endBufferAddress) == 0)
- return true;
- }
- }
-
- return false;
- }
-
- private void formatViewer() {
-
- fTableViewer.disposeColumns();
- fTableViewer.disposeCellEditors();
- doFormatTable();
- fTableViewer.setColumnHeaders(getColumnProperties());
- fTableViewer.showColumnHeader(true);
-
- Table table = fTableViewer.getTable();
- int colCnt = table.getColumnCount();
- CellEditor[] editors = new CellEditor[fTableViewer.getTable().getColumnCount()];
- for (int i=0; i<colCnt; i++)
- {
- editors[i] = createCellEditor(table, i);
- }
-
- fTableViewer.setCellEditors(editors);
-
- fTableViewer.formatViewer();
-
- // This resize needs to happen after the viewer has finished
- // getting the labels.
- // This fix is a hack to delay the resize until the viewer has a chance to get
- // the setData event from the UI thread. Otherwise, the columns will be
- // squeezed together.
- UIJob job = new UIJob("resize to fit"){ //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- resizeColumnsToPreferredSize();
- return Status.OK_STATUS;
- }};
-
- job.setSystem(true);
- job.schedule();
- }
-
- private void doFormatTable() {
- int bytesPerLine = getBytesPerLine();
- int columnSize = getBytesPerColumn();
- int numColumns = bytesPerLine/columnSize;
-
- Table table = fTableViewer.getTable();
- TableColumn column0 = new TableColumn(table,SWT.LEFT,0);
- column0.setText(DebugUIMessages.AbstractTableRendering_2);
-
- // create new byte columns
- TableColumn [] byteColumns = new TableColumn[numColumns];
- for (int i=0;i<byteColumns.length; i++)
- {
- TableColumn column = new TableColumn(table, SWT.LEFT, i+1);
- byteColumns[i] = column;
- }
-
- //Empty column for cursor navigation
- TableColumn emptyCol = new TableColumn(table,SWT.LEFT,byteColumns.length+1);
- emptyCol.setText(" "); //$NON-NLS-1$
- emptyCol.setWidth(1);
- emptyCol.setResizable(false);
- table.setHeaderVisible(true);
-
- // allow clients to override column labels
- setColumnHeadings();
-
- }
-
- private String[] getColumnProperties()
- {
- int numColumns = getAddressableUnitPerLine()/getAddressableUnitPerColumn();
- // +2 to include properties for address and navigation column
- String[] columnProperties = new String[numColumns+2];
- columnProperties[0] = TableRenderingLine.P_ADDRESS;
-
- int addressableUnit = getAddressableUnitPerColumn();
-
- // use column beginning offset to the row address as properties
- for (int i=1; i<columnProperties.length-1; i++)
- {
- // column properties are stored as number of addressable units from the
- // the line address
- columnProperties[i] = Integer.toHexString((i-1)*addressableUnit);
- }
-
- // Empty column for cursor navigation
- columnProperties[columnProperties.length-1] = " "; //$NON-NLS-1$
- return columnProperties;
- }
-
- /**
- * Create a cell editor from the specified composite and column.
- * @param composite parent composite that the cell editor is to be created from.
- * @param column the column where the cell editor is required
- * @return the cell editor for editing memory
- *
- * @since 3.3
- *
- */
- protected CellEditor createCellEditor(Composite composite, int column) {
-
- return new TextCellEditor(composite);
- }
-
-
- private ICellModifier newInternalCellModifier()
- {
- return new AsyncTableRenderingCellModifier(this, createCellModifier());
- }
-
- /**
- * Create a custom cell modifier for this rendering. Return null
- * if the default cell modifier is to be used.
- * @return the cell modifier for this rendering, or <code>null</code> if the
- * default cell modifier is to be used.
- *
- * @since 3.3
- *
- */
- protected ICellModifier createCellModifier() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.AbstractMemoryRendering#dispose()
- */
- public void dispose() {
-
- if (fIsDisposed)
- return;
-
- fIsDisposed = true;
-
- removeListeners();
-
- if (fMenuMgr != null)
- {
- fMenuMgr.removeAll();
- fMenuMgr.dispose();
- fMenuMgr = null;
- }
-
- if (fTableViewer != null)
- {
- if (fViewerListener != null)
- fTableViewer.removeVirtualContentListener(fViewerListener);
-
- if (fPresentationErrorListener != null)
- fTableViewer.removePresentationErrorListener(fPresentationErrorListener);
-
- fTableViewer.removeSelectionChangedListener(fViewerSelectionChangedListener);
- fTableViewer.getTable().getVerticalBar().removeSelectionListener(fScrollBarSelectionListener);
-
- fTableViewer.dispose();
- }
-
- if (!fToolTipShell.isDisposed())
- {
- fToolTipShell.dispose();
- fToolTipShell = null;
- }
-
- fIsDisposed = true;
-
- super.dispose();
- }
-
- /**
- * Updates the label of this rendering, optionally displaying the
- * base address of this rendering's memory block.
- *
- * @param showAddress whether to display the base address of this
- * rendering's memory block in this rendering's label
- */
- protected void updateRenderingLabel(final boolean showAddress)
- {
- Job job = new Job("Update Rendering Label"){ //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- if (fIsDisposed)
- return Status.OK_STATUS;
- fLabel = buildLabel(showAddress);
- firePropertyChangedEvent(new PropertyChangeEvent(AbstractAsyncTableRendering.this, IBasicPropertyConstants.P_TEXT, null, fLabel));
- return Status.OK_STATUS;
- }};
- job.setSystem(true);
- job.setRule(serialByRenderingRule);
- job.schedule();
- }
-
- private String buildLabel(boolean showAddress) {
- String label = IInternalDebugCoreConstants.EMPTY_STRING;
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- label = ((IMemoryBlockExtension)getMemoryBlock()).getExpression();
-
- if (label == null)
- {
- label = DebugUIMessages.AbstractTableRendering_8;
- }
-
- if (label.startsWith("&")) //$NON-NLS-1$
- label = "&" + label; //$NON-NLS-1$
-
- try {
- if (showAddress && ((IMemoryBlockExtension)getMemoryBlock()).getBigBaseAddress() != null)
- {
- label += " : 0x"; //$NON-NLS-1$
- label += ((IMemoryBlockExtension)getMemoryBlock()).getBigBaseAddress().toString(16).toUpperCase();
- }
- } catch (DebugException e) {
- // do nothing, the label will not show the address
- }
- }
- else
- {
- long address = getMemoryBlock().getStartAddress();
- label = Long.toHexString(address).toUpperCase();
- }
-
- String preName = DebugUITools.getMemoryRenderingManager().getRenderingType(getRenderingId()).getLabel();
-
- if (preName != null)
- label += " <" + preName + ">"; //$NON-NLS-1$ //$NON-NLS-2$
-
- return decorateLabel(label);
- }
-
- /* Returns the label of this rendering.
- *
- * @return label of this rendering
- */
- public String getLabel() {
-
- if (fLabel == null)
- {
- fLabel = DebugUIMessages.AbstractAsyncTableRendering_1;
- updateRenderingLabel(isVisible());
- }
-
- return fLabel;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
-
- if (adapter == IColorProvider.class)
- return getColorProviderAdapter();
-
- if (adapter == ILabelProvider.class)
- return getLabelProviderAdapter();
-
- if (adapter == IFontProvider.class)
- return getFontProviderAdapter();
-
- if (adapter == IModelChangedListener.class)
- {
- return fModelChangedListener;
- }
-
- if (adapter == IWorkbenchAdapter.class)
- {
- // needed workbench adapter to fill the title of property page
- if (fWorkbenchAdapter == null) {
- fWorkbenchAdapter = new IWorkbenchAdapter() {
- public Object[] getChildren(Object o) {
- return new Object[0];
- }
-
- public ImageDescriptor getImageDescriptor(Object object) {
- return null;
- }
-
- public String getLabel(Object o) {
- return AbstractAsyncTableRendering.this.getLabel();
- }
-
- public Object getParent(Object o) {
- return null;
- }
- };
- }
- return fWorkbenchAdapter;
- }
-
- if (adapter == TableRenderingContentDescriptor.class)
- return getContentDescriptor();
-
- return super.getAdapter(adapter);
- }
-
- /**
- * Returns the number of characters a byte will convert to
- * or -1 if unknown.
- *
- * @return the number of characters a byte will convert to
- * or -1 if unknown
- */
- public int getNumCharsPerByte()
- {
- return -1;
- }
-
- /**
- * Create actions for this rendering
- */
- protected void createActions() {
-
- fCopyToClipboardAction = new AsyncCopyTableRenderingAction(this, fTableViewer);
- fGoToAddressAction = new RenderingGoToAddressAction(this);
- fResetMemoryBlockAction = new ResetToBaseAddressAction(this);
-
- fPrintViewTabAction = new AsyncPrintTableRenderingAction(this, fTableViewer);
-
- fFormatRenderingAction = new FormatTableRenderingAction(this);
- fReformatAction = new ReformatAction(this);
- fToggleAddressColumnAction = new ToggleAddressColumnAction();
-
- IMemoryRenderingSite site = getMemoryRenderingContainer().getMemoryRenderingSite();
- if (site.getSite().getSelectionProvider() != null)
- {
- fPropertiesDialogAction = new PropertyDialogAction(site.getSite(),site.getSite().getSelectionProvider());
- }
-
- fNextAction = new NextPageAction();
- fPrevAction = new PrevPageAction();
- }
-
- /**
- * Returns the currently selected address in this rendering.
- *
- * @return the currently selected address in this rendering
- */
- public BigInteger getSelectedAddress() {
- Object key = fTableViewer.getSelectionKey();
-
- if (key != null && key instanceof BigInteger)
- return (BigInteger)key;
-
- return null;
- }
-
- /**
- * Returns the currently selected content in this rendering as MemoryByte.
- *
- * @return the currently selected content in array of MemoryByte.
- * Returns an empty array if the selected address is out of buffered range.
- */
- public MemoryByte[] getSelectedAsBytes()
- {
- if (getSelectedAddress() == null)
- return new MemoryByte[0];
-
- Object key = fTableViewer.getSelectionKey();
- AbstractVirtualContentTableModel model = fTableViewer.getVirtualContentModel();
-
- if (model != null)
- {
- model = (AbstractVirtualContentTableModel)fTableViewer.getModel();
- int row = model.indexOfKey(key);
- Object element = model.getElement(row);
- int col = model.columnOf(element, key);
-
- // check precondition
- if (col <= 0 || col > getBytesPerLine()/getBytesPerColumn())
- {
- return new MemoryByte[0];
- }
-
- if (!(element instanceof MemorySegment))
- return new MemoryByte[0];
-
- MemorySegment line = (MemorySegment)element;
- int offset = (col-1)*(getAddressableUnitPerColumn()*getAddressableSize());
-
- // make a copy of the bytes to ensure that data cannot be changed
- // by caller
- MemoryByte[] bytes = line.getBytes(offset, getAddressableUnitPerColumn()*getAddressableSize());
- MemoryByte[] retBytes = new MemoryByte[bytes.length];
-
- System.arraycopy(bytes, 0, retBytes, 0, bytes.length);
- return retBytes;
- }
- return new MemoryByte[0];
- }
-
- /**
- * Returns the currently selected content in this rendering as a String.
- *
- * @return the currently selected content in this rendering
- */
- public String getSelectedAsString() {
-
- if (getSelectedAddress() == null)
- return IInternalDebugCoreConstants.EMPTY_STRING;
-
- MemoryByte[] bytes = getSelectedAsBytes();
- if (bytes.length > 0)
- {
- return getString(this.getRenderingId(), getSelectedAddress(), bytes);
- }
- else
- return IInternalDebugCoreConstants.EMPTY_STRING;
-
- }
-
- /**
- * Moves the cursor to the specified address.
- * Will load more memory if the address is not currently visible.
- *
- * @param address address to position cursor at
- * @throws DebugException if an exception occurs
- */
- public void goToAddress(BigInteger address) throws DebugException {
-
- if (fTableViewer.getVirtualContentModel() == null)
- return;
-
- int i = fTableViewer.getVirtualContentModel().indexOfKey(address);
-
- if (i >= 0)
- {
- // address is within range, set cursor and reveal
- fTableViewer.setSelection(address);
- updateSyncTopAddress(getTopVisibleAddress());
- updateSyncSelectedAddress(address);
- }
- else
- {
- // if not extended memory block
- // do not allow user to go to an address that's out of range
- if (!(getMemoryBlock() instanceof IMemoryBlockExtension))
- {
- Status stat = new Status(
- IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(),
- DebugException.NOT_SUPPORTED, DebugUIMessages.AbstractTableRendering_11, null
- );
- DebugException e = new DebugException(stat);
- throw e;
- }
-
- BigInteger startAdd = fContentDescriptor.getStartAddress();
- BigInteger endAdd = fContentDescriptor.getEndAddress();
-
- if (address.compareTo(startAdd) < 0 ||
- address.compareTo(endAdd) > 0)
- {
- Status stat = new Status(
- IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(),
- DebugException.NOT_SUPPORTED, DebugUIMessages.AbstractTableRendering_11, null
- );
- DebugException e = new DebugException(stat);
- throw e;
- }
-
- // load at the address
- fTableViewer.setSelection(address);
- reloadTable(address);
-
- updateSyncSelectedAddress(address);
-
- if (!isDynamicLoad())
- {
- updateSyncPageStartAddress(address);
- }
-
- updateSyncTopAddress(address);
- }
- }
-
- /**
- * Refresh the table viewer with the current top visible address.
- * Update labels in the memory rendering.
- */
- public void refresh() {
- fTableViewer.refresh();
- }
-
-
- /**
- * Resize column to the preferred size.
- */
- public void resizeColumnsToPreferredSize() {
- fTableViewer.resizeColumnsToPreferredSize();
- if (!fIsShowAddressColumn)
- {
- final TableColumn column = fTableViewer.getTable().getColumn(0);
- column.addControlListener(new ControlListener() {
-
- public void controlMoved(ControlEvent e) {
- }
-
- public void controlResized(ControlEvent e) {
- column.removeControlListener(this);
- column.setWidth(0);
- }});
- }
- }
-
- /**
- * Updates labels of this rendering.
- */
- public void updateLabels()
- {
- UIJob job = new UIJob("updateLabels"){ //$NON-NLS-1$
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
-
- // do not handle if the rendering is already disposed
- if (fPageBook.isDisposed())
- return Status.OK_STATUS;
-
- // update tab labels
- updateRenderingLabel(true);
-
- if (fTableViewer != null)
- {
- // update column labels
- setColumnHeadings();
-
- // rebuild cache and force labels to be refreshed
- fTableViewer.formatViewer();
- }
- return Status.OK_STATUS;
- }};
- job.setSystem(true);
- job.schedule();
- }
-
- /**
- * Fills the context menu for this rendering
- *
- * @param menu menu to fill
- */
- protected void fillContextMenu(IMenuManager menu) {
-
- menu.add(new Separator(EMPTY_MEMORY_GROUP));
- menu.add(new Separator());
- menu.add(fResetMemoryBlockAction);
- menu.add(fGoToAddressAction);
- menu.add(new Separator(EMPTY_NAVIGATION_GROUP));
-
- menu.add(new Separator());
- menu.add(fFormatRenderingAction);
-
- if (!isDynamicLoad() && getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- menu.add(new Separator());
- menu.add(fPrevAction);
- menu.add(fNextAction);
- menu.add(new Separator(EMPTY_NON_AUTO_LOAD_GROUP));
- }
-
- menu.add(new Separator());
- menu.add(fReformatAction);
- menu.add(fToggleAddressColumnAction);
- menu.add(new Separator());
- menu.add(fCopyToClipboardAction);
- menu.add(fPrintViewTabAction);
- if (fPropertiesDialogAction != null)
- {
- menu.add(new Separator());
- menu.add(fPropertiesDialogAction);
- menu.add(new Separator(EMPTY_PROPERTY_GROUP));
- }
-
- menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
-
- private int getPageSizeInUnits()
- {
- return fPageSize * getAddressableUnitPerLine();
- }
-
- private void getPageSizeFromPreference()
- {
- fPageSize = DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE);
- }
-
- private void getPreBufferSizeFromPreference()
- {
- fPreBufferSize = DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PRE_BUFFER_SIZE);
- }
-
- private void getPostBufferSizeFromPreference()
- {
- fPostBufferSize = DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_TABLE_RENDERING_POST_BUFFER_SIZE);
- }
-
- private void updateDynamicLoadProperty() {
-
- boolean value = DebugUIPlugin
- .getDefault()
- .getPreferenceStore()
- .getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM);
-
- if (value != isDynamicLoad())
- {
- setDynamicLoad(value);
-
- if (!fIsDisposed) {
- if (isDynamicLoad()) {
- fContentDescriptor.setPostBuffer(getPostBufferSize());
- fContentDescriptor.setPreBuffer(getPreBufferSize());
- fContentDescriptor.setNumLines(getNumberOfVisibleLines());
-
- } else {
- fContentDescriptor.setPostBuffer(0);
- fContentDescriptor.setPreBuffer(0);
- fContentDescriptor.setNumLines(fPageSize);
- }
- }
- }
- }
-
- private void getDynamicLoadFromPreference()
- {
- setDynamicLoad(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM));
- }
-
- private boolean isDynamicLoad()
- {
- return fContentDescriptor.isDynamicLoad();
- }
-
- private int getPageSize()
- {
- return fPageSize;
- }
-
- private int getNumLinesToLoad() {
- int numberOfLines = -1;
-
- if (isDynamicLoad())
- numberOfLines = getNumberOfVisibleLines();
- else
- numberOfLines = getPageSize();
-
- return numberOfLines;
- }
-
- private void setDynamicLoad(boolean load)
- {
- fContentDescriptor.setDynamicLoad(load);
- }
-
- private void handlePageStartAddressChanged(BigInteger address)
- {
- // do not handle if in dynamic mode
- if (isDynamicLoad())
- return;
-
- if (!(getMemoryBlock() instanceof IMemoryBlockExtension))
- return;
-
- // do not handle event if the base address of the memory
- // block has changed, wait for debug event to update to
- // new location
- if (isMemoryBlockBaseAddressChanged())
- return;
-
- if(fTableViewer.getKey(0).equals(address))
- return;
-
- BigInteger start = fContentDescriptor.getStartAddress();
- BigInteger end = fContentDescriptor.getEndAddress();
-
- // smaller than start address, load at start address
- if (address.compareTo(start) < 0)
- {
- if (isAtTopLimit())
- return;
-
- address = start;
- }
-
- // bigger than end address, no need to load, already at top
- if (address.compareTo(end) > 0)
- {
- if (isAtBottomLimit())
- return;
-
- address = end.subtract(BigInteger.valueOf(getPageSizeInUnits()));
- }
-
- fContentDescriptor.setLoadAddress(address);
- final BigInteger finaladdress = address;
- Runnable runnable = new Runnable() {
- public void run() {
- if (fTableViewer.getTable().isDisposed())
- return;
-
- fTableViewer.setTopIndex(finaladdress);
- refresh();
- }};
-
- runOnUIThread(runnable);
-
- updateSyncPageStartAddress(address);
- updateSyncTopAddress(address);
- }
- private void handleDyanicLoadChanged() {
-
- // if currently in dynamic load mode, update page
- // start address
- BigInteger pageStart = getTopVisibleAddress();
- updateSyncPageStartAddress(pageStart);
-
- updateDynamicLoadProperty();
- if (isDynamicLoad())
- {
- refresh();
- fTableViewer.setTopIndex(pageStart);
- }
- else
- {
- handlePageStartAddressChanged(pageStart);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#becomesHidden()
- */
- public void becomesHidden() {
- // creates new object for storing potential changes in sync properties
- fPendingSyncProperties = new PendingPropertyChanges();
- super.becomesHidden();
-
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- updateRenderingLabel(false);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#becomesVisible()
- */
- public void becomesVisible() {
-
- if (!fIsCreated)
- {
- // label can still be constructed even though the rendering has not finished being
- // initialized
- updateRenderingLabel(true);
- super.becomesVisible();
- return;
- }
-
- // do not do anything if already visible
- if (isVisible() == true)
- {
- // super should always be called
- super.becomesVisible();
- return;
- }
-
- super.becomesVisible();
-
- if (fPendingSyncProperties != null)
- {
- // deal with format
- boolean format = false;
- int rowSize = getBytesPerLine();
- if (fPendingSyncProperties.getRowSize() > 0)
- {
- format = true;
- rowSize = fPendingSyncProperties.getRowSize();
- }
-
- int colSize = getBytesPerColumn();
- if (fPendingSyncProperties.getColumnSize() > 0)
- {
- format = true;
- colSize = fPendingSyncProperties.getColumnSize();
- }
-
- if (format)
- format(rowSize, colSize);
-
- BigInteger selectedAddress = fPendingSyncProperties.getSelectedAddress();
- if (selectedAddress != null)
- fTableViewer.setSelection(selectedAddress);
-
- updateDynamicLoadProperty();
-
- if (isDynamicLoad())
- {
- BigInteger topVisibleAddress = fPendingSyncProperties.getTopVisibleAddress();
- if (topVisibleAddress != null)
- {
- fContentDescriptor.setLoadAddress(topVisibleAddress);
- fTableViewer.setTopIndex(topVisibleAddress);
- }
- }
- else if (!(getMemoryBlock() instanceof IMemoryBlockExtension))
- {
- BigInteger topVisibleAddress = fPendingSyncProperties.getTopVisibleAddress();
- if (topVisibleAddress != null)
- fTableViewer.setTopIndex(topVisibleAddress);
- }
- else
- {
- if (fPendingSyncProperties.getPageSize() > 0)
- {
- fPageSize = fPendingSyncProperties.getPageSize();
- fContentDescriptor.setNumLines(fPageSize);
- }
-
- BigInteger pageStartAddress = fPendingSyncProperties.getPageStartAddress();
- if (pageStartAddress != null)
- fContentDescriptor.setLoadAddress(pageStartAddress);
-
- fTableViewer.setTopIndex(pageStartAddress);
- }
-
- showTable();
- refresh();
- }
-
- updateRenderingLabel(true);
-
- Job job = new Job("becomesVisible") //$NON-NLS-1$
- {
- protected IStatus run(IProgressMonitor monitor) {
- if (fIsDisposed)
- return Status.OK_STATUS;
- try {
- fContentDescriptor.updateContentBaseAddress();
- } catch (DebugException e) {
- showMessage(e.getMessage());
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
-
- // discard these properties
- fPendingSyncProperties = null;
- }
-
- /**
- * Handle column size changed event from synchronizer
- * @param newColumnSize
- */
- private void columnSizeChanged(final int newColumnSize) {
- // ignore event if rendering is not visible
- if (!isVisible())
- return;
-
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- int rowSize = getBytesPerLine();
- if (rowSize < newColumnSize)
- rowSize = newColumnSize;
-
- format(rowSize, newColumnSize);
- }
- });
- }
-
- /**
- * @param newRowSize - new row size in number of bytes
- */
- private void rowSizeChanged(final int newRowSize)
- {
- // ignore event if rendering is not visible
- if (!isVisible())
- return;
-
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- int colSize = getBytesPerColumn();
- if (newRowSize < colSize)
- colSize = newRowSize;
-
- format(newRowSize, colSize);
- }
- });
- }
-
- /**
- * update selected address in synchronizer if update is true.
- */
- private void updateSyncSelectedAddress(BigInteger address) {
-
- if (!fIsCreated)
- return;
- PropertyChangeEvent event = new PropertyChangeEvent(this, AbstractAsyncTableRendering.PROPERTY_SELECTED_ADDRESS, null, address);
- firePropertyChangedEvent(event);
- }
-
- /**
- * update column size in synchronizer
- */
- private void updateSyncColSize() {
-
- if (!fIsCreated)
- return;
-
- PropertyChangeEvent event = new PropertyChangeEvent(this, AbstractAsyncTableRendering.PROPERTY_COL_SIZE, null, new Integer(fColumnSize));
- firePropertyChangedEvent(event);
- }
-
- /**
- * update column size in synchronizer
- */
- private void updateSyncRowSize() {
-
- if (!fIsCreated)
- return;
-
- PropertyChangeEvent event = new PropertyChangeEvent(this, AbstractAsyncTableRendering.PROPERTY_ROW_SIZE, null, new Integer(fBytePerLine));
- firePropertyChangedEvent(event);
- }
-
- /**
- * update top visible address in synchronizer
- */
- private void updateSyncTopAddress(BigInteger address) {
-
- if (!fIsCreated)
- return;
-
- PropertyChangeEvent event = new PropertyChangeEvent(this, AbstractAsyncTableRendering.PROPERTY_TOP_ADDRESS, null, address);
- firePropertyChangedEvent(event);
- }
-
- private void updateSyncPageStartAddress(BigInteger address) {
-
- if (!fIsCreated)
- return;
-
- if (isMemoryBlockBaseAddressChanged())
- return;
-
- PropertyChangeEvent event = new PropertyChangeEvent(this, IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS, null, address);
- firePropertyChangedEvent(event);
- }
-
- /**
- * Returns the color provider for this rendering's memory block or
- * <code>null</code> if none.
- * <p>
- * By default a color provider is obtained by asking this rendering's
- * memory block for its {@link IColorProvider} adapter. When the color
- * provider is queried for color information, it is provided with a
- * {@link MemoryRenderingElement} as an argument.
- * </p>
- * @return the color provider for this rendering's memory block,
- * or <code>null</code>
- */
- protected IColorProvider getColorProviderAdapter()
- {
- return (IColorProvider)getMemoryBlock().getAdapter(IColorProvider.class);
- }
-
- /**
- * Returns the label provider for this rendering's memory block or
- * <code>null</code> if none.
- * <p>
- * By default a label provider is obtained by asking this rendering's
- * memory block for its {@link ILabelProvider} adapter. When the label
- * provider is queried for label information, it is provided with a
- * {@link MemoryRenderingElement} as an argument.
- * </p>
- * @return the label provider for this rendering's memory block,
- * or <code>null</code>
- */
- protected ILabelProvider getLabelProviderAdapter()
- {
- return (ILabelProvider)getMemoryBlock().getAdapter(ILabelProvider.class);
- }
-
- /**
- * Returns the font provider for this rendering's memory block or
- * <code>null</code> if none.
- * <p>
- * By default a font provider is obtained by asking this rendering's
- * memory block for its {@link IFontProvider} adapter. When the font
- * provider is queried for font information, it is provided with a
- * {@link MemoryRenderingElement} as an argument.
- * </p>
- * @return the font provider for this rendering's memory block,
- * or <code>null</code>
- */
- protected IFontProvider getFontProviderAdapter()
- {
- return (IFontProvider)getMemoryBlock().getAdapter(IFontProvider.class);
- }
-
- /**
- * Returns the table presentation for this rendering's memory block or
- * <code>null</code> if none.
- * <p>
- * By default a table presentation is obtained by asking this rendering's
- * memory block for its {@link IMemoryBlockTablePresentation} adapter.
- * </p>
- * @return the table presentation for this rendering's memory block,
- * or <code>null</code>
- */
- protected IMemoryBlockTablePresentation getTablePresentationAdapter()
- {
- return (IMemoryBlockTablePresentation)getMemoryBlock().getAdapter(IMemoryBlockTablePresentation.class);
- }
-
- /**
- * Setup the viewer so it supports hovers to show the offset of each field
- */
- private void createToolTip() {
-
- fToolTipShell = new Shell(DebugUIPlugin.getShell(), SWT.ON_TOP | SWT.RESIZE );
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 1;
- gridLayout.marginWidth = 2;
- gridLayout.marginHeight = 0;
- fToolTipShell.setLayout(gridLayout);
- fToolTipShell.setBackground(fTableViewer.getTable().getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
-
- final Control toolTipControl = createToolTipControl(fToolTipShell);
-
- if (toolTipControl == null)
- {
- // if client decide not to use tooltip support
- fToolTipShell.dispose();
- return;
- }
-
- MouseTrackAdapter listener = new MouseTrackAdapter(){
-
- private TableItem fTooltipItem = null;
- private int fCol = -1;
-
- public void mouseExit(MouseEvent e){
-
- if (!fToolTipShell.isDisposed())
- fToolTipShell.setVisible(false);
- fTooltipItem = null;
- }
-
- public void mouseHover(MouseEvent e){
-
- Point hoverPoint = new Point(e.x, e.y);
- Control control = null;
-
- if (e.widget instanceof Control)
- control = (Control)e.widget;
-
- if (control == null)
- return;
-
- hoverPoint = control.toDisplay(hoverPoint);
- TableItem item = getItem(hoverPoint);
- int column = getColumn(hoverPoint);
-
- //Only if there is a change in hover
- if(this.fTooltipItem != item || fCol != column){
-
- //Keep Track of the latest hover
- fTooltipItem = item;
- fCol = column;
-
- if(item != null){
- toolTipAboutToShow(toolTipControl, fTooltipItem, column);
-
- //Setting location of the tooltip
- Rectangle shellBounds = fToolTipShell.getBounds();
- shellBounds.x = hoverPoint.x;
- shellBounds.y = hoverPoint.y + item.getBounds(0).height;
-
- fToolTipShell.setBounds(shellBounds);
- fToolTipShell.pack();
-
- fToolTipShell.setVisible(true);
- }
- else {
- fToolTipShell.setVisible(false);
- }
- }
- }
- };
-
- fTableViewer.getTable().addMouseTrackListener(listener);
- fTableViewer.getCursor().addMouseTrackListener(listener);
- }
-
- /**
- * Creates the control used to display tool tips for cells in this table. By default
- * a label is used to display the address of the cell. Clients may override this
- * method to create custom tooltip controls.
- * <p>
- * Also see the methods <code>getToolTipText(...)</code> and
- * <code>toolTipAboutToShow(...)</code>.
- * </p>
- * @param composite parent for the tooltip control
- * @return the tooltip control to be displayed
- * @since 3.2
- */
- protected Control createToolTipControl(Composite composite) {
- Control fToolTipLabel = new Label(composite, SWT.NONE);
- fToolTipLabel.setForeground(fTableViewer.getTable().getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
- fToolTipLabel.setBackground(fTableViewer.getTable().getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
- fToolTipLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL |
- GridData.VERTICAL_ALIGN_CENTER));
- return fToolTipLabel;
- }
-
- /**
- * Bug with table widget,BUG 113015, the widget is not able to return the correct
- * table item if SWT.FULL_SELECTION is not on when the table is created.
- * Created the following function to work around the problem.
- * We can remove this method when the bug is fixed.
- * @param point
- * @return the table item where the point is located, return null if the item cannot be located.
- */
- private TableItem getItem(Point point)
- {
- TableItem[] items = fTableViewer.getTable().getItems();
- for (int i=0; i<items.length; i++)
- {
- TableItem item = items[i];
- if (item.getData() != null)
- {
- Point start = new Point(item.getBounds(0).x, item.getBounds(0).y);
- start = fTableViewer.getTable().toDisplay(start);
- Point end = new Point(start.x + item.getBounds(0).width, start.y + item.getBounds(0).height);
-
- if (start.y < point.y && point.y < end.y)
- return item;
- }
- }
- return null;
- }
-
- /**
- * Method for figuring out which column the point is located.
- * @param point
- * @return the column index where the point is located, return -1 if column is not found.
- */
- private int getColumn(Point point)
- {
- int colCnt = fTableViewer.getTable().getColumnCount();
-
- TableItem item = null;
- for (int i=0; i<fTableViewer.getTable().getItemCount(); i++)
- {
- item = fTableViewer.getTable().getItem(i);
- if (item.getData() != null)
- break;
- }
-
- if (item != null)
- {
- for (int i=0; i<colCnt; i++)
- {
- Point start = new Point(item.getBounds(i).x, item.getBounds(i).y);
- start = fTableViewer.getTable().toDisplay(start);
- Point end = new Point(start.x + item.getBounds(i).width, start.y + item.getBounds(i).height);
-
- if (start.x < point.x && end.x > point.x)
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Called when the tool tip is about to show in this rendering.
- * Clients who overrides <code>createTooltipControl</code> may need to
- * also override this method to ensure that the tooltip shows up properly
- * in their customized control.
- * <p>
- * By default a text tooltip is displayed, and the contents for the tooltip
- * are generated by the <code>getToolTipText(...)</code> method.
- * </p>
- * @param toolTipControl - the control for displaying the tooltip
- * @param item - the table item where the mouse is pointing.
- * @param col - the column at which the mouse is pointing.
- * @since 3.2
- */
- protected void toolTipAboutToShow(Control toolTipControl, TableItem item,
- int col) {
- if (toolTipControl instanceof Label) {
- Object address = fTableViewer.getKey(fTableViewer.getTable().indexOf(item), col);
- if (address != null && address instanceof BigInteger) {
- Object data = item.getData();
- if (data instanceof MemorySegment) {
- MemorySegment line = (MemorySegment) data;
-
- if (col > 0) {
- int start = (col - 1) * getBytesPerColumn();
- int end = start + getBytesPerColumn();
- MemoryByte[] bytes = line.getBytes(start, end);
-
- String str = getToolTipText((BigInteger)address, bytes);
-
- if (str != null)
- ((Label) toolTipControl).setText(str);
- } else {
- String str = getToolTipText((BigInteger)address,
- new MemoryByte[] {});
-
- if (str != null)
- ((Label) toolTipControl).setText(str);
- }
- }
- }
- }
- }
-
- /**
- * Returns the text to display in a tool tip at the specified address
- * for the specified bytes. By default the address of the bytes is displayed.
- * Subclasses may override.
- *
- * @param address address of cell that tool tip is displayed for
- * @param bytes the bytes in the cell
- * @return the tooltip text for the memory bytes located at the specified
- * address
- * @since 3.2
- */
- protected String getToolTipText(BigInteger address, MemoryByte[] bytes)
- {
- StringBuffer buf = new StringBuffer("0x"); //$NON-NLS-1$
- buf.append(address.toString(16).toUpperCase());
-
- return buf.toString();
- }
-
- private void setColumnHeadings()
- {
- String[] columnLabels = new String[0];
-
- IMemoryBlockTablePresentation presentation = getTablePresentationAdapter();
- if (presentation != null)
- {
- columnLabels = presentation.getColumnLabels(getMemoryBlock(), getBytesPerLine(), getBytesPerLine()/getBytesPerColumn());
- }
-
- // check that column labels returned are not null
- if (columnLabels == null)
- columnLabels = new String[0];
-
- int numByteColumns = fBytePerLine/fColumnSize;
-
- TableColumn[] columns = fTableViewer.getTable().getColumns();
-
- int j=0;
- for (int i=1; i<columns.length-1; i++)
- {
- // if the number of column labels returned is correct
- // use supplied column labels
- if (columnLabels.length == numByteColumns)
- {
- columns[i].setText(columnLabels[j]);
- j++;
- }
- else
- {
- // otherwise, use default
- int addressableUnit = getAddressableUnitPerColumn();
- if (addressableUnit >= 4)
- {
- columns[i].setText(Integer.toHexString(j*addressableUnit).toUpperCase() +
- " - " + Integer.toHexString(j*addressableUnit+addressableUnit-1).toUpperCase()); //$NON-NLS-1$
- }
- else
- {
- columns[i].setText(Integer.toHexString(j*addressableUnit).toUpperCase());
- }
- j++;
- }
- }
- }
-
- /**
- *
- * Return this rendering's viewer
- * @return this rendering's viewer
- */
- public StructuredViewer getViewer()
- {
- return fTableViewer;
- }
-
- private boolean isMemoryBlockBaseAddressChanged()
- {
- try {
- BigInteger address = getMemoryBlockBaseAddress();
- BigInteger oldBaseAddress = fContentDescriptor.getContentBaseAddress();
- if (!oldBaseAddress.equals(address))
- return true;
- } catch (DebugException e) {
- // fail silently
- }
- return false;
- }
-
- /**
- * @param topVisibleAddress
- */
- private void createContentDescriptor(final BigInteger topVisibleAddress) {
- fContentDescriptor = new TableRenderingContentDescriptor(AbstractAsyncTableRendering.this);
- fContentDescriptor.setPostBuffer(getPostBufferSize());
- fContentDescriptor.setPreBuffer(getPreBufferSize());
- fContentDescriptor.setLoadAddress(topVisibleAddress);
- try {
- fContentDescriptor.updateContentBaseAddress();
-
- } catch (DebugException e) {
- fError = true;
- showMessage(e.getMessage());
- }
-
- fContentDescriptor.setAddressableSize(getAddressableSize());
-
- try {
- int addressSize = 4;
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- IMemoryBlockExtension extMb = (IMemoryBlockExtension)getMemoryBlock();
- addressSize = extMb.getAddressSize();
-
- if (addressSize <= 0)
- {
- DebugUIPlugin.logErrorMessage("Invalid address Size: " + addressSize); //$NON-NLS-1$
- addressSize = 4;
- }
- fContentDescriptor.setAddressSize(addressSize);
- }
- fContentDescriptor.setAddressSize(addressSize);
- } catch (DebugException e) {
- fError = true;
- showMessage(e.getMessage());
- } finally {
- if (fContentDescriptor.getAddressSize() <= 0)
- fContentDescriptor.setAddressSize(4);
- }
- }
-
- /**
- * Return the number of lines to be bufferred before the top visible line of the memory rendering
- * @return number of lines to be buffered before the top visible line in the memory rendering
- */
- private int getPreBufferSize()
- {
- if (fPreBufferSize < 0)
- getPreBufferSizeFromPreference();
-
- return fPreBufferSize;
- }
-
- /**
- * Returns the number of lines to be bufferred after the last visible line in the memory rendering
- * @return the number of lines to be bufferred after the last visible line in the memory rendering
- */
- private int getPostBufferSize()
- {
- if (fPostBufferSize < 0)
- getPostBufferSizeFromPreference();
-
- return fPostBufferSize;
- }
-
- private TableRenderingContentDescriptor getContentDescriptor()
- {
- return fContentDescriptor;
- }
-
- private void createGoToAddressComposite(Composite parent)
- {
- fGoToAddressComposite = new GoToAddressComposite();
- fGoToAddressComposite.createControl(parent);
- Button button = fGoToAddressComposite.getButton(IDialogConstants.OK_ID);
- if (button != null)
- {
- button.addSelectionListener(new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent e) {
- doGoToAddress();
- }
- });
-
- button = fGoToAddressComposite.getButton(IDialogConstants.CANCEL_ID);
- if (button != null)
- {
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- hideGotoAddressComposite();
- }});
- }
- }
-
- fGoToAddressComposite.getExpressionWidget().addSelectionListener(new SelectionAdapter() {
- public void widgetDefaultSelected(SelectionEvent e) {
- doGoToAddress();
- }});
-
- fGoToAddressComposite.getExpressionWidget().addKeyListener(new KeyAdapter() {
-
- public void keyPressed(KeyEvent e) {
- if (e.keyCode == SWT.ESC)
- hideGotoAddressComposite();
- super.keyPressed(e);
- }});
- }
-
- private void showGoToAddressComposite() {
-
- String selectedStr = getSelectedAsString();
- Text text = fGoToAddressComposite.getExpressionWidget();
- text.setText(selectedStr);
- text.setSelection(0, text.getCharCount());
-
- double height = fGoToAddressComposite.getHeight();
- double canvasHeight = fSashForm.getParent().getClientArea().height;
- double tableHeight = canvasHeight - height;
-
- double tableWeight = (tableHeight/canvasHeight) * 100;
- double textWeight = (height / canvasHeight) * 100;
- fSashForm.setWeights(new int[]{(int)tableWeight, (int)textWeight});
- fSashForm.setMaximizedControl(null);
-
- fGoToAddressComposite.getExpressionWidget().setFocus();
- }
-
- private void hideGotoAddressComposite()
- {
- fSashForm.setMaximizedControl(fTableViewer.getControl());
- if (isActivated())
- fTableViewer.getControl().setFocus();
- }
-
- /**
- *
- */
- private void doGoToAddress() {
- try {
- BigInteger address = fGoToAddressComposite.getGoToAddress(fContentDescriptor.getContentBaseAddress(), getSelectedAddress());
- fGoToAddressAction.doGoToAddress(address.toString(16));
- hideGotoAddressComposite();
- } catch (DebugException e1) {
- MemoryViewUtil.openError(DebugUIMessages.GoToAddressAction_Go_to_address_failed,
- DebugUIMessages.GoToAddressAction_Go_to_address_failed, e1);
- } catch (NumberFormatException e1)
- {
- MemoryViewUtil.openError(DebugUIMessages.GoToAddressAction_Go_to_address_failed,
- DebugUIMessages.GoToAddressAction_Address_is_invalid, e1);
- }
- }
-
- public void activated() {
- super.activated();
-
- fActivated = true;
- IWorkbench workbench = PlatformUI.getWorkbench();
- ICommandService commandSupport = (ICommandService)workbench.getAdapter(ICommandService.class);
- IContextService contextSupport = (IContextService)workbench.getAdapter(IContextService.class);
-
- if (commandSupport != null && contextSupport != null)
- {
- fContext.add(contextSupport.activateContext(ID_ASYNC_TABLE_RENDERING_CONTEXT));
- Command gotoCommand = commandSupport.getCommand(ID_GO_TO_ADDRESS_COMMAND);
-
- if (fGoToAddressHandler == null)
- {
- fGoToAddressHandler = new AbstractHandler() {
- public Object execute(ExecutionEvent event) throws ExecutionException {
- if (fSashForm.getMaximizedControl() != null)
- fGoToAddressAction.run();
- else
- hideGotoAddressComposite();
- return null;
- }};
- }
- gotoCommand.setHandler(fGoToAddressHandler);
-
- // The page up and page down actions can only be activated if the rendering
- // is in manual scrolling mode. We are unable to determine the scrolling mode
- // until the content descriptor is created. When the rendering is activated, the content
- // descriptor may not be created yet. In that case, we cannot activate the shortcuts here.
- // We will activate the shortcut after the rendering is created.
- if (fContentDescriptor != null && !isDynamicLoad())
- {
- activatePageActions();
- }
- }
- }
-
- private void activatePageActions() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- ICommandService commandSupport = (ICommandService)workbench.getAdapter(ICommandService.class);
- if (commandSupport != null)
- {
- Command nextPage = commandSupport.getCommand(ID_NEXT_PAGE_COMMAND);
- if (fNextPageHandler == null)
- {
- fNextPageHandler = new AbstractHandler() {
-
- public Object execute(ExecutionEvent arg0)
- throws ExecutionException {
- fNextAction.run();
- return null;
- }
- };
- }
- nextPage.setHandler(fNextPageHandler);
-
- Command prevPage = commandSupport.getCommand(ID_PREV_PAGE_COMMAND);
- if (fPrevPageHandler == null)
- {
- fPrevPageHandler = new AbstractHandler() {
-
- public Object execute(ExecutionEvent arg0)
- throws ExecutionException {
- fPrevAction.run();
- return null;
- }
- };
- }
- prevPage.setHandler(fPrevPageHandler);
- }
- }
-
- public void deactivated() {
-
- fActivated = false;
- IWorkbench workbench = PlatformUI.getWorkbench();
- ICommandService commandSupport = (ICommandService)workbench.getAdapter(ICommandService.class);
- IContextService contextSupport = (IContextService)workbench.getAdapter(IContextService.class);
-
- if (commandSupport != null && contextSupport != null)
- {
- // remove handler
- Command command = commandSupport.getCommand(ID_GO_TO_ADDRESS_COMMAND);
- command.setHandler(null);
-
- command = commandSupport.getCommand(ID_NEXT_PAGE_COMMAND);
- command.setHandler(null);
-
- command = commandSupport.getCommand(ID_PREV_PAGE_COMMAND);
- command.setHandler(null);
-
- if (fContext != null)
- contextSupport.deactivateContexts(fContext);
- }
- super.deactivated();
- }
-
- private boolean isActivated()
- {
- return fActivated;
- }
-
- /**
- * Returns text for the given memory bytes at the specified address for the specified
- * rendering type. This is called by the label provider for.
- * Subclasses must override.
- *
- * @param renderingTypeId rendering type identifier
- * @param address address where the bytes belong to
- * @param data the bytes
- * @return a string to represent the memory. Cannot not return <code>null</code>.
- * Returns a string to pad the cell if the memory cannot be converted
- * successfully.
- */
- abstract public String getString(String renderingTypeId, BigInteger address, MemoryByte[] data);
-
- /**
- * Returns bytes for the given text corresponding to bytes at the given
- * address for the specified rendering type. This is called by the cell modifier
- * when modifying bytes in a memory block.
- * Subclasses must convert the string value to an array of bytes. The bytes will
- * be passed to the debug adapter for memory block modification.
- * Returns <code>null</code> if the bytes cannot be formatted properly.
- *
- * @param renderingTypeId rendering type identifier
- * @param address address the bytes begin at
- * @param currentValues current values of the data in bytes format
- * @param newValue the string to be converted to bytes
- * @return the bytes converted from a string
- */
- abstract public byte[] getBytes(String renderingTypeId, BigInteger address, MemoryByte[] currentValues, String newValue);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTextRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTextRendering.java
deleted file mode 100644
index bed96d88a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTextRendering.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.memory.provisional;
-
-import java.io.UnsupportedEncodingException;
-import java.math.BigInteger;
-
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Abstract implementation of a rendering that translates memory into
- * text, displayed in a table.
- * <p>
- * Clients should subclass from this class if they wish to provide a table
- * text rendering with a specific code page.
- * </p>
- * @since 3.2
- */
-abstract public class AbstractAsyncTextRendering extends AbstractAsyncTableRendering {
-
- private String fCodePage;
-
- /**
- * Constructs a text rendering of the specified type.
- *
- * @param renderingId memory rendering type identifier
- */
- public AbstractAsyncTextRendering(String renderingId)
- {
- super(renderingId);
- }
-
- /**
- * Constructs a text rendering of the specified type on the given
- * code page.
- *
- * @param renderingId memory rendering type identifier
- * @param codePage the name of a supported
- * {@link java.nio.charset.Charset </code>charset<code>}, for
- * example <code>CP1252</code>
- */
- public AbstractAsyncTextRendering(String renderingId, String codePage)
- {
- super(renderingId);
- fCodePage = codePage;
- }
-
- /**
- * Sets the code page for this rendering. This does not cause
- * the rendering to be updated with the new code page. Clients need
- * to update the rendering manually when the code page is changed.
- *
- * @param codePage the name of a supported
- * {@link java.nio.charset.Charset </code>charset<code>}, for
- * example <code>CP1252</code>
- */
- public void setCodePage(String codePage)
- {
- fCodePage = codePage;
- }
-
- /**
- * Returns the current code page used by this rendering. Returns null
- * if not set.
- * @return Returns the current code page used by this rendering. Returns null
- * if not set.
- */
- public String getCodePage()
- {
- return fCodePage;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.provisional.AbstractAsyncTableRendering#getString(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[])
- */
- public String getString(String dataType, BigInteger address, MemoryByte[] data) {
- try {
- String paddedStr = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR);
- if(fCodePage == null)
- return IInternalDebugCoreConstants.EMPTY_STRING;
-
- boolean[] invalid = new boolean[data.length];
- boolean hasInvalid = false;
- byte byteArray[] = new byte[data.length];
- for (int i=0; i<data.length; i++)
- {
- if (!data[i].isReadable())
- {
- invalid[i] = true;
- hasInvalid = true;
- }
- byteArray[i] = data[i].getValue();
- }
-
- if (hasInvalid)
- {
- StringBuffer strBuf = new StringBuffer();
- for (int i=0; i<data.length; i++)
- {
- if (invalid[i])
- strBuf.append(paddedStr);
- else
- strBuf.append(new String(new byte[]{byteArray[i]}, fCodePage));
- }
- return strBuf.toString();
- }
-
- return new String(byteArray, fCodePage);
-
- } catch (UnsupportedEncodingException e) {
- return "-- error --"; //$NON-NLS-1$
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.provisional.AbstractAsyncTableRendering#getBytes(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[], java.lang.String)
- */
- public byte[] getBytes(String dataType, BigInteger address, MemoryByte[] currentValues, String data) {
- try {
-
- if (fCodePage == null)
- return new byte[0];
-
- byte[] bytes = data.getBytes(fCodePage);
- return bytes;
-
- } catch (UnsupportedEncodingException e) {
- return new byte[0];
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/MemoryViewPresentationContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/MemoryViewPresentationContext.java
deleted file mode 100644
index ade979113..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/MemoryViewPresentationContext.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.memory.provisional;
-
-import org.eclipse.debug.internal.ui.viewers.PartPresentationContext;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
-import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
-
-/**
- * Presentation context from the Memory View. This presentation provides additional
- * information regarding the originator of the asynchronous request.
- *
- * Clients may reference or subclass from this class.
- *
- * @since 3.2
- *
- */
-public class MemoryViewPresentationContext extends PartPresentationContext {
-
- private IMemoryRenderingContainer fContainer;
- private IMemoryRendering fRendering;
- private IMemoryRenderingSite fMemoryView;
-
- /**
- * Constructs MemoryViewPresentationContext
- * @param site - the memory rendering site that this presentation context is for
- * @param container - the memory rendering container that this presentation context is for, may be <code>null</code>
- * @param rendering - - the memory rendering that this presentation context is for, may be <code>null</code>
- */
- public MemoryViewPresentationContext(IMemoryRenderingSite site, IMemoryRenderingContainer container, IMemoryRendering rendering) {
- super(site.getSite().getPart());
-
- fMemoryView = site;
- fContainer = container;
- fRendering = rendering;
- }
-
- /**
- * Returns the memory rendering site that this presentation context is for
- * @return the memory rendering site that this presentation context is for
- */
- public IMemoryRenderingSite getMemoryRenderingSite()
- {
- return fMemoryView;
- }
-
- /**
- * Returns the memory rendering container that this presentation context is for
- * @return the memory rendering container that this presentation context is for, <code>null</code> if none.
- */
- public IMemoryRenderingContainer getMemoryRenderingContainer()
- {
- return fContainer;
- }
-
- /**
- * Returns the memory rendering that this presentation context is for
- * @return the memory rendering that this presentation context is for, <code>null</code> if none.
- */
- public IMemoryRendering getRendering()
- {
- return fRendering;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementLabelProvider.java
deleted file mode 100644
index 8dd7a59d3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementLabelProvider.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.views.DebugModelPresentationContext;
-import org.eclipse.debug.internal.ui.views.launch.DebugElementHelper;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IDebugModelPresentationExtension;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * @since 3.3
- */
-public class DebugElementLabelProvider extends ElementLabelProvider {
-
- protected String getLabel(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
- Object element = elementPath.getLastSegment();
- if (presentationContext instanceof DebugModelPresentationContext) {
- DebugModelPresentationContext debugContext = (DebugModelPresentationContext) presentationContext;
- return debugContext.getModelPresentation().getText(element);
- }
- return DebugElementHelper.getLabel(element);
- }
-
- protected RGB getBackground(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
- Object element = elementPath.getLastSegment();
- if (presentationContext instanceof DebugModelPresentationContext) {
- DebugModelPresentationContext debugContext = (DebugModelPresentationContext) presentationContext;
- return DebugElementHelper.getBackground(element, debugContext.getModelPresentation());
- }
- return DebugElementHelper.getBackground(element);
- }
-
- protected FontData getFontData(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
- Object element = elementPath.getLastSegment();
- if (presentationContext instanceof DebugModelPresentationContext) {
- DebugModelPresentationContext debugContext = (DebugModelPresentationContext) presentationContext;
- return DebugElementHelper.getFont(element, debugContext.getModelPresentation());
-
- }
- return DebugElementHelper.getFont(element);
- }
-
- protected RGB getForeground(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
- Object element = elementPath.getLastSegment();
- if (presentationContext instanceof DebugModelPresentationContext) {
- DebugModelPresentationContext debugContext = (DebugModelPresentationContext) presentationContext;
- return DebugElementHelper.getForeground(element, debugContext.getModelPresentation());
- }
- return DebugElementHelper.getForeground(element);
- }
-
- protected ImageDescriptor getImageDescriptor(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
- Object element = elementPath.getLastSegment();
- if (presentationContext instanceof DebugModelPresentationContext) {
- DebugModelPresentationContext debugContext = (DebugModelPresentationContext) presentationContext;
- return DebugElementHelper.getImageDescriptor(element, debugContext.getModelPresentation());
- }
- return DebugElementHelper.getImageDescriptor(element);
- }
-
- /**
- * Returns the model presentation for the specified model, or <code>null</code> if none.
- *
- * @param context presentation context
- * @param modelId debug model identifier
- * @return debug model presentation or <code>null</code>
- */
- protected IDebugModelPresentation getModelPresentation(IPresentationContext context, String modelId) {
- if (context instanceof DebugModelPresentationContext) {
- DebugModelPresentationContext debugContext = (DebugModelPresentationContext) context;
- IDebugModelPresentation presentation = debugContext.getModelPresentation();
- if (presentation instanceof DelegatingModelPresentation) {
- return ((DelegatingModelPresentation)presentation).getPresentation(modelId);
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider#requiresUIJob(org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate[])
- */
- protected boolean requiresUIJob(ILabelUpdate[] updates) {
- if (updates.length > 0) {
- ILabelUpdate update = updates[0];
- IPresentationContext context = update.getPresentationContext();
- if (context instanceof DebugModelPresentationContext) {
- DebugModelPresentationContext debugContext = (DebugModelPresentationContext) context;
- IDebugModelPresentation presentation = debugContext.getModelPresentation();
- if (presentation instanceof IDebugModelPresentationExtension) {
- IDebugModelPresentationExtension extension = (IDebugModelPresentationExtension) presentation;
- for (int i = 0; i < updates.length; i++) {
- if (extension.requiresUIThread(updates[i].getElement())) {
- return true;
- }
- }
- }
- }
- }
- return false;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementMementoProvider.java
deleted file mode 100644
index 3340c752b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementMementoProvider.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.ui.IMemento;
-
-/**
- * Abstract memento provider debug elements.
- *
- * @since 3.4
- */
-public abstract class DebugElementMementoProvider extends ElementMementoProvider {
-
- protected static final String ELEMENT_NAME = "ELEMENT_NAME"; //$NON-NLS-1$
-
- protected boolean encodeElement(Object element, IMemento memento, IPresentationContext context) throws CoreException {
- if (supportsContext(context)) {
- String name = getElementName(element, context);
- memento.putString(ELEMENT_NAME, name);
- return true;
- }
- return false;
- }
-
- protected boolean isEqual(Object element, IMemento memento, IPresentationContext context) throws CoreException {
- String mementoName = memento.getString(ELEMENT_NAME);
- if (mementoName != null) {
- String name = getElementName(element, context);
- if (name != null) {
- return name.equals(mementoName);
- }
- }
- return false;
- }
-
- /**
- * Returns whether this adapter supports the given context.
- *
- * @param context
- * @return whether this adapter supports the given context
- */
- protected boolean supportsContext(IPresentationContext context) {
- return supportsContextId(context.getId());
- }
-
- /**
- * Returns whether this adapter provides content in the specified context id.
- *
- * @param id part id
- * @return whether this adapter provides content in the specified context id
- */
- protected boolean supportsContextId(String id) {
- return true;
- }
-
- /**
- * Returns the name of the given element to use in a memento in the given context,
- * or <code>null</code> if unsupported.
- *
- * @param element model element
- * @param context presentation context
- * @return element name or <code>null</code> if none
- * @throws CoreException
- */
- protected abstract String getElementName(Object element, IPresentationContext context) throws CoreException;
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugTargetContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugTargetContentProvider.java
deleted file mode 100644
index f0a0bf838..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugTargetContentProvider.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * @since 3.3
- */
-public class DebugTargetContentProvider extends ElementContentProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- String id = context.getId();
- if (id.equals(IDebugUIConstants.ID_DEBUG_VIEW))
- {
- return ((IDebugTarget)element).getThreads().length;
- }
- else if (id.equals(IDebugUIConstants.ID_MEMORY_VIEW))
- {
- return getAllChildren(element, context, monitor).length;
- }
- return 0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
- */
- protected boolean supportsContextId(String id) {
- return IDebugUIConstants.ID_DEBUG_VIEW.equals(id) || IDebugUIConstants.ID_MEMORY_VIEW.equals(id);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return getElements(getAllChildren(parent, context, monitor), index, length);
- }
-
- protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- String id = context.getId();
- if (id.equals(IDebugUIConstants.ID_DEBUG_VIEW))
- {
- return ((IDebugTarget)element).hasThreads();
- }
- else if (id.equals(IDebugUIConstants.ID_MEMORY_VIEW))
- {
- return getAllChildren(element, context, monitor).length > 0;
- }
- return false;
- }
-
- protected Object[] getAllChildren(Object parent, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- String id = context.getId();
- if (id.equals(IDebugUIConstants.ID_DEBUG_VIEW))
- {
- return ((IDebugTarget)parent).getThreads();
- }
- else if (id.equals(IDebugUIConstants.ID_MEMORY_VIEW))
- {
- if (parent instanceof IMemoryBlockRetrieval)
- {
- if (((IMemoryBlockRetrieval)parent).supportsStorageRetrieval())
- return DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks((IMemoryBlockRetrieval)parent);
- }
- }
- return EMPTY;
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java
deleted file mode 100644
index d9c2166ef..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-
-/**
- * @since 3.3
- */
-public abstract class ElementContentProvider implements IElementContentProvider {
-
- protected static final Object[] EMPTY = new Object[0];
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider#updateChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IElementRequestMonitor)
- */
- public void update(final IChildrenUpdate[] updates) {
- Job job = new Job("children update") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- for (int i = 0; i < updates.length; i++) {
- IChildrenUpdate update = updates[i];
- if (!update.isCanceled()) {
- retrieveChildren(update);
- }
- update.done();
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(getRule(updates));
- job.schedule();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider#update(org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate)
- */
- public void update(final IChildrenCountUpdate[] updates) {
- Job job = new Job("child count update") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- for (int i = 0; i < updates.length; i++) {
- IChildrenCountUpdate update = updates[i];
- if (!update.isCanceled()) {
- retrieveChildCount(update);
- }
- update.done();
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(getRule(updates));
- job.schedule();
- }
-
- /**
- * Computes the children for the given parent in the specified context.
- *
- * @param update update request
- */
- protected void retrieveChildren(IChildrenUpdate update) {
- if (!update.isCanceled()) {
- IStatus status = Status.OK_STATUS;
- try {
- IPresentationContext context = update.getPresentationContext();
- if (supportsContext(context)) {
- int offset = update.getOffset();
- Object[] children = getChildren(update.getElement(), offset, update.getLength(), context, update);
- if (!update.isCanceled() && children != null) {
- for (int i = 0; i < children.length; i++) {
- update.setChild(children[i], offset + i);
- }
- }
- }
- } catch (CoreException e) {
- status = e.getStatus();
- }
- update.setStatus(status);
- }
- }
-
- /**
- * Computes whether the given element is a container.
- *
- * @param parent potential parent
- * @param context presentation context
- * @param monitor result to report to
- */
- protected void retrieveChildCount(IChildrenCountUpdate update) {
- if (!update.isCanceled()) {
- IStatus status = Status.OK_STATUS;
- try {
- IPresentationContext context = update.getPresentationContext();
- if (supportsContext(context)) {
- int childCount = getChildCount( update.getElement(), context, update);
- if (!update.isCanceled()) {
- update.setChildCount(childCount);
- }
- } else {
- update.setChildCount(0);
- }
- } catch (CoreException e) {
- status = e.getStatus();
- }
- update.setStatus(status);
- }
- }
-
- /**
- * Returns the children for the given parent at the specified index in the specified context
- * or <code>null</code> if none.
- *
- * @param parent element to retrieve children for
- * @param index child index
- * @param length number of children to retrieve
- * @param context context children will be presented in
- * @return child or <code>null</code>
- * @throws CoreException if an exception occurs retrieving child
- */
- protected abstract Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException;
-
- /**
- * Returns the number of children for the given element.
- *
- * @param elementPath element that may have children
- * @param context context element will be presented in
- * @return number of children
- * @throws CoreException if an exception occurs determining child count
- */
- protected abstract int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException;
-
- /**
- * Returns whether this adapter supports the given context.
- *
- * @param context
- * @return whether this adapter supports the given context
- */
- protected boolean supportsContext(IPresentationContext context) {
- return supportsContextId(context.getId());
- }
-
- /**
- * Returns whether this adapter provides content in the specified context id.
- *
- * @param id part id
- * @return whether this adapter provides content in the specified context id
- */
- protected abstract boolean supportsContextId(String id);
-
- /**
- * Returns the range of elements from <code>index</code> to <code>index + length</code>
- * or <code>null</code> if the index and range is outside the bounds of the original element array.
- *
- * @param elements the original element array
- * @param index the initial index to start copying from
- * @param length the number of elements we want to copy into the returned array
- * @return element or <code>null</code>
- */
- protected Object[] getElements(Object[] elements, int index, int length) {
- int max = elements.length;
- if (index < max && ((index + length) > max)) {
- length = max - index;
- }
- if ((index + length) <= elements.length) {
- Object[] sub = new Object[length];
- System.arraycopy(elements, index, sub, 0, length);
- return sub;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider#update(org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate[])
- */
- public void update(final IHasChildrenUpdate[] updates) {
- Job job = new Job("has children update") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- for (int i = 0; i < updates.length; i++) {
- IHasChildrenUpdate update = updates[i];
- if (!update.isCanceled()) {
- updateHasChildren(update);
- }
- update.done();
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(getRule(updates));
- job.schedule();
- }
-
- /**
- * Updates whether the given elements have children.
- *
- * @param update specifies element and progress monitor
- */
- protected void updateHasChildren(IHasChildrenUpdate update) {
- if (!update.isCanceled()) {
- IStatus status = Status.OK_STATUS;
- try {
- IPresentationContext context = update.getPresentationContext();
- if (supportsContext(context)) {
- boolean hasChildren = hasChildren(update.getElement(), context, update);
- if (!update.isCanceled()) {
- update.setHasChilren(hasChildren);
- }
- } else {
- update.setHasChilren(false);
- }
- } catch (CoreException e) {
- status = e.getStatus();
- }
- update.setStatus(status);
- }
-
- }
-
- /**
- * Returns whether the given element has children in the specified context.
- * Subclasses can override to be more efficient.
- *
- * @param element
- * @param context
- * @param monitor
- * @return
- */
- protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return getChildCount(element, context, monitor) > 0;
- }
-
- /**
- * Returns a scheduling rule to use when performing the given updates or
- * <code>null</code> if none.
- *
- * @param updates
- * @return scheduling rule or <code>null</code> if none
- */
- protected ISchedulingRule getRule(IChildrenCountUpdate[] updates) {
- return null;
- }
-
- /**
- * Returns a scheduling rule to use when performing the given updates or
- * <code>null</code> if none.
- *
- * @param updates
- * @return scheduling rule or <code>null</code> if none
- */
- protected ISchedulingRule getRule(IChildrenUpdate[] updates) {
- return null;
- }
-
- /**
- * Returns a scheduling rule to use when performing the given updates or
- * <code>null</code> if none.
- *
- * @param updates
- * @return scheduling rule or <code>null</code> if none
- */
- protected ISchedulingRule getRule(IHasChildrenUpdate[] updates) {
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java
deleted file mode 100644
index 0c867bd64..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java
+++ /dev/null
@@ -1,361 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Patrick Chuong (Texas Instruments) - added support for checkbox (Bug 286310)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import java.util.LinkedList;
-import java.util.NoSuchElementException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ICheckUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * Implementation of a context sensitive label provider, which provides
- * base functionality for subclasses such as label jobs and a basic label updater.
- *
- * @since 3.3.0.qualifier
- */
-public abstract class ElementLabelProvider implements IElementLabelProvider {
-
- private Job fLabelJob = null;
-
- /**
- * Describes a label job
- */
- interface ILabelJob {
- /**
- * Returns whether the updates were queued.
- *
- * @param updates updates
- * @return whether the updates were queued
- */
- public boolean queue(ILabelUpdate[] updates);
- }
-
- /**
- * A <code>Job</code> to update labels. This <code>Job</code> can run
- * in a non-UI thread.
- */
- class LabelJob extends Job implements ILabelJob {
-
- private LabelUpdater fUpdater = new LabelUpdater();
-
- public LabelJob() {
- super("Label Job"); //$NON-NLS-1$
- setSystem(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected IStatus run(IProgressMonitor monitor) {
- fUpdater.run();
- return Status.OK_STATUS;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider.ILabelJob#queue(org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate)
- */
- public boolean queue(ILabelUpdate[] updates) {
- return fUpdater.queue(updates);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#shouldRun()
- */
- public boolean shouldRun() {
- return fUpdater.shouldRun();
- }
-
- }
-
- /**
- * A <code>Job</code> to update labels. This <code>Job</code> runs
- * only in the UI thread.
- */
- class UILabelJob extends UIJob implements ILabelJob {
-
- private LabelUpdater fUpdater = new LabelUpdater();
-
- public UILabelJob() {
- super("Label Job"); //$NON-NLS-1$
- setSystem(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.IProgressMonitor)
- */
- public IStatus runInUIThread(IProgressMonitor monitor) {
- fUpdater.run();
- return Status.OK_STATUS;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider.ILabelJob#queue(org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate)
- */
- public boolean queue(ILabelUpdate[] updates) {
- return fUpdater.queue(updates);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#shouldRun()
- */
- public boolean shouldRun() {
- return fUpdater.shouldRun();
- }
- }
-
- /**
- * Queue of label updates
- */
- class LabelUpdater implements Runnable {
-
- LinkedList fQueue = new LinkedList();
-
- public synchronized boolean queue(ILabelUpdate[] updates) {
- if (fQueue == null) {
- return false;
- } else {
- for (int i = 0; i < updates.length; i++) {
- fQueue.addLast(updates[i]);
- }
- return true;
- }
- }
-
- /* (non-Javadoc)
- * @see java.lang.Runnable#run()
- */
- public void run() {
- ILabelUpdate update = getNextUpdate();
- while (update != null) {
- ISchedulingRule rule = getRule(update);
- if (!update.isCanceled()) {
- try {
- if (rule != null) {
- Job.getJobManager().beginRule(rule, null);
- }
- retrieveLabel(update);
- } catch (CoreException e) {
- update.setStatus(e.getStatus());
- } finally {
- if (rule != null) {
- Job.getJobManager().endRule(rule);
- }
- }
- }
- update.done();
- update = getNextUpdate();
- }
- }
-
- /**
- * Returns the next update to process, if there is one in the
- * queue. If there are no queued items <code>null</code> is returned
- * @return the next queued item or <code>null</code> if the queue is empty.
- */
- public synchronized ILabelUpdate getNextUpdate() {
- if (fQueue == null) {
- return null;
- }
- ILabelUpdate update = null;
- try {
- update = (ILabelUpdate) fQueue.removeFirst();
- } catch (NoSuchElementException e) {
- fQueue = null;
- }
- return update;
- }
-
- public boolean shouldRun() {
- return fQueue != null;
- }
- }
-
- /**
- * Retrieves label attributes for the specified update.
- *
- * @param update
- */
- protected void retrieveLabel(ILabelUpdate update) throws CoreException {
- String[] columnIds = update.getColumnIds();
- IPresentationContext presentationContext = update.getPresentationContext();
- TreePath elementPath = update.getElementPath();
- int numColumns = 1;
- if (columnIds != null) {
- numColumns = columnIds.length;
- }
- for (int i = 0; i < numColumns; i++) {
- String columnId = null;
- if (columnIds != null) {
- columnId = columnIds[i];
- }
- update.setLabel(getLabel(elementPath, presentationContext, columnId), i);
- update.setImageDescriptor(getImageDescriptor(elementPath, presentationContext, columnId), i);
- update.setBackground(getBackground(elementPath, presentationContext, columnId), i);
- update.setForeground(getForeground(elementPath, presentationContext, columnId), i);
- update.setFontData(getFontData(elementPath, presentationContext, columnId), i);
- if (update instanceof ICheckUpdate &&
- Boolean.TRUE.equals(presentationContext.getProperty(ICheckUpdate.PROP_CHECK)))
- {
- ((ICheckUpdate) update).setChecked(
- getChecked(elementPath, presentationContext), getGrayed(elementPath, presentationContext));
- }
- }
- }
-
- /**
- * Returns the <code>FontData</code> for the path in the given column with the current presentation
- * @param element
- * @param presentationContext
- * @param columnId
- * @return font information or <code>null</code>
- */
- protected FontData getFontData(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
- return null;
- }
-
- /**
- * Returns the <code>RGB</code> foreground colour for the path in the given column with the current presentation
- * @param element
- * @param presentationContext
- * @param columnId
- * @return color or <code>null</code>
- */
- protected RGB getForeground(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
- return null;
- }
-
- /**
- * Returns the <code>RGB</code> background colour for the path in the given column with the current presentation
- * @param element
- * @param presentationContext
- * @param columnId
- * @return color or <code>null</code>
- */
- protected RGB getBackground(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
- return null;
- }
-
- /**
- * Returns the <code>ImageDescriptor</code> for the path in the given column with the current presentation
- * @param element
- * @param presentationContext
- * @param columnId
- * @return image descriptor or <code>null</code>
- */
- protected ImageDescriptor getImageDescriptor(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
- return null;
- }
-
- /**
- * Returns the label for the path in the given column with the current presentation
- * @param element
- * @param presentationContext
- * @param columnId
- * @return label
- */
- protected abstract String getLabel(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException;
-
- /**
- * Returns the checked state for the given path.
- *
- * @param path Path of the element to retrieve the grayed state for.
- * @param presentationContext Presentation context where the element is
- * displayed.
- * @return <code>true<code> if the element check box should be checked
- * @throws CoreException
- *
- * @since 3.6
- */
- protected boolean getChecked(TreePath path, IPresentationContext presentationContext) throws CoreException {
- return false;
- }
-
- /**
- * Returns the grayed state for the given path.
- *
- * @param path Path of the element to retrieve the grayed state for.
- * @param presentationContext Presentation context where the element is
- * displayed.
- * @return <code>true<code> if the element check box should be grayed
- * @throws CoreException
- *
- * @since 3.6
- */
- protected boolean getGrayed(TreePath path, IPresentationContext presentationContext) throws CoreException {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider#update(org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate[])
- */
- public synchronized void update(ILabelUpdate[] updates) {
- if (fLabelJob == null) {
- fLabelJob = newLabelJob(updates);
- }
- if (!((ILabelJob)fLabelJob).queue(updates)) {
- fLabelJob = newLabelJob(updates);
- ((ILabelJob)fLabelJob).queue(updates);
- }
- // TODO: rule
- fLabelJob.schedule();
- }
-
- /**
- * Returns a new <code>Job</code> to update the specified labels. This method
- * is used to determine if a UI job is needed or not, in the event the request for an update
- * job has come from a non-UI thread.
- * @param updates an array of pending label updates
- * @return a new <code>Job</code> to update labels with.
- */
- private Job newLabelJob(ILabelUpdate[] updates) {
- if (requiresUIJob(updates)) {
- return new UILabelJob();
- } else {
- return new LabelJob();
- }
- }
-
- /**
- * Returns whether a UI job should be used for updates versus a non-UI job.
- * @param updates
- * @return true if the array of updates requires a UI job to update the labels, false otherwise
- */
- protected boolean requiresUIJob(ILabelUpdate[] updates) {
- return false;
- }
-
- /**
- * Returns the scheduling rule for the given update or <code>null</code>
- * it none.
- *
- * @param update label update
- * @return associated scheduling rule, or <code>null</code>
- */
- protected ISchedulingRule getRule(ILabelUpdate update) {
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java
deleted file mode 100644
index 536fb5b18..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.ui.IMemento;
-
-/**
- * @since 3.3
- */
-public abstract class ElementMementoProvider implements IElementMementoProvider {
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider#compareElements(org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest[])
- */
- public void compareElements(final IElementCompareRequest[] requests) {
- Job job = new Job("compare element") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- for (int i = 0; i < requests.length; i++) {
- IElementCompareRequest request = requests[i];
- try {
- request.setEqual(isEqual(request.getElement(), request.getMemento(), request.getPresentationContext()));
- } catch (CoreException e) {
- request.setStatus(e.getStatus());
- }
- request.done();
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- // TODO: rule
- job.schedule();
- }
-
- /**
- * Returns whether the memento represents the given element.
- *
- * @param element the element to compare to the memento
- * @param memento memento
- * @param context the context the compare is in
- * @return whether the memento represents the given element
- */
- protected abstract boolean isEqual(Object element, IMemento memento, IPresentationContext context) throws CoreException;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider#encodeElements(org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest[])
- */
- public void encodeElements(final IElementMementoRequest[] requests) {
- Job job = new Job("encode element") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- for (int i = 0; i < requests.length; i++) {
- IElementMementoRequest request = requests[i];
- try {
- if (!encodeElement(request.getElement(), request.getMemento(), request.getPresentationContext())) {
- request.cancel();
- }
- } catch (CoreException e) {
- request.setStatus(e.getStatus());
- }
- request.done();
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- // TODO: rule
- job.schedule();
- }
-
- /**
- * Encodes the specified element into the given memento.
- * Returns whether the element could be encoded
- *
- * @param element the element to encode
- * @param memento the memento to write to
- * @param context presentation context
- * @return false if cancelled/not supported
- * @throws CoreException
- */
- protected abstract boolean encodeElement(Object element, IMemento memento, IPresentationContext context) throws CoreException;
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionContentProvider.java
deleted file mode 100644
index 6a6c2d249..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionContentProvider.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IErrorReportingExpression;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.internal.ui.viewers.model.ViewerAdapterService;
-import org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-
-/**
- * @since 3.3
- */
-public class ExpressionContentProvider extends VariableContentProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#update(org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate[])
- */
- public void update(IChildrenCountUpdate[] updates) {
- // See if we can delegate to a model specific content provider
- Map delegateMap = new HashMap();
- List notDelegated = new ArrayList();
- findDelegates(delegateMap, notDelegated, updates);
-
- // Batch the updates and send them to the delegates
- for (Iterator iterator = delegateMap.keySet().iterator(); iterator.hasNext();) {
- IElementContentProvider delegate = (IElementContentProvider) iterator.next();
- List updateList = (List)delegateMap.get(delegate);
- delegate.update((IChildrenCountUpdate[])updateList.toArray(new IChildrenCountUpdate[updateList.size()]));
- }
- if (notDelegated.size() > 0){
- super.update((IChildrenCountUpdate[])notDelegated.toArray(new IChildrenCountUpdate[notDelegated.size()]));
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#update(org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate[])
- */
- public void update(IHasChildrenUpdate[] updates) {
- // See if we can delegate to a model specific content provider
- Map delegateMap = new HashMap();
- List notDelegated = new ArrayList();
- findDelegates(delegateMap, notDelegated, updates);
-
- // Batch the updates and send them to the delegates
- for (Iterator iterator = delegateMap.keySet().iterator(); iterator.hasNext();) {
- IElementContentProvider delegate = (IElementContentProvider) iterator.next();
- List updateList = (List)delegateMap.get(delegate);
- delegate.update((IHasChildrenUpdate[])updateList.toArray(new IHasChildrenUpdate[updateList.size()]));
- }
- if (notDelegated.size() > 0){
- super.update((IHasChildrenUpdate[])notDelegated.toArray(new IHasChildrenUpdate[notDelegated.size()]));
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#update(org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate[])
- */
- public void update(IChildrenUpdate[] updates) {
- // See if we can delegate to a model specific content provider
- Map delegateMap = new HashMap();
- List notDelegated = new ArrayList();
- findDelegates(delegateMap, notDelegated, updates);
-
- // Batch the updates and send them to the delegates
- for (Iterator iterator = delegateMap.keySet().iterator(); iterator.hasNext();) {
- IElementContentProvider delegate = (IElementContentProvider) iterator.next();
- List updateList = (List)delegateMap.get(delegate);
- delegate.update((IChildrenUpdate[])updateList.toArray(new IChildrenUpdate[updateList.size()]));
- }
- if (notDelegated.size() > 0){
- super.update((IChildrenUpdate[])notDelegated.toArray(new IChildrenUpdate[notDelegated.size()]));
- }
- }
-
- /**
- * Finds all possibly delegate content providers for the given set of updates. Found delegates are added
- * to the given map as the key while the list of updates to be sent to that delegate are set as the value.
- * Any updates that are not to be delegated are put in the notDelegated list.
- *
- * @param delegateMap map to add delegates to
- * @param notDelegated list of updates that should not be delegated
- * @param updates array of updates that can be handled by delegates
- * @since 3.4
- */
- private void findDelegates(Map delegateMap, List notDelegated, IViewerUpdate[] updates){
- for (int i = 0; i < updates.length; i++) {
- if (updates[i] instanceof ViewerUpdateMonitor && !((ViewerUpdateMonitor)updates[i]).isDelegated() && updates[i].getElement() instanceof IExpression){
- IElementContentProvider delegate = ViewerAdapterService.getContentProvider(((IExpression)updates[i].getElement()).getValue());
- if (delegate != null){
- List updateList = (List)delegateMap.get(delegate);
- if (updateList == null){
- updateList = new ArrayList();
- delegateMap.put(delegate, updateList);
- }
- ((ViewerUpdateMonitor)updates[i]).setDelegated(true);
- updateList.add(updates[i]);
- continue;
- }
- }
- notDelegated.add(updates[i]);
- }
- }
-
-
- protected Object[] getAllChildren(Object parent, IPresentationContext context) throws CoreException {
- if (parent instanceof IErrorReportingExpression) {
- IErrorReportingExpression expression = (IErrorReportingExpression) parent;
- if (expression.hasErrors()) {
- String[] messages = expression.getErrorMessages();
- LinkedHashSet set = new LinkedHashSet(messages.length);
- for (int i = 0; i < messages.length; i++) {
- set.add(messages[i]);
- }
- return set.toArray();
- }
- }
- if (parent instanceof IExpression) {
- IExpression expression = (IExpression) parent;
- IValue value = expression.getValue();
- if (value != null) {
- return getValueChildren(expression, value, context);
- }
- }
- return EMPTY;
- }
-
- protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- if (element instanceof IErrorReportingExpression) {
- IErrorReportingExpression expression = (IErrorReportingExpression) element;
- if (expression.hasErrors()) {
- return true;
- }
- }
- IValue value = ((IExpression)element).getValue();
- if (value == null) {
- return false;
- }
- return value.hasVariables();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionLabelProvider.java
deleted file mode 100644
index 8788f0cd6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionLabelProvider.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IErrorReportingExpression;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * @since 3.3
- */
-public class ExpressionLabelProvider extends VariableLabelProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.VariableLabelProvider#getForeground(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
- */
- protected RGB getForeground(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
- Object element = elementPath.getLastSegment();
- if (element instanceof IErrorReportingExpression) {
- IErrorReportingExpression expression = (IErrorReportingExpression) element;
- if (expression.hasErrors()) {
- return new RGB(255, 0, 0);
- }
- }
- return super.getForeground(elementPath, presentationContext, columnId);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerContentProvider.java
deleted file mode 100644
index 94503f48f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerContentProvider.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.IExpressionManager;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Default content provider for the expression manager.
- */
-public class ExpressionManagerContentProvider extends ElementContentProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return ((IExpressionManager) element).getExpressions().length;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return getElements(((IExpressionManager) parent).getExpressions(), index, length);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
- */
- protected boolean supportsContextId(String id) {
- return id.equals(IDebugUIConstants.ID_EXPRESSION_VIEW);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#hasChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
- */
- protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return ((IExpressionManager)element).hasExpressions();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerMementoProvider.java
deleted file mode 100644
index 8c4194adc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerMementoProvider.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.IExpressionManager;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-
-/**
- * Memento provider for expression manager.
- *
- * @since 3.4
- */
-public class ExpressionManagerMementoProvider extends DebugElementMementoProvider {
-
- private static final String EXP_MGR = "EXP_MGR"; //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.DebugElementMementoProvider#getElementName(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
- */
- protected String getElementName(Object element, IPresentationContext context) throws CoreException {
- if (element instanceof IExpressionManager) {
- return EXP_MGR;
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionMementoProvider.java
deleted file mode 100644
index 6bb4fe271..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionMementoProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-
-/**
- * Memento provider for expressions.
- *
- * @since 3.4
- */
-public class ExpressionMementoProvider extends DebugElementMementoProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.DebugElementMementoProvider#getElementName(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
- */
- protected String getElementName(Object element, IPresentationContext context) throws CoreException {
- if (element instanceof IExpression) {
- return ((IExpression) element).getExpressionText();
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchContentProvider.java
deleted file mode 100644
index c350078b5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchContentProvider.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * @since 3.3
- */
-public class LaunchContentProvider extends ElementContentProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return ((ILaunch)element).getChildren().length;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
- */
- protected boolean supportsContextId(String id) {
- return IDebugUIConstants.ID_DEBUG_VIEW.equals(id);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return getElements(((ILaunch)parent).getChildren(), index, length);
- }
-
- protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return ((ILaunch)element).hasChildren();
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchManagerContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchManagerContentProvider.java
deleted file mode 100644
index 81883a39b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchManagerContentProvider.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * @since 3.3
- */
-public class LaunchManagerContentProvider extends ElementContentProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return ((ILaunchManager)element).getLaunches().length;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
- */
- protected boolean supportsContextId(String id) {
- return IDebugUIConstants.ID_DEBUG_VIEW.equals(id);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return getElements(((ILaunchManager)parent).getLaunches(),index, length);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockContentProvider.java
deleted file mode 100644
index bb4008fd5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockContentProvider.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * This content provider is required in order to have selection maintained properly
- * when swtiching between session. The problem is, when swtich debug session, the memory view reset the input
- * to the viewer.
- *
- * After the input is set, viewer's doInitialRestore is called. At this time, the elemtns
- * are not mapped in the viewer yet, as a result, the selection cannot be maintained.
- *
- * The viewer tries to restore selection again after elements are added to the view. This is done
- * in the HasChildrenJob. However, this job will not get scheduled unless the element provides a content
- * provider adapter. As a result, the job is never scheduled and the selection cannot be maintained.
- *
- */
-public class MemoryBlockContentProvider extends ElementContentProvider {
-
- protected int getChildCount(Object element, IPresentationContext context,
- IViewerUpdate monitor) throws CoreException {
- return 0;
- }
-
- protected Object[] getChildren(Object parent, int index, int length,
- IPresentationContext context, IViewerUpdate monitor)
- throws CoreException {
- return EMPTY;
- }
-
- protected boolean supportsContextId(String id) {
- if (id.equals(IDebugUIConstants.ID_MEMORY_VIEW))
- return true;
- return false;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockLabelProvider.java
deleted file mode 100644
index 91233a4d4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockLabelProvider.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.TreePath;
-
-public class MemoryBlockLabelProvider extends DebugElementLabelProvider {
-
- protected String getLabel(TreePath elementPath,
- IPresentationContext presentationContext, String columnId)
- throws CoreException {
- Object element = elementPath.getLastSegment();
-
- if (element instanceof IMemoryBlock)
- return getLabel((IMemoryBlock)element);
-
- return super.getLabel(elementPath, presentationContext, columnId);
- }
-
- protected ImageDescriptor getImageDescriptor(TreePath elementPath,
- IPresentationContext presentationContext, String columnId)
- throws CoreException {
-
- Object element = elementPath.getLastSegment();
-
- if (element instanceof IMemoryBlock)
- return DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_OBJS_VARIABLE);
-
- return super.getImageDescriptor(elementPath, presentationContext, columnId);
- }
-
- /**
- * @param memoryBlockLabel
- * @return
- */
- private String getLabel(IMemoryBlock memoryBlock) {
-
- String memoryBlockLabel = " "; //$NON-NLS-1$
- if (memoryBlock instanceof IMemoryBlockExtension)
- {
- // simply return the expression without the address
- // do not want to keep track of changes in the address
- if (((IMemoryBlockExtension)memoryBlock).getExpression() != null)
- {
- memoryBlockLabel += ((IMemoryBlockExtension)memoryBlock).getExpression();
- }
- }
- else
- {
- long address = memoryBlock.getStartAddress();
- memoryBlockLabel = Long.toHexString(address);
- }
- return memoryBlockLabel;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryRetrievalContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryRetrievalContentProvider.java
deleted file mode 100644
index 11d0ee3cd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryRetrievalContentProvider.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-public class MemoryRetrievalContentProvider extends ElementContentProvider {
-
- protected int getChildCount(Object element, IPresentationContext context,
- IViewerUpdate monitor) throws CoreException {
- return getAllChildren(element, context, monitor).length;
- }
-
- protected Object[] getChildren(Object parent, int index, int length,
- IPresentationContext context, IViewerUpdate monitor)
- throws CoreException {
-
- return getElements(getAllChildren(parent, context, monitor), index, length);
-
- }
-
- protected Object[] getAllChildren(Object parent, IPresentationContext context, IViewerUpdate monitor) {
- String id = context.getId();
- if (id.equals(IDebugUIConstants.ID_MEMORY_VIEW))
- {
- if (parent instanceof IMemoryBlockRetrieval)
- {
- if (((IMemoryBlockRetrieval)parent).supportsStorageRetrieval())
- return DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks((IMemoryBlockRetrieval)parent);
- }
- }
- return EMPTY;
- }
-
- protected boolean supportsContextId(String id) {
- return id.equals(IDebugUIConstants.ID_MEMORY_VIEW);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryViewElementMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryViewElementMementoProvider.java
deleted file mode 100644
index ca4727c53..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryViewElementMementoProvider.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.ui.IMemento;
-
-public class MemoryViewElementMementoProvider extends ElementMementoProvider {
-
- private static final String OBJECT_ID = "OBJECT_ID"; //$NON-NLS-1$
-
- protected boolean encodeElement(Object element, IMemento memento,
- IPresentationContext context) throws CoreException {
- String id = context.getId();
- if (id.equals(IDebugUIConstants.ID_MEMORY_VIEW))
- {
- if (element instanceof IMemoryBlock || element instanceof IMemoryBlockRetrieval)
- {
- memento.putInteger(OBJECT_ID, element.hashCode());
- return true;
- }
- }
- return false;
- }
-
- protected boolean isEqual(Object element, IMemento memento,
- IPresentationContext context) throws CoreException {
- String id = context.getId();
- if (id.equals(IDebugUIConstants.ID_MEMORY_VIEW))
- {
- if (element instanceof IMemoryBlock || element instanceof IMemoryBlockRetrieval)
- {
- Integer objectId = memento.getInteger(OBJECT_ID);
- if (objectId != null && objectId.intValue() == element.hashCode())
- return true;
- }
- }
- return false;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupContentProvider.java
deleted file mode 100644
index 8d3016462..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupContentProvider.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IRegisterGroup;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Register group content provider.
- *
- * @since 3.3
- */
-public class RegisterGroupContentProvider extends ElementContentProvider {
-
- protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return ((IRegisterGroup)element).getRegisters().length;
- }
-
- protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return getElements(((IRegisterGroup)parent).getRegisters(), index, length);
- }
-
- protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return ((IRegisterGroup)element).hasRegisters();
- }
-
- protected boolean supportsContextId(String id) {
- return IDebugUIConstants.ID_REGISTER_VIEW.equals(id);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupLabelProvider.java
deleted file mode 100644
index cc04c51c8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupLabelProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.elements.adapters.VariableColumnPresentation;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.TreePath;
-
-/**
- * @since 3.3
- */
-public class RegisterGroupLabelProvider extends DebugElementLabelProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider#getImageDescriptor(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
- */
- protected ImageDescriptor getImageDescriptor(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
- if (columnId == null || VariableColumnPresentation.COLUMN_VARIABLE_NAME.equals(columnId)) {
- return super.getImageDescriptor(elementPath, presentationContext, columnId);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider#getLabel(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
- */
- protected String getLabel(TreePath elementPath, IPresentationContext context, String columnId) throws CoreException {
- if (columnId == null || VariableColumnPresentation.COLUMN_VARIABLE_NAME.equals(columnId)) {
- return super.getLabel(elementPath, context, columnId);
- } else {
- return IInternalDebugCoreConstants.EMPTY_STRING;
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupMementoProvider.java
deleted file mode 100644
index 9d2f9401e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupMementoProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IRegisterGroup;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-
-/**
- * Memento provider for register groups.
- *
- * @since 3.4
- */
-public class RegisterGroupMementoProvider extends DebugElementMementoProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.DebugElementMementoProvider#getElementName(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
- */
- protected String getElementName(Object element, IPresentationContext context) throws CoreException {
- if (element instanceof IRegisterGroup) {
- return ((IRegisterGroup) element).getName();
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameContentProvider.java
deleted file mode 100644
index 61ce7cef0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameContentProvider.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * @since 3.3
- */
-public class StackFrameContentProvider extends ElementContentProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return getAllChildren(element, context, monitor).length;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return getElements(getAllChildren(parent, context, monitor), index, length);
- }
-
- /**
- * This method retrieves all of the children for the specified parent given the current context
- * @param parent the parent ot get the children for
- * @param context the context for which to get the children for
- * @param monitor the monitor for progress
- * @return the collection of children, or an empty collection, never <code>null</code>
- * @throws CoreException
- */
- protected Object[] getAllChildren(Object parent, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- if (parent instanceof IStackFrame) {
- String id = context.getId();
- IStackFrame frame = (IStackFrame) parent;
- if (id.equals(IDebugUIConstants.ID_VARIABLE_VIEW)) {
- return frame.getVariables();
- } else if (id.equals(IDebugUIConstants.ID_REGISTER_VIEW)) {
- return frame.getRegisterGroups();
- }
- } else {
- monitor.cancel();
- }
- return EMPTY;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
- */
- protected boolean supportsContextId(String id) {
- return id.equals(IDebugUIConstants.ID_VARIABLE_VIEW) || id.equals(IDebugUIConstants.ID_REGISTER_VIEW);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#hasChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.core.runtime.IProgressMonitor)
- */
- protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- String id = context.getId();
- IStackFrame frame = (IStackFrame) element;
- if (id.equals(IDebugUIConstants.ID_VARIABLE_VIEW)) {
- return frame.hasVariables();
- } else if (id.equals(IDebugUIConstants.ID_REGISTER_VIEW)) {
- return frame.hasRegisterGroups();
- }
- return false;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameMementoProvider.java
deleted file mode 100644
index 450ce046c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameMementoProvider.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Memento provider for stack frames.
- *
- * @since 3.4
- */
-public class StackFrameMementoProvider extends DebugElementMementoProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.DebugElementMementoProvider#getElementName(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
- */
- protected String getElementName(Object element, IPresentationContext context) throws CoreException {
- if (element instanceof IStackFrame) {
- IStackFrame frame = (IStackFrame) element;
- if (IDebugUIConstants.ID_REGISTER_VIEW.equals(context.getId())) {
- // for registers view attempt to maintain expansion for target rather than each frame
- return frame.getModelIdentifier();
- } else {
- return frame.getName();
- }
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ThreadContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ThreadContentProvider.java
deleted file mode 100644
index dd99e6650..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ThreadContentProvider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * @since 3.3
- */
-public class ThreadContentProvider extends ElementContentProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return ((IThread)element).getStackFrames().length;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
- */
- protected boolean supportsContextId(String id) {
- return IDebugUIConstants.ID_DEBUG_VIEW.equals(id);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return getElements(((IThread)parent).getStackFrames(), index, length);
- }
-
- protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return ((IThread)element).hasStackFrames();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java
deleted file mode 100644
index 8c050f792..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.ILogicalStructureType;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IIndexedValue;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.internal.ui.views.variables.IndexedVariablePartition;
-import org.eclipse.debug.internal.ui.views.variables.LogicalStructureCache;
-import org.eclipse.debug.internal.ui.views.variables.VariablesView;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * @since 3.3
- */
-public class VariableContentProvider extends ElementContentProvider {
-
- /**
- * Cache of logical structures to avoid computing structures for different
- * subranges.
- */
- private static LogicalStructureCache fgLogicalCache;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return getAllChildren(element, context).length;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return getElements(getAllChildren(parent, context), index, length);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#hasChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
- */
- protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return ((IVariable)element).getValue().hasVariables();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
- */
- protected boolean supportsContextId(String id) {
- return id.equals(IDebugUIConstants.ID_EXPRESSION_VIEW) || id.equals(IDebugUIConstants.ID_VARIABLE_VIEW) || id.equals(IDebugUIConstants.ID_REGISTER_VIEW);
- }
-
- /**
- * Gets all the children variables for the parent
- * @param parent the parent IVariable
- * @param context the context the children will be presented in
- * @return an array of all children or an empty array if none
- * @throws CoreException
- */
- protected Object[] getAllChildren(Object parent, IPresentationContext context) throws CoreException {
- IVariable variable = (IVariable) parent;
- IValue value = variable.getValue();
- if (value != null) {
- return getValueChildren(variable, value, context);
- }
- return EMPTY;
- }
-
- /**
- * Return whether to show compute a logical structure or a raw structure
- * in the specified context
- *
- * @return whether to show compute a logical structure or a raw structure
- * in the specified context
- */
- protected boolean isShowLogicalStructure(IPresentationContext context) {
- Boolean show = (Boolean) context.getProperty(VariablesView.PRESENTATION_SHOW_LOGICAL_STRUCTURES);
- return show != null && show.booleanValue();
- }
-
- /**
- * Returns the number of entries that should be displayed in each partition
- * of an indexed collection.
- *
- * @return the number of entries that should be displayed in each partition
- * of an indexed collection
- */
- protected int getArrayPartitionSize() {
- // TODO: should fix this with a user preference
- return 100;
- }
-
- /**
- * Returns any logical value for the raw value in the specified context
- *
- * @param value
- * @param context
- * @return logical value for the raw value
- */
- protected IValue getLogicalValue(IValue value, IPresentationContext context) throws CoreException {
- return getLogicalValue(value, new ArrayList(), context);
- }
-
- /**
- * Returns children for the given value, creating array partitions if
- * required
- *
- * @param parent expression or variable containing the given value
- * @param value the value to retrieve children for
- * @param context the context in which children have been requested
- * @return children for the given value, creating array partitions if
- * required
- * @throws CoreException
- */
- protected Object[] getValueChildren(IDebugElement parent, IValue value, IPresentationContext context) throws CoreException {
- if (value == null) {
- return EMPTY;
- }
- IValue logicalValue = getLogicalValue(value, context);
- if (logicalValue instanceof IIndexedValue) {
- IIndexedValue indexedValue = (IIndexedValue) logicalValue;
- int partitionSize = computeParitionSize(indexedValue);
- if (partitionSize > 1) {
- int offset = indexedValue.getInitialOffset();
- int length = indexedValue.getSize();
- int numPartitions = length / partitionSize;
- int remainder = length % partitionSize;
- if (remainder > 0) {
- numPartitions++;
- }
- IVariable[] partitions = new IVariable[numPartitions];
- for (int i = 0; i < (numPartitions - 1); i++) {
- partitions[i] = new IndexedVariablePartition(parent, indexedValue, offset, partitionSize);
- offset = offset + partitionSize;
- }
- if (remainder == 0) {
- remainder = partitionSize;
- }
- partitions[numPartitions - 1] = new IndexedVariablePartition(parent, indexedValue, offset, remainder);
- return partitions;
- }
- }
- if (logicalValue == null) {
- // safeguard against an structure type returning null
- logicalValue = value;
- }
- return logicalValue.getVariables();
- }
-
- /**
- * Returns the partition size to use for the given indexed value. The
- * partition size is computed by determining the number of levels that an
- * indexed collection must be nested in order to partition the collection
- * sub-collections of the preferred partition size.
- *
- * @param value
- * indexed value
- * @return size of partitions the value should be subdivided into
- */
- protected int computeParitionSize(IIndexedValue value) {
- int partitionSize = 1;
- try {
- int length = value.getSize();
- int partitionDepth = 0;
- int preferredSize = getArrayPartitionSize();
- int remainder = length % preferredSize;
- length = length / preferredSize;
- while (length > 0) {
- if (remainder == 0 && length == 1) {
- break;
- }
- partitionDepth++;
- remainder = length % preferredSize;
- length = length / preferredSize;
- }
- for (int i = 0; i < partitionDepth; i++) {
- partitionSize = partitionSize * preferredSize;
- }
- } catch (DebugException e) {
- }
- return partitionSize;
- }
-
- /**
- * Returns any logical value for the raw value. This method will recurse
- * over the returned value until the same structure is encountered again (to
- * avoid infinite recursion).
- *
- * @param value raw value to possibly be replaced by a logical value
- * @param previousStructureIds
- * the list of logical structures that have already been applied
- * to the returned value during the recursion of this method.
- * Callers should always pass in a new, empty list.
- * @return logical value if one is calculated, otherwise the raw value is returned
- */
- protected IValue getLogicalValue(IValue value, List previousStructureIds, IPresentationContext context) throws CoreException {
- if (isShowLogicalStructure(context)) {
- ILogicalStructureType[] types = DebugPlugin.getLogicalStructureTypes(value);
- if (types.length > 0) {
- ILogicalStructureType type = DebugPlugin.getDefaultStructureType(types);
- if (type != null && !previousStructureIds.contains(type.getId())) {
- IValue logicalValue = getLogicalStructureCache().getLogicalStructure(type, value);
- previousStructureIds.add(type.getId());
- return getLogicalValue(logicalValue, previousStructureIds, context);
- }
- }
- }
- return value;
- }
-
- /**
- * Returns the logical structure cache to use to store calculated structures. If the cache does not
- * exist yet, one is created and a debug event listener is added to clear the cache on RESUME and
- * TERMINATE events.
- *
- * @return the logical structure cache to use
- */
- protected synchronized LogicalStructureCache getLogicalStructureCache(){
- if (fgLogicalCache == null){
- fgLogicalCache = new LogicalStructureCache();
- // Add a listener to clear the cache when resuming, terminating, or suspending
- DebugPlugin.getDefault().addDebugEventListener(new IDebugEventSetListener(){
- public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- if (events[i].getKind() == DebugEvent.TERMINATE){
- fgLogicalCache.clear();
- break;
- } else if (events[i].getKind() == DebugEvent.RESUME && events[i].getDetail() != DebugEvent.EVALUATION_IMPLICIT){
- fgLogicalCache.clear();
- break;
- } else if (events[i].getKind() == DebugEvent.SUSPEND && events[i].getDetail() != DebugEvent.EVALUATION_IMPLICIT){
- fgLogicalCache.clear();
- break;
- } else if (events[i].getKind() == DebugEvent.CHANGE && events[i].getDetail() == DebugEvent.CONTENT){
- fgLogicalCache.clear();
- break;
- }
- }
- }
- });
- }
- return fgLogicalCache;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableEditor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableEditor.java
deleted file mode 100644
index b886d20ed..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableEditor.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.debug.internal.ui.elements.adapters.DefaultVariableCellModifier;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementEditor;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @since 3.3
- */
-public class VariableEditor implements IElementEditor {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementEditor#getCellEditor(org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String, java.lang.Object, org.eclipse.swt.widgets.Composite)
- */
- public CellEditor getCellEditor(IPresentationContext context, String columnId, Object element, Composite parent) {
- return new TextCellEditor(parent);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementEditor#getCellModifier(org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.Object)
- */
- public ICellModifier getCellModifier(IPresentationContext context, Object element) {
- return new DefaultVariableCellModifier();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableLabelProvider.java
deleted file mode 100644
index d01ab5121..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableLabelProvider.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.DefaultLabelProvider;
-import org.eclipse.debug.internal.ui.elements.adapters.VariableColumnPresentation;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * Provides context sensitive labels for debug variables.
- *
- * @since 3.3
- */
-public class VariableLabelProvider extends DebugElementLabelProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider#getBackground(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
- */
- protected RGB getBackground(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
- Object element = elementPath.getLastSegment();
- if (columnId != null) {
- if (element instanceof IVariable) {
- IVariable variable = (IVariable) element;
- if (variable.hasValueChanged()) {
- return DebugUIPlugin.getPreferenceColor(IDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND).getRGB();
- }
- }
- }
- return super.getBackground(elementPath, presentationContext, columnId);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider#getForeground(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
- */
- protected RGB getForeground(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
- Object element = elementPath.getLastSegment();
- if (columnId == null) {
- if (element instanceof IVariable) {
- IVariable variable = (IVariable) element;
- if (variable.hasValueChanged()) {
- return DebugUIPlugin.getPreferenceColor(IDebugUIConstants.PREF_CHANGED_DEBUG_ELEMENT_COLOR).getRGB();
- }
- }
- }
- return super.getForeground(elementPath, presentationContext, columnId);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider#getImageDescriptor(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
- */
- protected ImageDescriptor getImageDescriptor(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
- if (columnId == null || VariableColumnPresentation.COLUMN_VARIABLE_NAME.equals(columnId)) {
- return super.getImageDescriptor(elementPath, presentationContext, columnId);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider#getFontData(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
- */
- protected FontData getFontData(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
- return JFaceResources.getFontDescriptor(IDebugUIConstants.PREF_VARIABLE_TEXT_FONT).getFontData()[0];
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider#getLabel(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
- */
- protected String getLabel(TreePath elementPath, IPresentationContext context, String columnId) throws CoreException {
- if (columnId == null) {
- return super.getLabel(elementPath, context, columnId);
- } else {
- IVariable variable = (IVariable) elementPath.getLastSegment();
- IValue value = variable.getValue();
- return getColumnText(variable, value, context, columnId);
- }
- }
-
- /**
- * Returns text for a specific columns for the variable/value.
- *
- * @param variable variable to retrieve text for
- * @param value the value associated with the variable
- * @param context presentation context specifying how to display the text
- * @param columnId the column to get the text for
- * @return the label text
- * @throws CoreException
- */
- protected String getColumnText(IVariable variable, IValue value, IPresentationContext context, String columnId) throws CoreException {
- if (VariableColumnPresentation.COLUMN_VARIABLE_NAME.equals(columnId)) {
- return getVariableName(variable, context);
- } else if (VariableColumnPresentation.COLUMN_VARIABLE_TYPE.equals(columnId)) {
- return getVariableTypeName(variable, context);
- } else if (VariableColumnPresentation.COLUMN_VARIABLE_VALUE.equals(columnId)) {
- return getValueText(variable, value, context);
- } else if (VariableColumnPresentation.COLUMN_VALUE_TYPE.equals(columnId)) {
- return getValueTypeName(variable, value, context);
- }
- return null;
- }
-
- /**
- * Returns the name of the given variable to display in <code>COLUMN_VARIABLE_NAME</code>.
- *
- * @param variable
- * @return variable name
- * @throws CoreException
- */
- protected String getVariableName(IVariable variable, IPresentationContext context) throws CoreException {
- return variable.getName();
- }
-
- /**
- * Returns the type name of the given variable to display in <code>COLUMN_VARIABLE_TYPE</code>.
- *
- * @param variable
- * @return variable type name
- * @throws CoreException
- */
- protected String getVariableTypeName(IVariable variable, IPresentationContext context) throws CoreException {
- return variable.getReferenceTypeName();
- }
-
- /**
- * Returns the label for the given value's type to display in <code>COLUMN_VARIABLE_VALUE</code>
- *
- * @param variable
- * @param value
- * @return value label
- * @throws CoreException
- */
- protected String getValueTypeName(IVariable variable, IValue value, IPresentationContext context) throws CoreException {
- return value.getReferenceTypeName();
- }
-
- /**
- * Returns the label for the given value to display in <code>COLUMN_VALUE_TYPE</code>
- *
- * @param variable
- * @param value
- * @return value label
- * @throws CoreException
- */
- protected String getValueText(IVariable variable, IValue value, IPresentationContext context) throws CoreException {
- return escapeSpecialChars(value.getValueString());
- }
-
- /**
- * Escapes special characters using the default label provider
- *
- * @param label the text to escape
- * @return the string with special characters escaped
- */
- protected String escapeSpecialChars(String label) {
- return DefaultLabelProvider.escapeSpecialChars(label);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableMementoProvider.java
deleted file mode 100644
index f64ff8b7a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableMementoProvider.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-
-/**
- * Memento provider for variables and registers.
- *
- * @since 3.4
- */
-public class VariableMementoProvider extends DebugElementMementoProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.DebugElementMementoProvider#getElementName(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
- */
- protected String getElementName(Object element, IPresentationContext context) throws CoreException {
- if (element instanceof IVariable) {
- return ((IVariable) element).getName();
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ViewerInputProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ViewerInputProvider.java
deleted file mode 100644
index cc0bf6208..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ViewerInputProvider.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-
-/**
- * Common code for viewer input providers. Creates a job to process request asynchronously.
-
- * @since 3.4
- */
-public abstract class ViewerInputProvider implements IViewerInputProvider {
-
- protected static final Object[] EMPTY = new Object[0];
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider#updateChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IElementRequestMonitor)
- */
- public void update(final IViewerInputUpdate update) {
- Job job = new Job("viewer input resolution") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- if (!update.isCanceled()) {
- retrieveInput(update);
- }
- update.done();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(getRule(update));
- job.schedule();
- }
-
- /**
- * Computes the viewer input for the specified context.
- *
- * @param update update request
- */
- protected void retrieveInput(IViewerInputUpdate update) {
- if (!update.isCanceled()) {
- IStatus status = Status.OK_STATUS;
- try {
- IPresentationContext context = update.getPresentationContext();
- if (supportsContext(context)) {
- update.setInputElement(getViewerInput(update.getElement(), context, update));
- } else {
- update.setInputElement(update.getElement());
- }
- } catch (CoreException e) {
- status = e.getStatus();
- }
- update.setStatus(status);
- }
- }
-
-
- /**
- * Returns the viewer input derived from the given source object in the specified
- * context, possibly <code>null</code>.
- *
- * @param source element to derive a viewer input from
- * @param context context for which an input is requested
- * @param update viewer update request
- * @throws CoreException if an exception occurs retrieving child
- */
- protected abstract Object getViewerInput(Object source, IPresentationContext context, IViewerUpdate update) throws CoreException;
-
-
- /**
- * Returns whether this adapter supports the given context.
- *
- * @param context
- * @return whether this adapter supports the given context
- */
- protected boolean supportsContext(IPresentationContext context) {
- return supportsContextId(context.getId());
- }
-
- /**
- * Returns whether this adapter provides content in the specified context id.
- *
- * @param id part id
- * @return whether this adapter provides content in the specified context id
- */
- protected abstract boolean supportsContextId(String id);
-
- /**
- * Returns a scheduling rule to use when performing the given updates or
- * <code>null</code> if none.
- *
- * @param updates
- * @return scheduling rule or <code>null</code> if none
- */
- protected ISchedulingRule getRule(IViewerInputUpdate update) {
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/BooleanFieldEditor2.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/BooleanFieldEditor2.java
deleted file mode 100644
index 91e434280..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/BooleanFieldEditor2.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.preferences;
-
-
-import org.eclipse.jface.preference.BooleanFieldEditor;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * A boolean field editor that provides access to this editors boolean
- * button.
- */
-public class BooleanFieldEditor2 extends BooleanFieldEditor {
-
- private Button fChangeControl;
-
- /**
- * @see BooleanFieldEditor#BooleanFieldEditor(java.lang.String, java.lang.String, int, org.eclipse.swt.widgets.Composite)
- */
- public BooleanFieldEditor2(
- String name,
- String labelText,
- int style,
- Composite parent) {
- super(name, labelText, style, parent);
- }
-
- /**
- * @see org.eclipse.jface.preference.BooleanFieldEditor#getChangeControl(Composite)
- */
- public Button getChangeControl(Composite parent) {
- if (fChangeControl == null) {
- fChangeControl = super.getChangeControl(parent);
- }
- return fChangeControl;
- }
-
-
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ConsolePreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ConsolePreferencePage.java
deleted file mode 100644
index 5a4b7253b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ConsolePreferencePage.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.preferences;
-
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.jface.preference.BooleanFieldEditor;
-import org.eclipse.jface.preference.ColorFieldEditor;
-import org.eclipse.jface.preference.FieldEditor;
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.IntegerFieldEditor;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * A page to set the preferences for the console
- */
-public class ConsolePreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
-
- /**
- * This class exists to provide visibility to the
- * <code>refreshValidState</code> method and to perform more intelligent
- * clearing of the error message.
- */
- protected class ConsoleIntegerFieldEditor extends IntegerFieldEditor {
-
- public ConsoleIntegerFieldEditor(String name, String labelText, Composite parent) {
- super(name, labelText, parent);
- }
-
- /**
- * @see org.eclipse.jface.preference.FieldEditor#refreshValidState()
- */
- protected void refreshValidState() {
- super.refreshValidState();
- }
-
- /**
- * Clears the error message from the message line if the error
- * message is the error message from this field editor.
- */
- protected void clearErrorMessage() {
- if (canClearErrorMessage()) {
- super.clearErrorMessage();
- }
- }
- }
-
- private BooleanFieldEditor2 fWrapEditor = null;
- private ConsoleIntegerFieldEditor fWidthEditor = null;
-
- private BooleanFieldEditor2 fUseBufferSize = null;
- private ConsoleIntegerFieldEditor fBufferSizeEditor = null;
-
- private ConsoleIntegerFieldEditor fTabSizeEditor = null;
-
- /**
- * Create the console page.
- */
- public ConsolePreferencePage() {
- super(GRID);
- setDescription(DebugPreferencesMessages.ConsolePreferencePage_Console_settings);
- setPreferenceStore(DebugUIPlugin.getDefault().getPreferenceStore());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createControl(Composite)
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(
- getControl(),
- IDebugHelpContextIds.CONSOLE_PREFERENCE_PAGE );
- }
-
- /**
- * Create all field editors for this page
- */
- public void createFieldEditors() {
-
- fWrapEditor = new BooleanFieldEditor2(IDebugPreferenceConstants.CONSOLE_WRAP, DebugPreferencesMessages.ConsolePreferencePage_Wrap_text_1, SWT.NONE, getFieldEditorParent());
- addField(fWrapEditor);
-
- fWidthEditor = new ConsoleIntegerFieldEditor(IDebugPreferenceConstants.CONSOLE_WIDTH, DebugPreferencesMessages.ConsolePreferencePage_Console_width, getFieldEditorParent());
- addField(fWidthEditor);
- fWidthEditor.setValidRange(80, 1000);
- fWidthEditor.setErrorMessage(DebugPreferencesMessages.ConsolePreferencePage_console_width);
-
- fWrapEditor.getChangeControl(getFieldEditorParent()).addSelectionListener(
- new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateWidthEditor();
- }
- }
- );
-
- fUseBufferSize = new BooleanFieldEditor2(IDebugPreferenceConstants.CONSOLE_LIMIT_CONSOLE_OUTPUT, DebugPreferencesMessages.ConsolePreferencePage_Limit_console_output_1, SWT.NONE, getFieldEditorParent());
- addField(fUseBufferSize);
-
- fBufferSizeEditor = new ConsoleIntegerFieldEditor(IDebugPreferenceConstants.CONSOLE_LOW_WATER_MARK, DebugPreferencesMessages.ConsolePreferencePage_Console_buffer_size__characters___2, getFieldEditorParent());
- addField(fBufferSizeEditor);
- fBufferSizeEditor.setValidRange(1000, 1000000);
- fBufferSizeEditor.setErrorMessage(DebugPreferencesMessages.ConsolePreferencePage_The_console_buffer_size_must_be_at_least_1000_characters__1);
-
- fUseBufferSize.getChangeControl(getFieldEditorParent()).addSelectionListener(
- new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateBufferSizeEditor();
- }
- }
- );
-
- fTabSizeEditor = new ConsoleIntegerFieldEditor(IDebugPreferenceConstants.CONSOLE_TAB_WIDTH, DebugPreferencesMessages.ConsolePreferencePage_12, getFieldEditorParent());
- addField(fTabSizeEditor);
- fTabSizeEditor.setValidRange(1,100);
- fTabSizeEditor.setErrorMessage(DebugPreferencesMessages.ConsolePreferencePage_13);
-
- addField(new BooleanFieldEditor(IDebugPreferenceConstants.CONSOLE_OPEN_ON_OUT, DebugPreferencesMessages.ConsolePreferencePage_Show__Console_View_when_there_is_program_output_3, SWT.NONE, getFieldEditorParent()));
- addField(new BooleanFieldEditor(IDebugPreferenceConstants.CONSOLE_OPEN_ON_ERR, DebugPreferencesMessages.ConsolePreferencePage_Show__Console_View_when_there_is_program_error_3, SWT.NONE, getFieldEditorParent()));
-
- ColorFieldEditor sysout= new ColorFieldEditor(IDebugPreferenceConstants.CONSOLE_SYS_OUT_COLOR, DebugPreferencesMessages.ConsolePreferencePage_Standard_Out__2, getFieldEditorParent());
- ColorFieldEditor syserr= new ColorFieldEditor(IDebugPreferenceConstants.CONSOLE_SYS_ERR_COLOR, DebugPreferencesMessages.ConsolePreferencePage_Standard_Error__3, getFieldEditorParent());
- ColorFieldEditor sysin= new ColorFieldEditor(IDebugPreferenceConstants.CONSOLE_SYS_IN_COLOR, DebugPreferencesMessages.ConsolePreferencePage_Standard_In__4, getFieldEditorParent());
- ColorFieldEditor background= new ColorFieldEditor(IDebugPreferenceConstants.CONSOLE_BAKGROUND_COLOR, DebugPreferencesMessages.ConsolePreferencePage_11, getFieldEditorParent());
-
- addField(sysout);
- addField(syserr);
- addField(sysin);
- addField(background);
- }
-
- /**
- * @see IWorkbenchPreferencePage#init(IWorkbench)
- */
- public void init(IWorkbench workbench) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
- public boolean performOk() {
- boolean ok= super.performOk();
- // update high water mark to be (about) 100 lines (100 * 80 chars) greater than low water mark
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- int low = store.getInt(IDebugPreferenceConstants.CONSOLE_LOW_WATER_MARK);
- int high = low + 8000;
- store.setValue(IDebugPreferenceConstants.CONSOLE_HIGH_WATER_MARK, high);
- return ok;
- }
-
- /**
- * @see org.eclipse.jface.preference.FieldEditorPreferencePage#initialize()
- */
- protected void initialize() {
- super.initialize();
- updateWidthEditor();
- updateBufferSizeEditor();
- }
-
- /**
- * Update enablement of width editor based on enablement of 'fixed width' editor.
- */
- protected void updateWidthEditor() {
- Button b = fWrapEditor.getChangeControl(getFieldEditorParent());
- fWidthEditor.getTextControl(getFieldEditorParent()).setEnabled(b.getSelection());
- fWidthEditor.getLabelControl(getFieldEditorParent()).setEnabled(b.getSelection());
- }
-
- /**
- * Update enablement of buffer size editor based on enablement of 'limit
- * console output' editor.
- */
- protected void updateBufferSizeEditor() {
- Button b = fUseBufferSize.getChangeControl(getFieldEditorParent());
- fBufferSizeEditor.getTextControl(getFieldEditorParent()).setEnabled(b.getSelection());
- fBufferSizeEditor.getLabelControl(getFieldEditorParent()).setEnabled(b.getSelection());
- }
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
- protected void performDefaults() {
- super.performDefaults();
- updateWidthEditor();
- updateBufferSizeEditor();
- }
-
- protected boolean canClearErrorMessage() {
- if (fWidthEditor.isValid() && fBufferSizeEditor.isValid()) {
- return true;
- }
- return false;
- }
-
- /**
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
-
- if (event.getProperty().equals(FieldEditor.IS_VALID)) {
- boolean newValue = ((Boolean) event.getNewValue()).booleanValue();
- // If the new value is true then we must check all field editors.
- // If it is false, then the page is invalid in any case.
- if (newValue) {
- if (fWidthEditor != null && event.getSource() != fWidthEditor) {
- fWidthEditor.refreshValidState();
- }
- if (fBufferSizeEditor != null && event.getSource() != fBufferSizeEditor) {
- fBufferSizeEditor.refreshValidState();
- }
- checkState();
- } else {
- super.propertyChange(event);
- }
-
- } else {
- super.propertyChange(event);
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencePage.java
deleted file mode 100644
index 9f6ea8800..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencePage.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.preferences;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.preference.BooleanFieldEditor;
-import org.eclipse.jface.preference.ColorFieldEditor;
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * The page for setting debugger preferences. Built on the 'field editor' infrastructure.
- */
-public class DebugPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage, IDebugPreferenceConstants {
-
- public DebugPreferencePage() {
- super(GRID);
-
- IPreferenceStore store= DebugUIPlugin.getDefault().getPreferenceStore();
- setPreferenceStore(store);
- setDescription(DebugPreferencesMessages.DebugPreferencePage_1);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createControl(Composite)
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.DEBUG_PREFERENCE_PAGE);
- }
-
- /**
- * @see FieldEditorPreferencePage#createFieldEditors
- */
- protected void createFieldEditors() {
- addField(new BooleanFieldEditor(IDebugUIConstants.PREF_REUSE_EDITOR, DebugPreferencesMessages.DebugPreferencePage_2, SWT.NONE, getFieldEditorParent()));
-
- SWTFactory.createHorizontalSpacer(getFieldEditorParent(), 2);
-
- addField(new BooleanFieldEditor(IDebugUIConstants.PREF_ACTIVATE_WORKBENCH, DebugPreferencesMessages.DebugPreferencePage_3, SWT.NONE, getFieldEditorParent()));
- addField(new BooleanFieldEditor(IInternalDebugUIConstants.PREF_ACTIVATE_DEBUG_VIEW, DebugPreferencesMessages.DebugPreferencePage_26, SWT.NONE, getFieldEditorParent()));
-
- SWTFactory.createHorizontalSpacer(getFieldEditorParent(), 2);
-
- addField(new BooleanFieldEditor(IDebugUIConstants.PREF_SKIP_BREAKPOINTS_DURING_RUN_TO_LINE, DebugPreferencesMessages.DebugPreferencePage_25, SWT.NONE, getFieldEditorParent()));
- addField(new BooleanFieldEditor(IDebugPreferenceConstants.PREF_PROMPT_REMOVE_ALL_BREAKPOINTS, DebugPreferencesMessages.DebugPreferencePage_29, SWT.NONE, getFieldEditorParent()));
- addField(new BooleanFieldEditor(IDebugPreferenceConstants.PREF_PROMPT_REMOVE_BREAKPOINTS_FROM_CONTAINER, DebugPreferencesMessages.DebugPreferencePage_30, SWT.NONE, getFieldEditorParent()));
- addField(new BooleanFieldEditor(IDebugPreferenceConstants.PREF_PROMPT_REMOVE_ALL_EXPRESSIONS, DebugPreferencesMessages.DebugPreferencePage_5, SWT.NONE, getFieldEditorParent()));
-
- SWTFactory.createHorizontalSpacer(getFieldEditorParent(), 2);
- ColorFieldEditor mem= new ColorFieldEditor(IDebugUIConstants.PREF_CHANGED_DEBUG_ELEMENT_COLOR, DebugPreferencesMessages.DebugPreferencePage_4, getFieldEditorParent());
- addField(mem);
- mem = new ColorFieldEditor(IDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND, DebugPreferencesMessages.DebugPreferencePage_28, getFieldEditorParent());
- addField(mem);
- mem= new ColorFieldEditor(IDebugUIConstants.PREF_MEMORY_HISTORY_UNKNOWN_COLOR, DebugPreferencesMessages.DebugPreferencePage_0, getFieldEditorParent());
- addField(mem);
- mem= new ColorFieldEditor(IDebugUIConstants.PREF_MEMORY_HISTORY_KNOWN_COLOR, DebugPreferencesMessages.DebugPreferencePage_27, getFieldEditorParent());
- addField(mem);
- }
-
- /**
- * @see IWorkbenchPreferencePage#init(IWorkbench)
- */
- public void init(IWorkbench workbench) {}
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.java
deleted file mode 100644
index 7c0681c04..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.preferences;
-
-import org.eclipse.osgi.util.NLS;
-
-public class DebugPreferencesMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.preferences.DebugPreferencesMessages";//$NON-NLS-1$
-
- public static String ConsolePreferencePage_11;
-
- public static String ConsolePreferencePage_Console_settings;
- public static String ConsolePreferencePage_Show__Console_View_when_there_is_program_error_3;
- public static String ConsolePreferencePage_Show__Console_View_when_there_is_program_output_3;
- public static String ConsolePreferencePage_Standard_Error__3;
- public static String ConsolePreferencePage_Standard_In__4;
- public static String ConsolePreferencePage_Standard_Out__2;
- public static String ConsolePreferencePage_Wrap_text_1;
- public static String ConsolePreferencePage_Console_width;
- public static String ConsolePreferencePage_Limit_console_output_1;
- public static String ConsolePreferencePage_Console_buffer_size__characters___2;
- public static String ConsolePreferencePage_The_console_buffer_size_must_be_at_least_1000_characters__1;
- public static String ConsolePreferencePage_console_width;
- public static String ConsolePreferencePage_12;
- public static String ConsolePreferencePage_13;
-
- public static String DebugPreferencePage_1;
- public static String DebugPreferencePage_2;
-
- public static String DebugPreferencePage_29;
- public static String DebugPreferencePage_3;
- public static String DebugPreferencePage_0;
-
- public static String DebugPreferencePage_30;
- public static String DebugPreferencePage_4;
- public static String DebugPreferencePage_10;
- public static String DebugPreferencePage_11;
- public static String DebugPreferencePage_21;
- public static String DebugPreferencePage_22;
- public static String DebugPreferencePage_23;
- public static String DebugPreferencePage_24;
- public static String DebugPreferencePage_25;
- public static String DebugPreferencePage_26;
- public static String DebugPreferencePage_27;
-
- public static String DefaultLaunchConfigurationsPropertiesPage_0;
-
- public static String DefaultLaunchConfigurationsPropertiesPage_1;
- public static String DefaultLaunchConfigurationsPropertiesPage_11;
- public static String DefaultLaunchConfigurationsPropertiesPage_12;
- public static String DefaultLaunchConfigurationsPropertiesPage_2;
- public static String DefaultLaunchConfigurationsPropertiesPage_3;
- public static String DefaultLaunchConfigurationsPropertiesPage_4;
- public static String DefaultLaunchConfigurationsPropertiesPage_5;
- public static String DefaultLaunchConfigurationsPropertiesPage_6;
- public static String DefaultLaunchConfigurationsPropertiesPage_7;
- public static String DefaultLaunchConfigurationsPropertiesPage_8;
- public static String DefaultLaunchConfigurationsPropertiesPage_9;
-
- public static String LaunchDelegatesPreferencePage_0;
-
- public static String LaunchDelegatesPreferencePage_1;
- public static String LaunchDelegatesPreferencePage_2;
- public static String LaunchDelegatesPreferencePage_3;
-
- public static String LaunchDelegatesPreferencePage_4;
-
- public static String LaunchersPreferencePage_0;
-
- public static String LaunchingPreferencePage_40;
- public static String LaunchingPreferencePage_1;
- public static String LaunchingPreferencePage_2;
- public static String LaunchingPreferencePage_3;
- public static String LaunchingPreferencePage_37;
- public static String LaunchingPreferencePage_38;
- public static String LaunchingPreferencePage_39;
- public static String LaunchingPreferencePage_4;
-
- public static String LaunchingPreferencePage_41;
- public static String LaunchingPreferencePage_5;
- public static String LaunchingPreferencePage_6;
- public static String LaunchingPreferencePage_7;
- public static String LaunchingPreferencePage_8;
- public static String LaunchingPreferencePage_9;
- public static String LaunchingPreferencePage_10;
- public static String LaunchingPreferencePage_11;
- public static String LaunchingPreferencePage_12;
- public static String LaunchingPreferencePage_13;
- public static String LaunchingPreferencePage_14;
- public static String LaunchingPreferencePage_15;
- public static String LaunchingPreferencePage_16;
- public static String LaunchingPreferencePage_17;
- public static String LaunchingPreferencePage_18;
- public static String LaunchingPreferencePage_21;
- public static String LaunchingPreferencePage_22;
- public static String LaunchingPreferencePage_23;
- public static String LaunchingPreferencePage_26;
- public static String LaunchingPreferencePage_27;
- public static String LaunchingPreferencePage_0;
- public static String LaunchingPreferencePage_28;
- public static String LaunchingPreferencePage_29;
- public static String LaunchingPreferencePage_30;
- public static String LaunchingPreferencePage_31;
- public static String LaunchingPreferencePage_32;
- public static String LaunchingPreferencePage_33;
- public static String LaunchingPreferencePage_34;
- public static String LaunchingPreferencePage_35;
- public static String LaunchingPreferencePage_36;
-
- public static String LaunchingPreferencePage_confirm_0;
-
- public static String LaunchPerspectivePreferencePage_0;
-
- public static String LaunchPerspectivePreferencePage_1;
-
- public static String PerspectivePreferencePage_0;
- public static String PerspectivePreferencePage_1;
- public static String PerspectivePreferencePage_2;
- public static String PerspectivePreferencePage_4;
- public static String PerspectivePreferencePage_5;
-
- public static String LaunchConfigurationsPreferencePage_1;
- public static String LaunchConfigurationsPreferencePage_0;
-
- public static String ProcessPropertyPage_Command_Line__1;
-
- public static String SimpleVariablePreferencePage_3;
- public static String SimpleVariablePreferencePage_4;
- public static String SimpleVariablePreferencePage_5;
- public static String SimpleVariablePreferencePage_6;
- public static String SimpleVariablePreferencePage_7;
- public static String SimpleVariablePreferencePage_8;
- public static String SimpleVariablePreferencePage_9;
- public static String SimpleVariablePreferencePage_10;
- public static String SimpleVariablePreferencePage_11;
- public static String SimpleVariablePreferencePage_12;
- public static String SimpleVariablePreferencePage_13;
- public static String SimpleVariablePreferencePage_14;
- public static String SimpleVariablePreferencePage_15;
- public static String SimpleVariablePreferencePage_16;
- public static String SimpleLaunchVariablePreferencePage_21;
- public static String SimpleLaunchVariablePreferencePage_22;
- public static String SimpleLaunchVariablePreferencePage_23;
-
- public static String StringVariablePreferencePage_20;
- public static String StringVariablePreferencePage_21;
- public static String StringVariablePreferencePage_22;
- public static String StringVariablePreferencePage_23;
- public static String StringVariablePreferencePage_24;
- public static String StringVariablePreferencePage_25;
- public static String StringVariablePreferencePage_26;
- public static String StringVariablePreferencePage_27;
-
- public static String ViewManagementPreferencePage_0;
- public static String ViewManagementPreferencePage_1;
- public static String ViewManagementPreferencePage_2;
- public static String ViewManagementPreferencePage_3;
- public static String ViewManagementPreferencePage_4;
- public static String ViewManagementPreferencePage_5;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, DebugPreferencesMessages.class);
- }
-
- public static String LaunchConfigurationsPreferencePage_2;
-
- public static String LaunchConfigurationsPreferencePage_3;
-
- public static String ProcessPropertyPage_0;
-
- public static String ProcessPropertyPage_1;
-
- public static String ProcessPropertyPage_2;
-
- public static String ProcessPropertyPage_3;
-
- public static String ProcessPropertyPage_4;
-
- public static String ProcessPropertyPage_5;
-
- public static String DebugPreferencePage_28;
-
- public static String DebugPreferencePage_5;
-
- public static String RunDebugPropertiesPage_0;
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties
deleted file mode 100644
index f712d8e3a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencesMessages.properties
+++ /dev/null
@@ -1,155 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2009 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-ConsolePreferencePage_Console_settings=Debug Console Settings.
-ConsolePreferencePage_Show__Console_View_when_there_is_program_error_3=Show when &program writes to standard error
-ConsolePreferencePage_Show__Console_View_when_there_is_program_output_3=&Show when program writes to standard out
-ConsolePreferencePage_Standard_Error__3=Standard &Error text color:
-ConsolePreferencePage_Standard_In__4=Standard &In text color:
-ConsolePreferencePage_Standard_Out__2=Standard &Out text color:
-ConsolePreferencePage_Wrap_text_1=Fixed &width console
-ConsolePreferencePage_Console_width=&Maximum character width:
-ConsolePreferencePage_Limit_console_output_1=&Limit console output
-ConsolePreferencePage_Console_buffer_size__characters___2=Console &buffer size (characters):
-ConsolePreferencePage_The_console_buffer_size_must_be_at_least_1000_characters__1=Buffer size must be between 1000 and 1000000 inclusive.
-ConsolePreferencePage_console_width=Character width must be between 80 and 1000 inclusive.
-ConsolePreferencePage_12=Displayed &tab width:
-ConsolePreferencePage_13=Tab width must be between 1 and 100 inclusive.
-ConsolePreferencePage_11=Back&ground color:
-
-DebugPreferencePage_1=General Settings for Running and Debugging.
-DebugPreferencePage_2=Re&use editor when displaying source code
-DebugPreferencePage_3=Activate the workbenc&h when a breakpoint is hit
-DebugPreferencePage_0=&Memory unbuffered color:
-DebugPreferencePage_4=Changed &value color:
-DebugPreferencePage_10=Si&ze of recently launched applications list:
-DebugPreferencePage_11=The size of recently launched applications should be between {0} and {1}
-DebugPreferencePage_21=Open the associated perspective when an application suspends
-DebugPreferencePage_22=A&lways
-DebugPreferencePage_23=&Never
-DebugPreferencePage_24=&Prompt
-DebugPreferencePage_25=Skip &breakpoints during a 'Run to Line' operation.
-DebugPreferencePage_26=A&ctivate the debug view when a breakpoint is hit
-DebugPreferencePage_27=Memor&y buffered color:
-DebugPreferencePage_28=Changed value bac&kground color:
-DebugPreferencePage_29=&Prompt for confirmation when deleting all breakpoints.
-DebugPreferencePage_30=Prompt for confirmation when deleting breakpoint con&tainers.
-DebugPreferencePage_5=Prompt for confirmation when deleting all e&xpressions.
-
-LaunchingPreferencePage_1=&Build (if required) before launching
-LaunchingPreferencePage_2=Save required dirty editors before launching
-LaunchingPreferencePage_3=Alwa&ys
-LaunchingPreferencePage_4=&Never
-LaunchingPreferencePage_5=&Prompt
-LaunchingPreferencePage_6=Wait for ongoing build to complete before launching
-LaunchingPreferencePage_7=A&lways
-LaunchingPreferencePage_8=N&ever
-LaunchingPreferencePage_9=Pro&mpt
-LaunchingPreferencePage_0=Select the launch configurations to &migrate:
-LaunchersPreferencePage_0=Currently there are no conflicting launchers.
-LaunchingPreferencePage_10=Remove term&inated launches when a new launch is created
-LaunchingPreferencePage_11=Open the associated perspective when launching
-LaunchingPreferencePage_12=Al&ways
-LaunchingPreferencePage_13=Ne&ver
-LaunchingPreferencePage_14=Pr&ompt
-LaunchingPreferencePage_15=Launch in debug mode when workspace contains breakpoints
-LaunchingPreferencePage_16=Alway&s
-LaunchingPreferencePage_17=Neve&r
-LaunchingPreferencePage_18=Promp&t
-LaunchingPreferencePage_21=Continue launch if project contains errors
-LaunchingPreferencePage_22=Al&ways
-LaunchingPreferencePage_23=Pr&ompt
-LaunchingPreferencePage_26=Search for, select, and upgrade launch configurations to be compatible with current tooling.
-LaunchingPreferencePage_27=Mi&grate...
-LaunchingPreferencePage_28=Select Launch Configurations
-LaunchingPreferencePage_29=No Candidates
-LaunchingPreferencePage_30=None of the available launch configurations require migration.
-LaunchingPreferencePage_31=Migrating launch configurations...
-LaunchingPreferencePage_32=Launch Configuration Filters
-LaunchingPreferencePage_33=&Filter configurations in closed projects
-LaunchingPreferencePage_34=Filter configurations in dele&ted or missing projects
-LaunchingPreferencePage_35=Migration
-LaunchingPreferencePage_36=General Options
-LaunchingPreferencePage_37=Always launch the previously launched appli&cation
-LaunchingPreferencePage_38=Launch t&he selected resource or active editor. If not launchable:
-LaunchingPreferencePage_39=Launch the associated pro&ject
-LaunchingPreferencePage_40=Launch Operation
-LaunchingPreferencePage_41=La&unch the previously launched application
-LaunchingPreferencePage_confirm_0=Prompt for confirmation when removin&g a configuration from the launch history
-
-ProcessPropertyPage_Command_Line__1=Co&mmand Line:
-ProcessPropertyPage_0=Run-&at time:
-ProcessPropertyPage_1=&Path:
-ProcessPropertyPage_2=Process properties
-ProcessPropertyPage_3=No path information available
-ProcessPropertyPage_4=No time information available
-ProcessPropertyPage_5=No command line information provided
-
-SimpleVariablePreferencePage_3=Variable
-SimpleVariablePreferencePage_4=Value
-SimpleVariablePreferencePage_5=Description
-SimpleVariablePreferencePage_6=&Create and configure string substitution variables.
-SimpleVariablePreferencePage_7=&New...
-SimpleVariablePreferencePage_8=&Edit...
-SimpleVariablePreferencePage_9=&Remove
-SimpleVariablePreferencePage_10=&Name:
-SimpleVariablePreferencePage_11=&Value:
-SimpleVariablePreferencePage_12=&Description:
-SimpleVariablePreferencePage_13=New String Substitution Variable
-SimpleVariablePreferencePage_14=Edit Variable: {0}
-SimpleVariablePreferencePage_15=Overwrite variable?
-SimpleVariablePreferencePage_16=A variable named {0} already exists. Overwrite?
-SimpleLaunchVariablePreferencePage_21=Remove Contributed Variables
-SimpleLaunchVariablePreferencePage_22=The following variables were contributed by plug-ins. Removing them may cause unknown problems.\n{0}\nProceed?
-SimpleLaunchVariablePreferencePage_23=\ [contributed]
-StringVariablePreferencePage_24=Error
-StringVariablePreferencePage_25=Unable to save changes
-StringVariablePreferencePage_26=\ [read only]
-StringVariablePreferencePage_27=Contributed By
-StringVariablePreferencePage_23=Cannot overwrite read only variable
-StringVariablePreferencePage_22=A read only variable named {0} already exists. Read only variables can not be overwritten.
-StringVariablePreferencePage_21=Problem creating variable
-StringVariablePreferencePage_20=Variables cannot have an empty name.
-ViewManagementPreferencePage_0=The Debug View can automatically open and close views based on selection. Choose in which perspectives this feature should be enabled:
-ViewManagementPreferencePage_1=View Management
-ViewManagementPreferencePage_2=&Perspectives:
-ViewManagementPreferencePage_3=Do &not automatically open/close views which have been manually closed/opened.
-ViewManagementPreferencePage_4=The list of views that have been manually opened/closed is persisted between sessions.
-ViewManagementPreferencePage_5=&Reset
-PerspectivePreferencePage_0=These settings control perspectives for running and debugging. A perspective can automatically open when launching or when an application suspends.
-PerspectivePreferencePage_1=Appli&cation Types/Launchers:
-PerspectivePreferencePage_2=Modes/Perspec&tives:
-PerspectivePreferencePage_4=None
-PerspectivePreferencePage_5=These settings assign perspectives to each application type or launcher and launch mode set. Select "None" to indicate that a perspective should not be opened.
-LaunchConfigurationsPreferencePage_0=Filter checked launch configuration type&s:
-LaunchConfigurationsPreferencePage_1=Launch Configurations
-LaunchConfigurationsPreferencePage_2=Delete &configurations when associated resource is deleted
-LaunchConfigurationsPreferencePage_3=Apply window &working set(s)
-LaunchDelegatesPreferencePage_1=The settings on this page specify which launcher to use when multiple launchers are available for a configuration and launch mode.
-LaunchDelegatesPreferencePage_2=Launch &Type/Mode:
-LaunchDelegatesPreferencePage_3=P&referred Launcher:
-LaunchDelegatesPreferencePage_0=Default Launcher
-LaunchDelegatesPreferencePage_4=Launcher Description
-LaunchPerspectivePreferencePage_0=There is no perspective information available to change.
-LaunchPerspectivePreferencePage_1=The selected types/launchers do not have any common mode sets.
-DefaultLaunchConfigurationsPropertiesPage_0=This page allows you to manage launch configurations associated with the currently selected resource.
-DefaultLaunchConfigurationsPropertiesPage_1=Launch con&figurations for ''{0}'':
-DefaultLaunchConfigurationsPropertiesPage_2=&New...
-DefaultLaunchConfigurationsPropertiesPage_3=Create new launch configuration
-DefaultLaunchConfigurationsPropertiesPage_4=Du&plicate
-DefaultLaunchConfigurationsPropertiesPage_5=Duplicate selected launch configuration
-DefaultLaunchConfigurationsPropertiesPage_6=&Edit...
-DefaultLaunchConfigurationsPropertiesPage_7=Edit selected launch configuration
-DefaultLaunchConfigurationsPropertiesPage_8=De&lete
-DefaultLaunchConfigurationsPropertiesPage_9=Delete selected launch configuration
-DefaultLaunchConfigurationsPropertiesPage_11=Select Configuration Type
-DefaultLaunchConfigurationsPropertiesPage_12=&Select the type of configuration to create:
-RunDebugPropertiesPage_0=There was a problem trying to edit {0}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/IDebugPreferenceConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/IDebugPreferenceConstants.java
deleted file mode 100644
index 971aa7fb7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/IDebugPreferenceConstants.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * QNX Software Systems - Mikhail Khodjaiants - Registers View (Bug 53640)
- * Wind River Systems - Pawel Piech - Added Modules view (bug 211158)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.preferences;
-
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Constants defining the keys to be used for accessing preferences
- * inside the debug ui plugin's preference bundle.
- *
- * In descriptions (of the keys) below describe the preference
- * stored at the given key. The type indicates type of the stored preferences
- *
- * The preference store is loaded by the plugin (DebugUIPlugin).
- * @see DebugUIPlugin.initializeDefaultPreferences(IPreferenceStore) - for initialization of the store
- */
-public interface IDebugPreferenceConstants {
-
- /**
- * The symbolic names for colors for displaying the content in the Console
- * @see org.eclipse.jface.resource.ColorRegistry
- */
- public static final String CONSOLE_SYS_ERR_COLOR= "org.eclipse.debug.ui.errorColor"; //$NON-NLS-1$
- public static final String CONSOLE_SYS_OUT_COLOR= "org.eclipse.debug.ui.outColor"; //$NON-NLS-1$
- public static final String CONSOLE_SYS_IN_COLOR= "org.eclipse.debug.ui.inColor"; //$NON-NLS-1$
- public static final String CONSOLE_BAKGROUND_COLOR= "org.eclipse.debug.ui.consoleBackground"; //$NON-NLS-1$
-
- /**
- * @deprecated use IDebugUIConstants.PREF_MEMORY_HISTORY_UNKNOWN_COLOR instead
- */
- public static final String MEMORY_VIEW_UNBUFFERED_LINE_COLOR = IDebugUIConstants.PLUGIN_ID + ".MemoryViewLineColor"; //$NON-NLS-1$
-
- /**
- * @deprecated use IDebugUIConstants.PREF_MEMORY_HISTORY_KNOWN_COLOR instead
- */
- public static final String MEMORY_VIEW_BUFFERED_LINE_COLOR = IDebugUIConstants.PLUGIN_ID + ".MemoryViewBufferedLineColor"; //$NON-NLS-1$
-
- /**
- * (boolean) Whether or not the text in the console will wrap
- */
- public static final String CONSOLE_WRAP= "Console.wrap"; //$NON-NLS-1$
-
- /**
- * (int) The maximum console character width, if wrapping.
- */
- public static final String CONSOLE_WIDTH = "Console.width"; //$NON-NLS-1$
-
- /**
- * (boolean) Whether or not the console view is shown
- * when there is program output.
- */
- public static final String CONSOLE_OPEN_ON_OUT= "DEBUG.consoleOpenOnOut"; //$NON-NLS-1$
- /**
- * (boolean) Whether or not the console view is shown
- * when there is program error.
- */
- public static final String CONSOLE_OPEN_ON_ERR= "DEBUG.consoleOpenOnErr"; //$NON-NLS-1$
-
- /**
- * Console buffer high and low water marks
- */
- public static final String CONSOLE_LIMIT_CONSOLE_OUTPUT = "Console.limitConsoleOutput"; //$NON-NLS-1$
- public static final String CONSOLE_LOW_WATER_MARK = "Console.lowWaterMark"; //$NON-NLS-1$
- public static final String CONSOLE_HIGH_WATER_MARK = "Console.highWaterMark"; //$NON-NLS-1$
-
- /**
- * Integer preference specifying the number of spaces composing a
- * tab in the console.
- *
- * @since 3.0
- */
- public static final String CONSOLE_TAB_WIDTH= "Console.console_tab_width"; //$NON-NLS-1$
-
-
-
- /**
- * The orientation of the detail view in the VariablesView
- */
- public static final String VARIABLES_DETAIL_PANE_ORIENTATION = "Variables.detail.orientation"; //$NON-NLS-1$
- public static final String EXPRESSIONS_DETAIL_PANE_ORIENTATION = "Expressions.detail.orientation"; //$NON-NLS-1$
- public static final String REGISTERS_DETAIL_PANE_ORIENTATION = "Registers.detail.orientation"; //$NON-NLS-1$
- public static final String MODULES_DETAIL_PANE_ORIENTATION = "Modules.detail.orientation"; //$NON-NLS-1$
- public static final String VARIABLES_DETAIL_PANE_RIGHT = "Variables.detail.orientation.right"; //$NON-NLS-1$
- public static final String VARIABLES_DETAIL_PANE_UNDERNEATH = "Variables.detail.orientation.underneath"; //$NON-NLS-1$
- public static final String VARIABLES_DETAIL_PANE_HIDDEN = "Variables.detail.orientation.hidden"; //$NON-NLS-1$
-
- /**
- * Memento for the last selected launch config in the
- * launch config dialog.
- *
- * @deprecated no longer supported
- */
- public static final String PREF_LAST_LAUNCH_CONFIGURATION_SELECTION = IDebugUIConstants.PLUGIN_ID + ".lastLaunchConfigSelection"; //$NON-NLS-1$
-
- /**
- * The maximum size of the launch history list
- */
- public static int MAX_LAUNCH_HISTORY_SIZE= 40;
-
- /**
- * Boolean preference controlling whether the text in the detail panes is
- * wrapped. When <code>true</code> the text in the detail panes will be
- * wrapped in new variable view.
- *
- * @since 2.1
- */
- public static final String PREF_DETAIL_PANE_WORD_WRAP = IDebugUIConstants.PLUGIN_ID + ".detail_pane_word_wrap"; //$NON-NLS-1$
-
- /**
- * Column size preference for the Memory View
- *
- * @since 3.0
- */
- public static final String PREF_COLUMN_SIZE = "org.eclipse.debug.ui.memory.columnSize"; //$NON-NLS-1$
-
- /**
- * Default column size for the Memory View
- *
- * @since 3.0
- */
- public static final int PREF_COLUMN_SIZE_DEFAULT = 4;
-
-
- /**
- * Row size preference for Memory View
- *
- * @since 3.2
- */
- public static final String PREF_ROW_SIZE = "org.eclipse.debug.ui.memory.rowSize"; //$NON-NLS-1$
-
- /**
- * Default row size for the Memory View
- *
- * @since 3.2
- */
- public static final int PREF_ROW_SIZE_DEFAULT = 16;
-
- /**
- * Stores the boolean preference of whether to prompt when removing all breakpoints.
- * @since 3.3
- */
- public static final String PREF_PROMPT_REMOVE_ALL_BREAKPOINTS = IDebugUIConstants.PLUGIN_ID + ".remove_all_breakpoints_prompt"; //$NON-NLS-1$
-
- /**
- * stores the boolean preference of whether or not to prompt when removing all of the breakpoints
- * from a breakpoints container.
- * @since 3.3
- */
- public static final String PREF_PROMPT_REMOVE_BREAKPOINTS_FROM_CONTAINER = IDebugUIConstants.PLUGIN_ID + ".remove_breakpoints_from_container_prompt"; //$NON-NLS-1$
-
- /**
- * Stores the boolean preference of whether to prompt when removing all expressions.
- * @since 3.5
- */
- public static final String PREF_PROMPT_REMOVE_ALL_EXPRESSIONS = IDebugUIConstants.PLUGIN_ID + ".remove_all_expressions_prompt"; //$NON-NLS-1$
-
- /**
- * Default padded string for renderings
- *
- * @since 3.1
- */
- public static final String PREF_PADDED_STR_DEFAULT = "??"; //$NON-NLS-1$
-
- /**
- * Default ASCII code page if ASCII code page preference is not set.
- * @since 3.1
- */
- public static final String DEFAULT_ASCII_CP = "CP1252"; //$NON-NLS-1$
-
-
- /**
- * Default EBCDIC code page if EBCDIC code page preference is not set.
- * @since 3.1
- */
- public static final String DEFAULT_EBCDIC_CP = "CP037"; //$NON-NLS-1$
-
- /**
- * Preference to determine if table rendering should dynamically load
- * memory as the user scrolls
- *
- * @since 3.1
- */
- public static final String PREF_DYNAMIC_LOAD_MEM = "org.eclpise.debug.ui.memory.dynamicLoad"; //$NON-NLS-1$
-
-
- /**
- * Size of buffer in a table rendering when dynamic loading mode is off.
- *
- * @since 3.1
- */
- public static final String PREF_TABLE_RENDERING_PAGE_SIZE = "org.eclispe.debug.ui.memory.pageSize"; //$NON-NLS-1$
-
- /**
- * Default page size when dynamic loading mode is off. This preference is stored
- * in number of lines.
- *
- * @since 3.1
- */
- public static final int DEFAULT_PAGE_SIZE = 20;
- /**
- * Preference for defining behavior when resetting a memory monitor.
- * Possible values:
- * - RESET_AL - reset all renderings regardless if they are visible or not
- * - RESET_VISIBLE - reset visible renderings
- *
- * @since 3.2
- */
- public static final String PREF_RESET_MEMORY_BLOCK = IDebugUIConstants.PLUGIN_ID + ".reset_memory_block"; //$NON-NLS-1$
-
- /**
- * Constant to indicate that the memory view will reset all memory renderings when the reset
- * memory monitor action is invoked.
- *
- * @since 3.2
- */
- public static final String RESET_ALL = IDebugUIConstants.PLUGIN_ID + "resetMemoryBlock.all"; //$NON-NLS-1$
-
-
- /**
- * Constant to indicate that the memory view will reset visible memory renderings when
- * the reset memory monitor action is invoked
- *
- * @since 3.2
- */
- public static final String RESET_VISIBLE = IDebugUIConstants.PLUGIN_ID + "resetMemoryBlock.visible"; //$NON-NLS-1$
-
- /**
- * Preference identifier for the row size in a table rendering.
- * This preference is expected to be saved by an </code>IPersistableDebugElement</code>.
- * Memory Blocks can optionally provide and save this preference to customize
- * the initial format of a table rendering.
- *
- * The value of this property is an Integer. The value can be one of the
- * following values: 1, 2, 4, 8, 16. This value must be greater than
- * <code>PREF_COL_SIZE_BY_MODEL</code> and must also be divisible by <code>PREF_COL_SIZE_BY_MODEL</code>.
- *
- * @since 3.2
- */
- public static final String PREF_ROW_SIZE_BY_MODEL = "org.eclipse.debug.ui.AbstractTableRendering.rowSize"; //$NON-NLS-1$
- /**
- * Preference identifier for the column size in a table rendering.
- * This preference is expected to be saved by an <code>IPersistableDebugElement</code>.
- * Memory Blocks can optionally provide and save this preference to customize
- * the initial format of a table rendering.
- *
- * The value of this property is an Integer. The value can be one of the
- * following values: 1, 2, 4, 8, 16. This value must be smaller than
- * <code>PREF_ROW_SIZE_BY_MODEL</code>. <code>PREF_ROW_SIZE_BY_MODEL</code> must be divisible by <code>PREF_COL_SIZE_BY_MODEL</code>.
- *
- * @since 3.2
- */
- public static final String PREF_COL_SIZE_BY_MODEL = "org.eclipse.debug.ui.AbstractTableRendering.colSize"; //$NON-NLS-1$
-
- /**
- * Number of lines to preload before the visible region in the table rendering
- *
- * @since 3.3
- */
- public static final String PREF_TABLE_RENDERING_PRE_BUFFER_SIZE = "org.eclispe.debug.ui.memory.preBufferSize"; //$NON-NLS-1$
-
- /**
- * Number of lines to preload after the visible region in the table rendering
- *
- * @since 3.3
- */
- public static final String PREF_TABLE_RENDERING_POST_BUFFER_SIZE = "org.eclispe.debug.ui.memory.postBufferSize"; //$NON-NLS-1$
-
- /**
- * The layout mode in Debug view.
- *
- * @since 3.5
- */
- public static final String DEBUG_VIEW_MODE = "org.eclispe.debug.ui.Debug_view.mode"; //$NON-NLS-1$
- public static final String DEBUG_VIEW_MODE_AUTO = "Debug_view.mode.auto"; //$NON-NLS-1$
- public static final String DEBUG_VIEW_MODE_COMPACT = "Debug_view.mode.compact"; //$NON-NLS-1$
- public static final String DEBUG_VIEW_MODE_FULL = "Debug_view.mode.full"; //$NON-NLS-1$
-
- /**
- * Preference whether to auto-expand in the breadcrumb drop-down viewers.
- *
- * @since 3.5
- */
- public static final String DEBUG_VIEW_BREADCRUMB_AUTO_EXPAND_DROP_DOWN = "org.eclispe.debug.ui.Debug_view.Breadcrumb.dropDownAutoexpand"; //$NON-NLS-1$
-}
-
-
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java
deleted file mode 100644
index b0850b8eb..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java
+++ /dev/null
@@ -1,396 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.preferences;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.core.Preferences;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.core.LaunchManager;
-import org.eclipse.debug.internal.ui.AbstractDebugCheckboxSelectionDialog;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchCategoryFilter;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.preference.BooleanFieldEditor;
-import org.eclipse.jface.preference.FieldEditor;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.wizard.ProgressMonitorPart;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.model.AdaptableList;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchViewerComparator;
-
-/**
- * Provides the Launch Configuration preference page to the Run/Debug preferences
- *
- * This page allows users to set filtering options as well as perform migration tasks.
- * This class is not intended to be sub-classed
- * @since 3.2
- */
-public class LaunchConfigurationsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-
- /**
- * Creates a dialog that allows users to select one or more projects to migrate.
- * @since 3.2
- */
- class LaunchConfigurationMigrationSelectionDialog extends AbstractDebugCheckboxSelectionDialog {
-
- private Object fInput;
-
- public LaunchConfigurationMigrationSelectionDialog(Shell parentShell, Object input) {
- super(parentShell);
- fInput = input;
- setShellStyle(getShellStyle() | SWT.RESIZE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
- */
- protected String getDialogSettingsId() {
- return IDebugUIConstants.PLUGIN_ID + ".MIGRATION_SELECTION_DIALOG"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.SELECT_LAUNCH_CONFIGURATION_MIGRATION_DIALOG;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
- */
- protected Object getViewerInput() {
- return fInput;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
- */
- protected String getViewerLabel() {
- return DebugPreferencesMessages.LaunchingPreferencePage_0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getContentProvider()
- */
- protected IContentProvider getContentProvider() {
- return new WorkbenchContentProvider();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getLabelProvider()
- */
- protected IBaseLabelProvider getLabelProvider() {
- return DebugUITools.newDebugModelPresentation();
- }
- }
-
- /**
- * Content provider for the launch configuration type table
- */
- class TableContentProvider implements IStructuredContentProvider {
-
- public Object[] getElements(Object inputElement) {
- return getLaunchConfigurationTypes();
- }
-
- public void dispose() {}
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
- }
-
- /**
- * to monitor the progress of the migration process
- */
- private ProgressMonitorPart fMonitor;
-
- /**
- * the migrate now button
- */
- private Button fMigrateNow;
-
- /**
- * a list of the field editors
- */
- private List fFieldEditors;
-
- /**
- * Boolean editor for debug core plug-in preference
- */
- private Button fDeleteConfigs;
-
- /**
- * The table for the launch configuration types
- */
- private Table fTable;
-
- /**
- * Constructor
- */
- public LaunchConfigurationsPreferencePage() {
- super();
- setPreferenceStore(DebugUIPlugin.getDefault().getPreferenceStore());
- setTitle(DebugPreferencesMessages.LaunchConfigurationsPreferencePage_1);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.LAUNCH_CONFIGURATION_PREFERENCE_PAGE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- fFieldEditors = new ArrayList();
- Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, GridData.FILL_HORIZONTAL);
- //filtering options
- Group group = SWTFactory.createGroup(comp, DebugPreferencesMessages.LaunchingPreferencePage_32, 1, 1, GridData.FILL_HORIZONTAL);
- Composite spacer = SWTFactory.createComposite(group, group.getFont(), 1, 1, GridData.FILL_HORIZONTAL);
- FieldEditor edit = new BooleanFieldEditor(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_CLOSED, DebugPreferencesMessages.LaunchingPreferencePage_33, SWT.NONE, spacer);
- fFieldEditors.add(edit);
- edit = new BooleanFieldEditor(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_DELETED, DebugPreferencesMessages.LaunchingPreferencePage_34, SWT.NONE, spacer);
- fFieldEditors.add(edit);
- edit = new BooleanFieldEditor(IInternalDebugUIConstants.PREF_FILTER_WORKING_SETS, DebugPreferencesMessages.LaunchConfigurationsPreferencePage_3, SWT.NONE, spacer);
- fFieldEditors.add(edit);
- fDeleteConfigs = SWTFactory.createCheckButton(comp, DebugPreferencesMessages.LaunchConfigurationsPreferencePage_2, null, false, 3);
-
- //add table options
- createTypeFiltering(group);
-
- //migration
- group = SWTFactory.createGroup(comp, DebugPreferencesMessages.LaunchingPreferencePage_35, 1, 1, GridData.FILL_HORIZONTAL);
- Label label = new Label(group, SWT.LEFT | SWT.WRAP);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint = 350;
- label.setLayoutData(gd);
- label.setText(DebugPreferencesMessages.LaunchingPreferencePage_26);
- label.setFont(parent.getFont());
- fMigrateNow = SWTFactory.createPushButton(group, DebugPreferencesMessages.LaunchingPreferencePage_27, null);
- gd = new GridData(SWT.BEGINNING);
-
- fMigrateNow.setLayoutData(gd);
- fMigrateNow.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- handleMigrateNowSelected();
- }
- });
-
- //init field editors
- initFieldEditors();
- fTable.setEnabled(getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_TYPES));
- return comp;
- }
-
- /**
- * @param parent the parent to add this composite to
- * @return the new composite with the type selection table in it
- */
- private Composite createTypeFiltering(Composite parent) {
- Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, GridData.FILL_HORIZONTAL);
- BooleanFieldEditor2 editor = new BooleanFieldEditor2(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_TYPES, DebugPreferencesMessages.LaunchConfigurationsPreferencePage_0, SWT.NONE, comp);
- editor.setPropertyChangeListener(new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- boolean newvalue = false;
- if(event.getNewValue() instanceof Boolean) {
- newvalue = ((Boolean)event.getNewValue()).booleanValue();
- }
- else {
- newvalue = Boolean.valueOf(event.getNewValue().toString()).booleanValue();
- }
- if(newvalue) {
- fTable.setEnabled(true);
- }
- else {
- fTable.setEnabled(false);
- }
- }
- });
- fFieldEditors.add(editor);
- fTable = new Table(comp, SWT.CHECK | SWT.BORDER);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.heightHint = 155;
- fTable.setLayoutData(gd);
- CheckboxTableViewer tviewer = new CheckboxTableViewer(fTable);
- tviewer.setLabelProvider(DebugUITools.newDebugModelPresentation());
- tviewer.setContentProvider(new TableContentProvider());
- tviewer.setComparator(new WorkbenchViewerComparator());
- // filter external tool builders
- tviewer.addFilter(new LaunchCategoryFilter(IInternalDebugUIConstants.ID_EXTERNAL_TOOL_BUILDER_LAUNCH_CATEGORY));
- tviewer.setInput(getLaunchConfigurationTypes());
- fTable.setFont(parent.getFont());
- return comp;
- }
-
- /**
- * returns the launch configuration types
- * @return the launch configuration types
- */
- private ILaunchConfigurationType[] getLaunchConfigurationTypes() {
- return DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes();
- }
-
- /**
- * handles the Migrate button being clicked
- *
- * @since 3.2
- */
- private void handleMigrateNowSelected() {
- try {
- ILaunchManager lmanager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfiguration[] configurations = lmanager.getMigrationCandidates();
- //separate the private from the public
- List pub = new ArrayList();
- for(int i = 0; i < configurations.length; i++) {
- if(DebugUITools.isPrivate(configurations[i])) {
- //auto-migrate private ones
- configurations[i].migrate();
- }
- else {
- pub.add(configurations[i]);
- }
- }
- if(pub.size() == 0) {
- MessageDialog.openInformation(getShell(), DebugPreferencesMessages.LaunchingPreferencePage_29, DebugPreferencesMessages.LaunchingPreferencePage_30);
- return;
- }
- LaunchConfigurationMigrationSelectionDialog listd = new LaunchConfigurationMigrationSelectionDialog(getShell(),new AdaptableList(pub));
- listd.setTitle(DebugPreferencesMessages.LaunchingPreferencePage_28);
- listd.setInitialSelections(configurations);
- if(listd.open() == IDialogConstants.OK_ID) {
- fMonitor = new ProgressMonitorPart(fMigrateNow.getParent(), new GridLayout());
- Object[] objs = listd.getResult();
- fMonitor.beginTask(DebugPreferencesMessages.LaunchingPreferencePage_31, objs.length);
- for(int i = 0; i < objs.length; i++) {
- if(objs[i] instanceof ILaunchConfiguration) {
- ((ILaunchConfiguration)objs[i]).migrate();
- }
- fMonitor.worked(1);
- }
- fMonitor.done();
- fMonitor.dispose();
- }
- }
- catch (CoreException e) {DebugUIPlugin.log(e);}
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- public void init(IWorkbench workbench) {}
-
- /**
- * Initializes the field editors to their values
- * @since 3.2
- */
- private void initFieldEditors() {
- FieldEditor editor;
- for(int i = 0; i < fFieldEditors.size(); i++) {
- editor = (FieldEditor)fFieldEditors.get(i);
- editor.setPreferenceStore(getPreferenceStore());
- editor.load();
- }
- fDeleteConfigs.setSelection(
- Platform.getPreferencesService().getBoolean(DebugPlugin.getUniqueIdentifier(),
- LaunchManager.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE, true, null));
- //restore the tables' checked state
- String[] types = getPreferenceStore().getString(IInternalDebugUIConstants.PREF_FILTER_TYPE_LIST).split("\\,"); //$NON-NLS-1$
- TableItem[] items = fTable.getItems();
- ILaunchConfigurationType type;
- for(int i = 0; i < types.length; i++) {
- for(int j = 0; j < items.length; j++) {
- type = (ILaunchConfigurationType)items[j].getData();
- if(type.getIdentifier().equals(types[i])) {
- items[j].setChecked(true);
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
- protected void performDefaults() {
- fDeleteConfigs.setSelection(Preferences.getDefaultBoolean(DebugPlugin.getUniqueIdentifier(), LaunchManager.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE, true));
- FieldEditor editor = null;
- for(int i = 0; i < fFieldEditors.size(); i++) {
- editor = (FieldEditor)fFieldEditors.get(i);
- editor.loadDefault();
- if(editor instanceof BooleanFieldEditor2) {
- fTable.setEnabled(((BooleanFieldEditor2)editor).getBooleanValue());
- }
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performOk()
- */
- public boolean performOk() {
- //save field editors
- for(int i = 0; i < fFieldEditors.size(); i++) {
- ((FieldEditor)fFieldEditors.get(i)).store();
- }
- Preferences.setBoolean(DebugPlugin.getUniqueIdentifier(), LaunchManager.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE, fDeleteConfigs.getSelection(), null);
- //save table
- String types = IInternalDebugCoreConstants.EMPTY_STRING;
- TableItem[] items = fTable.getItems();
- ILaunchConfigurationType type;
- for(int i = 0; i < items.length; i++) {
- if(items[i].getChecked()) {
- type = (ILaunchConfigurationType)items[i].getData();
- types += type.getIdentifier()+","; //$NON-NLS-1$
- }
- }
- getPreferenceStore().setValue(IInternalDebugUIConstants.PREF_FILTER_TYPE_LIST, types);
- return super.performOk();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java
deleted file mode 100644
index 3783607e2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java
+++ /dev/null
@@ -1,625 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.preferences;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchDelegate;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.core.LaunchDelegate;
-import org.eclipse.debug.internal.core.LaunchManager;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchCategoryFilter;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPresentationManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.PerspectiveManager;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.preference.RadioGroupFieldEditor;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IPerspectiveRegistry;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.activities.ActivityManagerEvent;
-import org.eclipse.ui.activities.IActivityManagerListener;
-import org.eclipse.ui.activities.WorkbenchActivityHelper;
-import org.eclipse.ui.model.WorkbenchViewerComparator;
-
-/**
- * The preference page for selecting and changing launch perspectives
- *
- * @since 3.3
- */
-public class LaunchPerspectivePreferencePage extends PreferencePage implements IWorkbenchPreferencePage, IActivityManagerListener {
-
- /**
- * Represents a perspective delta for a given type, delegate and mode set combination.
- */
- final class PerspectiveChange {
- private ILaunchConfigurationType fType = null;
- private ILaunchDelegate fDelegate = null;
- private Set fModes = null;
- private String fPid = null;
-
- public PerspectiveChange(ILaunchConfigurationType type, ILaunchDelegate delegate, Set modes, String perspectiveid) {
- fType = type;
- fDelegate = delegate;
- fModes = modes;
- fPid = perspectiveid;
- }
-
- public ILaunchConfigurationType getType() {return fType;}
- public ILaunchDelegate getDelegate() {return fDelegate;}
- public String getPerspectiveId() {return fPid;}
- public Set getModes() {return fModes;}
- public boolean equals(Object o) {
- if(o instanceof PerspectiveChange) {
- PerspectiveChange change = (PerspectiveChange) o;
- return change.getDelegate() == fDelegate &&
- change.getType().equals(fType) &&
- change.getModes().equals(fModes);
- }
- return super.equals(o);
- }
- }
-
- /**
- * Implementation to expose use of getFilteredChildren method
- */
- final class PerspectivesTreeViewer extends TreeViewer {
- public PerspectivesTreeViewer(Tree tree) {
- super(tree);
- }
- public Object[] getFilteredChildren(Object o) {return super.getFilteredChildren(o);}
- }
-
- /**
- * Provides content for the configuration tree viewer
- */
- final class PerspectiveContentProvider implements ITreeContentProvider {
- public Object[] getChildren(Object parentElement) {
- if(parentElement instanceof ILaunchConfigurationType) {
- ILaunchConfigurationType type = (ILaunchConfigurationType) parentElement;
- return ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates(type.getIdentifier());
- }
- return new Object[0];
- }
- public Object[] getElements(Object inputElement) {
- return DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes();
- }
- public boolean hasChildren(Object element) {return element instanceof ILaunchConfigurationType;}
- public Object getParent(Object element) {return null;}
- public void dispose() {}
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
- }
-
- /**
- * Panel container that is reused to present series of combo boxes to users for perspective selections
- */
- class PerspectivesPanel {
-
- private Composite fMainComposite = null;
- private Label fMessage = null;
-
- public PerspectivesPanel(Composite parent, String heading) {
- createPanel(parent, heading);
- }
-
- protected void createPanel(Composite parent, String heading) {
- fMainComposite = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_BOTH);
- SWTFactory.createWrapLabel(fMainComposite, heading, 2);
- fMessage = SWTFactory.createWrapLabel(fMainComposite, IInternalDebugCoreConstants.EMPTY_STRING, 2, 250);
- }
-
- public void setMessage(String msg) {
- fMessage.setText((msg == null ? IInternalDebugCoreConstants.EMPTY_STRING : msg));
- }
-
- public void refreshPanel(IStructuredSelection selection) {
- //get rid of any existing children, but leave the first two (the label for the control, and the message area)
- Control[] children = fMainComposite.getChildren();
- for(int i = 2; i < children.length; i++) {
- children[i].dispose();
- }
- if(fgCurrentWorkingContext == null) {
- fgCurrentWorkingContext = new HashSet();
- }
- fgCurrentWorkingContext.clear();
- if(!selection.isEmpty()) {
- Point pt = getShell().getSize();
- createCombos(fMainComposite, selection.toArray());
- fMainComposite.layout();
- if(!fInitializing) {
- Point pt2 = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- if(pt2.x > pt.x) {
- getShell().setSize(pt2);
- }
- }
- }
- else {
- SWTFactory.createWrapLabel(fMainComposite, DebugPreferencesMessages.LaunchPerspectivePreferencePage_0, 2, 275);
- }
- fMainComposite.layout();
- }
- }
-
- /**
- * Widgets
- */
- private RadioGroupFieldEditor fSwitchLaunch = null;
- private RadioGroupFieldEditor fSwitchSuspend = null;
- private Tree fTree = null;
- private PerspectivesTreeViewer fTreeViewer = null;
- private PerspectivesPanel fPerspectivesPanel = null;
-
- /**
- * Caches
- */
- private static String[] fgPerspectiveLabels = null;
- private static Map fgPerspectiveIdMap = null;
- private static HashSet fgChangeSet = null;
- private static HashSet fgCurrentWorkingContext = null;
-
- /**
- * fields
- */
- private boolean fInitializing = false;
-
- /**
- * A default selection listener to be reused by all combo boxes presenting perspective data
- */
- private SelectionListener fSelectionListener = new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- Object o = e.getSource();
- if(o instanceof Combo) {
- Combo combo = (Combo) o;
- LaunchDelegate delegate = null;
- ILaunchConfigurationType type = null;
- PerspectiveChange change = null;
- Set modes = null;
- for(Iterator iter = fgCurrentWorkingContext.iterator(); iter.hasNext();) {
- o = iter.next();
- if(o instanceof ILaunchDelegate) {
- delegate = (LaunchDelegate) o;
- type = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(delegate.getLaunchConfigurationTypeId());
- }
- else if(o instanceof ILaunchConfigurationType) {
- delegate = null;
- type = (ILaunchConfigurationType) o;
- }
- modes = (Set) combo.getData();
- change = findChange(type, delegate, modes);
- if(change == null) {
- change = new PerspectiveChange(type, delegate, modes, (String)fgPerspectiveIdMap.get(combo.getText()));
- fgChangeSet.add(change);
- }
- else {
- change.fPid = (String)fgPerspectiveIdMap.get(combo.getText());
- }
- }
- }
- }
- };
-
- /**
- * Constructor
- */
- public LaunchPerspectivePreferencePage() {}
-
- /**
- * @see org.eclipse.jface.dialogs.DialogPage#dispose()
- */
- public void dispose() {
- PlatformUI.getWorkbench().getActivitySupport().getActivityManager().removeActivityManagerListener(this);
- fgPerspectiveIdMap.clear();
- fgPerspectiveIdMap = null;
- fgPerspectiveLabels = null;
- fgChangeSet.clear();
- fgChangeSet = null;
- if(fgCurrentWorkingContext != null) {
- fgCurrentWorkingContext.clear();
- fgCurrentWorkingContext = null;
- }
- super.dispose();
- }
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.PERSPECTIVE_PREFERENCE_PAGE);
- }
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
-
- SWTFactory.createWrapLabel(parent, DebugPreferencesMessages.PerspectivePreferencePage_0, 2, 300);
-
- SWTFactory.createVerticalSpacer(parent, 1);
-
- fSwitchLaunch = new RadioGroupFieldEditor(
- IInternalDebugUIConstants.PREF_SWITCH_TO_PERSPECTIVE,
- DebugPreferencesMessages.LaunchingPreferencePage_11, 3,
- new String[][] {{DebugPreferencesMessages.LaunchingPreferencePage_12, MessageDialogWithToggle.ALWAYS },
- { DebugPreferencesMessages.LaunchingPreferencePage_13, MessageDialogWithToggle.NEVER },
- { DebugPreferencesMessages.LaunchingPreferencePage_14, MessageDialogWithToggle.PROMPT } },
- SWTFactory.createComposite(parent, 1, 2, GridData.FILL_HORIZONTAL),
- true);
- fSwitchLaunch.setPreferenceName(IInternalDebugUIConstants.PREF_SWITCH_TO_PERSPECTIVE);
- fSwitchLaunch.setPreferenceStore(getPreferenceStore());
- fSwitchSuspend = new RadioGroupFieldEditor(
- IInternalDebugUIConstants.PREF_SWITCH_PERSPECTIVE_ON_SUSPEND,
- DebugPreferencesMessages.DebugPreferencePage_21, 3,
- new String[][] {{ DebugPreferencesMessages.DebugPreferencePage_22, MessageDialogWithToggle.ALWAYS },
- { DebugPreferencesMessages.DebugPreferencePage_23, MessageDialogWithToggle.NEVER },
- { DebugPreferencesMessages.DebugPreferencePage_24, MessageDialogWithToggle.PROMPT } },
- SWTFactory.createComposite(parent, 1, 2, GridData.FILL_HORIZONTAL),
- true);
- fSwitchSuspend.setPreferenceName(IInternalDebugUIConstants.PREF_SWITCH_PERSPECTIVE_ON_SUSPEND);
- fSwitchSuspend.setPreferenceStore(getPreferenceStore());
-
- SWTFactory.createVerticalSpacer(parent, 1);
- SWTFactory.createWrapLabel(parent, DebugPreferencesMessages.PerspectivePreferencePage_5, 2, 300);
- Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 2, 1, GridData.FILL_BOTH, 0, 0);
- createTreeViewer(comp);
- fPerspectivesPanel = new PerspectivesPanel(comp, DebugPreferencesMessages.PerspectivePreferencePage_2);
- initializeControls();
- PlatformUI.getWorkbench().getActivitySupport().getActivityManager().addActivityManagerListener(this);
- Dialog.applyDialogFont(parent);
- return parent;
- }
-
- /**
- * Creates the <code>Tree</code> and <code>TreeViewer</code> widgets
- * @param parent the parent to add these components to
- */
- protected void createTreeViewer(Composite parent) {
- Composite comp = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_VERTICAL);
- SWTFactory.createWrapLabel(comp, DebugPreferencesMessages.PerspectivePreferencePage_1, 1);
- fTree = new Tree(comp, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.MULTI);
- GridData gd = new GridData(GridData.FILL_VERTICAL);
- gd.widthHint = 220;
- gd.heightHint = 250;
- fTree.setLayoutData(gd);
- fTreeViewer = new PerspectivesTreeViewer(fTree);
- fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- fPerspectivesPanel.refreshPanel((IStructuredSelection) event.getSelection());
- }
- });
- fTreeViewer.setLabelProvider(DebugUITools.newDebugModelPresentation());
- fTreeViewer.setComparator(new WorkbenchViewerComparator());
- fTreeViewer.setContentProvider(new PerspectiveContentProvider());
- // filter external tool builders
- fTreeViewer.addFilter(new LaunchCategoryFilter(IInternalDebugUIConstants.ID_EXTERNAL_TOOL_BUILDER_LAUNCH_CATEGORY));
- fTreeViewer.setInput(DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes());
- }
-
- /**
- * Creates a set of combo boxes on a per-selection basis that display a listing of available perspectives to switch to
- * @param parent the parent to add the created combo boxes to
- * @param selection the selection in the tree viewer
- */
- protected void createCombos(Composite parent, Object[] selection) {
- Set modes = collectCommonModeSets(selection);
- if(modes.isEmpty()) {
- fPerspectivesPanel.setMessage(DebugPreferencesMessages.LaunchPerspectivePreferencePage_1);
- return;
- }
- fPerspectivesPanel.setMessage(IInternalDebugCoreConstants.EMPTY_STRING);
- List fmodes = null;
- Combo combo = null;
- Set smodes = null;
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- smodes = (Set) iter.next();
- fmodes = LaunchConfigurationPresentationManager.getDefault().getLaunchModeNames(smodes);
- if(!fmodes.isEmpty()) {
- //add the mode set and create a combo
- SWTFactory.createLabel(parent, fmodes.toString()+":", 1); //$NON-NLS-1$
- combo = SWTFactory.createCombo(parent, SWT.READ_ONLY, 1, fgPerspectiveLabels);
- String text = getComboSelection(smodes);
- if(text != null) {
- combo.setText(text);
- }
- combo.setData(smodes);
- combo.addSelectionListener(fSelectionListener);
- GridData gd = (GridData)combo.getLayoutData();
- gd.grabExcessHorizontalSpace = true;
- }
- }
- }
-
- /**
- * Returns the text item to select for the current combo context given the current working set context
- * @param modes the set of modes
- * @return the text to select in the current combo / current working set context, or "None"
- */
- private String getComboSelection(Set modes) {
- String text = DebugPreferencesMessages.PerspectivePreferencePage_4;
- IStructuredSelection ss = (IStructuredSelection) fTreeViewer.getSelection();
- if(ss != null && !ss.isEmpty()) {
- Object o = null;
- Set tmp = new HashSet();
- String id = null;
- ILaunchConfigurationType type = null;
- LaunchDelegate delegate = null;
- PerspectiveChange change = null;
- for(Iterator iter = ss.iterator(); iter.hasNext();) {
- o = iter.next();
- if(o instanceof LaunchDelegate) {
- delegate = (LaunchDelegate) o;
- type = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(delegate.getLaunchConfigurationTypeId());
- }
- else if(o instanceof ILaunchConfigurationType) {
- type = (ILaunchConfigurationType) o;
- }
- change = findChange(type, delegate, modes);
- if(change != null) {
- id = change.getPerspectiveId();
- }
- else {
- id = DebugUIPlugin.getDefault().getPerspectiveManager().getLaunchPerspective(type, modes, delegate);
- }
- if(id == null) {
- id = IDebugUIConstants.PERSPECTIVE_NONE;
- }
- tmp.add(id);
- }
- if(tmp.size() == 1) {
- id = (String) tmp.iterator().next();
- if(!IDebugUIConstants.PERSPECTIVE_NONE.equals(id)) {
- String label = null;
- for(Iterator iter = fgPerspectiveIdMap.keySet().iterator(); iter.hasNext();) {
- label = (String) iter.next();
- if(id.equals(fgPerspectiveIdMap.get(label))) {
- return label;
- }
- }
- }
- }
- }
-
- return text;
- }
-
- /**
- * Traverses the current change set to find a matching change. Matching in this context considers only the
- * type, delegate and mode set, we do not compare perspective ids, as they can change many times.
- * @param type the type
- * @param delegate the delegate, possibly <code>null</code>
- * @param modes the current mode set
- * @return the existing <code>PerspectiveChange</code> if there is one, <code>null</code> otherwise
- */
- private PerspectiveChange findChange(ILaunchConfigurationType type, ILaunchDelegate delegate, Set modes) {
- PerspectiveChange change = new PerspectiveChange(type, delegate, modes, null);
- Object o = null;
- for(Iterator iter = fgChangeSet.iterator(); iter.hasNext();) {
- o = iter.next();
- if(change.equals(o)) {
- return (PerspectiveChange) o;
- }
- }
- return null;
- }
-
- /**
- * Collects a list of mode sets that are common to the current selection context. It is possible
- * that there are no mode sets in comomon.
- * @param selection the current selection context
- * @param list the list to fill
- * @return a list of mode sets or an empty list, never <code>null</code>
- */
- protected Set collectCommonModeSets(Object[] selection) {
- HashSet common = new HashSet();
- //prep selection context, remove types from the equation
- HashSet delegates = new HashSet();
- Object o = null;
- Object[] kids = null;
- for(int i = 0; i < selection.length; i++) {
- o = selection[i];
- if(o instanceof ILaunchDelegate) {
- delegates.add(o);
- }
- else if(o instanceof ILaunchConfigurationType) {
- fgCurrentWorkingContext.add(o);
- kids = fTreeViewer.getFilteredChildren(o);
- delegates.addAll(Arrays.asList(kids));
- }
- }
- //compare the listing of delegates to find common mode sets
- ILaunchDelegate delegate = null;
- List modes = null;
- HashSet pruned = new HashSet();
- Set fmodes = null;
- if(!delegates.isEmpty()) {
- for(Iterator iter = delegates.iterator(); iter.hasNext();) {
- delegate = (ILaunchDelegate) iter.next();
- modes = delegate.getModes();
- for(Iterator iter2 = modes.iterator(); iter2.hasNext();) {
- fmodes = (Set) iter2.next();
- if(isCommonModeset(fmodes, delegates, pruned)) {
- common.add(fmodes);
- fgCurrentWorkingContext.add(delegate);
- }
- }
- }
- }
- return common;
- }
-
- /**
- * Returns if the specified mode set is common to the listing of delegates, at the same time adding any not common
- * mode sets to a listing used to prune the search as we go along
- * @param modeset the set to test for commonality
- * @param delegates the listing to test against
- * @param pruned the monotonic listing of pruned mode sets
- * @return true if the specified mode set is common to all members of the specified listing of launch delegates, false otherwise
- */
- private boolean isCommonModeset(Set modeset, Set delegates, Set pruned) {
- if(!pruned.contains(modeset)) {
- ILaunchDelegate delegate = null;
- boolean common = true;
- for(Iterator iter = delegates.iterator(); iter.hasNext();) {
- delegate = (ILaunchDelegate) iter.next();
- common &= delegate.getModes().contains(modeset);
- }
- if(!common) {
- pruned.add(modeset);
- }
- else {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Restores the widget state from the preference store, called after all of the widgets have been created and triggers
- * a selection changed event from the tree viewer
- */
- protected void initializeControls() {
- fInitializing = true;
- if(fTree.getItemCount() > 0) {
- TreeItem item = fTree.getItem(0);
- fTreeViewer.setSelection(new StructuredSelection(item.getData()));
- fTreeViewer.expandToLevel(item.getData(), 1);
- }
- //load the group selections
- fSwitchLaunch.load();
- fSwitchSuspend.load();
- fInitializing = false;
- }
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
- protected void performDefaults() {
- fgChangeSet.clear();
- fSwitchLaunch.loadDefault();
- fSwitchSuspend.loadDefault();
-
- PerspectiveManager pm = DebugUIPlugin.getDefault().getPerspectiveManager();
- TreeItem[] items = fTree.getItems();
- ILaunchConfigurationType type = null;
- Set modes = null;
- Set modeset = null;
- Object[] delegates = null;
- for(int i = 0; i < items.length; i++) {
- //reset type
- type = (ILaunchConfigurationType) items[i].getData();
- modes = type.getSupportedModeCombinations();
- delegates = fTreeViewer.getFilteredChildren(type);
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- modeset = (Set) iter.next();
- fgChangeSet.add(new PerspectiveChange(type, null, modeset, pm.getDefaultLaunchPerspective(type, null, modeset)));
- }
- for(int j = 0; j < delegates.length; j++) {
- modes = new HashSet(((ILaunchDelegate)delegates[j]).getModes());
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- modeset = (Set) iter.next();
- fgChangeSet.add(new PerspectiveChange(type, (ILaunchDelegate) delegates[j], modeset, pm.getDefaultLaunchPerspective(type, (ILaunchDelegate) delegates[j], modeset)));
- }
- }
- }
- if(fTree.getItemCount() > 0) {
- TreeItem item = fTree.getItem(0);
- fTreeViewer.setSelection(new StructuredSelection(item.getData()));
- fTreeViewer.expandToLevel(item.getData(), 1);
- }
- super.performDefaults();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- public void init(IWorkbench workbench) {
- setPreferenceStore(DebugUIPlugin.getDefault().getPreferenceStore());
- fgChangeSet = new HashSet();
- //init the labels mapping and the list of labels
- fgPerspectiveIdMap = new HashMap();
- ArrayList labels = new ArrayList();
- labels.add(DebugPreferencesMessages.PerspectivePreferencePage_4);
- IPerspectiveRegistry registry = PlatformUI.getWorkbench().getPerspectiveRegistry();
- IPerspectiveDescriptor[] descriptors = registry.getPerspectives();
- String label = null;
- for(int i = 0; i < descriptors.length; i++) {
- if(!WorkbenchActivityHelper.filterItem(descriptors[i])) {
- label = descriptors[i].getLabel();
- labels.add(label);
- fgPerspectiveIdMap.put(label, descriptors[i].getId());
- }
- }
- fgPerspectiveLabels = (String[]) labels.toArray(new String[labels.size()]);
- }
-
- /**
- * @see org.eclipse.ui.activities.IActivityManagerListener#activityManagerChanged(org.eclipse.ui.activities.ActivityManagerEvent)
- */
- public void activityManagerChanged(ActivityManagerEvent activityManagerEvent) {
- if(!fTree.isDisposed()) {
- fTreeViewer.refresh();
- }
- }
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage#performOk()
- */
- public boolean performOk() {
- fSwitchLaunch.store();
- fSwitchSuspend.store();
- if(!fgChangeSet.isEmpty()) {
- PerspectiveChange change = null;
- PerspectiveManager mgr = DebugUIPlugin.getDefault().getPerspectiveManager();
- for(Iterator iter = fgChangeSet.iterator(); iter.hasNext();) {
- change = (PerspectiveChange) iter.next();
- mgr.setLaunchPerspective(change.getType(), change.getModes(), change.getDelegate(), change.getPerspectiveId());
- }
- }
- return super.performOk();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchersPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchersPreferencePage.java
deleted file mode 100644
index a22f10830..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchersPreferencePage.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.preferences;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchDelegate;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.core.LaunchManager;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.DefaultLabelProvider;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPresentationManager;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.model.WorkbenchViewerComparator;
-
-/**
- * This class provides a preference page for selecting and changing preferred launch delegates for those of them
- * that have conflicting delegates.
- *
- * Delegates are considered to be conflicting if they are for the same launch configuration type, and apply to the same
- * mode sets.
- *
- * @since 3.3
- */
-public class LaunchersPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-
- /**
- * Class to collect and persist attributes to sufficiently describe a duplicate launch delegate
- */
- class DuplicateDelegate {
- private ILaunchConfigurationType fType = null;
- private ILaunchDelegate[] fDelegates = null;
- private Set fModes = null;
-
- public DuplicateDelegate(ILaunchConfigurationType type, ILaunchDelegate[] delegates, Set modes) {
- fModes = modes;
- fType = type;
- fDelegates = delegates;
- }
-
- public ILaunchConfigurationType getType() {
- return fType;
- }
- public ILaunchDelegate[] getDelegates() {
- return fDelegates;
- }
- public Set getModeSet() {
- return fModes;
- }
- }
-
- /**
- * label provider to extend the default one, provides labels to both the tree and table of this page
- */
- class LabelProvider extends DefaultLabelProvider {
- public String getText(Object element) {
- if(element instanceof ILaunchConfigurationType) {
- return super.getText(element);
- }
- else if(element instanceof DuplicateDelegate) {
- DuplicateDelegate dd = (DuplicateDelegate) element;
- return LaunchConfigurationPresentationManager.getDefault().getLaunchModeNames(dd.getModeSet()).toString();
- }
- else if(element instanceof ILaunchDelegate){
- return ((ILaunchDelegate) element).getName();
- }
- return element.toString();
- }
- }
-
- /**
- * This class is used to provide content to the tree
- */
- class TreeProvider implements ITreeContentProvider {
- public Object[] getChildren(Object parentElement) {
- if(parentElement instanceof ILaunchConfigurationType) {
- ILaunchConfigurationType type = (ILaunchConfigurationType) parentElement;
- Set dupes = (Set) fDuplicates.get(type);
- if(dupes != null) {
- return dupes.toArray();
- }
- return null;
- }
- return null;
- }
- public boolean hasChildren(Object element) {
- return element instanceof ILaunchConfigurationType;
- }
- public Object[] getElements(Object inputElement) {
- if(inputElement instanceof Map) {
- return ((Map)inputElement).keySet().toArray();
- }
- return null;
- }
- public Object getParent(Object element) {return null;}
- public void dispose() {}
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
- }
-
- private TreeViewer fTreeViewer = null;
- private CheckboxTableViewer fTableViewer = null;
- private Map fDuplicates = null;
- private Map fDupeSelections = null;
- private boolean fDirty = false;
- private Text fDescription = null;
-
- /**
- * Constructor
- */
- public LaunchersPreferencePage() {
- setTitle(DebugPreferencesMessages.LaunchDelegatesPreferencePage_0);
- }
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.LAUNCH_DELEGATES_PREFERENCE_PAGE);
- }
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Composite comp = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_BOTH);
- SWTFactory.createWrapLabel(comp, DebugPreferencesMessages.LaunchDelegatesPreferencePage_1, 2, 300);
-
- boolean enabled = fDuplicates.size() > 0;
- if(!enabled) {
- SWTFactory.createVerticalSpacer(comp, 1);
- SWTFactory.createWrapLabel(comp, DebugPreferencesMessages.LaunchersPreferencePage_0, 2, 300);
- }
-
- SWTFactory.createVerticalSpacer(comp, 1);
- //tree
- Composite comp1 = SWTFactory.createComposite(comp, 1, 1, GridData.FILL_VERTICAL);
- SWTFactory.createLabel(comp1, DebugPreferencesMessages.LaunchDelegatesPreferencePage_2, 1);
- Tree tree = new Tree(comp1, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE);
- tree.setEnabled(enabled);
- tree.setFont(parent.getFont());
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.grabExcessHorizontalSpace = false;
- tree.setLayoutData(gd);
- fTreeViewer = new TreeViewer(tree);
- fTreeViewer.setComparator(new WorkbenchViewerComparator());
- fTreeViewer.setContentProvider(new TreeProvider());
- fTreeViewer.setLabelProvider(new LabelProvider());
- fTreeViewer.setInput(fDuplicates);
- fTreeViewer.expandToLevel(2);
- fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- Object obj = ((IStructuredSelection) event.getSelection()).getFirstElement();
- if(obj instanceof DuplicateDelegate) {
- fTableViewer.setAllChecked(false);
- DuplicateDelegate dd = (DuplicateDelegate) obj;
- fTableViewer.setInput(dd.getDelegates());
- fTableViewer.setSelection(null);
- obj = fDupeSelections.get(dd);
- if(obj != null) {
- fTableViewer.setChecked(obj, true);
- fTableViewer.setSelection(new StructuredSelection(obj));
- }
- }
- else {
- fTableViewer.setInput(null);
- }
- }
- });
-
- //table
- Composite comp2 = SWTFactory.createComposite(comp, comp.getFont(), 1, 1, GridData.FILL_BOTH);
- SWTFactory.createLabel(comp2, DebugPreferencesMessages.LaunchDelegatesPreferencePage_3, 1);
- Table table = new Table(comp2, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CHECK | SWT.SINGLE);
- table.setEnabled(enabled);
- table.setLayoutData(new GridData(GridData.FILL_BOTH));
- table.setFont(parent.getFont());
- fTableViewer = new CheckboxTableViewer(table);
- fTableViewer.setComparator(new WorkbenchViewerComparator());
- fTableViewer.setLabelProvider(new LabelProvider());
- fTableViewer.setContentProvider(new ArrayContentProvider());
- fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection ss = (IStructuredSelection) event.getSelection();
- if(ss != null && !ss.isEmpty()) {
- ILaunchDelegate delegate = (ILaunchDelegate)ss.getFirstElement();
- fDescription.setText(delegate.getDescription());
- }
- else {
- fDescription.setText(IInternalDebugCoreConstants.EMPTY_STRING);
- }
- }
- });
- fTableViewer.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- fDirty = true;
- Object element = event.getElement();
- boolean checked = event.getChecked();
- //always set checked, this way users cannot 'undo' a change to selecting a preferred delegate
- //The story for this is that on startup if there are dupes, the user is prompted to pick a delegate, after that they cannot
- //return to a state of not being able to launch something, but can pick a different delegate
- fTableViewer.setCheckedElements(new Object[] {element});
- //set the selection to be the checked element
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=233233
- fTableViewer.setSelection(new StructuredSelection(element));
- //persist the selection
- Object obj = ((IStructuredSelection) fTreeViewer.getSelection()).getFirstElement();
- if(obj instanceof DuplicateDelegate) {
- fDupeSelections.remove(obj);
- if(checked) {
- fDupeSelections.put(obj, element);
- }
- }
- }
- });
- Group group = SWTFactory.createGroup(comp, DebugPreferencesMessages.LaunchDelegatesPreferencePage_4, 1, 2, GridData.FILL_BOTH);
- fDescription = SWTFactory.createText(group, SWT.WRAP | SWT.READ_ONLY, 1, GridData.FILL_BOTH);
- fDescription.setEnabled(enabled);
- fDescription.setBackground(group.getBackground());
- return comp;
- }
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage#performOk()
- */
- public boolean performOk() {
- if(fDirty && fDupeSelections != null && fDupeSelections.size() > 0) {
- fDirty = false;
- DuplicateDelegate dd = null;
- ILaunchDelegate delegate = null;
- for(Iterator iter = fDupeSelections.keySet().iterator(); iter.hasNext();) {
- dd = (DuplicateDelegate) iter.next();
- delegate = (ILaunchDelegate) fDupeSelections.get(dd);
- try {
- dd.getType().setPreferredDelegate(dd.getModeSet(), delegate);
- }
- catch (CoreException e) {DebugUIPlugin.log(e);}
- }
- }
- return super.performOk();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- public void init(IWorkbench workbench) {
- //init a listing of duplicate delegates arranged by type
- try {
- setPreferenceStore(DebugUIPlugin.getDefault().getPreferenceStore());
- LaunchManager lm = (LaunchManager) DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType[] types = lm.getLaunchConfigurationTypes();
- fDuplicates = new HashMap();
- fDupeSelections = new HashMap();
- Set modes = null;
- ILaunchDelegate[] delegates = null;
- Set modeset = null;
- Set tmp = null;
- ILaunchDelegate prefdelegate = null;
- DuplicateDelegate dd = null;
- for(int i = 0; i < types.length; i++) {
- modes = types[i].getSupportedModeCombinations();
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- modeset = (Set) iter.next();
- delegates = types[i].getDelegates(modeset);
- if(delegates.length > 1) {
- tmp = (Set) fDuplicates.get(types[i]);
- if(tmp == null) {
- tmp = new HashSet();
- }
- dd = new DuplicateDelegate(types[i], delegates, modeset);
- tmp.add(dd);
- fDuplicates.put(types[i], tmp);
- prefdelegate = types[i].getPreferredDelegate(modeset);
- if(prefdelegate != null) {
- fDupeSelections.put(dd, prefdelegate);
- }
- }
- }
- }
- }
- catch(CoreException e) {DebugUIPlugin.log(e);}
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchingPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchingPreferencePage.java
deleted file mode 100644
index ad0fbbca9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchingPreferencePage.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.preferences;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.preference.BooleanFieldEditor;
-import org.eclipse.jface.preference.FieldEditor;
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.IntegerFieldEditor;
-import org.eclipse.jface.preference.RadioGroupFieldEditor;
-import org.eclipse.jface.preference.StringFieldEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * A preference page for configuring launching preferences.
- *
- * @since 3.0.0
- */
-public class LaunchingPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
-
- private Button fUseContextLaunching;
- private Button fUseOldLaunching;
- private Button fLaunchLastIfNotLaunchable;
- private Button fCheckParent;
-
- /**
- * The default constructor
- */
- public LaunchingPreferencePage() {
- super();
- setPreferenceStore(DebugUIPlugin.getDefault().getPreferenceStore());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.LAUNCHING_PREFERENCE_PAGE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Composite comp = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_HORIZONTAL);
- //save dirty editors
- FieldEditor edit = new RadioGroupFieldEditor(IInternalDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH, DebugPreferencesMessages.LaunchingPreferencePage_2, 3,
- new String[][] {{DebugPreferencesMessages.LaunchingPreferencePage_3, MessageDialogWithToggle.ALWAYS},
- {DebugPreferencesMessages.LaunchingPreferencePage_4, MessageDialogWithToggle.NEVER},
- {DebugPreferencesMessages.LaunchingPreferencePage_5, MessageDialogWithToggle.PROMPT}},
- comp,
- true);
- addField(edit);
-
- //wait for build
- edit = new RadioGroupFieldEditor(IInternalDebugUIConstants.PREF_WAIT_FOR_BUILD,
- DebugPreferencesMessages.LaunchingPreferencePage_6, 3,
- new String[][] {{DebugPreferencesMessages.LaunchingPreferencePage_7, MessageDialogWithToggle.ALWAYS},
- {DebugPreferencesMessages.LaunchingPreferencePage_8, MessageDialogWithToggle.NEVER},
- {DebugPreferencesMessages.LaunchingPreferencePage_9, MessageDialogWithToggle.PROMPT}},
- comp,
- true);
- addField(edit);
-
- //re-launch in debug mode
- edit = new RadioGroupFieldEditor(IInternalDebugUIConstants.PREF_RELAUNCH_IN_DEBUG_MODE,
- DebugPreferencesMessages.LaunchingPreferencePage_15, 3,
- new String[][] {{DebugPreferencesMessages.LaunchingPreferencePage_16, MessageDialogWithToggle.ALWAYS},
- {DebugPreferencesMessages.LaunchingPreferencePage_17, MessageDialogWithToggle.NEVER},
- {DebugPreferencesMessages.LaunchingPreferencePage_18, MessageDialogWithToggle.PROMPT}},
- comp,
- true);
- addField(edit);
-
- //continue with compile errors
- edit = new RadioGroupFieldEditor(IInternalDebugUIConstants.PREF_CONTINUE_WITH_COMPILE_ERROR,
- DebugPreferencesMessages.LaunchingPreferencePage_21, 2,
- new String[][] {{DebugPreferencesMessages.LaunchingPreferencePage_22, MessageDialogWithToggle.ALWAYS},
- {DebugPreferencesMessages.LaunchingPreferencePage_23, MessageDialogWithToggle.PROMPT}},
- comp,
- true);
- addField(edit);
-
- //filtering options
- Group group = SWTFactory.createGroup(comp, DebugPreferencesMessages.LaunchingPreferencePage_36, 1, 1, GridData.FILL_HORIZONTAL);
- Composite spacer = SWTFactory.createComposite(group, 1, 1, GridData.FILL_HORIZONTAL);
- edit = new BooleanFieldEditor(IDebugUIConstants.PREF_BUILD_BEFORE_LAUNCH, DebugPreferencesMessages.LaunchingPreferencePage_1, SWT.NONE, spacer);
- edit.fillIntoGrid(spacer, 2);
- addField(edit);
- edit = new BooleanFieldEditor(IDebugUIConstants.PREF_AUTO_REMOVE_OLD_LAUNCHES, DebugPreferencesMessages.LaunchingPreferencePage_10, SWT.NONE, spacer);
- edit.fillIntoGrid(spacer, 2);
- addField(edit);
-
- edit = new BooleanFieldEditor(IInternalDebugUIConstants.PREF_REMOVE_FROM_LAUNCH_HISTORY, DebugPreferencesMessages.LaunchingPreferencePage_confirm_0, spacer);
- edit.fillIntoGrid(spacer, 2);
- addField(edit);
-
- //history list size preference
- IntegerFieldEditor editor = new IntegerFieldEditor(IDebugUIConstants.PREF_MAX_HISTORY_SIZE, DebugPreferencesMessages.DebugPreferencePage_10, spacer);
- editor.fillIntoGrid(spacer, 2);
- addField(editor);
- int historyMax = IDebugPreferenceConstants.MAX_LAUNCH_HISTORY_SIZE;
- editor.setTextLimit(Integer.toString(historyMax).length());
- editor.setErrorMessage(MessageFormat.format(DebugPreferencesMessages.DebugPreferencePage_11, new Object[] { new Integer(1), new Integer(historyMax)}));
- editor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
- editor.setValidRange(1, historyMax);
- editor.setEmptyStringAllowed(false);
-
- //CONTEXTLAUNCHING
- createContextLaunchingControls(comp);
- initialize();
- checkState();
- return comp;
- }
-
- /**
- * Creates the context launching portion of the page, which includes two radio buttons and
- * a nested check box
- * @param parent the parent to add this control to
- *
- * @since 3.3.0
- * CONTEXTLAUNCHING
- */
- private void createContextLaunchingControls(Composite parent) {
- Group group = SWTFactory.createGroup(parent, DebugPreferencesMessages.LaunchingPreferencePage_40, 1, 1, GridData.FILL_HORIZONTAL);
- fUseOldLaunching = SWTFactory.createRadioButton(group, DebugPreferencesMessages.LaunchingPreferencePage_37);
- fUseContextLaunching = SWTFactory.createRadioButton(group, DebugPreferencesMessages.LaunchingPreferencePage_38);
- fUseContextLaunching.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- boolean enabled = ((Button)e.widget).getSelection();
- fCheckParent.setEnabled(enabled);
- fLaunchLastIfNotLaunchable.setEnabled(enabled);
- }
- });
- Composite space = SWTFactory.createComposite(group, 1, 1, GridData.FILL_HORIZONTAL);
- GridData gd = (GridData) space.getLayoutData();
- gd.horizontalIndent = 10;
- GridLayout layout = (GridLayout) space.getLayout();
- layout.marginHeight = 0;
- fCheckParent = SWTFactory.createRadioButton(space, DebugPreferencesMessages.LaunchingPreferencePage_39);
- fLaunchLastIfNotLaunchable = SWTFactory.createRadioButton(space, DebugPreferencesMessages.LaunchingPreferencePage_41);
-
- //initialize the buttons
- boolean value = getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_USE_CONTEXTUAL_LAUNCH);
- fUseOldLaunching.setSelection(!value);
- fUseContextLaunching.setSelection(value);
- boolean enable = getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_LAUNCH_PARENT_PROJECT);
- fCheckParent.setSelection(enable);
- fCheckParent.setEnabled(value);
- fLaunchLastIfNotLaunchable.setSelection(!enable);
- fLaunchLastIfNotLaunchable.setEnabled(value);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- public void init(IWorkbench workbench) {}
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
- protected void performDefaults() {
- boolean value = getPreferenceStore().getDefaultBoolean(IInternalDebugUIConstants.PREF_USE_CONTEXTUAL_LAUNCH);
- fUseOldLaunching.setSelection(!value);
- fUseContextLaunching.setSelection(value);
- boolean parent = getPreferenceStore().getDefaultBoolean(IInternalDebugUIConstants.PREF_LAUNCH_PARENT_PROJECT);
- fCheckParent.setSelection(parent);
- fCheckParent.setEnabled(value);
- fLaunchLastIfNotLaunchable.setSelection(!parent);
- fLaunchLastIfNotLaunchable.setEnabled(value);
- super.performDefaults();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performOk()
- */
- public boolean performOk() {
- getPreferenceStore().setValue(IInternalDebugUIConstants.PREF_USE_CONTEXTUAL_LAUNCH, fUseContextLaunching.getSelection());
- getPreferenceStore().setValue(IInternalDebugUIConstants.PREF_LAUNCH_PARENT_PROJECT, fCheckParent.getSelection());
- getPreferenceStore().setValue(IInternalDebugUIConstants.PREF_LAUNCH_LAST_IF_NOT_LAUNCHABLE, fLaunchLastIfNotLaunchable.getSelection());
- return super.performOk();
- }
-
- /**
- * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
- */
- protected void createFieldEditors() {
- //do nothing we overload the create contents method
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java
deleted file mode 100644
index 11b627ef4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.preferences;
-
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PropertyPage;
-
-public class ProcessPropertyPage extends PropertyPage {
-
- private static Font fHeadingFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT);
-
- /**
- * Constructor for ProcessPropertyPage
- */
- public ProcessPropertyPage() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite ancestor) {
- noDefaultAndApplyButton();
- Composite parent = SWTFactory.createComposite(ancestor, ancestor.getFont(), 1, 1, GridData.FILL_BOTH);
-
- IProcess proc = getProcess();
-
- //create the process time section
- SWTFactory.createLabel(parent, DebugPreferencesMessages.ProcessPropertyPage_0, fHeadingFont, 1);
- Text text = SWTFactory.createText(parent, SWT.READ_ONLY, 1);
- ((GridData)text.getLayoutData()).horizontalIndent = 10;
- PlatformUI.getWorkbench().getHelpSystem().setHelp(text, IDebugHelpContextIds.PROCESS_PAGE_RUN_AT);
- text.setText(getTimeText(proc));
- text.setBackground(parent.getBackground());
- SWTFactory.createVerticalSpacer(parent, 2);
-
- //create the path name section
- SWTFactory.createLabel(parent, DebugPreferencesMessages.ProcessPropertyPage_1, fHeadingFont, 1);
- text = SWTFactory.createText(parent, SWT.WRAP | SWT.READ_ONLY, 1);
- ((GridData)text.getLayoutData()).horizontalIndent = 10;
- text.setText(getPathText(proc));
- text.setBackground(parent.getBackground());
- SWTFactory.createVerticalSpacer(parent, 2);
-
- //create commandline section
- SWTFactory.createLabel(parent, DebugPreferencesMessages.ProcessPropertyPage_Command_Line__1, fHeadingFont, 1);
- text = SWTFactory.createText(parent,
- SWT.WRAP | SWT.READ_ONLY | SWT.BORDER | SWT.V_SCROLL,
- 1,
- convertWidthInCharsToPixels(10),
- convertHeightInCharsToPixels(15),
- GridData.FILL_BOTH);
- text.setBackground(parent.getBackground());
- ((GridData)text.getLayoutData()).horizontalIndent = 10;
- String commandLineText = getCommandLineText(proc);
- if (commandLineText != null) {
- text.setText(commandLineText);
- }
-
- setTitle(DebugPreferencesMessages.ProcessPropertyPage_2);
- return parent;
- }
-
- /**
- * Gets the process from the selected element
- * @return the process or null if the element is not a process
- *
- * @since 3.2
- */
- private IProcess getProcess() {
- IProcess proc = null;
- Object obj = getElement();
- if (obj instanceof IDebugElement) {
- obj = ((IDebugElement)obj).getDebugTarget().getProcess();
- }
- if (obj instanceof IProcess) {
- proc = ((IProcess)obj);
- }
- return proc;
- }
-
- /**
- * returns the path text
- * @param proc the process to extract the path text from
- * @return the path text or a message indicating no path text available
- *
- * @since 3.2
- */
- private String getPathText(IProcess proc) {
- String text = DebugPreferencesMessages.ProcessPropertyPage_3;
- if(proc != null) {
- String tmp = proc.getLabel();
- int idx = tmp.lastIndexOf("("); //$NON-NLS-1$
- if(idx < 0) {
- idx = tmp.length();
- }
- text = tmp.substring(0, idx);
- }
- return text;
- }
-
- /**
- * gets the pattern of text from the process label specified by regex
- * @param proc the process to compile the regex against
- * @param deftext the default text to return if the process is null
- * @param regex the regex to match in the process label
- * @return the regex matched text or the default supplied text if the process is null
- *
- * @since 3.2
- */
- private String getTimeText(IProcess proc) {
- String text = DebugPreferencesMessages.ProcessPropertyPage_4;
- if(proc != null) {
- Pattern pattern = Pattern.compile("\\(.*\\)"); //$NON-NLS-1$
- Matcher matcher = pattern.matcher(proc.getLabel());
- if(matcher.find()) {
- text = matcher.group(0);
- }
- }
- return text;
- }
-
- /**
- * Initializes the text to be displayed in the commandline text widget
- * @param proc the process to compile the label fragment from
- * @return the commandline text or the empty string
- *
- * @since 3.2
- */
- private String getCommandLineText(IProcess proc) {
- String cmdline = DebugPreferencesMessages.ProcessPropertyPage_5;
- if(proc != null) {
- cmdline = proc.getAttribute(IProcess.ATTR_CMDLINE);
- }
- return cmdline;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.PROCESS_PROPERTY_PAGE);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
deleted file mode 100644
index 1112114d1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
+++ /dev/null
@@ -1,527 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.preferences;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.core.LaunchManager;
-import org.eclipse.debug.internal.ui.AbstractDebugListSelectionDialog;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.DefaultLabelProvider;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationComparator;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.ui.dialogs.SelectionDialog;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Displays default launch configuration settings for a selected resource - associated launch configurations.
- *
- * @see {@link PropertyPage}
- * @see {@link ILaunchConfiguration}
- * @see {@link org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog}
- * @see {@link IDebugHelpContextIds#DEFAULT_LAUNCHCONFIGURATION_PROPERTY_PAGE}
- *
- * CONTEXTLAUNCHING
- *
- * @since 3.3.0
- */
-public class RunDebugPropertiesPage extends PropertyPage {
- /**
- * Set of configurations to be deleted
- */
- private Set fDeletedConfigurations = new HashSet();
-
- /**
- * Set of original default candidates for the resource
- */
- private Set fOriginalCandidates;
-
- /**
- * Holds configurations that need to be saved when the page closes
- */
- private Set fChangedConfigurations = new HashSet();
-
- /**
- * List of the applicable launch config types for the backing resource
- */
- private List fTypeCandidates = null;
-
- //widgets
- private TableViewer fViewer;
- private Button fNewButton = null;
- private Button fEditButton = null;
- private Button fDuplicateButton = null;
- private Button fDeleteButton = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugHelpContextIds.RUN_DEBUG_RESOURCE_PROPERTY_PAGE);
- collectConfigCandidates(getResource());
- Composite topComposite = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_BOTH);
-
- SWTFactory.createWrapLabel(topComposite, DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_0, 2, 300);
- SWTFactory.createVerticalSpacer(topComposite, 2);
- SWTFactory.createWrapLabel(topComposite, MessageFormat.format(DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_1, new String[]{getResource().getName()}), 2, 300);
- fViewer = createViewer(topComposite);
-
- Composite buttonComp = SWTFactory.createComposite(topComposite, 1, 1, GridData.FILL_VERTICAL);
- GridLayout layout = (GridLayout) buttonComp.getLayout();
- layout.marginHeight = 0;
- fNewButton = SWTFactory.createPushButton(buttonComp, DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_2, null);
- fNewButton.setToolTipText(DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_3);
- fNewButton.setEnabled(collectTypeCandidates().length > 0);
- fNewButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- handleNew();
- }
- });
-
- fDuplicateButton = SWTFactory.createPushButton(buttonComp, DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_4, null);
- fDuplicateButton.setToolTipText(DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_5);
- fDuplicateButton.setEnabled(false);
- fDuplicateButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- handleCopy();
- }
- });
- fEditButton = SWTFactory.createPushButton(buttonComp, DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_6, null);
- fEditButton.setToolTipText(DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_7);
- fEditButton.setEnabled(false);
- fEditButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- handleEdit();
- }
- });
- fDeleteButton = SWTFactory.createPushButton(buttonComp, DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_8, null);
- fDeleteButton.setToolTipText(DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_9);
- fDeleteButton.setEnabled(false);
- fDeleteButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- handleDelete();
- }
- });
-
- fViewer.setSelection(new StructuredSelection());
- applyDialogFont(topComposite);
- return topComposite;
- }
-
- /**
- * Creates and returns the viewer that will display the possible default configurations.
- *
- * @param parent parent composite to create the viewer in
- * @return viewer viewer that will display possible default configurations
- */
- protected TableViewer createViewer(Composite parent){
- TableViewer viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);
- viewer.setLabelProvider(new DefaultLabelProvider());
- viewer.setContentProvider(new ArrayContentProvider());
- viewer.setComparator(new LaunchConfigurationComparator());
- Table builderTable = viewer.getTable();
- GridData tableGridData = new GridData(GridData.FILL_BOTH);
- tableGridData.heightHint = 300;
- tableGridData.widthHint = 300;
- builderTable.setLayoutData(tableGridData);
- IResource resource = getResource();
- viewer.setInput(collectConfigCandidates(resource));
- viewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection sel = event.getSelection();
- if(sel instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) sel;
- boolean empty = ss.isEmpty();
- int size = ss.size();
- fEditButton.setEnabled(!empty && size == 1);
- fDuplicateButton.setEnabled(!empty && size == 1);
- fDeleteButton.setEnabled(!empty);
- setErrorMessage(null);
- }
- }
- });
- viewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent arg0) {
- handleEdit();
- }
- });
- return viewer;
- }
-
- /**
- * @see org.eclipse.jface.dialogs.DialogPage#dispose()
- */
- public void dispose() {
- if(fOriginalCandidates != null) {
- fOriginalCandidates.clear();
- fOriginalCandidates = null;
- }
- if(fChangedConfigurations != null) {
- fChangedConfigurations.clear();
- fChangedConfigurations = null;
- }
- super.dispose();
- }
-
- /**
- * Returns the viewer displaying possible default configurations.
- *
- * @return viewer
- */
- protected TableViewer getViewer() {
- return fViewer;
- }
-
- /**
- * Returns the launch manager
- * @return the launch manager
- */
- protected LaunchManager getLaunchManager() {
- return (LaunchManager) DebugPlugin.getDefault().getLaunchManager();
- }
-
- /**
- * Collects the applicable launch configuration types for the backing resource.
- * Default implementation uses the launch shortcut evaluation expressions and leverages the
- * mapping of launch shortcut to config type id to derive the applicable types.
- * @return the listing of applicable launch configuration types for the backing resource
- */
- protected ILaunchConfigurationType[] collectTypeCandidates() {
- if(fTypeCandidates == null) {
- String[] types = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getApplicableConfigurationTypes(getResource());
- fTypeCandidates = new ArrayList(types.length);
- for(int i = 0; i < types.length; i++) {
- fTypeCandidates.add(DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(types[i]));
- }
-
- Collections.sort(fTypeCandidates, new Comparator() {
- public int compare(Object o1, Object o2) {
- ILaunchConfigurationType t1 = (ILaunchConfigurationType) o1;
- ILaunchConfigurationType t2 = (ILaunchConfigurationType) o2;
- return t1.getName().compareTo(t2.getName());
- }
- });
- }
- return (ILaunchConfigurationType[]) fTypeCandidates.toArray(new ILaunchConfigurationType[fTypeCandidates.size()]);
- }
-
- /**
- * Returns a set of potential default configurations candidates for the given
- * resource. The configurations are working copies.
- *
- * @param resource resource
- * @return list of default candidates
- */
- protected Set collectConfigCandidates(IResource resource) {
- if(fOriginalCandidates == null) {
- fOriginalCandidates = new HashSet();
- try {
- ILaunchConfiguration[] configs = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getApplicableLaunchConfigurations(null, resource);
- for(int i = 0; i < configs.length; i++) {
- fOriginalCandidates.add(configs[i].getWorkingCopy());
- }
- }
- catch(CoreException ce) {DebugUIPlugin.log(ce);}
- }
- return fOriginalCandidates;
- }
-
-
-
- /**
- * Returns the resource this property page is open on.
- *
- * @return resource
- */
- protected IResource getResource() {
- Object element = getElement();
- IResource resource = null;
- if (element instanceof IResource) {
- resource = (IResource) element;
- } else if (element instanceof IAdaptable) {
- resource = (IResource) ((IAdaptable)element).getAdapter(IResource.class);
- }
- return resource;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performOk()
- */
- public boolean performOk() {
- //delete
- Iterator iter = fDeletedConfigurations.iterator();
- while (iter.hasNext()) {
- ILaunchConfigurationWorkingCopy currentConfig = (ILaunchConfigurationWorkingCopy) iter.next();
- try{
- if (currentConfig.getOriginal() != null){
- currentConfig.getOriginal().delete();
- }
- } catch (CoreException e) {
- DebugPlugin.logMessage("Problem deleting configuration " + currentConfig.getName(), e); //$NON-NLS-1$
- }
- }
- //add
- iter = fChangedConfigurations.iterator();
- while (iter.hasNext()) {
- ILaunchConfigurationWorkingCopy currentConfig = (ILaunchConfigurationWorkingCopy) iter.next();
- try{
- currentConfig.doSave();
- } catch (CoreException e) {
- DebugPlugin.logMessage("Problem saving changes to configuration " + currentConfig.getName(), e); //$NON-NLS-1$
- }
- }
-
- return super.performOk();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
- protected void performDefaults() {
- setErrorMessage(null);
- setValid(true);
- fOriginalCandidates.clear();
- fOriginalCandidates = null;
- getViewer().setInput(collectConfigCandidates(getResource()));
- fChangedConfigurations.clear();
- fDeletedConfigurations.clear();
- fViewer.refresh(true, true);
- super.performDefaults();
- }
-
- /**
- * Returns the names of the launch configurations passed in as original input to the tree viewer
- * @return the names of the original launch configurations
- */
- private Set getConfigurationNames() {
- Set names = new HashSet();
- Iterator iter = fOriginalCandidates.iterator();
- while (iter.hasNext()) {
- names.add(((ILaunchConfiguration)iter.next()).getName());
- }
- iter = fChangedConfigurations.iterator();
- while (iter.hasNext()) {
- names.add(((ILaunchConfiguration)iter.next()).getName());
- }
- return names;
- }
-
- /**
- * Returns selected configurations.
- *
- * @return selected configurations
- */
- private ILaunchConfigurationWorkingCopy[] getSelectedConfigurations() {
- IStructuredSelection ss = (IStructuredSelection) fViewer.getSelection();
- return (ILaunchConfigurationWorkingCopy[]) ss.toList().toArray(new ILaunchConfigurationWorkingCopy[ss.size()]);
- }
-
- /**
- * Copy the selection
- */
- private void handleCopy() {
- ILaunchConfigurationWorkingCopy configuration = getSelectedConfigurations()[0];
- try {
- ILaunchConfigurationWorkingCopy copy = configuration.copy(
- ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).generateUniqueLaunchConfigurationNameFrom(configuration.getName(), getConfigurationNames()));
- copy.setAttributes(configuration.getAttributes());
- fChangedConfigurations.add(copy);
- fViewer.add(copy);
- fViewer.setSelection(new StructuredSelection(copy));
- } catch (CoreException e) {
- setErrorMessage(e.getMessage());
- }
- }
-
- /**
- * Delete the selection
- */
- private void handleDelete() {
- Table table = fViewer.getTable();
- int[] indices = table.getSelectionIndices();
- Arrays.sort(indices);
- ILaunchConfiguration[] configurations = getSelectedConfigurations();
- for (int i = 0; i < configurations.length; i++) {
- fDeletedConfigurations.add(configurations[i]);
- fChangedConfigurations.remove(configurations[i]);
- fViewer.remove(configurations[i]);
- }
- if (indices[0] < table.getItemCount()) {
- fViewer.setSelection(new StructuredSelection(table.getItem(indices[0]).getData()));
- } else if (table.getItemCount() > 0) {
- fViewer.setSelection(new StructuredSelection(table.getItem(table.getItemCount() - 1).getData()));
- }
- }
-
- /**
- * Edit the selection
- */
- private void handleEdit() {
- ILaunchConfigurationWorkingCopy config = getSelectedConfigurations()[0];
- int ret = edit(config, false);
- if(ret == IDialogConstants.OK_ID) {
- fChangedConfigurations.add(config);
- fViewer.refresh(config, true, true);
- }
- else if(ret == IDialogConstants.ABORT_ID) {
- setErrorMessage(MessageFormat.format(DebugPreferencesMessages.RunDebugPropertiesPage_0, new String[] {config.getName()}));
- }
- }
-
- /**
- * Edits the given configuration as a nested working copy.
- * Returns the code from the dialog used to edit the configuration.
- *
- * @param configuration
- * @param setDefaults whether to set default values in the config
- * @return dialog return code - OK or CANCEL
- */
- private int edit(ILaunchConfigurationWorkingCopy configuration, boolean setDefaults) {
- try {
- LaunchConfigurationManager lcm = DebugUIPlugin.getDefault().getLaunchConfigurationManager();
- ILaunchGroup group = null;
- // bug 208034, we should try modes we know about first then guess
- ILaunchConfigurationType type = configuration.getType();
- if(type.supportsMode(ILaunchManager.RUN_MODE)) {
- group = lcm.getLaunchGroup(type, ILaunchManager.RUN_MODE);
- }
- else if(type.supportsMode(ILaunchManager.DEBUG_MODE)) {
- group = lcm.getLaunchGroup(type, ILaunchManager.DEBUG_MODE);
- }
- else if(type.supportsMode(ILaunchManager.PROFILE_MODE)) {
- group = lcm.getLaunchGroup(type, ILaunchManager.PROFILE_MODE);
- }
- else {
- Set modes = type.getSupportedModeCombinations();
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(type, (Set)iter.next());
- if(group != null) {
- break;
- }
- }
- }
- if(group != null) {
- return DebugUIPlugin.openLaunchConfigurationPropertiesDialog(getShell(), configuration, group.getIdentifier(), getConfigurationNames(), null, setDefaults);
- }
- }
- catch(CoreException ce) {}
- return IDialogConstants.ABORT_ID;
- }
-
- /**
- * Create a new configuration
- */
- private void handleNew() {
-
- final ILaunchConfigurationType[] typeCandidates = collectTypeCandidates();
-
- SelectionDialog dialog = new AbstractDebugListSelectionDialog(getShell()){
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
- */
- protected String getDialogSettingsId() {
- return DebugUIPlugin.getUniqueIdentifier() + ".SELECT_CONFIGURATION_TYPE_DIALOG"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
- */
- protected Object getViewerInput() {
- return typeCandidates;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.SELECT_CONFIGURATION_TYPE_DIALOG;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
- */
- protected String getViewerLabel() {
- return DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_12;
- }
-
- };
- dialog.setTitle(DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_11);
-
- if (dialog.open() == Window.OK) {
- Object[] result = dialog.getResult();
- if (result.length == 1) {
- ILaunchConfigurationType type = (ILaunchConfigurationType) result[0];
- try {
- ILaunchConfigurationWorkingCopy wc = type.newInstance(null,
- ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).
- generateUniqueLaunchConfigurationNameFrom("New_configuration", getConfigurationNames())); //$NON-NLS-1$
- int ret = edit(wc, true);
- if (ret == Window.OK) {
- fChangedConfigurations.add(wc);
- fViewer.add(wc);
- fViewer.setSelection(new StructuredSelection(wc));
- }
- else if(ret == IDialogConstants.ABORT_ID) {
- setErrorMessage(MessageFormat.format(DebugPreferencesMessages.RunDebugPropertiesPage_0, new String[] {wc.getName()}));
- }
- } catch (CoreException e) {
- setErrorMessage(e.getMessage());
- }
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java
deleted file mode 100644
index bc353eaac..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java
+++ /dev/null
@@ -1,715 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.preferences;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.variables.IStringVariableManager;
-import org.eclipse.core.variables.IValueVariable;
-import org.eclipse.core.variables.VariablesPlugin;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.MultipleInputDialog;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.viewers.ColumnLayoutData;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Preference page for creating and configuring simple
- * launch variables.
- *
- * @see org.eclipse.debug.core.variables.IValueVariable
- * @see org.eclipse.debug.core.variables.ISimpleVariableRegistry
- */
-public class StringVariablePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-
- private TableViewer variableTable;
- protected Button envAddButton;
- protected Button envEditButton;
- protected Button envRemoveButton;
-
- protected SimpleVariableContentProvider variableContentProvider= new SimpleVariableContentProvider();
-
- protected static final String NAME_LABEL= DebugPreferencesMessages.SimpleVariablePreferencePage_10;
- protected static final String VALUE_LABEL = DebugPreferencesMessages.SimpleVariablePreferencePage_11;
- protected static final String DESCRIPTION_LABEL = DebugPreferencesMessages.SimpleVariablePreferencePage_12;
-
- protected static final String STRING_VARIABLE_PREFERENCE_KEY = "StringVariablePreferencePage"; //$NON-NLS-1$
-
- protected static String[] variableTableColumnProperties= {
- "variable", //$NON-NLS-1$
- "value", //$NON-NLS-1$
- "description" //$NON-NLS-1$
- };
- protected String[] variableTableColumnHeaders= {
- DebugPreferencesMessages.SimpleVariablePreferencePage_3,
- DebugPreferencesMessages.SimpleVariablePreferencePage_4,
- DebugPreferencesMessages.SimpleVariablePreferencePage_5,
- DebugPreferencesMessages.StringVariablePreferencePage_27
- };
- protected ColumnLayoutData[] variableTableColumnLayouts= {
- new ColumnWeightData(30),
- new ColumnWeightData(25),
- new ColumnWeightData(25),
- new ColumnWeightData(20)
- };
-
- public StringVariablePreferencePage() {
- setDescription(DebugPreferencesMessages.SimpleVariablePreferencePage_6);
- }
-
- /**
- * @see PreferencePage#createControl(Composite)
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.SIMPLE_VARIABLE_PREFERENCE_PAGE);
- }
-
- protected Control createContents(Composite parent) {
- noDefaultAndApplyButton();
- Font font= parent.getFont();
- //The main composite
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight=0;
- layout.marginWidth=0;
- layout.numColumns= 2;
- composite.setLayout(layout);
- composite.setFont(font);
-
- createTable(composite);
- createButtons(composite);
-
- return composite;
- }
-
- /**
- * Creates and configures the table containing launch configuration variables
- * and their associated value.
- */
- private void createTable(Composite parent) {
- Font font= parent.getFont();
- // Create table composite
- Composite tableComposite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.numColumns = 1;
- GridData gridData = new GridData(GridData.FILL_BOTH);
- gridData.heightHint = 150;
- gridData.widthHint = 400;
- tableComposite.setLayout(layout);
- tableComposite.setLayoutData(gridData);
- tableComposite.setFont(font);
- // Create table
- variableTable = new TableViewer(tableComposite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
- Table table = variableTable.getTable();
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- table.setFont(font);
- gridData = new GridData(GridData.FILL_BOTH);
- variableTable.getControl().setLayoutData(gridData);
- variableTable.setContentProvider(variableContentProvider);
- variableTable.setColumnProperties(variableTableColumnProperties);
- variableTable.addFilter(new VariableFilter());
- variableTable.setComparator(new ViewerComparator() {
- public int compare(Viewer iViewer, Object e1, Object e2) {
- if (e1 == null) {
- return -1;
- } else if (e2 == null) {
- return 1;
- } else {
- return ((VariableWrapper)e1).getName().compareToIgnoreCase(((VariableWrapper)e2).getName());
- }
- }
- });
-
- variableTable.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- handleTableSelectionChanged(event);
- }
- });
-
- variableTable.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- if (!variableTable.getSelection().isEmpty()) {
- handleEditButtonPressed();
- }
- }
- });
- variableTable.getTable().addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent event) {
- if (event.character == SWT.DEL && event.stateMask == 0) {
- handleRemoveButtonPressed();
- }
- }
- });
-
- for (int i = 0; i < variableTableColumnHeaders.length; i++) {
- TableColumn tc = new TableColumn(table, SWT.NONE, i);
- tc.setResizable(variableTableColumnLayouts[i].resizable);
- tc.setText(variableTableColumnHeaders[i]);
- }
-
- // Try restoring column widths from preferences, if widths aren't stored, init columns to default
- if (!restoreColumnWidths()){
- restoreDefaultColumnWidths();
- }
-
- variableTable.setInput(getVariableManager());
- variableTable.setLabelProvider(new SimpleVariableLabelProvider());
- }
-
- /**
- * Creates the new/edit/remove buttons for the variable table
- * @param parent the composite in which the buttons should be created
- */
- private void createButtons(Composite parent) {
- // Create button composite
- Composite buttonComposite = new Composite(parent, SWT.NONE);
- GridLayout glayout = new GridLayout();
- glayout.marginHeight = 0;
- glayout.marginWidth = 0;
- glayout.numColumns = 1;
- GridData gdata = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
- buttonComposite.setLayout(glayout);
- buttonComposite.setLayoutData(gdata);
- buttonComposite.setFont(parent.getFont());
-
- // Create buttons
- envAddButton = SWTFactory.createPushButton(buttonComposite, DebugPreferencesMessages.SimpleVariablePreferencePage_7, null);
- envAddButton.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent event) {
- handleAddButtonPressed();
- }
- });
- envEditButton = SWTFactory.createPushButton(buttonComposite, DebugPreferencesMessages.SimpleVariablePreferencePage_8, null);
- envEditButton.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent event) {
- handleEditButtonPressed();
- }
- });
- envEditButton.setEnabled(false);
- envRemoveButton = SWTFactory.createPushButton(buttonComposite, DebugPreferencesMessages.SimpleVariablePreferencePage_9, null);
- envRemoveButton.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent event) {
- handleRemoveButtonPressed();
- }
- });
- envRemoveButton.setEnabled(false);
- }
-
- private void handleAddButtonPressed() {
- boolean done = false;
- String name = null;
- String description = null;
- String value = null;
- while (!done){
-
- MultipleInputDialog dialog= new MultipleInputDialog(getShell(), DebugPreferencesMessages.SimpleVariablePreferencePage_13);
- dialog.addTextField(NAME_LABEL, name, false);
- dialog.addBrowseField(VALUE_LABEL, value, true);
- dialog.addTextField(DESCRIPTION_LABEL, description, true);
-
- if (dialog.open() != Window.OK) {
- done = true;
- }
- else {
- name= dialog.getStringValue(NAME_LABEL).trim();
- value = dialog.getStringValue(VALUE_LABEL);
- description= dialog.getStringValue(DESCRIPTION_LABEL);
- done = addVariable(name, description, value);
- }
- }
- }
-
- /**
- * Attempts to create and add a new variable with the given properties. Returns
- * whether the operation completed successfully (either the variable was added
- * successfully, or the user cancelled the operation). Returns false if the name
- * is null or the user chooses not to overwrite an existing variable.
- *
- * @param name name of the variable, cannot be <code>null</code> or empty.
- * @param description description of the variable or <code>null</code>
- * @param value value of the variable or <code>null</code>
- * @return whether the operation completed successfully
- */
- private boolean addVariable(String name, String description, String value) {
- if (name == null || name.length() == 0){
- MessageDialog.openError(getShell(),DebugPreferencesMessages.StringVariablePreferencePage_21, DebugPreferencesMessages.StringVariablePreferencePage_20);
- return false;
- }
- List editedVariables= variableContentProvider.getWorkingSetVariables();
- Iterator iter= editedVariables.iterator();
- while (iter.hasNext()) {
- VariableWrapper currentVariable = (VariableWrapper) iter.next();
- if (!currentVariable.isRemoved()) {
- String currentName = currentVariable.getName();
- if (currentName.equals(name)) {
- if (currentVariable.isReadOnly()){
- MessageDialog.openError(getShell(),DebugPreferencesMessages.StringVariablePreferencePage_23, MessageFormat.format(DebugPreferencesMessages.StringVariablePreferencePage_22, new String[] {name}));
- return false;
- }
- else {
- MessageDialog dialog = new MessageDialog(getShell(), DebugPreferencesMessages.SimpleVariablePreferencePage_15, null, MessageFormat.format(DebugPreferencesMessages.SimpleVariablePreferencePage_16, new String[] {name}), MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 0);
- int overWrite= dialog.open();
- if (overWrite == 0) {
- currentVariable.setValue(value);
- currentVariable.setDescription(description);
- variableTable.update(currentVariable, null);
- return true;
- } else if(overWrite == 1){
- return false;
- } else {
- return true; // Cancel was pressed, return true so operation is ended
- }
- }
- }
- }
- }
- VariableWrapper newVariable = new VariableWrapper(name, description, value);
- variableContentProvider.addVariable(newVariable);
- variableTable.refresh();
- return true;
- }
-
- private void handleEditButtonPressed() {
- IStructuredSelection selection= (IStructuredSelection) variableTable.getSelection();
- VariableWrapper variable= (VariableWrapper) selection.getFirstElement();
- if (variable == null || variable.isReadOnly()) {
- return;
- }
- String value= variable.getValue();
- String description= variable.getDescription();
- String name= variable.getName();
- MultipleInputDialog dialog= new MultipleInputDialog(getShell(), MessageFormat.format(DebugPreferencesMessages.SimpleVariablePreferencePage_14, new String[] {name}));
- dialog.addBrowseField(VALUE_LABEL, value, true);
- dialog.addTextField(DESCRIPTION_LABEL, description, true);
-
- if (dialog.open() == Window.OK) {
- value= dialog.getStringValue(VALUE_LABEL);
- description= dialog.getStringValue(DESCRIPTION_LABEL);
- if (value != null) {
- variable.setValue(value);
- }
- if (description != null) {
- variable.setDescription(description);
- }
- variableTable.update(variable, null);
- }
- }
-
- /**
- * Remove the selection variables.
- */
- private void handleRemoveButtonPressed() {
- IStructuredSelection selection= (IStructuredSelection) variableTable.getSelection();
- List variablesToRemove= selection.toList();
- StringBuffer contributedVariablesToRemove= new StringBuffer();
- Iterator iter= variablesToRemove.iterator();
- while (iter.hasNext()) {
- VariableWrapper variable = (VariableWrapper) iter.next();
- if (variable.isContributed()) {
- contributedVariablesToRemove.append('\t').append(variable.getName()).append('\n');
- }
- }
- if (contributedVariablesToRemove.length() > 0) {
- boolean remove= MessageDialog.openQuestion(getShell(), DebugPreferencesMessages.SimpleLaunchVariablePreferencePage_21, MessageFormat.format(DebugPreferencesMessages.SimpleLaunchVariablePreferencePage_22, new String[] {contributedVariablesToRemove.toString()})); //
- if (!remove) {
- return;
- }
- }
- VariableWrapper[] variables= (VariableWrapper[]) variablesToRemove.toArray(new VariableWrapper[0]);
- for (int i = 0; i < variables.length; i++) {
- variables[i].setRemoved(true);
- }
- variableTable.refresh();
- }
-
- /**
- * Responds to a selection changed event in the variable table
- * @param event the selection change event
- */
- protected void handleTableSelectionChanged(SelectionChangedEvent event) {
- IStructuredSelection selection = ((IStructuredSelection)event.getSelection());
- VariableWrapper variable= (VariableWrapper) selection.getFirstElement();
- if (variable == null || variable.isReadOnly()) {
- envEditButton.setEnabled(false);
- envRemoveButton.setEnabled(false);
- }
- else {
- envEditButton.setEnabled(selection.size() == 1);
- envRemoveButton.setEnabled(selection.size() > 0);
- }
- }
-
- public void init(IWorkbench workbench) {
- }
-
- /**
- * Clear the variables.
- */
- protected void performDefaults() {
- variableContentProvider.init();
- variableTable.refresh();
- super.performDefaults();
- }
-
- /**
- * Sets the saved state for reversion.
- */
- public boolean performOk() {
- variableContentProvider.saveChanges();
- saveColumnWidths();
- return super.performOk();
- }
-
- /**
- * Returns the DebugPlugin's singleton instance of the
- * launch variable manager
- * @return the singleton instance of the simple variable registry.
- */
- private IStringVariableManager getVariableManager() {
- return VariablesPlugin.getDefault().getStringVariableManager();
- }
-
- public void saveColumnWidths() {
- StringBuffer widthPreference = new StringBuffer();
- for (int i = 0; i < variableTable.getTable().getColumnCount(); i++) {
- widthPreference.append(variableTable.getTable().getColumn(i).getWidth());
- widthPreference.append(',');
- }
- if (widthPreference.length() > 0){
- DebugUIPlugin.getDefault().getPreferenceStore().setValue(STRING_VARIABLE_PREFERENCE_KEY, widthPreference.toString());
- }
- }
-
- private boolean restoreColumnWidths() {
- String[] columnWidthStrings = DebugUIPlugin.getDefault().getPreferenceStore().getString(STRING_VARIABLE_PREFERENCE_KEY).split(","); //$NON-NLS-1$
- int columnCount = variableTable.getTable().getColumnCount();
- if (columnWidthStrings.length != columnCount){
- return false; // Preferred column sizes not stored correctly.
- }
- for (int i = 0; i < columnCount; i++) {
- try{
- int columnWidth = Integer.parseInt(columnWidthStrings[i]);
- variableTable.getTable().getColumn(i).setWidth(columnWidth);
- } catch (NumberFormatException e){
- DebugUIPlugin.log(new Throwable("Problem loading persisted column sizes for StringVariablePreferencesPage",e)); //$NON-NLS-1$
- }
- }
- return true;
- }
-
- private void restoreDefaultColumnWidths(){
- TableLayout layout = new TableLayout();
- for (int i = 0; i < variableTableColumnLayouts.length; i++) {
- layout.addColumnData(variableTableColumnLayouts[i]);
- }
- variableTable.getTable().setLayout(layout);
- }
-
- private class SimpleVariableContentProvider implements IStructuredContentProvider {
- /**
- * The content provider stores variable wrappers for use during editing.
- */
- private List fWorkingSet = new ArrayList();
-
- public Object[] getElements(Object inputElement) {
- return fWorkingSet.toArray();
- }
-
- /**
- * Adds the given variable to the 'wrappers'
- *
- * @param variable variable to add
- */
- public void addVariable(VariableWrapper variable) {
- fWorkingSet.add(variable);
- }
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (newInput == null || !(newInput instanceof IStringVariableManager)){
- return;
- }
- init();
- }
-
- /**
- * Saves the edited variable state to the variable manager.
- */
- public void saveChanges() {
- IStringVariableManager manager = getVariableManager();
- Iterator iterator = fWorkingSet.iterator();
- List remove = new ArrayList();
- List add = new ArrayList();
- while (iterator.hasNext()) {
- VariableWrapper variable = (VariableWrapper) iterator.next();
- if (!variable.isReadOnly()) {
- IValueVariable underlyingVariable = variable.getUnderlyingVariable();
- if (variable.isRemoved()) {
- if (underlyingVariable != null) {
- // if added and removed there is no underlying variable
- remove.add(underlyingVariable);
- }
- } else if (variable.isAdded()) {
- IValueVariable vv = manager.newValueVariable(variable.getName(), variable.getDescription());
- vv.setValue(variable.getValue());
- add.add(vv);
- } else if (variable.isChanged()) {
- underlyingVariable.setValue(variable.getValue());
- underlyingVariable.setDescription(variable.getDescription());
- }
- }
- }
- // remove
- if (!remove.isEmpty()) {
- manager.removeVariables((IValueVariable[]) remove.toArray(new IValueVariable[remove.size()]));
- }
- // add
- if (!add.isEmpty()) {
- try {
- manager.addVariables((IValueVariable[]) add.toArray(new IValueVariable[add.size()]));
- } catch (CoreException e) {
- DebugUIPlugin.errorDialog(getShell(), DebugPreferencesMessages.StringVariablePreferencePage_24, DebugPreferencesMessages.StringVariablePreferencePage_25, e.getStatus()); //
- }
- }
- }
-
- /**
- * Re-initializes to the variables currently stored in the manager.
- */
- public void init() {
- fWorkingSet.clear();
- IStringVariableManager manager = getVariableManager();
- IValueVariable[] variables = manager.getValueVariables();
- for (int i = 0; i < variables.length; i++) {
- fWorkingSet.add(new VariableWrapper(variables[i]));
- }
- }
-
- /**
- * Returns the 'working set' of variables
- *
- * @return the working set of variables (not yet saved)
- */
- public List getWorkingSetVariables() {
- return fWorkingSet;
- }
-
- }
-
- class VariableWrapper {
-
- protected IValueVariable fVariable;
- protected String fNewName = null;
- protected String fNewDesc = null;
- protected String fNewValue = null;
- boolean fRemoved = false;
- boolean fAdded = false;
-
- public VariableWrapper(IValueVariable variable) {
- fVariable = variable;
- }
-
- public VariableWrapper(String name, String desc, String value) {
- fNewName = name;
- fNewDesc = desc;
- fNewValue = value;
- fAdded = true;
- }
-
- public boolean isAdded() {
- return fAdded;
- }
-
- public String getName() {
- if (fNewName == null) {
- return fVariable.getName();
- }
- return fNewName;
- }
-
- public void setName(String name) {
- fNewName = name;
- }
-
- public String getDescription() {
- if (fNewDesc == null) {
- return fVariable.getDescription();
- }
- return fNewDesc;
- }
-
- public String getValue() {
- if (fNewValue == null) {
- return fVariable.getValue();
- }
- return fNewValue;
- }
-
- public void setValue(String value) {
- fNewValue = value;
- }
-
- public void setDescription(String desc) {
- fNewDesc = desc;
- }
-
- public boolean isChanged() {
- return !fAdded && !fRemoved && (fNewValue != null || fNewDesc != null);
- }
-
- public boolean isReadOnly() {
- if (fVariable == null) {
- return false;
- }
- return fVariable.isReadOnly();
- }
-
- public boolean isContributed() {
- if (fVariable == null) {
- return false;
- }
- return fVariable.isContributed();
- }
-
- public IValueVariable getUnderlyingVariable() {
- return fVariable;
- }
-
- public boolean isRemoved() {
- return fRemoved;
- }
-
- public void setRemoved(boolean removed) {
- fRemoved = removed;
- }
- }
-
- private class SimpleVariableLabelProvider extends LabelProvider implements ITableLabelProvider, IColorProvider {
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
- public String getColumnText(Object element, int columnIndex) {
- if (element instanceof VariableWrapper) {
- VariableWrapper variable= (VariableWrapper) element;
- switch (columnIndex) {
- case 0 :
- StringBuffer name = new StringBuffer();
- name.append(variable.getName());
- if (variable.isReadOnly()){
- name.append(DebugPreferencesMessages.StringVariablePreferencePage_26);
- }
- return name.toString();
- case 1:
- String value= variable.getValue();
- if (value == null) {
- value= IInternalDebugCoreConstants.EMPTY_STRING;
- }
- return value;
- case 2:
- String description= variable.getDescription();
- if (description == null) {
- description= IInternalDebugCoreConstants.EMPTY_STRING;
- }
- return description;
- case 3:
- String contribution = IInternalDebugCoreConstants.EMPTY_STRING;
- if (variable.isContributed()) {
- String pluginId = getVariableManager().getContributingPluginId(variable.getUnderlyingVariable());
- if (pluginId != null) {
- contribution = pluginId;
- } else {
- contribution = DebugPreferencesMessages.SimpleLaunchVariablePreferencePage_23;
- }
- }
- return contribution;
-
- }
- }
- return null;
- }
- public Color getForeground(Object element) {
- return null;
- }
- public Color getBackground(Object element) {
- if (element instanceof VariableWrapper) {
- if (((VariableWrapper) element).isReadOnly()) {
- Display display= Display.getCurrent();
- return display.getSystemColor(SWT.COLOR_INFO_BACKGROUND);
- }
- }
- return null;
- }
- }
-
- class VariableFilter extends ViewerFilter {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- return !((VariableWrapper)element).isRemoved();
- }
-
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ViewManagementPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ViewManagementPreferencePage.java
deleted file mode 100644
index 0e9349466..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ViewManagementPreferencePage.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.preferences;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.views.ViewContextService;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IPerspectiveRegistry;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.model.PerspectiveLabelProvider;
-
-/**
- * Preference page for configuring the debugger's automatic
- * view management.
- */
-public class ViewManagementPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-
- private CheckboxTableViewer fPerspectiveViewer;
- private Button fTrackViewsButton;
- private Button fResetViewsButton;
- // This flag indicates whether or not the user has pressed the reset button
- private boolean fResetPressed= false;
- private PerspectiveLabelProvider fLabelProvider= null;
- private SelectionListener fSelectionListener= new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent e) {
- Object source = e.getSource();
- if (source == fResetViewsButton) {
- handleResetPressed();
- } else if (source == fTrackViewsButton) {
- handleTrackViewsToggled();
- }
- }
-
- };
-
- public ViewManagementPreferencePage() {
- super();
- setTitle(DebugPreferencesMessages.ViewManagementPreferencePage_1);
- setDescription(DebugPreferencesMessages.ViewManagementPreferencePage_0);
- setPreferenceStore(DebugUITools.getPreferenceStore());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.VIEW_MANAGEMENT_PREFERENCE_PAGE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Composite composite= new Composite(parent, SWT.NONE);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setFont(parent.getFont());
-
- createPerspectiveViewer(composite);
-
- createViewTrackingOptions(composite);
-
- Dialog.applyDialogFont(composite);
-
- return composite;
- }
-
- /**
- * @param composite
- */
- private void createViewTrackingOptions(Composite composite) {
- fTrackViewsButton= new Button(composite, SWT.CHECK);
- fTrackViewsButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- fTrackViewsButton.setText(DebugPreferencesMessages.ViewManagementPreferencePage_3);
- fTrackViewsButton.setSelection(DebugUITools.getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_TRACK_VIEWS));
- fTrackViewsButton.addSelectionListener(fSelectionListener);
-
- Label label= new Label(composite, SWT.WRAP);
- label.setText(DebugPreferencesMessages.ViewManagementPreferencePage_4);
- label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- fResetViewsButton= SWTFactory.createPushButton(composite, DebugPreferencesMessages.ViewManagementPreferencePage_5, null);
- ((GridData) fResetViewsButton.getLayoutData()).horizontalAlignment= GridData.BEGINNING;
- fResetViewsButton.addSelectionListener(fSelectionListener);
- updateResetButton();
- }
-
- private void handleResetPressed() {
- fResetPressed= true;
- fResetViewsButton.setEnabled(false);
- }
-
- protected void handleTrackViewsToggled() {
- if (fTrackViewsButton.getSelection()) {
- // When toggled on, possibly re-enable the reset button
- updateResetButton();
- } else {
- // When toggled off, disable the reset button
- fResetViewsButton.setEnabled(false);
- }
- }
-
- /**
- * @param parent
- */
- private void createPerspectiveViewer(Composite parent) {
- Label label= new Label(parent, SWT.WRAP);
- label.setText(DebugPreferencesMessages.ViewManagementPreferencePage_2);
- label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Table table= new Table(parent, SWT.CHECK | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
- table.setLayout(new GridLayout());
- table.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- fPerspectiveViewer= new CheckboxTableViewer(table);
- PerspectiveProvider provider= new PerspectiveProvider();
- fPerspectiveViewer.setContentProvider(provider);
- fLabelProvider= new PerspectiveLabelProvider();
- fPerspectiveViewer.setLabelProvider(fLabelProvider);
- fPerspectiveViewer.setInput(this);
-
- Set perspectives;
- String preference = DebugUIPlugin.getDefault().getPreferenceStore().getString(
- IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES);
- if (IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES_DEFAULT.equals(preference)) {
- perspectives = ViewContextService.getDefaultEnabledPerspectives();
- } else {
- perspectives = ViewContextService.parseList(preference);
- }
- checkPerspectives(perspectives);
- }
-
- private void checkPerspectives(Set perspectives) {
- fPerspectiveViewer.setAllChecked(false);
- IPerspectiveRegistry registry= PlatformUI.getWorkbench().getPerspectiveRegistry();
- Iterator perspectiveIds= perspectives.iterator();
- while (perspectiveIds.hasNext()) {
- IPerspectiveDescriptor descriptor = registry.findPerspectiveWithId((String) perspectiveIds.next());
- if (descriptor != null) {
- fPerspectiveViewer.setChecked(descriptor, true);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
- public boolean performOk() {
- Object[] descriptors = fPerspectiveViewer.getCheckedElements();
- Set perspectives = new HashSet();
- for (int i = 0; i < descriptors.length; i++) {
- perspectives.add( ((IPerspectiveDescriptor)descriptors[i]).getId() );
- }
- if (perspectives.equals(ViewContextService.getDefaultEnabledPerspectives())) {
- getPreferenceStore().setValue(IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES,
- IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES_DEFAULT);
- } else {
- StringBuffer buffer= new StringBuffer();
- for (Iterator itr = perspectives.iterator(); itr.hasNext();) {
- buffer.append(itr.next()).append(',');
- }
- getPreferenceStore().setValue(IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES, buffer.toString());
- }
-
- boolean trackViews = fTrackViewsButton.getSelection();
- getPreferenceStore().setValue(IInternalDebugUIConstants.PREF_TRACK_VIEWS, trackViews);
- if (fResetPressed || !trackViews) {
- // Reset if the user has pressed reset or chosen to no longer track views
- getPreferenceStore().setValue(IInternalDebugUIConstants.PREF_USER_VIEW_BINDINGS, IInternalDebugCoreConstants.EMPTY_STRING);
- }
- return super.performOk();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
- protected void performDefaults() {
- checkPerspectives( ViewContextService.getDefaultEnabledPerspectives() );
- fTrackViewsButton.setSelection(getPreferenceStore().getDefaultBoolean(IInternalDebugUIConstants.PREF_TRACK_VIEWS));
- fResetPressed= false;
- updateResetButton();
- super.performDefaults();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- public void init(IWorkbench workbench) {
- }
-
- /**
- * Updates enablement of the reset button.
- * Enable if either persisted view collection is not empty.
- * Always disable if "track views" is turned off.
- */
- private void updateResetButton() {
- boolean enableReset= !IInternalDebugCoreConstants.EMPTY_STRING.equals(getPreferenceStore().getString(IInternalDebugUIConstants.PREF_USER_VIEW_BINDINGS));
- // Only enable the button if there are views to clear, the user hasn't pressed the reset
- // button, and the option to "track views" is turned on.
- fResetViewsButton.setEnabled(enableReset && !fResetPressed && fTrackViewsButton.getSelection());
- }
-
- private static class PerspectiveProvider implements IStructuredContentProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object inputElement) {
- return PlatformUI.getWorkbench().getPerspectiveRegistry().getPerspectives();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
- }
-
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#dispose()
- */
- public void dispose() {
- super.dispose();
- if (fLabelProvider != null) {
- fLabelProvider.dispose();
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddContainerAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddContainerAction.java
deleted file mode 100644
index e3f1ff34a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddContainerAction.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * The action to add a new source container.
- * Used by the CommonSourceNotFoundEditor, the launch configuration source tab,
- * and the EditSourceLookupPathDialog.
- */
-public class AddContainerAction extends SourceContainerAction {
-
- private ISourceLookupDirector fDirector;
-
- public AddContainerAction() {
- super(SourceLookupUIMessages.sourceTab_addButton);
- }
-
- /**
- * Prompts for a project to add.
- *
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- AddSourceContainerDialog dialog = new AddSourceContainerDialog(getShell(), getViewer(), fDirector);
- dialog.open();
- }
-
- public void setSourceLookupDirector(ISourceLookupDirector director) {
- fDirector = director;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.BaseSelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- if(selection == null || selection.isEmpty()) {
- return true;
- }
- return getViewer().getTree().getSelection()[0].getParentItem()==null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java
deleted file mode 100644
index 5bb6193b5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import java.util.ArrayList;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.ISourceContainerType;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.sourcelookup.ISourceContainerBrowser;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-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.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * The dialog for adding new source containers. Presents the user with a list of
- * source container types and allows them to select one.
- *
- * @since 3.0
- */
-public class AddSourceContainerDialog extends TitleAreaDialog {
-
- private TableViewer fViewer;
- private SourceContainerViewer fSourceContainerViewer;
- private boolean fDoubleClickSelects = true;
- private ISourceLookupDirector fDirector;
-
- /**
- * Constructor
- */
- public AddSourceContainerDialog(Shell shell, SourceContainerViewer viewer, ISourceLookupDirector director) {
- super(shell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- fSourceContainerViewer=viewer;
- fDirector = director;
- }
-
- /**
- * Creates the dialog area to display source container types that are "browseable"
- */
- protected Control createDialogArea(Composite ancestor) {
-
- getShell().setText(SourceLookupUIMessages.addSourceLocation_title);
- setTitle(SourceLookupUIMessages.addSourceLocation_description);
- setTitleImage(DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_ADD_SRC_LOC_WIZ));
-
- Composite parent = new Composite(ancestor, SWT.NULL);
- GridData gd= new GridData(GridData.FILL_BOTH);
- GridLayout topLayout = new GridLayout();
- topLayout.numColumns = 1;
- parent.setLayout(topLayout);
- parent.setLayoutData(gd);
-
- ISourceContainerType[] types = filterTypes(DebugPlugin.getDefault().getLaunchManager().getSourceContainerTypes());
-
- fViewer = new TableViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.SINGLE);
- final Table table = fViewer.getTable();
- gd = new GridData(GridData.FILL_BOTH);
- table.setLayoutData(gd);
-
- if (fDoubleClickSelects) {
- table.addSelectionListener(new SelectionAdapter() {
- public void widgetDefaultSelected(SelectionEvent e) {
- if (table.getSelectionCount() == 1)
- okPressed();
- }
- });
- }
-
- fViewer.setLabelProvider(new SourceContainerLabelProvider());
- fViewer.setContentProvider(new ArrayContentProvider());
- fViewer.setComparator(new ViewerComparator());
- fViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
- String desc = null;
- if (!selection.isEmpty()) {
- ISourceContainerType type = (ISourceContainerType) ((IStructuredSelection)selection).getFirstElement();
- desc = type.getDescription();
- }
- setMessage(desc);
- }
- });
- if(types.length != 0) {
- fViewer.setInput(types);
- }
- Dialog.applyDialogFont(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getShell(), IDebugHelpContextIds.ADD_SOURCE_CONTAINER_DIALOG);
- return parent;
- }
-
- /**
- * Removes types without browsers from the provided list of types.
- * @param types the complete list of source container types
- * @return the list of source container types that have browsers
- */
- private ISourceContainerType[] filterTypes(ISourceContainerType[] types){
- ArrayList validTypes = new ArrayList();
- for (int i=0; i< types.length; i++) {
- ISourceContainerType type = types[i];
- if (fDirector.supportsSourceContainerType(type)) {
- ISourceContainerBrowser sourceContainerBrowser = DebugUITools.getSourceContainerBrowser(type.getId());
- if(sourceContainerBrowser != null && sourceContainerBrowser.canAddSourceContainers(fDirector)) {
- validTypes.add(type);
- }
- }
- }
- return (ISourceContainerType[]) validTypes.toArray(new ISourceContainerType[validTypes.size()]);
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- //single selection dialog, so take first item in array
- //there will always be a selected item since we set it with viewer.setSelection
- ISourceContainerType type = (ISourceContainerType) ((IStructuredSelection) fViewer.getSelection()).getFirstElement();
- if (type != null) {
- ISourceContainerBrowser browser = DebugUITools.getSourceContainerBrowser(type.getId());
- if (browser != null) {
- ISourceContainer[] results = browser.addSourceContainers(getShell(), fDirector);
- if (results != null && results.length > 0) {
- fSourceContainerViewer.addEntries(results);
- }
- }
- }
- super.okPressed();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/BasicContainerContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/BasicContainerContentProvider.java
deleted file mode 100644
index b629d96cd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/BasicContainerContentProvider.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-/**
- * Provides content for a tree viewer that shows only containers.
- *
- * @since 3.0
- */
-public class BasicContainerContentProvider implements ITreeContentProvider {
-
- private boolean fShowClosedProjects = true;
- /**
- * Creates a new ResourceContentProvider.
- */
- public BasicContainerContentProvider() {
- }
- /**
- * The visual part that is using this content provider is about
- * to be disposed. Deallocate all allocated SWT resources.
- */
- public void dispose() {
- }
-
- /**
- * @see ITreeContentProvider#getChildren
- */
- public Object[] getChildren(Object element) {
- if (element instanceof IWorkspaceRoot) {
- // check if closed projects should be shown
- IProject[] allProjects = ((IWorkspaceRoot) element).getProjects();
- if (fShowClosedProjects)
- return allProjects;
-
- ArrayList accessibleProjects = new ArrayList();
- for (int i = 0; i < allProjects.length; i++) {
- if (allProjects[i].isOpen()) {
- accessibleProjects.add(allProjects[i]);
- }
- }
- return accessibleProjects.toArray();
- }
- return new Object[0];
- }
-
- /**
- * @see ITreeContentProvider#getElements
- */
- public Object[] getElements(Object element) {
- return getChildren(element);
- }
-
- /**
- * @see ITreeContentProvider#getParent
- */
- public Object getParent(Object element) {
- if (element instanceof IResource)
- return ((IResource) element).getParent();
- return null;
- }
-
- /**
- * @see ITreeContentProvider#hasChildren
- */
- public boolean hasChildren(Object element) {
- return getChildren(element).length > 0;
- }
-
- /**
- * @see IContentProvider#inputChanged
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/DownAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/DownAction.java
deleted file mode 100644
index 673b78bd9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/DownAction.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import java.util.List;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * The action for sorting the order of source containers in the dialog.
- *
- */
-public class DownAction extends SourceContainerAction {
-
- public DownAction() {
- super(SourceLookupUIMessages.sourceTab_downButton);
- }
- /**
- * @see IAction#run()
- */
- public void run() {
- List targets = getOrderedSelection();
- if (targets.isEmpty()) {
- return;
- }
- List list = getEntriesAsList();
- int bottom = list.size() - 1;
- int index = 0;
- for (int i = targets.size() - 1; i >= 0; i--) {
- Object target = targets.get(i);
- index = list.indexOf(target);
- if (index < bottom) {
- bottom = index + 1;
- Object temp = list.get(bottom);
- list.set(bottom, target);
- list.set(index, temp);
- }
- bottom = index;
- }
- setEntries(list);
- }
-
- /**
- * @see SelectionListenerAction#updateSelection(IStructuredSelection)
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- return !selection.isEmpty() && !isIndexSelected(selection, getEntriesAsList().size() - 1) && getViewer().getTree().getSelection()[0].getParentItem()==null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditContainerAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditContainerAction.java
deleted file mode 100644
index 9eadd343b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditContainerAction.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import java.util.Iterator;
-
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.ISourceContainerType;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.sourcelookup.ISourceContainerBrowser;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * Action used to edit source containers on a source lookup path
- */
-public class EditContainerAction extends SourceContainerAction {
-
- private ISourceLookupDirector fDirector;
- private ISourceContainer[] fContainers;
- private ISourceContainerBrowser fBrowser;
-
- public EditContainerAction() {
- super(SourceLookupUIMessages.EditContainerAction_0);
- }
-
- /**
- * Prompts for a project to add.
- *
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- ISourceContainer[] replacements = fBrowser.editSourceContainers(getShell(), fDirector, fContainers);
- int j = 0;
- ISourceContainer[] existing = getViewer().getEntries();
- for (int i = 0; i < existing.length && j < replacements.length; i++) {
- ISourceContainer toBeReplaced = fContainers[j];
- ISourceContainer container = existing[i];
- if (container.equals(toBeReplaced)) {
- existing[i] = replacements[j];
- j++;
- }
- }
- getViewer().setEntries(existing);
- }
-
- public void setSourceLookupDirector(ISourceLookupDirector director) {
- fDirector = director;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.BaseSelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- if(selection == null || selection.isEmpty()) {
- return false;
- }
- if (getViewer().getTree().getSelection()[0].getParentItem()==null) {
- // can only edit top level items of same type
- fContainers = new ISourceContainer[selection.size()];
- Iterator iterator = selection.iterator();
- ISourceContainer container = (ISourceContainer) iterator.next();
- ISourceContainerType type = container.getType();
- fContainers[0] = container;
- int i = 1;
- while (iterator.hasNext()) {
- container = (ISourceContainer) iterator.next();
- fContainers[i] = container;
- i++;
- if (!container.getType().equals(type)) {
- return false;
- }
- }
- // all the same type, see if editing is supported
- fBrowser = DebugUITools.getSourceContainerBrowser(type.getId());
- if (fBrowser != null) {
- return fBrowser.canEditSourceContainers(fDirector, fContainers);
- }
- }
- return false;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditSourceLookupPathAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditSourceLookupPathAction.java
deleted file mode 100644
index 641b01435..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditSourceLookupPathAction.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.views.launch.LaunchView;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.sourcelookup.SourceLookupDialog;
-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.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.SelectionListenerAction;
-
-/**
- * The action for editing the source lookup path. Brings up the
- * EditSourceLookupPathDialog.
- *
- * @since 3.0
- */
-public class EditSourceLookupPathAction extends SelectionListenerAction {
-
- private ISourceLookupDirector director = null;
- private LaunchView fView = null;
-
- public EditSourceLookupPathAction(LaunchView view) {
- super(SourceLookupUIMessages.EditSourceLookupPathAction_0);
- setEnabled(false);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.EDIT_SOURCELOOKUP_ACTION);
- setImageDescriptor(DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_SRC_LOOKUP_MENU));
- fView = view;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.BaseSelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- director = null;
- if (selection.size() == 1) {
- Object object = selection.getFirstElement();
- ILaunch launch = null;
- if (object instanceof IDebugElement) {
- launch = ((IDebugElement)object).getLaunch();
- } else if (object instanceof ILaunch) {
- launch = (ILaunch)object;
- }
- if (launch != null && launch.getLaunchConfiguration() != null &&
- launch.getSourceLocator() instanceof ISourceLookupDirector) {
- director = (ISourceLookupDirector) launch.getSourceLocator();
- }
- }
- return director != null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- Shell shell = DebugUIPlugin.getShell();
- SourceLookupDialog dialog = new SourceLookupDialog(shell, director);
- if (dialog.open() == Window.OK) {
- ISelection selection = fView.getViewer().getSelection();
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- if (ss.size() == 1) {
- IWorkbenchPage page = fView.getSite().getPage();
- SourceLookupManager.getDefault().displaySource(ss.getFirstElement(), page, true);
- }
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/LookupSourceAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/LookupSourceAction.java
deleted file mode 100644
index 8d13d4e49..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/LookupSourceAction.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.views.launch.LaunchView;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.SelectionListenerAction;
-
-/**
- * Does source lookup for the selected stack frame again.
- *
- * @since 3.0
- */
-public class LookupSourceAction extends SelectionListenerAction {
-
- private ISourceLookupDirector director = null;
- private LaunchView fView = null;
- private IStackFrame frame = null;
-
- public LookupSourceAction(LaunchView view) {
- super(SourceLookupUIMessages.LookupSourceAction_0);
- setEnabled(false);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.LOOKUP_SOURCE_ACTION);
- fView = view;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.actions.BaseSelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- director = null;
- frame = null;
- if (selection.size() == 1) {
- Object object = selection.getFirstElement();
- if (object instanceof IStackFrame) {
- frame = (IStackFrame)object;
- ILaunch launch = frame.getLaunch();
- if (launch != null && launch.getLaunchConfiguration() != null &&
- launch.getSourceLocator() instanceof ISourceLookupDirector) {
- director = (ISourceLookupDirector) launch.getSourceLocator();
- }
- }
- }
- return director != null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- ISelection selection = fView.getViewer().getSelection();
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- if (ss.size() == 1) {
- IWorkbenchPage page = fView.getSite().getPage();
- SourceLookupManager.getDefault().displaySource(ss.getFirstElement(), page, true);
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/Prompter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/Prompter.java
deleted file mode 100644
index 6be4e4543..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/Prompter.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IStatusHandler;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Prompts the user in the UI (asynchronously), on behalf of a non-UI client,
- * blocking the calling thread until a response is received.
- * <p>
- * This status handler is registered for for the debug UI plug-in,
- * with a status code of <code>STATUS_HANDLER_PROMPT</code>.
- * </p>
- * @since 3.0
- */
-public class Prompter implements IStatusHandler {
- /**
- * Prompts the user for input based on the given status and source
- * object, blocking the calling thread until the status is resolved.
- *
- * @param status client status code for which a status handler must
- * be registered
- * @param source object requesting the status to be resolved
- * @return result of resolving the given status
- * @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
- */
- public Object handleStatus(final IStatus status, final Object source) throws CoreException {
- DebugPlugin dp = DebugPlugin.getDefault();
- // on shutdown the debug plug-in can be null
- if (dp == null) {
- throw new CoreException(new Status(IStatus.INFO,
- IDebugUIConstants.PLUGIN_ID,
- IStatus.OK,
- SourceLookupUIMessages.Prompter_0,
- null));
- }
- final IStatusHandler handler = dp.getStatusHandler(status);
- if (handler == null) {
- throw new CoreException(new Status(IStatus.ERROR,
- IDebugUIConstants.PLUGIN_ID,
- IStatus.OK,
- SourceLookupUIMessages.Prompter_0,
- null));
- }
- Display display = DebugUIPlugin.getStandardDisplay();
- if (display.getThread().equals(Thread.currentThread())) {
- return handler.handleStatus(status, source);
- }
- final Object[] result = new Object[1];
- final CoreException[] exception = new CoreException[1];
- final Object lock = this;
- Runnable r = new Runnable() {
- public void run() {
- try {
- result[0] = handler.handleStatus(status, source);
- } catch (CoreException e) {
- exception[0] = e;
- }
- synchronized (lock) {
- lock.notifyAll();
- }
- }
- };
- DebugUIPlugin.getStandardDisplay().syncExec(r);
-
- if (exception[0] != null ) {
- throw exception[0];
- }
- return result[0];
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RemoveAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RemoveAction.java
deleted file mode 100644
index 7d0efb2d7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RemoveAction.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import java.util.List;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * The action used to remove source containers in the source location dialog/tab.
- *
- */
-public class RemoveAction extends SourceContainerAction {
- public RemoveAction() {
- super(SourceLookupUIMessages.sourceTab_removeButton);
- }
- /**
- * Removes all selected entries.
- *
- * @see IAction#run()
- */
- public void run() {
- List targets = getOrderedSelection();
- List list = getEntriesAsList();
- list.removeAll(targets);
- setEntries(list);
- }
-
- /**
- * @see SelectionListenerAction#updateSelection(IStructuredSelection)
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- //check that something is selected and it is a root tree node.
- return !selection.isEmpty() && getViewer().getTree().getSelection()[0].getParentItem()==null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/ResolveDuplicatesHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/ResolveDuplicatesHandler.java
deleted file mode 100644
index 51174e7cc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/ResolveDuplicatesHandler.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.core.IStatusHandler;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.sourcelookup.CommonSourceNotFoundEditor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-
-/**
- * Status handler to prompt for dupicate source element resolution.
- *
- * @since 3.0
- */
-public class ResolveDuplicatesHandler implements IStatusHandler {
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
- */
- public Object handleStatus(IStatus status, Object source) throws CoreException {
- Object[] args = (Object[])source;
- List sources = (List) args[1];
- return resolveSourceElement(sources);
- }
-
- public Object resolveSourceElement(List sources) {
- Object file = null;
- sources = removeSourceNotFoundEditors(sources);
- if(sources.size() == 1) {
- return sources.get(0);
- } else if(sources.size() == 0) {
- return null;
- }
- ElementListSelectionDialog dialog = new ElementListSelectionDialog(DebugUIPlugin.getShell(), new SourceElementLabelProvider());
- dialog.setMultipleSelection(false);
- dialog.setTitle(SourceLookupUIMessages.ResolveDuplicatesHandler_0);
- dialog.setMessage(SourceLookupUIMessages.ResolveDuplicatesHandler_1);
- dialog.setElements(sources.toArray());
- dialog.open();
- if(dialog.getReturnCode() == Window.OK) {
- file = dialog.getFirstResult();
- }
- return file;
- }
-
- /**
- * Remove extra source not found editors, if any.
- * If multiple source not found editors and no "real" source inputs,
- * return the first source not found editor.
- * @param sources the list to be filtered
- * @return the filtered list, may be empty
- */
- private List removeSourceNotFoundEditors(List sources){
- Iterator iterator = sources.iterator();
- List filteredList = new ArrayList();
- Object next;
- while(iterator.hasNext()) {
- next = iterator.next();
- if (!(next instanceof CommonSourceNotFoundEditor)) {
- filteredList.add(next);
- }
- }
- if (filteredList.isEmpty() && sources.get(0) != null) {
- filteredList.add(sources.get(0));
- }
- return filteredList;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RestoreDefaultAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RestoreDefaultAction.java
deleted file mode 100644
index 5020eb698..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RestoreDefaultAction.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.debug.core.sourcelookup.containers.DefaultSourceContainer;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * The action for adding the default container to the list.
- *
- * @since 3.0
- */
-public class RestoreDefaultAction extends SourceContainerAction {
-
- private ISourceLookupDirector fDirector;
-
- public RestoreDefaultAction() {
- super(SourceLookupUIMessages.sourceTab_defaultButton);
- }
- /**
- * @see IAction#run()
- */
- public void run() {
- ISourceContainer[] containers = new ISourceContainer[1];
- containers[0] = new DefaultSourceContainer();
- containers[0].init(fDirector);
- getViewer().setEntries(containers);
- setEnabled(false);
- }
-
- public void setSourceLookupDirector(ISourceLookupDirector director) {
- fDirector = director;
- }
-
- /**
- * @see SelectionListenerAction#updateSelection(IStructuredSelection)
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- //disable if selection is empty, default already present, or non-root node selected
- ISourceContainer[] containers = getViewer().getEntries();
- if(containers != null && containers.length == 1) {
- if(containers[0] instanceof DefaultSourceContainer) {
- return false;
- }
- }
- return true;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAction.java
deleted file mode 100644
index e9acaf1b6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAction.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.actions.SelectionListenerAction;
-
-/**
- * The abstract class for all source lookup actions.
- *
- * @since 3.0
- */
-public abstract class SourceContainerAction extends SelectionListenerAction {
- //the viewer that the action is operating on
- private SourceContainerViewer fViewer;
- //the button that is used to invoke the action
- private Button fButton;
- //the shell used to realize this action's dialog (if any)
- private Shell fShell;
-
- /**
- * The constructor for the action
- * @param label the label for the action's button
- */
- public SourceContainerAction(String label) {
- super(label);
- }
-
- /**
- * Sets the viewer on which this action operates.
- *
- * @param viewer the viewer on which this action operates
- */
- public void setViewer(SourceContainerViewer viewer) {
- if (fViewer != null) {
- fViewer.removeSelectionChangedListener(this);
- }
- fViewer = viewer;
- if (fViewer != null) {
- fViewer.addSelectionChangedListener(this);
- update();
- }
- }
-
- /**
- * Returns the viewer on which this action operates.
- *
- * @return the viewer on which this action operates
- */
- protected SourceContainerViewer getViewer() {
- return fViewer;
- }
-
- /**
- * Returns the selected items in the list, in the order they are
- * displayed.
- *
- * @return targets for an action
- */
- protected List getOrderedSelection() {
- List targets = new ArrayList();
- List selection =
- ((IStructuredSelection) getViewer().getSelection()).toList();
- ISourceContainer[] entries = getViewer().getEntries();
- for (int i = 0; i < entries.length; i++) {
- ISourceContainer target = entries[i];
- if (selection.contains(target)) {
- targets.add(target);
- }
- }
- return targets;
- }
-
- /**
- * Returns a list (copy) of the entries in the viewer
- */
- protected List getEntriesAsList() {
- ISourceContainer[] entries = getViewer().getEntries();
- List list = new ArrayList(entries.length);
- for (int i = 0; i < entries.length; i++) {
- list.add(entries[i]);
- }
- return list;
- }
-
- /**
- * Updates the entries to the entries in the given list
- */
- protected void setEntries(List list) {
- getViewer().setEntries(
- (ISourceContainer[]) list.toArray(new ISourceContainer[list.size()]));
- // update all selection listeners
- getViewer().setSelection(getViewer().getSelection());
- }
-
- /**
- * Returns whether the item at the given index in the list
- * (visually) is selected.
- */
- protected boolean isIndexSelected(
- IStructuredSelection selection,
- int index) {
- if (selection.isEmpty()) {
- return false;
- }
- Iterator entries = selection.iterator();
- List list = getEntriesAsList();
- while (entries.hasNext()) {
- Object next = entries.next();
- if (list.indexOf(next) == index) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Sets the button that invokes this action
- */
- public void setButton(Button button) {
- fButton = button;
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- run();
- }
- });
- }
-
- /**
- * @see IAction#setEnabled(boolean)
- */
- public void setEnabled(boolean enabled) {
- super.setEnabled(enabled);
- if (fButton != null) {
- fButton.setEnabled(enabled);
- }
- }
-
- /**
- * Updates the enabled state.
- */
- protected void update() {
- selectionChanged((IStructuredSelection) getViewer().getSelection());
- }
-
- /**
- * Returns the shell used to realize this action's dialog (if any).
- */
- protected Shell getShell() {
- if (fShell == null) {
- fShell = getViewer().getControl().getShell();
- }
- return fShell;
- }
-
- /**
- * Sets the shell used to realize this action's dialog (if any).
- */
- public void setShell(Shell shell) {
- fShell = shell;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAdapterFactory.java
deleted file mode 100644
index cc690aa8d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAdapterFactory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-/**
- * Adapter factory for standard source containers.
- *
- * @since 3.0
- */
-public class SourceContainerAdapterFactory implements IAdapterFactory {
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adapterType.equals(IWorkbenchAdapter.class)) {
- return new SourceContainerWorkbenchAdapter();
- }
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList() {
- return new Class[] {IWorkbenchAdapter.class};
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerLabelProvider.java
deleted file mode 100644
index 83b09ccb5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerLabelProvider.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.ISourceContainerType;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-/**
- * Label provider for source containers and source container types.
- *
- * @since 3.0
- */
-public class SourceContainerLabelProvider extends LabelProvider {
-
- private ILabelProvider fLabelProvider = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- public Image getImage(Object element) {
- // first allow workbench adapter to provide image
- Image image = getWorkbenchLabelProvider().getImage(element);
- if (image == null) {
- ISourceContainerType type = null;
- if (element instanceof ISourceContainer) {
- type = ((ISourceContainer)element).getType();
- } else if (element instanceof ISourceContainerType) {
- type = (ISourceContainerType) element;
- }
- if (type != null) {
- // next consult contributed image
- image = DebugUITools.getSourceContainerImage(type.getId());
- }
- }
- if (image != null) {
- return image;
- }
- return super.getImage(element);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object element) {
- // first, allo workbench adapter to provide label
- String label = getWorkbenchLabelProvider().getText(element);
- if (label == null || label.length() == 0) {
- if (element instanceof ISourceContainer) {
- return ((ISourceContainer) element).getName();
- } else if (element instanceof ISourceContainerType) {
- return ((ISourceContainerType)element).getName();
- }
- } else {
- return label;
- }
- return super.getText(element);
- }
-
- private ILabelProvider getWorkbenchLabelProvider() {
- if (fLabelProvider == null) {
- fLabelProvider = new WorkbenchLabelProvider();
- }
- return fLabelProvider;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- */
- public void dispose() {
- super.dispose();
- if (fLabelProvider != null) {
- fLabelProvider.dispose();
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerViewer.java
deleted file mode 100644
index 001c09cb4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerViewer.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech - Bug 173306: When editing source lookup, new source
- * containers should be added at the top of the list
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The viewer containing the source containers in the
- * SourceContainerLookupTab and the EditSourceLookupPathDialog.
- * It is a tree viewer since the containers are represented in tree form.
- *
- * @since 3.0
- */
-public class SourceContainerViewer extends TreeViewer {
-
- /**
- * Whether enabled/editable.
- */
- private boolean fEnabled = true;
- /**
- * The parent panel
- */
- private SourceLookupPanel fPanel;
- /**
- * The source container entries displayed in this viewer
- */
- protected List fEntries = new ArrayList();
-
- class ContentProvider implements ITreeContentProvider {
-
- /**
- * @see IStructuredContentProvider#getElements(Object)
- */
- public Object[] getElements(Object inputElement) {
- return getEntries();
- }
-
- /**
- * @see IContentProvider#dispose()
- */
- public void dispose() {
- }
-
- /**
- * @see IContentProvider#inputChanged(Viewer, Object, Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- /**
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- */
- public Object[] getChildren(Object parentElement) {
- try {
- return ((ISourceContainer)parentElement).getSourceContainers();
- } catch (CoreException e) {
- return new Object[0];
- }
- }
-
- /**
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- */
- public Object getParent(Object element) {
- return null;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- */
- public boolean hasChildren(Object element) {
- return ((ISourceContainer)element).isComposite();
- }
-
- }
-
- /**
- * Creates a runtime classpath viewer with the given parent.
- *
- * @param parent the parent control
- * @param panel the panel hosting this viewer
- */
- public SourceContainerViewer(Composite parent, SourceLookupPanel panel) {
- super(parent);
- setContentProvider(new ContentProvider());
- SourceContainerLabelProvider lp = new SourceContainerLabelProvider();
- setLabelProvider(lp);
- fPanel = panel;
- }
-
- /**
- * Sets the entries in this viewer
- *
- * @param entries source container entries
- */
- public void setEntries(ISourceContainer[] entries) {
- fEntries.clear();
- for (int i = 0; i < entries.length; i++) {
- if(entries[i] != null)
- fEntries.add(entries[i]);
- }
- if (getInput() == null) {
- setInput(fEntries);
- //select first item in list
- if(!fEntries.isEmpty() && fEntries.get(0)!=null)
- setSelection(new StructuredSelection(fEntries.get(0)));
- } else {
- refresh();
- }
- fPanel.setDirty(true);
- fPanel.updateLaunchConfigurationDialog();
- }
-
- /**
- * Returns the entries in this viewer
- *
- * @return the entries in this viewer
- */
- public ISourceContainer[] getEntries() {
- return (ISourceContainer[])fEntries.toArray(new ISourceContainer[fEntries.size()]);
- }
-
- /**
- * Adds the given entries to the list. If there is no selection
- * in the list, the entries are added at the end of the list,
- * otherwise the new entries are added before the (first) selected
- * entry. The new entries are selected.
- *
- * @param entries additions
- */
- public void addEntries(ISourceContainer[] entries) {
- int index = 0;
- IStructuredSelection sel = (IStructuredSelection)getSelection();
- if (!sel.isEmpty()) {
- index = fEntries.indexOf(sel.getFirstElement());
- }
- for (int i = 0; i < entries.length; i++) {
- if (!fEntries.contains(entries[i])) {
- fEntries.add(index, entries[i]);
- index++;
- }
- }
-
- refresh();
- if(entries.length > 0)
- setSelection(new StructuredSelection(entries));
- fPanel.setDirty(true);
- fPanel.updateLaunchConfigurationDialog();
- }
-
- /**
- * Enables/disables this viewer. Note the control is not disabled, since
- * we still want the user to be able to scroll if required to see the
- * existing entries. Just actions should be disabled.
- */
- public void setEnabled(boolean enabled) {
- fEnabled = enabled;
- // fire selection change to upate actions
- setSelection(getSelection());
- }
-
- /**
- * Returns whether this viewer is enabled
- */
- public boolean isEnabled() {
- return fEnabled;
- }
-
- /**
- * Returns the index of an equivalent entry, or -1 if none.
- *
- * @return the index of an equivalent entry, or -1 if none
- */
- public int indexOf(ISourceContainer entry) {
- return fEntries.indexOf(entry);
- }
-
- /**
- * Returns the source locator associated with the parent panel.
- *
- * @return the source locator
- */
- public ISourceLookupDirector getSourceLocator()
- {
- return fPanel.fLocator;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerWorkbenchAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerWorkbenchAdapter.java
deleted file mode 100644
index 5d81128d8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerWorkbenchAdapter.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import java.io.File;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.debug.core.sourcelookup.containers.ArchiveSourceContainer;
-import org.eclipse.debug.core.sourcelookup.containers.DirectorySourceContainer;
-import org.eclipse.debug.core.sourcelookup.containers.ExternalArchiveSourceContainer;
-import org.eclipse.debug.core.sourcelookup.containers.FolderSourceContainer;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-/**
- * Workbench adapter for standard source containers.
- *
- * @since 3.0
- */
-public class SourceContainerWorkbenchAdapter implements IWorkbenchAdapter {
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
- */
- public Object[] getChildren(Object o) {
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
- */
- public String getLabel(Object o) {
- if (o instanceof DirectorySourceContainer) {
- DirectorySourceContainer container = (DirectorySourceContainer) o;
- File file = container.getDirectory();
- IPath path = new Path(file.getAbsolutePath());
- return SourceElementWorkbenchAdapter.getQualifiedName(path);
- }
- if (o instanceof FolderSourceContainer) {
- FolderSourceContainer container = (FolderSourceContainer) o;
- return SourceElementWorkbenchAdapter.getQualifiedName(container.getContainer().getFullPath());
- }
- if (o instanceof ArchiveSourceContainer) {
- ArchiveSourceContainer container = (ArchiveSourceContainer)o;
- return SourceElementWorkbenchAdapter.getQualifiedName(container.getFile().getFullPath());
- }
- if (o instanceof ExternalArchiveSourceContainer) {
- ExternalArchiveSourceContainer container = (ExternalArchiveSourceContainer)o;
- IPath path = new Path(container.getName());
- return SourceElementWorkbenchAdapter.getQualifiedName(path);
- }
- return IInternalDebugCoreConstants.EMPTY_STRING;
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
- */
- public Object getParent(Object o) {
- return null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementAdapterFactory.java
deleted file mode 100644
index 6c76f83bd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementAdapterFactory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-/**
- * Adapter factory for source elements.
- *
- * @since 3.0
- */
-public class SourceElementAdapterFactory implements IAdapterFactory {
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adapterType.equals(IWorkbenchAdapter.class)) {
- return new SourceElementWorkbenchAdapter();
- }
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList() {
- return new Class[] {IWorkbenchAdapter.class};
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementLabelProvider.java
deleted file mode 100644
index ea9c1054f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementLabelProvider.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-/**
- * A label provider for source elements.
- *
- * @since 3.0
- */
-public class SourceElementLabelProvider extends LabelProvider {
-
- private ILabelProvider fLabelProvider = null;
-
-
-
- private ILabelProvider getWorkbenchLabelProvider() {
- if (fLabelProvider == null) {
- fLabelProvider = new WorkbenchLabelProvider();
- }
- return fLabelProvider;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- */
- public void dispose() {
- super.dispose();
- if (fLabelProvider != null) {
- fLabelProvider.dispose();
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- public Image getImage(Object element) {
- return getWorkbenchLabelProvider().getImage(element);
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object element) {
- if (element instanceof IResource) {
- return SourceElementWorkbenchAdapter.getQualifiedName(((IResource)element).getFullPath());
- }
- return getWorkbenchLabelProvider().getText(element);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementWorkbenchAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementWorkbenchAdapter.java
deleted file mode 100644
index 3e890a44e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementWorkbenchAdapter.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import java.io.File;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage;
-import org.eclipse.debug.core.sourcelookup.containers.ZipEntryStorage;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-/**
- * Workbench adapter for source elements.
- *
- * @since 3.0
- */
-public class SourceElementWorkbenchAdapter implements IWorkbenchAdapter {
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
- */
- public Object[] getChildren(Object o) {
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
- */
- public ImageDescriptor getImageDescriptor(Object o) {
- if (o instanceof LocalFileStorage || o instanceof ZipEntryStorage) {
- return PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJ_FILE);
- }
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
- */
- public String getLabel(Object o) {
- if (o instanceof LocalFileStorage) {
- LocalFileStorage storage = (LocalFileStorage) o;
- IPath path = storage.getFullPath();
- return getQualifiedName(path);
- }
- if (o instanceof ZipEntryStorage) {
- ZipEntryStorage storage = (ZipEntryStorage)o;
- StringBuffer buffer = new StringBuffer();
- buffer.append(storage.getZipEntry().getName());
- buffer.append(" - "); //$NON-NLS-1$
- buffer.append(storage.getArchive().getName());
- return buffer.toString();
- }
- return IInternalDebugCoreConstants.EMPTY_STRING;
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
- */
- public Object getParent(Object o) {
- return null;
- }
-
- public static String getQualifiedName(IPath path) {
- StringBuffer buffer = new StringBuffer();
- String[] segments = path.segments();
- if (segments.length > 0) {
- buffer.append(path.lastSegment());
- if (segments.length > 1) {
- buffer.append(" - "); //$NON-NLS-1$
- if (path.getDevice() != null) {
- buffer.append(path.getDevice());
- }
- for (int i = 0; i < segments.length - 1; i++) {
- buffer.append(File.separatorChar);
- buffer.append(segments[i]);
- }
- }
- return buffer.toString();
- }
- return IInternalDebugCoreConstants.EMPTY_STRING;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java
deleted file mode 100644
index 13ae678df..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java
+++ /dev/null
@@ -1,490 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Freescale - Teodor Madan - Show IP for active frame only (Bug 49730)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.ISourceLocator;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.InstructionPointerManager;
-import org.eclipse.debug.internal.ui.views.DebugUIViewsMessages;
-import org.eclipse.debug.internal.ui.views.launch.Decoration;
-import org.eclipse.debug.internal.ui.views.launch.DecorationManager;
-import org.eclipse.debug.internal.ui.views.launch.SourceNotFoundEditorInput;
-import org.eclipse.debug.internal.ui.views.launch.StandardDecoration;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugEditorPresentation;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.IInstructionPointerPresentation;
-import org.eclipse.debug.ui.ISourcePresentation;
-import org.eclipse.debug.ui.sourcelookup.CommonSourceNotFoundEditorInput;
-import org.eclipse.debug.ui.sourcelookup.ISourceLookupResult;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.IPageListener;
-import org.eclipse.ui.IPartListener2;
-import org.eclipse.ui.IReusableEditor;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartReference;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * Utility methods for looking up and displaying source.
- *
- * @since 3.1
- */
-public class SourceLookupFacility implements IPageListener, IPartListener2, IPropertyChangeListener {
-
- /**
- * Singleton source lookup facility
- */
- private static SourceLookupFacility fgDefault;
-
- /**
- * Contains a map of the editor to use for each workbench
- * page, when the 'reuse editor' preference is on.
- */
- private Map fEditorsByPage;
-
- /**
- * Used to generate annotations for stack frames
- */
- private IInstructionPointerPresentation fPresentation = (IInstructionPointerPresentation) DebugUITools.newDebugModelPresentation();
-
- /**
- * Whether to re-use editors when displaying source.
- */
- private boolean fReuseEditor = DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugUIConstants.PREF_REUSE_EDITOR);
-
- /**
- * Returns the source lookup facility
- * @return
- */
- public static SourceLookupFacility getDefault() {
- if (fgDefault == null) {
- fgDefault = new SourceLookupFacility();
- }
- return fgDefault;
- }
-
- /**
- * Performs cleanup
- */
- public static void shutdown() {
- if (fgDefault != null) {
- fgDefault.dispose();
- }
- }
-
- /**
- * Constructs a source lookup facility.
- */
- private SourceLookupFacility() {
- fEditorsByPage = new HashMap();
- DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
- }
-
- /**
- * Performs source lookup for the given artifact and returns the result.
- *
- * @param artifact object for which source is to be resolved
- * @param locator the source locator to use, or <code>null</code>. When <code>null</code>
- * a source locator is determined from the artifact, if possible. If the artifact
- * is a debug element, the source locator from its associated launch is used.
- * @return a source lookup result
- */
- public SourceLookupResult lookup(Object artifact, ISourceLocator locator) {
- SourceLookupResult result = new SourceLookupResult(artifact, null, null, null);
- IDebugElement debugElement = null;
- if (artifact instanceof IDebugElement) {
- debugElement = (IDebugElement)artifact;
- }
- if (locator == null) {
- ILaunch launch = null;
- if (debugElement != null) {
- launch = debugElement.getLaunch();
- }
- if (launch != null) {
- locator = launch.getSourceLocator();
- }
- }
- if (locator != null) {
- String editorId =null;
- IEditorInput editorInput = null;
- Object sourceElement = null;
- if (locator instanceof ISourceLookupDirector) {
- ISourceLookupDirector director = (ISourceLookupDirector)locator;
- sourceElement = director.getSourceElement(artifact);
- } else {
- if (artifact instanceof IStackFrame) {
- sourceElement = locator.getSourceElement((IStackFrame)artifact);
- }
- }
- if (sourceElement == null) {
- if (locator instanceof AbstractSourceLookupDirector) {
- editorInput = new CommonSourceNotFoundEditorInput(artifact);
- editorId = IDebugUIConstants.ID_COMMON_SOURCE_NOT_FOUND_EDITOR;
- } else {
- if (artifact instanceof IStackFrame) {
- IStackFrame frame = (IStackFrame)artifact;
- editorInput = new SourceNotFoundEditorInput(frame);
- editorId = IInternalDebugUIConstants.ID_SOURCE_NOT_FOUND_EDITOR;
- }
- }
- } else {
- ISourcePresentation presentation= null;
- if (locator instanceof ISourcePresentation) {
- presentation= (ISourcePresentation) locator;
- } else {
- if (debugElement != null) {
- presentation= getPresentation(debugElement.getModelIdentifier());
- }
- }
- if (presentation != null) {
- editorInput= presentation.getEditorInput(sourceElement);
- }
- if (editorInput != null) {
- editorId= presentation.getEditorId(editorInput, sourceElement);
- }
- }
- result.setEditorInput(editorInput);
- result.setEditorId(editorId);
- result.setSourceElement(sourceElement);
- }
- return result;
- }
-
- /**
- * Returns the model presentation for the given debug model, or <code>null</code>
- * if none.
- *
- * @param id debug model id
- * @return presentation for the model, or <code>null</code> if none.
- */
- protected IDebugModelPresentation getPresentation(String id) {
- return ((DelegatingModelPresentation)DebugUIPlugin.getModelPresentation()).getPresentation(id);
- }
-
- /**
- * Returns an editor presentation.
- *
- * @return an editor presentation
- */
- protected IDebugEditorPresentation getEditorPresentation() {
- return (DelegatingModelPresentation)DebugUIPlugin.getModelPresentation();
- }
-
- /**
- * Opens an editor in the given workbench page for the given source lookup
- * result. Has no effect if the result has an unknown editor id or editor input.
- * The editor is opened, positioned, and annotated.
- * <p>
- * Honor's the user preference of whether to re-use editors when displaying source.
- * </p>
- * @param result source lookup result to display
- * @param page the page to display the result in
- */
- public void display(ISourceLookupResult result, IWorkbenchPage page) {
- IEditorPart editor= openEditor(result, page);
- if (editor == null) {
- return;
- }
- IStackFrame frame = null;
- if (result.getArtifact() instanceof IStackFrame) {
- frame = (IStackFrame) result.getArtifact();
- }
- // position and annotate editor for stack frame
- if (frame != null) {
- IDebugEditorPresentation editorPresentation = getEditorPresentation();
- if (editorPresentation.addAnnotations(editor, frame)) {
- Decoration decoration = new StandardDecoration(editorPresentation, editor, frame.getThread());
- DecorationManager.addDecoration(decoration);
- } else {
- // perform standard positioning and annotations
- ITextEditor textEditor = null;
- if (editor instanceof ITextEditor) {
- textEditor = (ITextEditor)editor;
- } else {
- textEditor = (ITextEditor) editor.getAdapter(ITextEditor.class);
- }
- if (textEditor != null) {
- positionEditor(textEditor, frame);
- InstructionPointerManager.getDefault().removeAnnotations(textEditor);
- Annotation annotation = fPresentation.getInstructionPointerAnnotation(textEditor, frame);
- InstructionPointerManager.getDefault().addAnnotation(textEditor, frame, annotation);
- }
- }
- }
- }
-
- /**
- * Opens the editor used to display the source for an element selected in
- * this view and returns the editor that was opened or <code>null</code> if
- * no editor could be opened.
- */
- private IEditorPart openEditor(ISourceLookupResult result, IWorkbenchPage page) {
- IEditorPart editor = null;
- IEditorInput input= result.getEditorInput();
- String id= result.getEditorId();
- if (input == null || id == null) {
- return null;
- }
-
- if (fReuseEditor) {
- IEditorReference[] references = page.findEditors(input, id, IWorkbenchPage.MATCH_ID | IWorkbenchPage.MATCH_INPUT);
- if (references.length > 0) {
- // activate the editor we want to reuse
- IEditorPart refEditor= references[0].getEditor(false);
- editor = refEditor;
- page.bringToTop(editor);
- }
- if (editor == null) {
- IEditorPart editorForPage = getEditor(page);
- if (editorForPage == null || editorForPage.isDirty() || page.isEditorPinned(editorForPage)) {
- // open a new editor
- editor = openEditor(page, input, id);
- editorForPage = editor;
- } else if (editorForPage instanceof IReusableEditor && editorForPage.getSite().getId().equals(id)) {
- // re-use editor
- page.reuseEditor((IReusableEditor)editorForPage, input);
- editor = editorForPage;
- if(!page.isPartVisible(editor)) {
- page.bringToTop(editor);
- }
- } else {
- // close editor, open a new one
- editor = openEditor(page, input, id);
- page.closeEditor(editorForPage, false);
- editorForPage = editor;
- }
- setEditor(page, editorForPage);
- }
- } else {
- // Open a new editor
- editor = openEditor(page, input, id);
- }
- return editor;
- }
-
- /**
- * Positions the text editor for the given stack frame
- */
- private void positionEditor(ITextEditor editor, IStackFrame frame) {
- try {
- int charStart = frame.getCharStart();
- if (charStart >= 0) {
- editor.selectAndReveal(charStart, 0);
- return;
- }
- int lineNumber = frame.getLineNumber();
- lineNumber--; // Document line numbers are 0-based. Debug line numbers are 1-based.
- IRegion region= getLineInformation(editor, lineNumber);
- if (region != null) {
- editor.selectAndReveal(region.getOffset(), 0);
- }
- } catch (DebugException e) {
- }
- }
-
- /**
- * Returns the line information for the given line in the given editor
- */
- private IRegion getLineInformation(ITextEditor editor, int lineNumber) {
- IDocumentProvider provider= editor.getDocumentProvider();
- IEditorInput input= editor.getEditorInput();
- try {
- provider.connect(input);
- } catch (CoreException e) {
- return null;
- }
- try {
- IDocument document= provider.getDocument(input);
- if (document != null)
- return document.getLineInformation(lineNumber);
- } catch (BadLocationException e) {
- } finally {
- provider.disconnect(input);
- }
- return null;
- }
- /**
- * Opens an editor in the workbench and returns the editor that was opened
- * or <code>null</code> if an error occurred while attempting to open the
- * editor.
- */
- private IEditorPart openEditor(final IWorkbenchPage page, final IEditorInput input, final String id) {
- final IEditorPart[] editor = new IEditorPart[] {null};
- Runnable r = new Runnable() {
- public void run() {
- if (!page.getWorkbenchWindow().getWorkbench().isClosing()) {
- try {
- editor[0] = page.openEditor(input, id, false, IWorkbenchPage.MATCH_ID|IWorkbenchPage.MATCH_INPUT);
- } catch (PartInitException e) {
- DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(),
- DebugUIViewsMessages.LaunchView_Error_1,
- DebugUIViewsMessages.LaunchView_Exception_occurred_opening_editor_for_debugger__2,
- e);
- }
- }
- }
- };
- BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), r);
- return editor[0];
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPageListener#pageActivated(org.eclipse.ui.IWorkbenchPage)
- */
- public void pageActivated(IWorkbenchPage page) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPageListener#pageClosed(org.eclipse.ui.IWorkbenchPage)
- */
- public void pageClosed(IWorkbenchPage page) {
- fEditorsByPage.remove(page);
- page.removePartListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPageListener#pageOpened(org.eclipse.ui.IWorkbenchPage)
- */
- public void pageOpened(IWorkbenchPage page) {
- page.addPartListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partActivated(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partActivated(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partBroughtToTop(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partClosed(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partClosed(IWorkbenchPartReference partRef) {
- // clear the cached editor for the page if it has been closed
- IWorkbenchPage page = partRef.getPage();
- IEditorPart editor = getEditor(page);
- IWorkbenchPart part = partRef.getPart(false);
- if (part != null && part.equals(editor)) {
- fEditorsByPage.remove(page);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partDeactivated(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partDeactivated(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partOpened(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partOpened(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partHidden(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partHidden(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partVisible(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partVisible(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partInputChanged(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partInputChanged(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
- if (property.equals(IDebugUIConstants.PREF_REUSE_EDITOR)) {
- fReuseEditor = DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugUIConstants.PREF_REUSE_EDITOR);
- }
- }
-
- /**
- * Returns the editor to use to display source in the given page, or
- * <code>null</code> if a new editor should be opened.
- *
- * @param page workbench page
- * @return the editor to use to display source in the given page, or
- * <code>null</code> if a new editor should be opened
- */
- protected IEditorPart getEditor(IWorkbenchPage page) {
- return (IEditorPart) fEditorsByPage.get(page);
- }
-
- /**
- * Sets the editor to use to display source in the given page, or
- * <code>null</code> if a new editor should be opened.
- *
- * @param page workbench page
- * @return the editor to use to display source in the given page, or
- * <code>null</code> if a new editor should be opened
- */
- protected void setEditor(IWorkbenchPage page, IEditorPart editorPart) {
- if (editorPart == null) {
- fEditorsByPage.remove(page);
- } else {
- fEditorsByPage.put(page, editorPart);
- }
- page.addPartListener(this);
- page.getWorkbenchWindow().addPageListener(this);
- }
-
- /**
- * Performs cleanup.
- */
- protected void dispose() {
- DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
- fEditorsByPage.clear();
- fPresentation.dispose();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java
deleted file mode 100644
index 50dc8a3d9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.ui.IWindowListener;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Starts a source lookup service in each workbench window.
- *
- * @since 3.2
- */
-public class SourceLookupManager implements IWindowListener {
-
- private static SourceLookupManager fgDefault;
-
- /**
- * Services per window
- */
- private Map fServices = new HashMap();
-
- private SourceLookupManager() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow[] workbenchWindows = workbench.getWorkbenchWindows();
- for (int i = 0; i < workbenchWindows.length; i++) {
- IWorkbenchWindow window = workbenchWindows[i];
- windowOpened(window);
- }
- workbench.addWindowListener(this);
- }
-
- /**
- * Returns the default source lookup manager.
- *
- * @return
- */
- public static SourceLookupManager getDefault() {
- if (fgDefault == null) {
- fgDefault = new SourceLookupManager();
- }
- return fgDefault;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowActivated(IWorkbenchWindow window) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowDeactivated(IWorkbenchWindow window) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowClosed(IWorkbenchWindow window) {
- SourceLookupService service = (SourceLookupService) fServices.get(window);
- if (service != null) {
- service.dispose();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowOpened(IWorkbenchWindow window) {
- SourceLookupService service = new SourceLookupService(window);
- fServices.put(window, service);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.contexts.ISourceDisplayAdapter#displaySource(java.lang.Object, org.eclipse.ui.IWorkbenchPage, boolean)
- */
- public void displaySource(Object context, IWorkbenchPage page, boolean forceSourceLookup) {
- IWorkbenchWindow window = page.getWorkbenchWindow();
- SourceLookupService service = (SourceLookupService) fServices.get(window);
- if (service != null) {
- service.displaySource(context, page, forceSourceLookup);
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupPanel.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupPanel.java
deleted file mode 100644
index 9e5184b1a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupPanel.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * QNX Software Systems - Mikhail Khodjaiants - Bug 89748
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.model.ISourceLocator;
-import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector;
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.debug.core.sourcelookup.containers.DefaultSourceContainer;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.debug.ui.sourcelookup.WorkingSetSourceContainer;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
-
-/**
- * The panel that contains the list of source containers.
- *
- * @since 3.0
- */
-public class SourceLookupPanel extends AbstractLaunchConfigurationTab implements IPropertyChangeListener {
- //the configuration being edited
- protected ILaunchConfiguration fConfig;
- //the viewer displaying the containers
- protected SourceContainerViewer fPathViewer;
- //the duplicates checkbox
- protected Button fDuplicatesButton;
- //the source actions - up, down, add, remove, restore
- protected List fActions = new ArrayList(6);
- //the director that will be used by the tab to manage/store the containers
- protected ISourceLookupDirector fLocator;
-
- protected AddContainerAction fAddAction;
- protected EditContainerAction fEditAction;
- protected RestoreDefaultAction fRestoreDefaultAction;
-
- /**
- * Creates and returns the source lookup control.
- *
- * @param parent the parent widget of this control
- */
- public void createControl(Composite parent) {
- Font font = parent.getFont();
- Composite comp = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_BOTH);
- SWTFactory.createLabel(comp, SourceLookupUIMessages.sourceTab_lookupLabel, 2);
-
- fPathViewer = new SourceContainerViewer(comp, this);
- fPathViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
- fPathViewer.getControl().setFont(font);
-
- Composite pathButtonComp = SWTFactory.createComposite(comp, comp.getFont(), 1, 1, GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL, 0, 0);
-
- SWTFactory.createVerticalSpacer(comp, 2);
-
- fDuplicatesButton = SWTFactory.createCheckButton(comp, SourceLookupUIMessages.sourceTab_searchDuplicateLabel, null, false, 2);
- fDuplicatesButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- setDirty(true);
- updateLaunchConfigurationDialog();
- }
- });
-
- fAddAction = new AddContainerAction();
- Button button = SWTFactory.createPushButton(pathButtonComp, fAddAction.getText(), null);
- fAddAction.setButton(button);
- addAction(fAddAction);
-
- fEditAction = new EditContainerAction();
- button = SWTFactory.createPushButton(pathButtonComp, fEditAction.getText(), null);
- fEditAction.setButton(button);
- addAction(fEditAction);
-
- SourceContainerAction action = new RemoveAction();
- button = SWTFactory.createPushButton(pathButtonComp, action.getText(), null);
- action.setButton(button);
- addAction(action);
-
- action = new UpAction();
- button = SWTFactory.createPushButton(pathButtonComp, action.getText(), null);
- action.setButton(button);
- addAction(action);
-
- action = new DownAction();
- button = SWTFactory.createPushButton(pathButtonComp, action.getText(), null);
- action.setButton(button);
- addAction(action);
-
- fRestoreDefaultAction = new RestoreDefaultAction();
- button = SWTFactory.createPushButton(pathButtonComp, fRestoreDefaultAction.getText(), null);
- fRestoreDefaultAction.setButton(button);
- addAction(fRestoreDefaultAction);
-
- retargetActions(fPathViewer);
-
- //listen to changes user made to the working sets, if a working set is being removed
- //check current list to validate working sets
- IWorkingSetManager workingSetMgr = DebugUIPlugin.getDefault().getWorkbench().getWorkingSetManager();
- workingSetMgr.addPropertyChangeListener(this);
- /*Dialog.applyDialogFont(comp);*/
- setControl(comp);
- }
-
- /**
- * Adds the given action to the action collection in this tab
- */
- protected void addAction(SourceContainerAction action) {
- fActions.add(action);
- }
-
- /**
- * Re-targets actions to the given viewer
- */
- protected void retargetActions(SourceContainerViewer viewer) {
- Iterator actions = fActions.iterator();
- while (actions.hasNext()) {
- SourceContainerAction action = (SourceContainerAction) actions.next();
- action.setViewer(viewer);
- }
- }
-
- /**
- * Initializes this control based on the settings in the given
- * launch configuration.
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- if (fLocator != null) {
- fLocator.dispose();
- fLocator = null;
- }
- setErrorMessage(null);
- setMessage(null);
- String memento = null;
- String type = null;
- try{
- memento = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, (String)null);
- type = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, (String)null);
- if (type == null) {
- type = configuration.getType().getSourceLocatorId();
- }
- } catch(CoreException e){
- setErrorMessage(e.getMessage());
- return;
- }
-
- if(type == null) {
- setErrorMessage(SourceLookupUIMessages.sourceLookupPanel_2);
- return;
- }
-
- boolean migration = false;
- try {
- ISourceLocator locator = getLaunchManager().newSourceLocator(type);
- if(!(locator instanceof AbstractSourceLookupDirector)) {
- // migrate to the new source lookup infrastructure
- memento = null; // don't use old memento
- type = configuration.getType().getSourceLocatorId();
- if(type == null) {
- setErrorMessage(SourceLookupUIMessages.sourceLookupPanel_2);
- return;
- }
- locator = getLaunchManager().newSourceLocator(type);
- if (!(locator instanceof AbstractSourceLookupDirector)) {
- setErrorMessage(SourceLookupUIMessages.sourceLookupPanel_2);
- return;
- }
- migration = true;
- }
- fLocator = (AbstractSourceLookupDirector)locator;
- if (memento == null) {
- fLocator.initializeDefaults(configuration);
- } else {
- fLocator.initializeFromMemento(memento, configuration);
- }
- } catch (CoreException e) {
- setErrorMessage(e.getMessage());
- return;
- }
- initializeFrom(fLocator);
- if (migration && configuration.isWorkingCopy()) {
- // ensure perform apply actual updates the config
- setDirty(true);
- performApply((ILaunchConfigurationWorkingCopy)configuration);
- }
- }
-
- /**
- * Initializes this control based on the settings in the given
- * AbstractSourceLookupDirector
- */
- public void initializeFrom(ISourceLookupDirector locator) {
- if(fConfig == null) {
- fConfig = locator.getLaunchConfiguration();
- }
- fPathViewer.setEntries(locator.getSourceContainers());
- fDuplicatesButton.setSelection(locator.isFindDuplicates());
- fLocator = locator;
- fAddAction.setSourceLookupDirector(locator);
- fEditAction.setSourceLookupDirector(locator);
- fRestoreDefaultAction.setSourceLookupDirector(locator);
- setDirty(false);
- }
-
- /**
- * Saves the containers and duplicate policy into the given working copy of the configuration.
- * Saving the configuration will result in a change event, which will be picked up by the director
- * and used to refresh its internal list.
- *
- * @param workingCopy the working copy of the configuration that these values should be stored in, may be null.
- * If null, will be written into a working copy of the configuration referenced by the director.
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- if (isDirty()) {
- if (fLocator == null) {
- configuration.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, (String)null);
- configuration.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, (String)null);
- return;
- }
- ILaunchConfigurationWorkingCopy workingCopy = configuration;
- if(configuration == null) {
- try {
- ILaunchConfiguration config = fLocator.getLaunchConfiguration();
- if(config != null) {
- workingCopy = config.getWorkingCopy();
- }
- }
- catch(CoreException e) {
- DebugUIPlugin.log(e);
- setErrorMessage(SourceLookupUIMessages.sourceLookupPanel_1);
- return;
- }
- }
- if(workingCopy == null) {
- DebugUIPlugin.logErrorMessage("Error occurred - a working copy could not be acquired, therefore source lookup path changes will not be applied."); //$NON-NLS-1$
- return;
- }
- //set new values in director so memento returned is correct
- fLocator.setSourceContainers(fPathViewer.getEntries());
- fLocator.setFindDuplicates(fDuplicatesButton.getSelection());
-
- //writing to the file will cause a change event and the listeners will be updated
- try {
- if (isDefault()) {
- workingCopy.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, (String)null);
- workingCopy.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, (String)null);
- } else {
- workingCopy.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, fLocator.getMemento());
- workingCopy.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, fLocator.getId());
- }
- }
- catch(CoreException e) {
- DebugUIPlugin.log(e);
- setErrorMessage(SourceLookupUIMessages.sourceLookupPanel_1);
- }
-
- }
- }
-
- /**
- * determines of the current source lookup path is the default path
- * @param configuration
- * @return
- */
- protected boolean isDefault() {
- ISourceContainer[] current = getEntries();
- return !fDuplicatesButton.getSelection() && current.length == 1 && current[0] instanceof DefaultSourceContainer;
- }
-
- /**
- * Returns the entries visible in the viewer
- */
- public ISourceContainer[] getEntries() {
- return fPathViewer.getEntries();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#setDirty(boolean)
- */
- public void setDirty(boolean dirty) {
- super.setDirty(dirty);
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return SourceLookupUIMessages.sourceTab_tabTitle;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog()
- */
- protected void updateLaunchConfigurationDialog() {
- if (getLaunchConfigurationDialog() != null) {
- super.updateLaunchConfigurationDialog();
- }
- }
-
- /**
- * This is called whenever a working set has been removed. Loops through the original list
- * of working sets the user stores in the configuration. If the one being removed is in the
- * list, remove it from the list
- * @param affectedWorkingSet - the working set being removed
- */
- private void validateWorkingSetSourceContainers(IWorkingSet affectedWorkingSet) {
- List sourceContainers = (List) fPathViewer.getInput();
- if (sourceContainers != null) {
- for (int i = 0; i < sourceContainers.size(); i++) {
- if (sourceContainers.get(i) instanceof WorkingSetSourceContainer) {
- WorkingSetSourceContainer wsSrcContainer = (WorkingSetSourceContainer) sourceContainers.get(i);
- if (wsSrcContainer.getName().equals(affectedWorkingSet.getName())) {
- sourceContainers.remove(i);
- }
- }
- }
- }
- }
-
- /**
- * Listen to working set changes
- * @param event
- */
- public void propertyChange(PropertyChangeEvent event) {
- //if the PropertyChangeEvent has changeId CHANGE_WORKING_SET_REMOVE,
- //validate the list to make sure all working sets are valid
- //if the PropertyChangeEvent has changeId CHANGE_WORKING_SET_NAME_CHANGE,
- //do nothing because the event only has newValue, since oldValue is not provided
- //there is no way to identify which working set does the newValue corresponds to
- if (event.getProperty().equals(IWorkingSetManager.CHANGE_WORKING_SET_REMOVE))
- validateWorkingSetSourceContainers((IWorkingSet) event.getOldValue());
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
- initializeFrom(workingCopy);
- }
-
- /**
- * Returns the source lookup director associated with this
- * panel, or <code>null</code> if none.
- *
- * @return the source lookup director associated with this
- * panel, or <code>null</code> if none
- */
- public ISourceLookupDirector getDirector() {
- return fLocator;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose()
- */
- public void dispose() {
- super.dispose();
- //listen to changes user made to the working sets, if a working set is being removed
- //check current list to validate working sets
- IWorkingSetManager workingSetMgr = DebugUIPlugin.getDefault().getWorkbench().getWorkingSetManager();
- workingSetMgr.removePropertyChangeListener(this);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupResult.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupResult.java
deleted file mode 100644
index 940dc9253..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupResult.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import org.eclipse.debug.ui.sourcelookup.ISourceLookupResult;
-import org.eclipse.ui.IEditorInput;
-
-/**
- * The result of a source lookup contains the source element, editor id, and
- * editor input resolved for a debug artifact.
- *
- * @since 3.1
- */
-public class SourceLookupResult implements ISourceLookupResult {
-
- /**
- * Element that source was resolved for.
- */
- private Object fArtifact;
- /**
- * Corresponding source element, or <code>null</code>
- * if unknown.
- */
- private Object fSourceElement;
- /**
- * Associated editor id, used to display the source element,
- * or <code>null</code> if unknown.
- */
- private String fEditorId;
- /**
- * Associated editor input, used to display the source element,
- * or <code>null</code> if unknown.
- */
- private IEditorInput fEditorInput;
-
- /**
- * Creates a source lookup result on the given artifact, source element,
- * editor id, and editor input.
- */
- public SourceLookupResult(Object artifact, Object sourceElement, String editorId, IEditorInput editorInput) {
- fArtifact = artifact;
- setSourceElement(sourceElement);
- setEditorId(editorId);
- setEditorInput(editorInput);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.sourcelookup.ISourceLookupResult#getArtifact()
- */
- public Object getArtifact() {
- return fArtifact;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.sourcelookup.ISourceLookupResult#getSourceElement()
- */
- public Object getSourceElement() {
- return fSourceElement;
- }
-
- /**
- * Sets the source element resolved for the artifact that source
- * lookup was performed for, or <code>null</code> if a source element
- * was not resolved.
- *
- * @param element resolved source element or <code>null</code> if unknown
- */
- protected void setSourceElement(Object element) {
- fSourceElement = element;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.sourcelookup.ISourceLookupResult#getEditorId()
- */
- public String getEditorId() {
- return fEditorId;
- }
-
- /**
- * Sets the identifier of the editor used to display this source
- * lookup result's source element, or <code>null</code> if unknown.
- *
- * @param id the identifier of the editor used to display this source
- * lookup result's source element, or <code>null</code> if unknown
- */
- protected void setEditorId(String id) {
- fEditorId = id;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.sourcelookup.ISourceLookupResult#getEditorInput()
- */
- public IEditorInput getEditorInput() {
- return fEditorInput;
- }
-
- /**
- * Sets the editor input used to display this source lookup
- * result's source element, or <code>null</code> if unknown.
- *
- * @param input the editor input used to display this source lookup
- * result's source element, or <code>null</code> if unknown
- */
- protected void setEditorInput(IEditorInput input) {
- fEditorInput = input;
- }
-
- /**
- * Updates the artifact to refer to the given artifact
- * if equal. For example, when a source lookup result is reused
- * for the same stack frame, we still need to update in case
- * the stack frame is not identical.
- *
- * @param artifact new artifact state
- */
- public void updateArtifact(Object artifact) {
- if (fArtifact.equals(artifact)) {
- fArtifact = artifact;
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java
deleted file mode 100644
index b2d28c017..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River - Pawel Piech - Fixed debug context service usage (Bug 258189)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.debug.internal.ui.views.launch.DebugElementAdapterFactory;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextService;
-import org.eclipse.debug.ui.sourcelookup.ISourceDisplay;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * Performs source lookup in a window.
- *
- * @since 3.2
- */
-public class SourceLookupService implements IDebugContextListener, ISourceDisplay {
-
- private IWorkbenchWindow fWindow;
- private IDebugContextService fDebugContextService;
-
- public SourceLookupService(IWorkbenchWindow window) {
- fWindow = window;
- fDebugContextService = DebugUITools.getDebugContextManager().getContextService(window);
- fDebugContextService.addDebugContextListener(this);
- }
-
- public void dispose() {
- fDebugContextService.removeDebugContextListener(this);
- }
-
- public synchronized void debugContextChanged(DebugContextEvent event) {
- if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
- displaySource(event.getContext(), event.getDebugContextProvider().getPart(), false);
- }
- }
-
- /**
- * Displays source for the given selection and part, optionally forcing
- * a source lookup.
- *
- * @param selection
- * @param part
- * @param force
- */
- protected synchronized void displaySource(ISelection selection, IWorkbenchPart part, boolean force) {
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
- if (structuredSelection.size() == 1) {
- Object context = (structuredSelection).getFirstElement();
- IWorkbenchPage page = null;
- if (part == null) {
- page = fWindow.getActivePage();
- } else {
- page = part.getSite().getPage();
- }
- displaySource(context, page, force);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.contexts.ISourceDisplayAdapter#displaySource(java.lang.Object, org.eclipse.ui.IWorkbenchPage, boolean)
- */
- public void displaySource(Object context, IWorkbenchPage page, boolean forceSourceLookup) {
- if (context instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) context;
- ISourceDisplay adapter = (ISourceDisplay) adaptable.getAdapter(ISourceDisplay.class);
- if (adapter == null && !(context instanceof PlatformObject)) {
- // for objects that don't properly subclass PlatformObject to inherit default
- // adapters, just delegate to the adapter factory
- adapter = (ISourceDisplay) new DebugElementAdapterFactory().getAdapter(context, ISourceDisplay.class);
- }
- if (adapter != null) {
- adapter.displaySource(context, page, forceSourceLookup);
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIMessages.java
deleted file mode 100644
index 3e3470ab6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIMessages.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- * QNX Software Systems - Mikhail Khodjaiants - Bug 114664
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import org.eclipse.osgi.util.NLS;
-
-public class SourceLookupUIMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.sourcelookup.SourceLookupUIMessages";//$NON-NLS-1$
-
- public static String CommonSourceNotFoundEditor_0;
-
- public static String CommonSourceNotFoundEditor_1;
-
- // Source search launch configuration tab/errors/dialogs
- public static String EditContainerAction_0;
-
- public static String SourceLookupDialog_0;
-
- public static String SourceLookupDialog_1;
- public static String sourceTab_lookupLabel;
- public static String sourceTab_searchDuplicateLabel;
- public static String sourceTab_upButton;
- public static String sourceTab_downButton;
- public static String sourceTab_removeButton;
- public static String sourceTab_addButton;
- public static String sourceTab_tabTitle;
- public static String sourceTab_defaultButton;
-
- public static String addSourceLocation_title;
- public static String addSourceLocation_description;
-
- public static String addSourceLocation_addButton2;
- public static String addSourceLocation_editorMessage;
-
- public static String sourceSearch_folderSelectionError;
- public static String sourceSearch_initError;
-
- public static String projectSelection_chooseLabel;
- public static String projectSelection_requiredLabel;
-
- public static String folderSelection_title;
- public static String folderSelection_label;
-
- public static String manageSourceDialog_title;
- public static String manageSourceDialog_description;
-
- public static String sourceLookupPanel_1;
- public static String sourceLookupPanel_2;
- public static String ResolveDuplicatesHandler_0;
- public static String ResolveDuplicatesHandler_1;
- public static String EditSourceLookupPathAction_0;
- public static String LookupSourceAction_0;
- public static String ExternalArchiveSourceContainerBrowser_2;
- public static String ArchiveSourceContainerBrowser_3;
- public static String ArchiveSourceContainerBrowser_4;
- public static String DirectorySourceContainerDialog_0;
- public static String DirectorySourceContainerDialog_1;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, SourceLookupUIMessages.class);
- }
-
- public static String DirectorySourceContainerDialog_2;
-
- public static String DirectorySourceContainerDialog_3;
-
- public static String DirectorySourceContainerDialog_4;
-
- public static String DirectorySourceContainerDialog_5;
-
- public static String DirectorySourceContainerDialog_6;
-
- public static String DirectorySourceContainerDialog_7;
-
- public static String DirectorySourceContainerDialog_8;
-
- public static String Prompter_0;
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIMessages.properties
deleted file mode 100644
index ab28335f8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIMessages.properties
+++ /dev/null
@@ -1,64 +0,0 @@
-###############################################################################
-# Copyright (c) 2003, 2006 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-# QNX Software Systems - Mikhail Khodjaiants - Bug 114664
-###############################################################################
-
-# Source search launch configuration tab/errors/dialogs
-EditContainerAction_0=&Edit...
-sourceTab_lookupLabel = S&ource Lookup Path:
-sourceTab_searchDuplicateLabel = Searc&h for duplicate source files on the path
-sourceTab_upButton = U&p
-sourceTab_downButton = &Down
-sourceTab_removeButton = Re&move
-sourceTab_addButton = &Add...
-sourceTab_tabTitle = Source
-sourceTab_defaultButton = Restore Defa&ult
-
-addSourceLocation_title = Add Source
-addSourceLocation_description = Select the type of source to add to the source lookup path
-
-addSourceLocation_addButton2 = &Edit Source Lookup Path...
-addSourceLocation_editorMessage = Source not found.
-
-sourceSearch_folderSelectionError = Selection must be a folder.
-sourceSearch_initError = Unable to initialize source container.
-
-projectSelection_chooseLabel = Choose &project(s) to add:
-projectSelection_requiredLabel = Add &required projects of selected projects
-
-folderSelection_title=Folder Selection
-folderSelection_label=&Choose folders to add:
-
-manageSourceDialog_title = Edit Source Lookup Path
-manageSourceDialog_description = Edit the path used to locate source files.
-
-sourceLookupPanel_1 = Unable to apply source lookup path changes.
-sourceLookupPanel_2 = Launch configuration does not support source lookup
-ResolveDuplicatesHandler_0=Select Source File
-ResolveDuplicatesHandler_1=Choose a source file (? = any character, * = any string)
-EditSourceLookupPathAction_0=Edit Source Loo&kup...
-LookupSourceAction_0=Lookup &Source
-ExternalArchiveSourceContainerBrowser_2=Select Source Archive
-ArchiveSourceContainerBrowser_3=Archive Selection
-ArchiveSourceContainerBrowser_4=Choose archives to add:
-DirectorySourceContainerDialog_0=Directory Selection
-DirectorySourceContainerDialog_1=Choose directory to add:
-DirectorySourceContainerDialog_2=File system folder
-DirectorySourceContainerDialog_3=Specify folder and whether subfolders should be searched
-DirectorySourceContainerDialog_4=&Directory:
-DirectorySourceContainerDialog_5=&Browse...
-DirectorySourceContainerDialog_6=Search sub&folders
-DirectorySourceContainerDialog_7=Add File System Directory
-DirectorySourceContainerDialog_8=Edit File System Directory
-Prompter_0=Failed to get the root status handler.
-CommonSourceNotFoundEditor_0=Select a Context
-CommonSourceNotFoundEditor_1=You must select an item in the debug view to use as context for source lookup path changes.\n\nFor example: the launch or one of the threads in the view.
-SourceLookupDialog_0=Launch configuration
-SourceLookupDialog_1=\ is read only, no source lookup path changes will be saved
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIUtils.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIUtils.java
deleted file mode 100644
index 4039d38e7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIUtils.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import java.util.Hashtable;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.sourcelookup.ISourceContainerBrowser;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Utility methods for the UI portion of the source lookup solution.
- *
- * @since 3.0
- */
-public class SourceLookupUIUtils {
- /**
- * Constant for the container presentation extension id.
- * @since 3.0
- */
- public static final String CONTAINER_PRESENTATION_EXTENSION = "sourceContainerPresentations"; //$NON-NLS-1$
- /**
- * Constant for the container presentation icon attribute.
- * @since 3.0
- */
- public static final String ICON_ATTRIBUTE = "icon"; //$NON-NLS-1$
- /**
- * Constant for the container presentation browser attribute.
- * @since 3.0
- */
- public static final String BROWSER_CLASS_ATTRIBUTE = "browserClass"; //$NON-NLS-1$
- /**
- * Constant for the container presentation type id attribute.
- * @since 3.0
- */
- public static final String CONTAINER_ID_ATTRIBUTE = "containerTypeID"; //$NON-NLS-1$
-
- private static Hashtable fSourceContainerPresentationHashtable;
-
- /**
- * Constructor. Reads in Source Container Presentation extension implementations.
- */
- public SourceLookupUIUtils(){
- IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), CONTAINER_PRESENTATION_EXTENSION);
- //read in SourceContainer presentation extensions
- IConfigurationElement[] sourceContainerPresentationExtensions =extensionPoint.getConfigurationElements();
- fSourceContainerPresentationHashtable = new Hashtable();
- for (int i = 0; i < sourceContainerPresentationExtensions.length; i++) {
- fSourceContainerPresentationHashtable.put(
- sourceContainerPresentationExtensions[i].getAttribute(CONTAINER_ID_ATTRIBUTE),
- sourceContainerPresentationExtensions[i]);
- registerContainerImages(sourceContainerPresentationExtensions[i]);
- }
- }
-
-
- /**
- * Retrieves the icon associated with a source container type.
- * @param id the container type id
- * @return the image for the type specified
- */
- public static Image getSourceContainerImage(String id){
- if(fSourceContainerPresentationHashtable == null)
- new SourceLookupUIUtils();
- return DebugPluginImages.getImage(id);
- }
-
- /**
- * Retrieves the browser class associated with the source container type specified.
- * @param typeID the source container type id
- * @return the browser class
- */
- public static ISourceContainerBrowser getSourceContainerBrowser(String typeID)
- {
- if(fSourceContainerPresentationHashtable == null)
- new SourceLookupUIUtils();
- IConfigurationElement element = (IConfigurationElement)fSourceContainerPresentationHashtable.get(typeID);
- ISourceContainerBrowser browser = null;
- try{
- if(element!= null && element.getAttribute(BROWSER_CLASS_ATTRIBUTE) != null)
- browser = (ISourceContainerBrowser) element.createExecutableExtension(BROWSER_CLASS_ATTRIBUTE);
- }catch(CoreException e){}
- return browser;
- }
-
- private void registerContainerImages(IConfigurationElement configElement){
- ImageDescriptor imageDescriptor = DebugUIPlugin.getImageDescriptor(configElement, ICON_ATTRIBUTE);
- if (imageDescriptor == null) {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
- String configTypeID = configElement.getAttribute(CONTAINER_ID_ATTRIBUTE);
- ImageRegistry imageRegistry = DebugPluginImages.getImageRegistry();
- imageRegistry.put(configTypeID, imageDescriptor);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/UpAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/UpAction.java
deleted file mode 100644
index 94110d3c6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/UpAction.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * The action used to move source containers up in the list
- */
-public class UpAction extends SourceContainerAction {
-
- public UpAction() {
- super(SourceLookupUIMessages.sourceTab_upButton);
- }
- /**
- * Moves all selected entries up one position (if possible).
- *
- * @see IAction#run()
- */
- public void run() {
- List targets = getOrderedSelection();
- if (targets.isEmpty()) {
- return;
- }
- int top = 0;
- int index = 0;
- List list = getEntriesAsList();
- Iterator entries = targets.iterator();
- while (entries.hasNext()) {
- Object target = entries.next();
- index = list.indexOf(target);
- if (index > top) {
- top = index - 1;
- Object temp = list.get(top);
- list.set(top, target);
- list.set(index, temp);
- }
- top = index;
- }
- setEntries(list);
- }
-
- /**
- * @see SelectionListenerAction#updateSelection(IStructuredSelection)
- */
- protected boolean updateSelection(IStructuredSelection selection) {
- //check that something is selected, it's not first in the list, and it is a root tree node.
- return !selection.isEmpty() && !isIndexSelected(selection, 0) && getViewer().getTree().getSelection()[0].getParentItem()==null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/WorkingSetSourceContainerType.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/WorkingSetSourceContainerType.java
deleted file mode 100644
index 2356bd14e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/WorkingSetSourceContainerType.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup;
-
-import java.io.IOException;
-import java.io.StringReader;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.containers.AbstractSourceContainerTypeDelegate;
-import org.eclipse.debug.ui.sourcelookup.WorkingSetSourceContainer;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.PlatformUI;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * The factory for creating/restoring working set source containers.
- *
- * @since 3.0
- */
-public class WorkingSetSourceContainerType extends AbstractSourceContainerTypeDelegate {
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerTypeDelegate#getMemento(org.eclipse.debug.internal.core.sourcelookup.ISourceContainer)
- */
- public String getMemento(ISourceContainer container) throws CoreException {
- WorkingSetSourceContainer workingSet = (WorkingSetSourceContainer) container;
- Document doc = newDocument();
- Element node = doc.createElement("workingSet"); //$NON-NLS-1$
- node.setAttribute("name", workingSet.getName()); //$NON-NLS-1$
- doc.appendChild(node);
- return serializeDocument(doc);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#createSourceContainer(java.lang.String)
- */
- public ISourceContainer createSourceContainer(String memento)throws CoreException {
- IWorkingSet workingSet = null;
- Exception ex = null;
- try {
- Element root = null;
- DocumentBuilder parser =
- DocumentBuilderFactory.newInstance().newDocumentBuilder();
- parser.setErrorHandler(new DefaultHandler());
- StringReader reader = new StringReader(memento);
- InputSource source = new InputSource(reader);
- root = parser.parse(source).getDocumentElement();
-
- String name = root.getAttribute("name");//$NON-NLS-1$
-
- if (isEmpty(name)) {
- abort(SourceLookupUIMessages.sourceSearch_initError,null);
- }
- workingSet = PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(name);
- //check that set still exists
- if (workingSet == null) {
- abort(SourceLookupUIMessages.sourceSearch_initError, null);
- }
- return new WorkingSetSourceContainer(workingSet);
-
- } catch (ParserConfigurationException e) {
- ex = e;
- } catch (SAXException e) {
- ex = e;
- } catch (IOException e) {
- ex = e;
- }
-
- abort(SourceLookupUIMessages.sourceSearch_initError, ex);
- return null;
- }
-
- private boolean isEmpty(String string) {
- return string == null || string.length() == 0;
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java
deleted file mode 100644
index c5d55658c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup.browsers;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.custom.BusyIndicator;
-
-/**
- * ArchiveFilter
- */
-public class ArchiveFilter extends ViewerFilter {
-
- /**
- * Collection of archives and containers to display
- */
- private Set fArchives;
-
- /**
- * Collection of already existing archives
- */
- private List fExisting;
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- return fArchives.contains(element) && !fExisting.contains(element);
- }
-
- /**
- * Constructs a new filter to display archives and their containers,
- * excluding the resources in the given list.
- *
- * @param objects resources to exclude
- */
- public ArchiveFilter(List objects) {
- fExisting = objects;
- init();
- }
-
- /**
- * Search for all archives in the workspace.
- */
- private void init() {
- BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), new Runnable() {
- public void run() {
- fArchives = new HashSet();
- traverse(ResourcesPlugin.getWorkspace().getRoot(), fArchives);
- }
- });
- }
-
- /**
- * Traverse the given container, adding archives to the given set.
- * Returns whether any files were added
- *
- * @param root
- */
- private boolean traverse(IContainer container, Set set) {
- boolean added = false;
- try {
- IResource[] resources = container.members();
- for (int i = 0; i < resources.length; i++) {
- IResource resource = resources[i];
- if (resource instanceof IFile) {
- IFile file = (IFile)resource;
- String ext = file.getFileExtension();
- if (ext != null && (ext.equalsIgnoreCase("jar") || ext.equalsIgnoreCase("zip"))) { //$NON-NLS-1$ //$NON-NLS-2$
- set.add(file);
- added = true;
- }
- } else if (resource instanceof IContainer) {
- if (traverse((IContainer)resource, set)) {
- set.add(resource);
- added = true;
- }
- }
- }
- } catch (CoreException e) {
- }
- return added;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java
deleted file mode 100644
index 1b6ed903a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup.browsers;
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.debug.core.sourcelookup.containers.ArchiveSourceContainer;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupUIMessages;
-import org.eclipse.debug.ui.sourcelookup.AbstractSourceContainerBrowser;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.views.navigator.ResourceComparator;
-
-/**
- * Adds an internal jar to the runtime class path.
- */
-public class ArchiveSourceContainerBrowser extends AbstractSourceContainerBrowser {
-
- private ISelectionStatusValidator validator= new ISelectionStatusValidator() {
- public IStatus validate(Object[] selection) {
- if (selection.length == 0) {
- return new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
- }
- for (int i= 0; i < selection.length; i++) {
- if (!(selection[i] instanceof IFile)) {
- return new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
- }
- }
- return new Status(IStatus.OK, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
- }
- };
-
- /**
- * Returns internal jars (source containers) currently used by the
- * given source lookup director.
- *
- * @param director source lookup director jars are being added to
- */
- protected List getSelectedJars(ISourceLookupDirector director) {
- ISourceContainer[] containers = director.getSourceContainers();
- List jars = new ArrayList();
- for (int i = 0; i < containers.length; i++) {
- ISourceContainer container = containers[i];
- if (container.getType().getId().equals(ArchiveSourceContainer.TYPE_ID)) {
- jars.add(container);
- }
- }
- return jars;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#createSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.internal.core.sourcelookup.ISourceLookupDirector)
- */
- public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
- ViewerFilter filter= new ArchiveFilter(getSelectedJars(director));
-
- ILabelProvider lp= new WorkbenchLabelProvider();
- ITreeContentProvider cp= new WorkbenchContentProvider();
-
- ElementTreeSelectionDialog dialog= new ElementTreeSelectionDialog(shell, lp, cp);
- dialog.setValidator(validator);
- dialog.setTitle(SourceLookupUIMessages.ArchiveSourceContainerBrowser_3);
- dialog.setMessage(SourceLookupUIMessages.ArchiveSourceContainerBrowser_4);
- dialog.addFilter(filter);
- dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
- dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
-
- if (dialog.open() == Window.OK) {
- Object[] result = dialog.getResult();
- ISourceContainer[] containers = new ISourceContainer[result.length];
- for (int i = 0; i < containers.length; i++) {
- containers[i] = new ArchiveSourceContainer((IFile)result[i], true);
- }
- return containers;
- }
- return new ISourceContainer[0];
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerBrowser.java
deleted file mode 100644
index b3cbbbad8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerBrowser.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * QNX Software Systems - Mikhail Khodjaiants - Bug 114664
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup.browsers;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.debug.core.sourcelookup.containers.DirectorySourceContainer;
-import org.eclipse.debug.ui.sourcelookup.AbstractSourceContainerBrowser;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * The browser for adding an external folder source container.
- * @since 3.0
- */
-public class DirectorySourceContainerBrowser extends AbstractSourceContainerBrowser {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#createSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.ILaunchConfiguration)
- */
- public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
- ISourceContainer[] containers = new ISourceContainer[1];
- DirectorySourceContainerDialog dialog = new DirectorySourceContainerDialog(shell);
- if (dialog.open() == Window.OK) {
- String directory = dialog.getDirectory();
- if(directory !=null) {
- containers[0] = new DirectorySourceContainer(new Path(directory), dialog.isSearchSubfolders());
- return containers;
- }
- }
- return new ISourceContainer[0];
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.sourcelookup.AbstractSourceContainerBrowser#canEditSourceContainers(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector, org.eclipse.debug.core.sourcelookup.ISourceContainer[])
- */
- public boolean canEditSourceContainers(ISourceLookupDirector director, ISourceContainer[] containers) {
- return containers.length == 1 && DirectorySourceContainer.TYPE_ID.equals(containers[0].getType().getId());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.sourcelookup.AbstractSourceContainerBrowser#editSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.sourcelookup.ISourceLookupDirector, org.eclipse.debug.core.sourcelookup.ISourceContainer[])
- */
- public ISourceContainer[] editSourceContainers(Shell shell, ISourceLookupDirector director, ISourceContainer[] containers) {
- if (containers.length == 1 && DirectorySourceContainer.TYPE_ID.equals(containers[0].getType().getId()) ) {
- DirectorySourceContainer c = (DirectorySourceContainer)containers[0];
- DirectorySourceContainerDialog dialog = new DirectorySourceContainerDialog(shell, c.getDirectory().getPath(), c.isComposite());
- if (dialog.open() == Window.OK) {
- String directory = dialog.getDirectory();
- if(directory !=null) {
- containers[0].dispose();
- return new ISourceContainer[]{ new DirectorySourceContainer(new Path(directory), dialog.isSearchSubfolders())};
- }
- }
- }
- return containers;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerDialog.java
deleted file mode 100644
index 942cb37e1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerDialog.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * QNX Software Systems - Mikhail Khodjaiants - Bug 114664
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup.browsers;
-
-import java.io.File;
-
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupUIMessages;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * The dialog for selecting the external folder for which a source container will be created.
- *
- * @since 3.0
- */
-public class DirectorySourceContainerDialog extends TitleAreaDialog {
-
- private static final String LAST_PATH_SETTING = "EXT_FOLDER_LAST_PATH_SETTING"; //$NON-NLS-1$
- private static final String LAST_SUBDIR_SETTING = "EXT_FOLDER_LAST_SUBDIR_SETTING"; //$NON-NLS-1$
-
- private String fDirectory;
- private boolean fSearchSubfolders = true;
-
- private Text fDirText;
- private Button fSubfoldersButton;
-
- private boolean fNewContainer = true;
-
- /**
- * Creates a dialog to select a new file system folder.
- *
- * @param shell shell
- */
- public DirectorySourceContainerDialog(Shell shell) {
- this(shell, IInternalDebugCoreConstants.EMPTY_STRING, DebugUIPlugin.getDefault().getDialogSettings().getBoolean(LAST_SUBDIR_SETTING));
- fNewContainer = true;
- }
-
- /**
- * Creates a dialog to edit file system folder.
- *
- * @param shell shell
- * @param directory directory to edit or empty string
- * @param searchSubfolders whether the search sub-folders button should be checked
- * @param newContainer
- */
- public DirectorySourceContainerDialog(Shell shell, String directory, boolean searchSubfolders) {
- super(shell);
- setShellStyle(getShellStyle() | SWT.RESIZE );
- fDirectory = directory;
- fSearchSubfolders = searchSubfolders;
- fNewContainer = false;
- }
-
- /**
- * Returns the result of the dialog.open() operation
- * @return the dialog.open() result
- */
- public String getDirectory() {
- return fDirectory;
- }
-
- /**
- * Returns whether the 'search subfolders' option is selected.
- *
- * @return whether the 'search subfolders' option is selected
- */
- public boolean isSearchSubfolders() {
- return fSearchSubfolders;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.TitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- Image image = (fNewContainer) ? DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_ADD_SRC_DIR_WIZ) :
- DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_EDIT_SRC_DIR_WIZ);
- setTitle(SourceLookupUIMessages.DirectorySourceContainerDialog_2);
- setMessage(SourceLookupUIMessages.DirectorySourceContainerDialog_3);
- setTitleImage(image);
- Composite parentComposite = (Composite)super.createDialogArea(parent);
- Font font = parentComposite.getFont();
- Composite composite = new Composite(parentComposite, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setFont(font);
-
- Composite dirComposite = new Composite(composite, SWT.NONE);
- layout = new GridLayout(2, false);
- dirComposite.setLayout(layout);
- dirComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- dirComposite.setFont(font);
-
- Label label = new Label(dirComposite, SWT.NONE);
- label.setText(SourceLookupUIMessages.DirectorySourceContainerDialog_4);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- label.setLayoutData(data);
- label.setFont(font);
-
- fDirText = new Text(dirComposite, SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 1;
- fDirText.setLayoutData(data);
- fDirText.setFont(font);
- fDirText.addModifyListener(new ModifyListener() {
- public void modifyText( ModifyEvent e ) {
- validate();
- }
- });
-
- Button button = new Button(dirComposite, SWT.PUSH);
- button.setText(SourceLookupUIMessages.DirectorySourceContainerDialog_5);
- data = new GridData();
- int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
- Point minSize = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- data.widthHint = Math.max(widthHint, minSize.x);
- button.setLayoutData(data);
- button.setFont(JFaceResources.getDialogFont());
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- browse();
- }
- });
-
- fSubfoldersButton = new Button(composite, SWT.CHECK);
- fSubfoldersButton.setText(SourceLookupUIMessages.DirectorySourceContainerDialog_6);
-
- return parentComposite;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
- */
- protected void configureShell(Shell newShell) {
- String title = null;
- if (fNewContainer) {
- title = SourceLookupUIMessages.DirectorySourceContainerDialog_7;
- } else {
- title = SourceLookupUIMessages.DirectorySourceContainerDialog_8;
- }
- newShell.setText(title);
- super.configureShell( newShell );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.TitleAreaDialog#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Control c = super.createContents(parent);
- fDirText.setText(fDirectory);
- fSubfoldersButton.setSelection(fSearchSubfolders);
- validate();
- PlatformUI.getWorkbench().getHelpSystem().setHelp(c, IDebugHelpContextIds.SELECT_DIRECTORY_SOURCE_CONTAINER_DIALOG);
- return c;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- fDirectory = fDirText.getText().trim();
- fSearchSubfolders = fSubfoldersButton.getSelection();
- DebugUIPlugin.getDefault().getDialogSettings().put(LAST_PATH_SETTING, fDirectory);
- DebugUIPlugin.getDefault().getDialogSettings().put(LAST_SUBDIR_SETTING, fSearchSubfolders);
- super.okPressed();
- }
-
- private void browse() {
- String last = fDirText.getText().trim();
- if (last.length() == 0) {
- last = DebugUIPlugin.getDefault().getDialogSettings().get(LAST_PATH_SETTING);
- }
- if (last == null) {
- last = IInternalDebugCoreConstants.EMPTY_STRING;
- }
- DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.SINGLE);
- dialog.setText(SourceLookupUIMessages.DirectorySourceContainerDialog_0);
- dialog.setMessage(SourceLookupUIMessages.DirectorySourceContainerDialog_1);
- dialog.setFilterPath(last);
- String result = dialog.open();
- if (result == null) {
- return;
- }
- fDirText.setText(result);
- }
-
- private void validate() {
- File file = new File(fDirText.getText().trim());
- getButton(IDialogConstants.OK_ID).setEnabled(file.isDirectory() && file.exists());
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ExternalArchiveSourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ExternalArchiveSourceContainerBrowser.java
deleted file mode 100644
index a5e2f036c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ExternalArchiveSourceContainerBrowser.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup.browsers;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.debug.core.sourcelookup.containers.ExternalArchiveSourceContainer;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupUIMessages;
-import org.eclipse.debug.ui.sourcelookup.AbstractSourceContainerBrowser;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * The browser for adding an external archive.
- * @since 3.0
- */
-public class ExternalArchiveSourceContainerBrowser extends AbstractSourceContainerBrowser {
-
- private static final String ROOT_DIR = ExternalArchiveSourceContainerBrowser.class.getName() + ".rootDir"; //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#createSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.ILaunchConfiguration)
- */
- public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
- FileDialog dialog = new FileDialog(shell, SWT.OPEN | SWT.MULTI);
- String rootDir = DebugUIPlugin.getDefault().getDialogSettings().get(ROOT_DIR);
- dialog.setText(SourceLookupUIMessages.ExternalArchiveSourceContainerBrowser_2);
- dialog.setFilterExtensions(new String[]{"*.jar;*.zip"}); //$NON-NLS-1$
- if (rootDir != null) {
- dialog.setFilterPath(rootDir);
- }
- dialog.open();
- String[] fileNames= dialog.getFileNames();
- int nChosen= fileNames.length;
- if (nChosen > 0) {
- rootDir = dialog.getFilterPath();
- IPath filterPath= new Path(rootDir);
- ISourceContainer[] containers= new ISourceContainer[nChosen];
- for (int i= 0; i < nChosen; i++) {
- IPath path= filterPath.append(fileNames[i]).makeAbsolute();
- // TODO: configure auto-detect
- containers[i]= new ExternalArchiveSourceContainer(path.toOSString(), true);
- }
- DebugUIPlugin.getDefault().getDialogSettings().put(ROOT_DIR, rootDir);
- return containers;
- }
- return new ISourceContainer[0];
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerBrowser.java
deleted file mode 100644
index d040e54e6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerBrowser.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup.browsers;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.debug.core.sourcelookup.containers.FolderSourceContainer;
-import org.eclipse.debug.ui.sourcelookup.AbstractSourceContainerBrowser;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-/**
- * The browser for adding a folder source container.
- *
- * @since 3.0
- */
-public class FolderSourceContainerBrowser extends AbstractSourceContainerBrowser {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#createSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.ILaunchConfiguration)
- */
- public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
- FolderSourceContainerDialog dialog = new FolderSourceContainerDialog(shell, new WorkbenchLabelProvider(), new WorkbenchContentProvider());
-
- if (dialog.open() == Window.OK) {
- Object[] selection= ((ElementTreeSelectionDialog)dialog).getResult();
- ArrayList containers = new ArrayList();
- for (int i= 0; i < selection.length; i++) {
- if(selection[i] instanceof IFolder) {
- containers.add(new FolderSourceContainer((IFolder)selection[i], dialog.isSearchSubfolders()));
- }
- }
- return (ISourceContainer[])containers.toArray(new ISourceContainer[containers.size()]);
- }
- return new ISourceContainer[0];
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.sourcelookup.AbstractSourceContainerBrowser#canEditSourceContainers(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector, org.eclipse.debug.core.sourcelookup.ISourceContainer[])
- */
- public boolean canEditSourceContainers(ISourceLookupDirector director, ISourceContainer[] containers) {
- return containers.length == 1 && containers[0].getType().getId().equals(FolderSourceContainer.TYPE_ID);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.sourcelookup.AbstractSourceContainerBrowser#editSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.sourcelookup.ISourceLookupDirector, org.eclipse.debug.core.sourcelookup.ISourceContainer[])
- */
- public ISourceContainer[] editSourceContainers(Shell shell, ISourceLookupDirector director, ISourceContainer[] containers) {
- FolderSourceContainerDialog dialog = new FolderSourceContainerDialog(shell, new WorkbenchLabelProvider(), new WorkbenchContentProvider());
- FolderSourceContainer container = (FolderSourceContainer) containers[0];
- dialog.setSearchSubfolders(container.isComposite());
- dialog.setInitialSelection(container.getContainer());
- if (dialog.open() == Window.OK) {
- container.dispose();
- Object[] selection= ((ElementTreeSelectionDialog)dialog).getResult();
- ArrayList list = new ArrayList();
- for (int i= 0; i < selection.length; i++) {
- if(selection[i] instanceof IFolder) {
- list.add(new FolderSourceContainer((IFolder)selection[i], dialog.isSearchSubfolders()));
- }
- }
- return (ISourceContainer[])list.toArray(new ISourceContainer[list.size()]);
- }
- return new ISourceContainer[0];
- }
-
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java
deleted file mode 100644
index a3e3864ea..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup.browsers;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupUIMessages;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.eclipse.ui.views.navigator.ResourceComparator;
-
-/**
- * The dialog for selecting the folder for which a source container will be created.
- *
- * @since 3.0
- */
-public class FolderSourceContainerDialog extends ElementTreeSelectionDialog {
-
- /**
- * Constant to persist the state of the search subfolders button
- *
- * @since 3.2
- */
- private static final String LAST_SUBDIR_SETTING = "EXT_FOLDER_SOURCE_LAST_SUBDIR_SETTING"; //$NON-NLS-1$
-
- /**
- * Lets us control searching subfolders
- *
- * @since 3.2
- */
- private Button fSubfoldersButton;
-
- /**
- * stored value whether to search subfolders or not
- *
- * @since 3.2
- */
- private boolean fSearchSubfolders = false;
-
- /**
- * We need to add in the new control for indicating whether to search sub folders or not
- *
- * @since 3.2
- */
- protected Control createDialogArea(Composite parent) {
- Composite parentc = (Composite)super.createDialogArea(parent);
- fSubfoldersButton = new Button(parentc, SWT.CHECK);
- fSubfoldersButton.setText(SourceLookupUIMessages.DirectorySourceContainerDialog_6);
- fSubfoldersButton.setSelection(fSearchSubfolders);
- return parentc;
- }
-
- /**
- * Sets the dialog values for its construction
- * @param parent the parent of the dialog
- * @param labelProvider the label provider for the content of the tree in the dialog
- * @param contentProvider the provider of the tree content for the dialog
- */
- public FolderSourceContainerDialog(Shell parent, ILabelProvider labelProvider, ITreeContentProvider contentProvider) {
- super(parent, labelProvider, contentProvider);
- setTitle(SourceLookupUIMessages.folderSelection_title); //
- setInput(ResourcesPlugin.getWorkspace().getRoot());
- setComparator(new ResourceComparator(ResourceComparator.NAME));
- ISelectionStatusValidator validator= new ISelectionStatusValidator() {
- public IStatus validate(Object[] selection) {
- for (int i= 0; i < selection.length; i++) {
- if (!(selection[i] instanceof IFolder)) {
- return new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), -1, SourceLookupUIMessages.sourceSearch_folderSelectionError, null); //
- }
- }
- return new Status(IStatus.OK, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
- }
- };
- setValidator(validator);
- setDoubleClickSelects(true);
- setAllowMultiple(true);
- setMessage(SourceLookupUIMessages.folderSelection_label);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugHelpContextIds.ADD_FOLDER_CONTAINER_DIALOG);
- setSearchSubfolders(DebugUIPlugin.getDefault().getDialogSettings().getBoolean(LAST_SUBDIR_SETTING));
- addFilter(new ViewerFilter() {
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if(!(element instanceof IFolder)) {
- if(element instanceof IProject) {
- return ((IProject)element).isAccessible();
- }
- return false;
- }
- return true;
- }
- });
- }
-
- /**
- * Returns whether the 'search subfolders' option is selected.
- *
- * @since 3.2
- * @return true if the search subfolders button is selected, false otherwise.
- */
- public boolean isSearchSubfolders() {
- return fSearchSubfolders;
- }
-
- /**
- * Sets whether the 'search subfolders' option is selected.
- *
- * @param subfolders
- * @since 3.2
- */
- public void setSearchSubfolders(boolean subfolders) {
- fSearchSubfolders = subfolders;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.dialogs.SelectionStatusDialog#okPressed()
- */
- protected void okPressed() {
- fSearchSubfolders = fSubfoldersButton.getSelection();
- DebugUIPlugin.getDefault().getDialogSettings().put(LAST_SUBDIR_SETTING, fSearchSubfolders);
- super.okPressed();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerBrowser.java
deleted file mode 100644
index a5c0e8c43..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerBrowser.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup.browsers;
-
-import java.util.ArrayList;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.debug.core.sourcelookup.containers.ProjectSourceContainer;
-import org.eclipse.debug.internal.ui.sourcelookup.BasicContainerContentProvider;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupUIMessages;
-import org.eclipse.debug.ui.sourcelookup.AbstractSourceContainerBrowser;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.ListSelectionDialog;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-/**
- * The browser for creating project source containers.
- *
- * @since 3.0
- */
-public class ProjectSourceContainerBrowser extends AbstractSourceContainerBrowser {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#createSourceContainers(org.eclipse.swt.widgets.Shell,org.eclipse.debug.core.ILaunchConfiguration)
- */
- public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
- Object input = ResourcesPlugin.getWorkspace().getRoot();
- IStructuredContentProvider contentProvider=new BasicContainerContentProvider();
- ILabelProvider labelProvider = new WorkbenchLabelProvider();
- Dialog dialog = new ProjectSourceContainerDialog(shell,input, contentProvider, labelProvider,
- SourceLookupUIMessages.projectSelection_chooseLabel);
- if(dialog.open() == Window.OK){
- Object[] elements= ((ListSelectionDialog)dialog).getResult();
- ArrayList res= new ArrayList();
- for (int i= 0; i < elements.length; i++) {
- if(!(elements[i] instanceof IProject))
- continue;
- res.add(new ProjectSourceContainer((IProject)elements[i], ((ProjectSourceContainerDialog)dialog).isAddRequiredProjects()));
- }
- return (ISourceContainer[])res.toArray(new ISourceContainer[res.size()]);
- }
- return new ISourceContainer[0];
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerDialog.java
deleted file mode 100644
index 3467f1bf8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerDialog.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup.browsers;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupUIMessages;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ListSelectionDialog;
-
-/**
- * The dialog for selecting the project for which a source container will be created.
- *
- * @since 3.0
- */
-public class ProjectSourceContainerDialog extends ListSelectionDialog {
-
- private boolean fAddRequiredProjects = false;
-
- public ProjectSourceContainerDialog(
- Shell parentShell,
- Object input,
- IStructuredContentProvider contentProvider,
- ILabelProvider labelProvider,
- String message) {
- super(parentShell, input, contentProvider, labelProvider, message);
- }
-
-
- /**
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- Font font = parent.getFont();
-
- Composite composite = (Composite)super.createDialogArea(parent);
-
- final Button addRequired = new Button(composite, SWT.CHECK);
- addRequired.setText(SourceLookupUIMessages.projectSelection_requiredLabel);
- addRequired.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- fAddRequiredProjects = addRequired.getSelection();
- }
- });
- addRequired.setSelection(fAddRequiredProjects);
- addRequired.setFont(font);
-
- applyDialogFont(composite);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getShell(), IDebugHelpContextIds.ADD_PROJECT_CONTAINER_DIALOG);
- return composite;
- }
-
-
- /**
- * Returns whether the user has selected to add required projects.
- *
- * @return whether the user has selected to add required projects
- */
- public boolean isAddRequiredProjects() {
- return fAddRequiredProjects;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkingSetSourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkingSetSourceContainerBrowser.java
deleted file mode 100644
index ea7a9144a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkingSetSourceContainerBrowser.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup.browsers;
-
-import java.util.ArrayList;
-
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.debug.ui.sourcelookup.AbstractSourceContainerBrowser;
-import org.eclipse.debug.ui.sourcelookup.WorkingSetSourceContainer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog;
-
-/**
- * The browser for creating working set source containers.
- *
- * @since 3.0
- */
-public class WorkingSetSourceContainerBrowser extends AbstractSourceContainerBrowser {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#createSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.ILaunchConfiguration)
- */
- public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
- ArrayList containers = new ArrayList();
- IWorkingSetSelectionDialog dialog = PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetSelectionDialog(shell,true);
-
- if(dialog.open() == Window.OK)
- {
- IWorkingSet[] selections = dialog.getSelection();
- if(selections != null)
- {
- for(int i=0; i<selections.length; i++)
- {
- containers.add(new WorkingSetSourceContainer(selections[i]));
- }
- }
- }
-
- return (ISourceContainer[])containers.toArray(new ISourceContainer[containers.size()]);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkspaceSourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkspaceSourceContainerBrowser.java
deleted file mode 100644
index 63758920c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkspaceSourceContainerBrowser.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.sourcelookup.browsers;
-
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.debug.core.sourcelookup.containers.WorkspaceSourceContainer;
-import org.eclipse.debug.ui.sourcelookup.AbstractSourceContainerBrowser;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * The browser for creating workspace source containers.
- *
- * @since 3.0
- */
-public class WorkspaceSourceContainerBrowser extends AbstractSourceContainerBrowser {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#createSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.ILaunchConfiguration)
- */
- public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
- ISourceContainer[] containers = new ISourceContainer[1];
-
- containers[0] = new WorkspaceSourceContainer();
-
- return containers;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePrompt.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePrompt.java
deleted file mode 100644
index 418c69f23..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePrompt.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 Matt Conway and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Matt Conway - initial implementation
- * IBM Corporation - integration and code cleanup
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.stringsubstitution;
-
-import org.eclipse.swt.widgets.FileDialog;
-
-/**
- * Prompts the user to choose a file and expands the selection
- */
-public class FilePrompt extends PromptingResolver {
-
- /**
- * Prompts the user to choose a file
- * @see PromptExpanderBase#prompt()
- */
- public void prompt() {
- FileDialog dialog = new FileDialog(getShell());
- dialog.setText(dialogMessage);
- dialog.setFileName(lastValue == null ? defaultValue : lastValue);
- dialogResultString = dialog.open();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FolderPrompt.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FolderPrompt.java
deleted file mode 100644
index 861fcebe8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FolderPrompt.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 Matt Conway and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Matt Conway - initial implementation
- * IBM Corporation - integration and code cleanup
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.stringsubstitution;
-
-import org.eclipse.swt.widgets.DirectoryDialog;
-
-/**
- * Prompts the user to choose a folder and expands the selection
- */
-public class FolderPrompt extends PromptingResolver {
-
- /**
- * Prompts the user to choose a folder.
- * @see PromptExpanderBase#prompt()
- */
- public void prompt() {
- DirectoryDialog dialog = new DirectoryDialog(getShell());
- dialog.setText(dialogMessage);
- dialog.setFilterPath(lastValue == null ? defaultValue : lastValue);
- dialogResultString = dialog.open();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/IArgumentSelector.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/IArgumentSelector.java
deleted file mode 100644
index 025697c2c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/IArgumentSelector.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.stringsubstitution;
-
-import org.eclipse.core.variables.IStringVariable;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * A variable presentation extension can contribute an argument selector
- * which is use to configure the argument for a string substitution
- * variable.
- *
- * @since 3.0
- */
-public interface IArgumentSelector {
-
- /**
- * Selects and returns an argument for the given variable,
- * or <code>null</code> if none.
- *
- * @param variable the variable an arugment is being seleted for
- * @param the shell to create any dialogs on, or <code>null</code> if none
- * @return argument for the given variable or <code>null</code>
- * if none
- */
- public String selectArgument(IStringVariable variable, Shell shell);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PasswordPrompt.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PasswordPrompt.java
deleted file mode 100644
index e535d9185..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PasswordPrompt.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Benjamin Muskalla and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Benjamin Muskalla - initial implementation
- * IBM Canada - review initial contribution and commit
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.stringsubstitution;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Prompts the user to input a string. The dialog will use a password text field so all
- * typed characters are hidden on the screen.
- */
-public class PasswordPrompt extends PromptingResolver {
-
- private String returnValue;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.stringsubstitution.PromptingResolver#prompt()
- */
- public void prompt() {
- Dialog dialog = new Dialog((Shell)null){
- private Text text;
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- // create composite
- Composite composite = (Composite) super.createDialogArea(parent);
- // create message
- if (dialogMessage != null) {
- Label label = new Label(composite, SWT.WRAP);
- label.setText(dialogMessage);
- GridData data = new GridData(GridData.GRAB_HORIZONTAL
- | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL
- | GridData.VERTICAL_ALIGN_CENTER);
- data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
- label.setLayoutData(data);
- label.setFont(parent.getFont());
- }
- text = new Text(composite, SWT.SINGLE | SWT.BORDER | SWT.PASSWORD);
- text.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
- | GridData.HORIZONTAL_ALIGN_FILL));
- String value = defaultValue == null ? lastValue : defaultValue;
- if (value != null){
- text.setText(value);
- }
- applyDialogFont(composite);
- return composite;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
- */
- protected void buttonPressed(int buttonId) {
- if (buttonId == IDialogConstants.OK_ID) {
- returnValue = text.getText();
- } else {
- returnValue = null;
- }
- super.buttonPressed(buttonId);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText(StringSubstitutionMessages.StringPromptExpander_0);
- }
-
- };
-
- int dialogResult = dialog.open();
- if (dialogResult == Window.OK) {
- dialogResultString = returnValue;
- }
- }
-
-} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java
deleted file mode 100644
index d1c3bb4cd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 Matt Conway and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Matt Conway - initial implementation
- * IBM Corporation - integration and code cleanup
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.stringsubstitution;
-
-import com.ibm.icu.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.variables.IDynamicVariable;
-import org.eclipse.core.variables.IDynamicVariableResolver;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Base implementation for variable resolvers that prompt the user
- * for their value.
- */
-abstract class PromptingResolver implements IDynamicVariableResolver {
-
- /**
- * A hint that helps the user choose their input. If a prompt
- * hint is provider the user will be prompted:
- * Please input a value for <code>promptHint</code>
- */
- protected String promptHint = null;
- /**
- * The prompt displayed to the user.
- */
- protected String dialogMessage = null;
- /**
- * The default value selected when the prompt is displayed
- */
- protected String defaultValue = null;
- /**
- * The last value chosen by the user for this variable
- */
- protected String lastValue = null;
- /**
- * The result returned from the prompt dialog
- */
- protected String dialogResultString = null;
-
- /**
- * Presents the user with the appropriate prompt for the variable to be expanded
- * and sets the <code>dialogResultString</code> based on the user's selection.
- */
- public abstract void prompt();
-
- /**
- * Initializes values displayed when the user is prompted. If
- * a prompt hint and default value are supplied in the given
- * variable value, these are extracted for presentation
- *
- * @param varValue the value of the variable from which the prompt
- * hint and default value will be extracted
- */
- protected void setupDialog(String varValue) {
- promptHint = null;
- defaultValue = null;
- dialogResultString = null;
- if (varValue != null) {
- int idx = varValue.indexOf(':');
- if (idx != -1) {
- promptHint = varValue.substring(0, idx);
- defaultValue = varValue.substring(idx + 1);
- } else {
- promptHint = varValue;
- }
- }
-
- if (promptHint != null) {
- dialogMessage = MessageFormat.format(StringSubstitutionMessages.PromptExpanderBase_0, new String[] {promptHint});
- } else {
- dialogMessage = StringSubstitutionMessages.PromptExpanderBase_1;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.stringsubstitution.IContextVariableResolver#resolveValue(org.eclipse.debug.internal.core.stringsubstitution.IContextVariable, java.lang.String)
- */
- public String resolveValue(IDynamicVariable variable, String argument) throws CoreException {
- String value = null;
- setupDialog(argument);
-
- DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
- public void run() {
- prompt();
- }
- });
- if (dialogResultString != null) {
- value = dialogResultString;
- lastValue = dialogResultString;
- } else {
- // dialogResultString == null means prompt was cancelled
- throw new DebugException(new Status(IStatus.CANCEL, DebugUIPlugin.getUniqueIdentifier(), IStatus.CANCEL, MessageFormat.format(StringSubstitutionMessages.PromptingResolver_0, new String[] { variable.getName() }), null));
- }
- return value;
- }
-
- protected Shell getShell() {
- return DebugUIPlugin.getShell();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/ResourceSelector.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/ResourceSelector.java
deleted file mode 100644
index d6e0f6ad7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/ResourceSelector.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.stringsubstitution;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.variables.IStringVariable;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.ResourceListSelectionDialog;
-
-/**
- * Selects a resource argument for a string substitution variable
- */
-public class ResourceSelector implements IArgumentSelector {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.stringsubstitution.IArgumentSelector#selectArgument(org.eclipse.debug.internal.core.stringsubstitution.IStringVariable)
- */
- public String selectArgument(IStringVariable variable, Shell shell) {
- ResourceListSelectionDialog dialog = new ResourceListSelectionDialog(shell, ResourcesPlugin.getWorkspace().getRoot(), IResource.FILE | IResource.FOLDER | IResource.PROJECT);
- dialog.setTitle(StringSubstitutionMessages.ResourceSelector_0);
- if (dialog.open() == Window.OK) {
- Object[] objects = dialog.getResult();
- if (objects.length == 1) {
- return ((IResource)objects[0]).getFullPath().toString();
- }
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java
deleted file mode 100644
index 842af04e7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.stringsubstitution;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * Maintains the context used to expand variables. The context is based on
- * the selected resource.
- */
-public class SelectedResourceManager {
-
- // singleton
- private static SelectedResourceManager fgDefault;
-
- /**
- * Returns the singleton resource selection manager
- *
- * @return VariableContextManager
- */
- public static SelectedResourceManager getDefault() {
- if (fgDefault == null) {
- fgDefault = new SelectedResourceManager();
- }
- return fgDefault;
- }
-
- /**
- * Returns the selection from the currently active part. If the active part is an
- * editor a new selection of the editor part is made, otherwise the selection
- * from the parts' selection provider is returned if it is a structured selection. Otherwise
- * and empty selection is returned, never <code>null</code>.
- * <br>
- * <p>
- * This method is intended to be called from the UI thread.
- * </p>
- *
- * @return the <code>IStructuredSelection</code> from the current parts' selection provider, or
- * a new <code>IStructuredSelection</code> of the current editor part, depending on what the current part
- * is.
- *
- * @since 3.3
- */
- public IStructuredSelection getCurrentSelection() {
- if(DebugUIPlugin.getStandardDisplay().getThread().equals(Thread.currentThread())) {
- return getCurrentSelection0();
- }
- else {
- final IStructuredSelection[] selection = new IStructuredSelection[1];
- DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
- public void run() {
- selection[0] = getCurrentSelection0();
- }
- });
- return selection[0];
- }
- }
-
- /**
- * Underlying implementation of <code>getCurrentSelection</code>
- * @return the current selection
- *
- * @since 3.4
- */
- private IStructuredSelection getCurrentSelection0() {
- IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
- if(window != null) {
- IWorkbenchPage page = window.getActivePage();
- if(page != null) {
- IWorkbenchPart part = page.getActivePart();
- if(part instanceof IEditorPart) {
- return new StructuredSelection(part);
- }
- else if(part != null) {
- IWorkbenchSite site = part.getSite();
- if(site != null) {
- ISelectionProvider provider = site.getSelectionProvider();
- if(provider != null) {
- ISelection selection = provider.getSelection();
- if(selection instanceof IStructuredSelection) {
- return (IStructuredSelection) provider.getSelection();
- }
- }
- }
- }
- }
- }
- return StructuredSelection.EMPTY;
- }
-
- /**
- * Returns the currently selected resource in the active workbench window,
- * or <code>null</code> if none. If an editor is active, the resource adapter
- * associated with the editor is returned.
- *
- * @return selected resource or <code>null</code>
- */
- public IResource getSelectedResource() {
- if(DebugUIPlugin.getStandardDisplay().getThread().equals(Thread.currentThread())) {
- return getSelectedResource0();
- }
- else {
- final IResource[] resource = new IResource[1];
- DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
- public void run() {
- resource[0] = getSelectedResource0();
- }
- });
- return resource[0];
- }
- }
-
- /**
- * Returns the currently selected resource from the active part, or <code>null</code> if one cannot be
- * resolved.
- * @return the currently selected <code>IResource</code>, or <code>null</code> if none.
- * @since 3.3
- */
- protected IResource getSelectedResource0() {
- IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
- IResource resource = null;
- if(window != null) {
- IWorkbenchPage page = window.getActivePage();
- if(page != null) {
- IWorkbenchPart part = page.getActivePart();
- if(part instanceof IEditorPart) {
- IEditorPart epart = (IEditorPart) part;
- resource = (IResource) epart.getEditorInput().getAdapter(IResource.class);
- }
- else if(part != null) {
- IWorkbenchPartSite site = part.getSite();
- if(site != null) {
- ISelectionProvider provider = site.getSelectionProvider();
- if(provider != null) {
- ISelection selection = provider.getSelection();
- if(selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- if(!ss.isEmpty()) {
- Iterator iterator = ss.iterator();
- while (iterator.hasNext() && resource == null) {
- Object next = iterator.next();
- resource = (IResource) Platform.getAdapterManager().getAdapter(next, IResource.class);
- }
- }
- }
- }
- }
- }
- }
- }
- return resource;
- }
-
- /**
- * Returns the current text selection as a <code>String</code>, or <code>null</code> if
- * none.
- *
- * @return the current text selection as a <code>String</code> or <code>null</code>
- */
- public String getSelectedText() {
- if(DebugUIPlugin.getStandardDisplay().getThread().equals(Thread.currentThread())) {
- return getSelectedText0();
- }
- else {
- final String[] text = new String[1];
- DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
- public void run() {
- text[0] = getSelectedText0();
- }
- });
- return text[0];
- }
- }
-
- /**
- * Returns the selected text from the most currently active editor. The editor does not have to
- * have focus at the time this method is called.
- * @return the currently selected text in the most recent active editor.
- *
- * @since 3.3
- */
- protected String getSelectedText0() {
- IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
- if(window != null) {
- IWorkbenchPage page = window.getActivePage();
- if(page != null) {
- IEditorPart epart = page.getActiveEditor();
- if(epart != null) {
- IEditorSite esite = epart.getEditorSite();
- if(esite != null) {
- ISelectionProvider sprovider = esite.getSelectionProvider();
- if(sprovider != null) {
- ISelection selection = sprovider.getSelection();
- if(selection instanceof ITextSelection) {
- return ((ITextSelection)selection).getText();
- }
- }
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the active workbench window, or <code>null</code> if none.
- *
- * @return the active workbench window, or <code>null</code> if none
- * @since 3.2
- */
- public IWorkbenchWindow getActiveWindow() {
- if(DebugUIPlugin.getStandardDisplay().getThread().equals(Thread.currentThread())) {
- return DebugUIPlugin.getActiveWorkbenchWindow();
- }
- else {
- final IWorkbenchWindow[] window = new IWorkbenchWindow[1];
- DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
- public void run() {
- window[0] = DebugUIPlugin.getActiveWorkbenchWindow();
- }
- });
- return window[0];
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceResolver.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceResolver.java
deleted file mode 100644
index 0fcedc27a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceResolver.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.stringsubstitution;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.variables.IDynamicVariable;
-import org.eclipse.core.variables.IDynamicVariableResolver;
-import org.eclipse.debug.internal.core.variables.ResourceResolver;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Resolves the currently selected resource.
- *
- * @since 3.5
- */
-public class SelectedResourceResolver extends ResourceResolver implements IDynamicVariableResolver {
-
- /* (non-Javadoc)
- * @see org.eclipse.core.variables.IDynamicVariableResolver#resolveValue(org.eclipse.core.variables.IDynamicVariable, java.lang.String)
- */
- public String resolveValue(IDynamicVariable variable, String argument) throws CoreException {
- IResource resource = SelectedResourceManager.getDefault().getSelectedResource();
- if (resource != null) {
- return translateToValue(resource, variable);
- }
- abort(MessageFormat.format(StringSubstitutionMessages.SelectedResourceResolver_0, new String[]{getReferenceExpression(variable, argument)}), null);
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedTextResolver.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedTextResolver.java
deleted file mode 100644
index e2726b883..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedTextResolver.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.stringsubstitution;
-
-import org.eclipse.core.variables.IDynamicVariable;
-import org.eclipse.core.variables.IDynamicVariableResolver;
-
-public class SelectedTextResolver implements IDynamicVariableResolver {
- private SelectedResourceManager selectedResourceManager;
-
- public SelectedTextResolver() {
- selectedResourceManager = SelectedResourceManager.getDefault();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.variables.IDynamicVariableResolver#resolveValue(org.eclipse.core.variables.IDynamicVariable, java.lang.String)
- */
- public String resolveValue(IDynamicVariable variable, String argument) {
- String selection = selectedResourceManager.getSelectedText();
- String selectedText = argument;
- if (selection != null && selection.length() > 0) {
- selectedText = selection;
- }
- return selectedText;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringPrompt.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringPrompt.java
deleted file mode 100644
index da44ec551..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringPrompt.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 Matt Conway and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Matt Conway - initial implementation
- * IBM Corporation - integration and code cleanup
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.stringsubstitution;
-
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.window.Window;
-
-/**
- * Prompts the user to input a string and expands to the value entered
- */
-public class StringPrompt extends PromptingResolver {
-
- /**
- * Prompts the user to input a string.
- * @see PromptExpanderBase#prompt()
- */
- public void prompt() {
- InputDialog dialog = new InputDialog(null, StringSubstitutionMessages.StringPromptExpander_0, dialogMessage, defaultValue == null ? lastValue : defaultValue, null);
- int dialogResult = dialog.open();
- if (dialogResult == Window.OK) {
- dialogResultString = dialog.getValue();
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringSubstitutionMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringSubstitutionMessages.java
deleted file mode 100644
index 728b1682e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringSubstitutionMessages.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- **********************************************************************/
-package org.eclipse.debug.internal.ui.stringsubstitution;
-
-import org.eclipse.osgi.util.NLS;
-
-public class StringSubstitutionMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.stringsubstitution.StringSubstitutionMessages";//$NON-NLS-1$
-
- public static String PromptExpanderBase_0;
- public static String PromptExpanderBase_1;
- public static String PromptingResolver_0;
-
- public static String RefreshTab_0;
-
- public static String RefreshTab_1;
-
- public static String RefreshTab_44;
- public static String RefreshTab_6;
- public static String RefreshTab_7;
- public static String RefreshTab_8;
- public static String RefreshTab_31;
- public static String RefreshTab_32;
- public static String RefreshTab_33;
- public static String RefreshTab_34;
- public static String RefreshTab_35;
- public static String RefreshTab_36;
- public static String RefreshTab_37;
- public static String RefreshTab_40;
- public static String RefreshTab_42;
-
- public static String ResourceSelector_0;
-
- public static String SelectedResourceResolver_0;
-
- public static String StringPromptExpander_0;
-
- public static String StringVariableSelectionDialog_2;
- public static String StringVariableSelectionDialog_3;
- public static String StringVariableSelectionDialog_6;
- public static String StringVariableSelectionDialog_7;
- public static String StringVariableSelectionDialog_8;
- public static String StringVariableSelectionDialog_0;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, StringSubstitutionMessages.class);
- }
-
- public static String SystemPropertyArgumentSelector_0;
-
- public static String SystemPropertyArgumentSelector_1;
-} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringSubstitutionMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringSubstitutionMessages.properties
deleted file mode 100644
index cf1db4b70..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringSubstitutionMessages.properties
+++ /dev/null
@@ -1,44 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2009 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-PromptExpanderBase_0=Please input a value for {0}
-PromptExpanderBase_1=Please input a value
-PromptingResolver_0=Failed to expand {0}. Input was cancelled.
-
-RefreshTab_0=Recursively &include sub-folders
-RefreshTab_1=Working set
-RefreshTab_6=Refresh
-RefreshTab_7=Refresh resources...
-RefreshTab_8=Exception(s) occurred during refresh.
-RefreshTab_31=Refresh resources &upon completion.
-RefreshTab_32=The &entire workspace
-RefreshTab_33=The se&lected resource
-RefreshTab_34=The &project containing the selected resource
-RefreshTab_35=The f&older containing the selected resource
-RefreshTab_36=&Specific resources
-RefreshTab_37=Specify &Resources...
-RefreshTab_40=working set
-RefreshTab_42=Must select resources to refresh.
-RefreshTab_44=Refresh scope invalid
-
-ResourceSelector_0=Select Resource
-
-SelectedResourceResolver_0=Unable to resource a selected resource: {0}
-StringPromptExpander_0=Variable input
-
-StringVariableSelectionDialog_2=Select Variable
-StringVariableSelectionDialog_3=&Choose a variable (? = any character, * = any string):
-StringVariableSelectionDialog_6=&Argument:
-StringVariableSelectionDialog_7=C&onfigure...
-StringVariableSelectionDialog_8=&Variable Description:
-StringVariableSelectionDialog_0=&Edit Variables...
-SystemPropertyArgumentSelector_0=Select System Property
-SystemPropertyArgumentSelector_1=Select a system property (? = any character, * = any String):
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariableLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariableLabelProvider.java
deleted file mode 100644
index ca12e4196..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariableLabelProvider.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.stringsubstitution;
-
-import org.eclipse.core.variables.IStringVariable;
-import org.eclipse.jface.viewers.LabelProvider;
-
-
-public class StringVariableLabelProvider extends LabelProvider {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object element) {
- if (element instanceof IStringVariable) {
- IStringVariable variable = (IStringVariable)element;
- return variable.getName();
- }
- return super.getText(element);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariablePresentationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariablePresentationManager.java
deleted file mode 100644
index 5832140b6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariablePresentationManager.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.stringsubstitution;
-
-import com.ibm.icu.text.MessageFormat;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.variables.IStringVariable;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-
-/**
- * Manages argument selectors (choosers) for string variables.
- *
- * @since 3.0
- */
-public class StringVariablePresentationManager {
-
- /**
- * String variable presentation extension point identifier
- * (value <code>"stringVariablePresentations"</code>).
- *
- * @since 3.0
- */
- public static final String EXTENSION_POINT_STRING_VARIABLE_PRESENTATIONS = "stringVariablePresentations"; //$NON-NLS-1$
-
- // default manager
- private static StringVariablePresentationManager fgManager;
-
- // extension point attributes
- public static final String ATTR_NAME = "variableName"; //$NON-NLS-1$
- public static final String ATTR_ARGUMENT_SELECTOR = "argumentSelector"; //$NON-NLS-1$
-
- /**
- * Table of configuration elements for variable presentations,
- * keyed by variable name.
- */
- private Map fConfigurations;
-
- /**
- * Returns the singleton string variable presentation manager.
- *
- * @return the singleton string variable presentation manager
- */
- public static StringVariablePresentationManager getDefault() {
- if (fgManager == null) {
- fgManager = new StringVariablePresentationManager();
- }
- return fgManager;
- }
-
- /**
- * Returns an argument selector contributed for the given
- * variable, or <code>null</code> if none.
- *
- * @param variable string substitution variable
- * @return argument selector or <code>null</code>
- */
- public IArgumentSelector getArgumentSelector(IStringVariable variable) {
- IConfigurationElement element = (IConfigurationElement) fConfigurations.get(variable.getName());
- if (element != null) {
- try {
- return (IArgumentSelector)element.createExecutableExtension(ATTR_ARGUMENT_SELECTOR);
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- return null;
- }
-
- /**
- * Constructs the manager, loading extensions.
- */
- private StringVariablePresentationManager() {
- initialize();
- }
-
- /**
- * Load extensions
- */
- private void initialize() {
- fConfigurations = new HashMap();
- IExtensionPoint point= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), EXTENSION_POINT_STRING_VARIABLE_PRESENTATIONS);
- IConfigurationElement elements[]= point.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- IConfigurationElement element = elements[i];
- String name= element.getAttribute(ATTR_NAME);
- if (name == null) {
- DebugUIPlugin.logErrorMessage(MessageFormat.format("String variable presentation extension missing required 'variableName' attribute: {0}", new String[] {element.getDeclaringExtension().getLabel()})); //$NON-NLS-1$
- continue;
- }
- fConfigurations.put(name, element);
- }
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SystemPropertyArgumentSelector.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SystemPropertyArgumentSelector.java
deleted file mode 100644
index b633cacf3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SystemPropertyArgumentSelector.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.stringsubstitution;
-
-import org.eclipse.core.variables.IStringVariable;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-
-/**
- * Argument selector for system properties.
- *
- * @since 3.2
- */
-public class SystemPropertyArgumentSelector implements IArgumentSelector {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.stringsubstitution.IArgumentSelector#selectArgument(org.eclipse.core.variables.IStringVariable, org.eclipse.swt.widgets.Shell)
- */
- public String selectArgument(IStringVariable variable, Shell shell) {
- ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, new LabelProvider());
- dialog.setElements(System.getProperties().keySet().toArray());
- dialog.setTitle(StringSubstitutionMessages.SystemPropertyArgumentSelector_0);
- dialog.setMessage(StringSubstitutionMessages.SystemPropertyArgumentSelector_1);
- if (dialog.open() == Window.OK) {
- return (String) dialog.getResult()[0];
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AbstractUpdatePolicy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AbstractUpdatePolicy.java
deleted file mode 100644
index c8bec419d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AbstractUpdatePolicy.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-
-/**
- * An update policy updates a viewer based on deltas reported by a model proxy.
- *
- * @since 3.2
- *
- */
-public abstract class AbstractUpdatePolicy {
-
- private AsynchronousViewer fViewer = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.viewers.IUpdatePolicy#init(org.eclipse.debug.ui.viewers.update.IPresentation)
- */
- public void init(AsynchronousViewer viewer) {
- fViewer = viewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.viewers.IUpdatePolicy#dispose()
- */
- public synchronized void dispose() {
- fViewer = null;
- }
-
- /**
- * Returns the viewer this policy is installed on or <code>null</code>
- * if disposed.
- *
- * @return presentation to update
- */
- public AsynchronousViewer getViewer() {
- return fViewer;
- }
-
- protected synchronized boolean isDisposed() {
- return fViewer == null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java
deleted file mode 100644
index b1225caa7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java
+++ /dev/null
@@ -1,641 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-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.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.elements.adapters.AsynchronousDebugLabelAdapter;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IStatusMonitor;
-import org.eclipse.debug.internal.ui.viewers.provisional.AsynchronousContentAdapter;
-import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousContentAdapter;
-import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousLabelAdapter;
-import org.eclipse.debug.internal.ui.viewers.provisional.IChildrenRequestMonitor;
-import org.eclipse.debug.internal.ui.viewers.provisional.ILabelRequestMonitor;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.viewers.ViewerSorter;
-
-/**
- * Model for an asynchronous viewer
- *
- * @since 3.2
- */
-public abstract class AsynchronousModel {
-
- private ModelNode fRoot; // root node
- private Map fElementToNodes = new HashMap(); // map of element to corresponding tree nodes (list)
- private Map fModelProxies = new HashMap(); // map of installed model proxies, by element
- private AsynchronousViewer fViewer; // viewer this model works for
- private boolean fDisposed = false; // whether disposed
-
- // debug flags
- public static boolean DEBUG_MODEL = false;
-
- static {
- DEBUG_MODEL = DebugUIPlugin.DEBUG && "true".equals( //$NON-NLS-1$
- Platform.getDebugOption("org.eclipse.debug.ui/debug/viewers/model")); //$NON-NLS-1$
- }
-
- class EmptyContentAdapter extends AsynchronousContentAdapter {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.AsynchronousContentAdapter#getChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected Object[] getChildren(Object parent, IPresentationContext context) throws CoreException {
- return EMPTY;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.AsynchronousContentAdapter#hasChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected boolean hasChildren(Object element, IPresentationContext context) throws CoreException {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.AsynchronousContentAdapter#supportsPartId(java.lang.String)
- */
- protected boolean supportsPartId(String id) {
- return true;
- }
- }
-
- protected IAsynchronousContentAdapter fEmptyContentAdapter = new EmptyContentAdapter();
-
- /**
- * List of requests currently being performed.
- */
- private List fPendingUpdates = new ArrayList();
-
- /**
- * List of pending viewer udpates
- */
- private List fViewerUpdates = new ArrayList();
-
- /**
- * Constructs a new empty tree model
- *
- * @param viewer associated viewer
- */
- public AsynchronousModel(AsynchronousViewer viewer) {
- fViewer = viewer;
- if (DEBUG_MODEL) {
- StringBuffer buffer = new StringBuffer();
- buffer.append("MODEL CREATED for: "); //$NON-NLS-1$
- buffer.append(fViewer);
- buffer.append(" ("); //$NON-NLS-1$
- buffer.append(this);
- buffer.append(")"); //$NON-NLS-1$
- DebugUIPlugin.debug(buffer.toString());
- }
- }
-
- /**
- * Initializes this model. Called once after creation.
- *
- * @param root root element or <code>null</code>
- * @param widget root widget/control
- */
- public void init(Object root) {
- if (root != null) {
- fRoot = new ModelNode(null, root);
- mapElement(root, fRoot);
- }
- }
-
- protected AsynchronousViewer getViewer() {
- return fViewer;
- }
-
- /**
- * Disposes this model
- */
- public synchronized void dispose() {
- if (DEBUG_MODEL) {
- StringBuffer buffer = new StringBuffer();
- buffer.append("MODEL DISPOSED for: "); //$NON-NLS-1$
- buffer.append(fViewer);
- buffer.append(" ("); //$NON-NLS-1$
- buffer.append(this);
- buffer.append(")"); //$NON-NLS-1$
- DebugUIPlugin.debug(buffer.toString());
- }
- fDisposed = true;
- cancelPendingUpdates();
- disposeAllModelProxies();
- ModelNode rootNode = getRootNode();
- if (rootNode != null) {
- rootNode.dispose();
- }
- fElementToNodes.clear();
- }
-
- /**
- * Returns whether this model has been disposed
- */
- public synchronized boolean isDisposed() {
- return fDisposed;
- }
-
- /**
- * Cancels all pending update requests.
- */
- protected synchronized void cancelPendingUpdates() {
- Iterator updates = fPendingUpdates.iterator();
- while (updates.hasNext()) {
- IStatusMonitor update = (IStatusMonitor) updates.next();
- updates.remove();
- update.setCanceled(true);
- }
- fPendingUpdates.clear();
- }
-
- /**
- * Installs the model proxy for the given element into this viewer
- * if not already installed.
- *
- * @param element element to install an update policy for
- */
- public synchronized void installModelProxy(Object element) {
- if (!fModelProxies.containsKey(element)) {
- IModelProxyFactory modelProxyFactory = getModelProxyFactoryAdapter(element);
- if (modelProxyFactory != null) {
- final IModelProxy proxy = modelProxyFactory.createModelProxy(element, getPresentationContext());
- if (proxy != null) {
- fModelProxies.put(element, proxy);
- Job job = new Job("Model Proxy installed notification job") {//$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- if (!monitor.isCanceled()) {
- proxy.init(getPresentationContext());
- getViewer().modelProxyAdded(proxy);
- proxy.installed(getViewer());
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
- }
- }
- }
-
- /**
- * Uninstalls the model proxy installed for the given element, if any.
- *
- * @param element
- */
- protected synchronized void disposeModelProxy(Object element) {
- IModelProxy proxy = (IModelProxy) fModelProxies.remove(element);
- if (proxy != null) {
- getViewer().modelProxyRemoved(proxy);
- proxy.dispose();
- }
- }
-
- /**
- * Unintalls all model proxies installed for this model
- */
- private void disposeAllModelProxies() {
- synchronized(fModelProxies) {
- Iterator updatePolicies = fModelProxies.values().iterator();
- while (updatePolicies.hasNext()) {
- IModelProxy proxy = (IModelProxy)updatePolicies.next();
- getViewer().modelProxyRemoved(proxy);
- proxy.dispose();
- }
-
- fModelProxies.clear();
- }
- }
-
- /**
- * Returns the presentation this model is installed in
- *
- * @return
- */
- protected IPresentationContext getPresentationContext() {
- return fViewer.getPresentationContext();
- }
-
- /**
- * Returns the model proxy factory for the given element of <code>null</code> if none.
- *
- * @param element element to retrieve adapters for
- * @return model proxy factory adapter or <code>null</code>
- */
- protected IModelProxyFactory getModelProxyFactoryAdapter(Object element) {
- IModelProxyFactory adapter = null;
- if (element instanceof IModelProxyFactory) {
- adapter = (IModelProxyFactory) element;
- } else if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- adapter = (IModelProxyFactory) adaptable.getAdapter(IModelProxyFactory.class);
- }
- return adapter;
- }
-
- /**
- * Maps the given element to the given node.
- *
- * @param element
- * @param node
- */
- protected synchronized void mapElement(Object element, ModelNode node) {
- ModelNode[] nodes = getNodes(element);
- node.remap(element);
- if (nodes == null) {
- fElementToNodes.put(element, new ModelNode[] { node});
- } else {
- for (int i = 0; i < nodes.length; i++) {
- if (nodes[i] == node) {
- return;
- }
- }
- ModelNode[] old = nodes;
- ModelNode[] newNodes = new ModelNode[old.length + 1];
- System.arraycopy(old, 0, newNodes, 0, old.length);
- newNodes[old.length] = node;
- fElementToNodes.put(element, newNodes);
- }
- installModelProxy(element);
- }
-
- /**
- * Unmaps the given node from its element and widget.
- *
- * @param node
- */
- protected synchronized void unmapNode(ModelNode node) {
- Object element = node.getElement();
- ModelNode[] nodes = (ModelNode[]) fElementToNodes.get(element);
- if (nodes == null) {
- return;
- }
- if (nodes.length == 1) {
- fElementToNodes.remove(element);
- disposeModelProxy(element);
- } else {
- for (int i = 0; i < nodes.length; i++) {
- ModelNode node2 = nodes[i];
- if (node2 == node) {
- ModelNode[] newNodes= new ModelNode[nodes.length - 1];
- System.arraycopy(nodes, 0, newNodes, 0, i);
- if (i < newNodes.length) {
- System.arraycopy(nodes, i + 1, newNodes, i, newNodes.length - i);
- }
- fElementToNodes.put(element, newNodes);
- }
- }
- }
- }
-
- /**
- * Returns the nodes in this model for the given element or
- * <code>null</code> if none.
- *
- * @param element model element
- * @return associated nodes or <code>null</code>
- */
- public synchronized ModelNode[] getNodes(Object element) {
- return (ModelNode[]) fElementToNodes.get(element);
- }
-
- /**
- * Returns the root node or <code>null</code>
- *
- * @return the root node or <code>null</code>
- */
- public ModelNode getRootNode() {
- return fRoot;
- }
-
- /**
- * Cancels any conflicting updates for children of the given item, and
- * schedules the new update.
- *
- * @param update the update to schedule
- */
- protected void requestScheduled(IStatusMonitor update) {
- AsynchronousRequestMonitor absUpdate = (AsynchronousRequestMonitor) update;
- synchronized (fPendingUpdates) {
- Iterator updates = fPendingUpdates.listIterator();
- while (updates.hasNext()) {
- AsynchronousRequestMonitor pendingUpdate = (AsynchronousRequestMonitor) updates.next();
- if (absUpdate.contains(pendingUpdate)) {
- updates.remove();
- pendingUpdate.setCanceled(true);
- }
- }
- fPendingUpdates.add(update);
- }
- }
-
- /**
- * Removes the update from the pending updates list.
- *
- * @param update
- */
- protected void requestComplete(IStatusMonitor update) {
- synchronized (fPendingUpdates) {
- fPendingUpdates.remove(update);
- }
- }
-
- /**
- * An viewer update has been scheduled due to the following update request.
- *
- * @param update
- */
- protected void viewerUpdateScheduled(IStatusMonitor update) {
- // synch viewer updates and pending updates on same lock - fPendingUpdates
- synchronized (fPendingUpdates) {
- fViewerUpdates.add(update);
- }
- }
-
- /**
- * Returns the result of running the given elements through the
- * viewers filters.
- *
- * @param parent parent element
- * @param elements the elements to filter
- * @return only the elements which all filters accept
- */
- protected Object[] filter(Object parent, Object[] elements) {
- ViewerFilter[] filters = getViewer().getFilters();
- if (filters != null) {
- ArrayList filtered = new ArrayList(elements.length);
- for (int i = 0; i < elements.length; i++) {
- boolean add = true;
- for (int j = 0; j < filters.length; j++) {
- add = filters[j].select(getViewer(), parent, elements[i]);
- if (!add)
- break;
- }
- if (add)
- filtered.add(elements[i]);
- }
- return filtered.toArray();
- }
- return elements;
- }
-
- /**
- * Refreshes the given node.
- *
- * @param node
- */
- protected void updateLabel(ModelNode node) {
- Object element = node.getElement();
- IAsynchronousLabelAdapter adapter = getLabelAdapter(element);
- if (adapter != null) {
- ILabelRequestMonitor labelUpdate = new LabelRequestMonitor(node, this);
- requestScheduled(labelUpdate);
- adapter.retrieveLabel(element, getPresentationContext(), labelUpdate);
- }
- }
-
- /**
- * Returns the label adapter for the given element or <code>null</code> if none.
- *
- * @param element element to retrieve adapter for
- * @return presentation adapter or <code>null</code>
- */
- protected IAsynchronousLabelAdapter getLabelAdapter(Object element) {
- IAsynchronousLabelAdapter adapter = null;
- if (element instanceof IAsynchronousLabelAdapter) {
- adapter = (IAsynchronousLabelAdapter) element;
- } else if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- adapter = (IAsynchronousLabelAdapter) adaptable.getAdapter(IAsynchronousLabelAdapter.class);
- }
- // if no adapter, use default (i.e. model presentation)
- if (adapter == null) {
- return new AsynchronousDebugLabelAdapter();
- }
- return adapter;
- }
-
- /**
- * Returns the tree element adapter for the given element or
- * <code>null</code> if none.
- *
- * @param element
- * element to retrieve adapter for
- * @return presentation adapter or <code>null</code>
- */
- protected IAsynchronousContentAdapter getContentAdapter(Object element) {
- IAsynchronousContentAdapter adapter = null;
- if (element instanceof IAsynchronousContentAdapter) {
- adapter = (IAsynchronousContentAdapter) element;
- } else if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- adapter = (IAsynchronousContentAdapter) adaptable.getAdapter(IAsynchronousContentAdapter.class);
- }
- return adapter;
- }
-
- /**
- * Updates the children of the given node.
- *
- * @param parent
- * node of which to update children
- */
- public void updateChildren(ModelNode parent) {
- Object element = parent.getElement();
- IAsynchronousContentAdapter adapter = getContentAdapter(element);
- if (adapter == null) {
- adapter = fEmptyContentAdapter;
- }
- if (adapter != null) {
- IChildrenRequestMonitor update = new ChildrenRequestMonitor(parent, this);
- requestScheduled(update);
- adapter.retrieveChildren(element, getPresentationContext(), update);
- }
- }
-
- /**
- * Update this model's viewer preserving its selection.
- *
- * @param update
- */
- protected void preservingSelection(Runnable update) {
- getViewer().preservingSelection(update);
- }
-
- /**
- * The viewer updated associated with a request is compelte.
- *
- * @param monitor
- */
- protected void viewerUpdateComplete(IStatusMonitor monitor) {
- // synch viewer updates and pending updates on same lock - fPendingUpdates
- synchronized (fPendingUpdates) {
- fViewerUpdates.remove(monitor);
- }
- getViewer().updateComplete(monitor);
- }
-
- /**
- * An update request was cancelled
- *
- * @param monitor
- */
- protected void requestCanceled(AsynchronousRequestMonitor monitor) {
- synchronized (fPendingUpdates) {
- fPendingUpdates.remove(monitor);
- }
- }
-
- /**
- * Whether any updates are still in progress in the model or against the viewer.
- *
- * @return
- */
- protected boolean hasPendingUpdates() {
- synchronized (fViewerUpdates) {
- return !fPendingUpdates.isEmpty() || !fViewerUpdates.isEmpty();
- }
- }
-
- /**
- * Asynchronous update for add/set children request.
- *
- * @param parent
- * @param element
- */
- protected abstract void add(ModelNode parent, Object element);
-
- /**
- * Notification from children request monitor
- *
- * @param parentNode parent node
- * @param kids list of model elements
- */
- protected void setChildren(final ModelNode parentNode, List kids) {
-
- final Object[] children = filter(parentNode.getElement(), kids.toArray());
- final AsynchronousViewer viewer = getViewer();
- ViewerSorter sorter = viewer.getSorter();
- if (sorter != null) {
- sorter.sort(viewer, children);
- }
-
- ModelNode[] prevKids = null;
- ModelNode[] newChildren = null;
- ModelNode[] unmap = null;
-
- synchronized (this) {
- if (isDisposed()) {
- return;
- }
- prevKids = parentNode.getChildrenNodes();
- if (prevKids == null) {
- newChildren = new ModelNode[children.length];
- for (int i = 0; i < children.length; i++) {
- ModelNode node = new ModelNode(parentNode, children[i]);
- mapElement(children[i], node);
- newChildren[i] = node;
- }
- parentNode.setChildren(newChildren);
- } else {
- newChildren = new ModelNode[children.length];
- unmap = new ModelNode[prevKids.length];
- for (int i = 0; i < prevKids.length; i++) {
- unmap[i] = prevKids[i];
- }
- for (int i = 0; i < children.length; i++) {
- Object child = children[i];
- boolean found = false;
- for (int j = 0; j < prevKids.length; j++) {
- ModelNode prevKid = prevKids[j];
- if (prevKid != null && child.equals(prevKid.getElement())) {
- newChildren[i] = prevKid;
- prevKids[j] = null;
- found = true;
- break;
- }
- }
- if (!found) {
- newChildren[i] = new ModelNode(parentNode, child);
- mapElement(child, newChildren[i]);
- }
- }
- for (int i = 0; i < prevKids.length; i++) {
- ModelNode kid = prevKids[i];
- if (kid != null) {
- kid.dispose();
- unmapNode(kid);
- }
- }
- parentNode.setChildren(newChildren);
- }
- if (DEBUG_MODEL) {
- DebugUIPlugin.debug("CHILDREN CHANGED: " + parentNode); //$NON-NLS-1$
- DebugUIPlugin.debug(toString());
- }
- }
-
- //update viewer outside the lock
- final ModelNode[] finalUnmap = unmap;
- preservingSelection(new Runnable() {
- public void run() {
- if (finalUnmap != null) {
- for (int i = 0; i < finalUnmap.length; i++) {
- viewer.unmapNode(finalUnmap[i]);
- }
- }
- viewer.nodeChildrenChanged(parentNode);
- }
- });
-
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer();
- if (fRoot != null) {
- buf.append("ROOT: "); //$NON-NLS-1$
- append(buf, fRoot, 0);
- } else {
- buf.append("ROOT: null"); //$NON-NLS-1$
- }
- return buf.toString();
- }
-
- private void append(StringBuffer buf, ModelNode node, int level) {
- for (int i = 0; i < level; i++) {
- buf.append('\t');
- }
- buf.append(node);
- buf.append('\n');
- ModelNode[] childrenNodes = node.getChildrenNodes();
- if (childrenNodes != null) {
- for (int i = 0; i < childrenNodes.length; i++) {
- append(buf, childrenNodes[i], level + 1);
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java
deleted file mode 100644
index fba6d5d8e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.debug.internal.ui.commands.actions.AbstractRequestMonitor;
-import org.eclipse.ui.progress.WorkbenchJob;
-
-/**
- * Base implementation of an asynchronous request monitor.
- * <p>
- * Not intended to be subclassed or instantiated by clients. For internal use
- * with the <code>AsynchronousViewer</code> implementation.
- * </p>
- * @since 3.2
- */
-public abstract class AsynchronousRequestMonitor extends AbstractRequestMonitor {
-
- /**
- * Model node the update is rooted at
- */
- private ModelNode fNode;
-
- /**
- * Model the update is being performed for
- */
- private AsynchronousModel fModel;
-
- /**
- * Whether this request's 'done' method has been called.
- */
- private boolean fDone = false;
-
- protected WorkbenchJob fViewerUpdateJob = new WorkbenchJob("Asynchronous viewer update") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- // necessary to check if widget is disposed. The item may
- // have been removed from the tree when another children update
- // occurred.
- getModel().viewerUpdateScheduled(AsynchronousRequestMonitor.this);
- if (fDone) {
- getModel().requestComplete(AsynchronousRequestMonitor.this);
- }
- if (!isCanceled() && !getNode().isDisposed()) {
- IStatus status = getStatus();
- if (status != null && !status.isOK()) {
- getModel().getViewer().handlePresentationFailure(AsynchronousRequestMonitor.this, status);
- } else {
- performUpdate();
- }
- }
- getModel().viewerUpdateComplete(AsynchronousRequestMonitor.this);
- return Status.OK_STATUS;
- }
- };
-
- /**
- * Constructs an update rooted at the given item.
- *
- * @param node model node
- * @param model model the node is in
- */
- public AsynchronousRequestMonitor(ModelNode node, AsynchronousModel model) {
- fNode = node;
- fModel = model;
- // serialize updates per viewer
- fViewerUpdateJob.setRule(getUpdateSchedulingRule());
- fViewerUpdateJob.setSystem(true);
- }
-
- /**
- * Returns the scheduling rule for viewer update job.
- *
- * @return rule or <code>null</code>
- */
- protected ISchedulingRule getUpdateSchedulingRule() {
- return AsynchronousSchedulingRuleFactory.getDefault().newSerialPerObjectRule(getModel().getViewer());
- }
-
- /**
- * Returns the model this update is being performed for
- *
- * @return the model this update is being performed for
- */
- protected AsynchronousModel getModel() {
- return fModel;
- }
-
- /**
- * Returns the model node this update is rooted at
- *
- * @return the model node this update is rooted at
- */
- protected ModelNode getNode() {
- return fNode;
- }
-
- /**
- * Returns whether this update contains the given node.
- * That is, whether this update is for the same node or a child of
- * the given node.
- *
- * @param ndoe node to test containment on
- * @return whether this update contains the given node
- */
- protected boolean contains(ModelNode node) {
- if (node == getNode()) {
- return true;
- }
- ModelNode parentNode = getNode().getParentNode();
- while (parentNode != null) {
- if (parentNode.equals(getNode())) {
- return true;
- }
- parentNode = parentNode.getParentNode();
- }
- return false;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IProgressMonitor#setCanceled(boolean)
- */
- public void setCanceled(boolean value) {
- super.setCanceled(value);
- if (value) {
- getModel().requestCanceled(this);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IProgressMonitor#done()
- */
- public final void done() {
- synchronized (this) {
- fDone = true;
- }
- scheduleViewerUpdate(0L);
- }
-
- /**
- * Returns whether this request is done yet.
- *
- * @return
- */
- protected synchronized boolean isDone() {
- return fDone;
- }
-
- protected void scheduleViewerUpdate(long ms) {
- if(!isCanceled())
- fViewerUpdateJob.schedule(ms);
- }
-
- /**
- * Notification this update has been completed and should now be applied to
- * this update's viewer. This method is called in the UI thread.
- */
- protected abstract void performUpdate();
-
- /**
- * Returns whether this update effectively contains the given update.
- * That is, whether this update will also perform the given update.
- *
- * @param update update to compare to
- * @return whether this update will also perform the given update
- */
- protected abstract boolean contains(AsynchronousRequestMonitor update);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousSchedulingRuleFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousSchedulingRuleFactory.java
deleted file mode 100644
index 5a9218c18..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousSchedulingRuleFactory.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-
-/**
- * Scheduling rule factory for asycn operations.
- *
- * @since 3.2
- */
-public class AsynchronousSchedulingRuleFactory {
-
- private static AsynchronousSchedulingRuleFactory fgFactory = null;
-
- /**
- * Rule allows only one job to run at a time
- */
- class SerialRule implements ISchedulingRule {
-
- public SerialRule() {
- }
-
- public boolean contains(ISchedulingRule rule) {
- return rule == this;
- }
-
- public boolean isConflicting(ISchedulingRule rule) {
- return rule instanceof SerialRule;
- }
- }
-
- class SerialPerObjectRule implements ISchedulingRule {
-
- private Object fObject = null;
-
- public SerialPerObjectRule(Object lock) {
- fObject = lock;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.ISchedulingRule#contains(org.eclipse.core.runtime.jobs.ISchedulingRule)
- */
- public boolean contains(ISchedulingRule rule) {
- return rule == this;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.ISchedulingRule#isConflicting(org.eclipse.core.runtime.jobs.ISchedulingRule)
- */
- public boolean isConflicting(ISchedulingRule rule) {
- if (rule instanceof SerialPerObjectRule) {
- SerialPerObjectRule vup = (SerialPerObjectRule) rule;
- return fObject == vup.fObject;
- }
- return false;
- }
-
- }
-
- private AsynchronousSchedulingRuleFactory() {}
-
- public static AsynchronousSchedulingRuleFactory getDefault() {
- if (fgFactory == null) {
- fgFactory = new AsynchronousSchedulingRuleFactory();
- }
- return fgFactory;
- }
-
- /**
- * Returns a scheulding rule that allows all jobs with an instance
- * of the rule to run one at a time.
- *
- * @return scheduling rule
- */
- public ISchedulingRule newSerialRule() {
- return new SerialRule();
- }
-
- /**
- * Returns a scheduling rule that allows all jobs with an instance
- * of the rule on the same object to run one at a time.
- *
- * @param lock object to serialize one
- * @return scheduling rule
- */
- public ISchedulingRule newSerialPerObjectRule(Object lock) {
- return new SerialPerObjectRule(lock);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableModel.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableModel.java
deleted file mode 100644
index 98b70f24d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableModel.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-
-/**
- * @since 3.2
- *
- */
-public class AsynchronousTableModel extends AsynchronousModel {
-
- /**
- * Constructs a new table model.
- *
- * @param viewer
- */
- public AsynchronousTableModel(AsynchronousViewer viewer) {
- super(viewer);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousModel#add(org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ModelNode, java.lang.Object)
- */
- protected void add(ModelNode parent, Object element) {}
-
- /**
- * Adds the given elements to the table.
- *
- * @param elements
- */
- public void add(Object[] elements) {
- TableAddRequestMonitor update = new TableAddRequestMonitor(getRootNode(), elements, this);
- requestScheduled(update);
- update.done();
- }
-
- /**
- * Notification add request is complete.
- *
- * @param elements elements to add
- */
- protected void added(Object[] elements) {
- List kids = null;
- boolean changed = false;
- synchronized (this) {
- ModelNode[] childrenNodes = getRootNode().getChildrenNodes();
- if (childrenNodes == null) {
- kids = new ArrayList(elements.length);
- } else {
- kids = new ArrayList(elements.length + childrenNodes.length);
- for (int i = 0; i < childrenNodes.length; i++) {
- kids.add(childrenNodes[i].getElement());
- }
- }
- for (int i = 0; i < elements.length; i++) {
- if (!kids.contains(elements[i])) {
- kids.add(elements[i]);
- changed = true;
- }
- }
- }
- if (changed) {
- setChildren(getRootNode(), kids);
- }
- }
-
- /**
- * Inserts the given elements to the table.
- *
- * @param elements
- * @param index
- */
- public void insert(Object[] elements, int index) {
- TableAddRequestMonitor update = new TableInsertRequestMonitor(getRootNode(), elements, index, this);
- requestScheduled(update);
- update.done();
- }
-
- /**
- * Notification insert request is complete.
- *
- * @param elements elements to add
- * @param index index to insert at
- */
- protected void inserted(Object[] elements, int index) {
- List kids = null;
- boolean changed = false;
- synchronized (this) {
- ModelNode[] childrenNodes = getRootNode().getChildrenNodes();
- if (childrenNodes == null) {
- kids = new ArrayList(elements.length);
- } else {
- kids = new ArrayList(elements.length + childrenNodes.length);
- for (int i = 0; i < childrenNodes.length; i++) {
- kids.add(childrenNodes[i].getElement());
- }
- }
- for (int i = 0; i < elements.length; i++) {
- if (!kids.contains(elements[i])) {
- kids.add(index, elements[i]);
- index++;
- changed = true;
- }
- }
- }
- if (changed) {
- setChildren(getRootNode(), kids);
- }
- }
-
- /**
- * Removes the given elements from the table.
- *
- * @param elements
- */
- public void remove(Object[] elements) {
- TableRemoveRequestMonitor update = new TableRemoveRequestMonitor(getRootNode(), elements, this);
- requestScheduled(update);
- update.done();
- }
-
- /**
- * Notification remove request is complete.
- *
- * @param elements elements to remove
- */
- protected void removed(Object[] elements) {
- List kids = null;
- boolean changed = false;
- synchronized (this) {
- ModelNode[] childrenNodes = getRootNode().getChildrenNodes();
- if (childrenNodes != null) {
- kids = new ArrayList(childrenNodes.length);
- for (int i = 0; i < childrenNodes.length; i++) {
- kids.add(childrenNodes[i].getElement());
- }
- }
- for (int i = 0; i < elements.length; i++) {
- if (kids.remove(elements[i])) {
- changed = true;
- }
- }
- }
- if (changed) {
- setChildren(getRootNode(), kids);
- }
- }
-
- /**
- * Adds the given elements to the table.
- *
- * @param elements
- */
- public void replace(Object element, Object replacement) {
- TableReplaceRequestMonitor update = new TableReplaceRequestMonitor(getRootNode(), element, replacement, this);
- requestScheduled(update);
- update.done();
- }
-
- /**
- * Notification add request is complete.
- *
- * @param elements elements to add
- */
- protected void replaced(Object element, Object replacement) {
- Object[] filtered = filter(getRootNode().getElement(), new Object[] { replacement });
- if (filtered.length == 0) {
- remove(new Object[]{element});
- return;
- }
- List list = new ArrayList();
- synchronized (this) {
- ModelNode[] nodes = getNodes(element);
- for (int i = 0; i < nodes.length; i++) {
- ModelNode node = nodes[i];
- node.remap(replacement);
- list.add(node);
- }
- }
- if (!list.isEmpty()) {
- Iterator iterator = list.iterator();
- while (iterator.hasNext()) {
- ModelNode node = (ModelNode) iterator.next();
- getViewer().nodeChanged(node);
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableViewer.java
deleted file mode 100644
index 785a26baf..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableViewer.java
+++ /dev/null
@@ -1,517 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.OpenEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.TableEditor;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.progress.WorkbenchJob;
-
-/**
- * @since 3.2
- */
-public class AsynchronousTableViewer extends AsynchronousViewer implements Listener {
-
- private Table fTable;
-
- private TableEditor fTableEditor;
-
- private TableEditorImpl fTableEditorImpl;
-
- public AsynchronousTableViewer(Composite parent) {
- this(parent, SWT.VIRTUAL);
- }
-
- public AsynchronousTableViewer(Composite parent, int style) {
- this(new Table(parent, style));
- }
-
- /**
- * Table must be SWT.VIRTUAL. This is intentional. Labels will never be
- * retrieved for non-visible items.
- *
- * @see SWT.VIRTUAL
- * @param table
- */
- public AsynchronousTableViewer(Table table) {
- Assert.isTrue((table.getStyle() & SWT.VIRTUAL) != 0);
- fTable = table;
- hookControl(fTable);
- fTableEditor = new TableEditor(fTable);
- fTableEditorImpl = createTableEditorImpl();
- }
-
- protected void hookControl(Control control) {
- super.hookControl(control);
- control.addMouseListener(new MouseAdapter() {
- public void mouseDown(MouseEvent e) {
- fTableEditorImpl.handleMouseDown(e);
- }
- });
- }
-
- public synchronized void dispose() {
- fTableEditor.dispose();
- fTable.dispose();
- super.dispose();
- }
-
- protected ISelection doAttemptSelectionToWidget(ISelection selection, boolean reveal) {
- if (acceptsSelection(selection)) {
- List list = ((IStructuredSelection) selection).toList();
- if (list == null) {
- fTable.deselectAll();
- return StructuredSelection.EMPTY;
- }
-
- int[] indices = new int[list.size()];
- ModelNode[] nodes = getModel().getRootNode().getChildrenNodes();
- if (nodes != null) {
- int index = 0;
-
- // I'm not sure if it would be faster to check TableItems first...
- for (int i = 0; i < nodes.length; i++) {
- Object element = nodes[i].getElement();
- if (list.contains(element)) {
- indices[index] = i;
- index++;
- }
- }
-
- fTable.setSelection(indices);
- if (reveal && indices.length > 0) {
- TableItem item = fTable.getItem(indices[0]);
- fTable.showItem(item);
- }
- }
- }
- return StructuredSelection.EMPTY;
- }
-
- protected boolean acceptsSelection(ISelection selection) {
- return selection instanceof IStructuredSelection;
- }
-
- protected ISelection getEmptySelection() {
- return StructuredSelection.EMPTY;
- }
-
- protected Widget getParent(Widget widget) {
- if (widget instanceof TableItem) {
- return fTable;
- }
- return null;
- }
-
- protected List getSelectionFromWidget() {
- TableItem[] selection = fTable.getSelection();
- List datas = new ArrayList(selection.length);
- for (int i = 0; i < selection.length; i++) {
- datas.add(selection[i].getData());
- }
- return datas;
- }
-
- public Control getControl() {
- return fTable;
- }
-
- public Table getTable() {
- return (Table) getControl();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousViewer#internalRefresh(org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ModelNode)
- */
- protected void internalRefresh(ModelNode node) {
- super.internalRefresh(node);
- if (node.getElement().equals(getInput())) {
- updateChildren(node);
- }
- }
-
- protected void restoreLabels(Item item) {
- TableItem tableItem = (TableItem) item;
- String[] values = (String[]) tableItem.getData(OLD_LABEL);
- Image[] images = (Image[]) tableItem.getData(OLD_IMAGE);
- if (values != null) {
- tableItem.setText(values);
- tableItem.setImage(images);
- }
- }
-
- public void setLabels(Widget widget, String[] labels, ImageDescriptor[] imageDescriptors) {
- TableItem item = (TableItem) widget;
- item.setText(labels);
- item.setData(OLD_LABEL, labels);
- Image[] images = new Image[labels.length];
- item.setData(OLD_IMAGE, images);
- if (imageDescriptors != null) {
- for (int i = 0; i < images.length; i++) {
- if (i < imageDescriptors.length)
- images[i] = getImage(imageDescriptors[i]);
- }
- }
- item.setImage(images);
- }
-
- public void setColors(Widget widget, RGB[] foregrounds, RGB[] backgrounds) {
- TableItem item = (TableItem) widget;
- if (foregrounds == null) {
- foregrounds = new RGB[fTable.getColumnCount()];
- }
- if (backgrounds == null) {
- backgrounds = new RGB[fTable.getColumnCount()];
- }
-
- for (int i = 0; i < foregrounds.length; i++) {
- Color fg = getColor(foregrounds[i]);
- item.setForeground(i, fg);
- }
- for (int i = 0; i < backgrounds.length; i++) {
- Color bg = getColor(backgrounds[i]);
- item.setBackground(i, bg);
- }
- }
-
- public void setFonts(Widget widget, FontData[] fontDatas) {
- TableItem item = (TableItem) widget;
- if (fontDatas != null) {
- for (int i = 0; i < fontDatas.length; i++) {
- Font font = getFont(fontDatas[i]);
- item.setFont(i, font);
- }
- }
- }
-
- public void setColumnHeaders(final String[] headers) {
- fTableEditorImpl.setColumnProperties(headers);
- }
-
- public Object[] getColumnProperties() {
- return fTableEditorImpl.getColumnProperties();
- }
-
- public void showColumnHeader(final boolean showHeaders) {
- WorkbenchJob job = new WorkbenchJob("Set Header Visibility") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if (!fTable.isDisposed())
- {
- fTable.setHeaderVisible(showHeaders);
- }
- return Status.OK_STATUS;
- }
- };
- job.setPriority(Job.INTERACTIVE);
- job.setSystem(true);
- job.schedule();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.StructuredViewer#reveal(java.lang.Object)
- */
- public void reveal(Object element) {
- Assert.isNotNull(element);
- Widget w = findItem(element);
- if (w instanceof TableItem)
- getTable().showItem((TableItem) w);
- }
-
- /**
- * Sets the cell editors of this table viewer.
- *
- * @param editors
- * the list of cell editors
- */
- public void setCellEditors(CellEditor[] editors) {
- fTableEditorImpl.setCellEditors(editors);
- }
-
- /**
- * Sets the cell modifier of this table viewer.
- *
- * @param modifier
- * the cell modifier
- */
- public void setCellModifier(ICellModifier modifier) {
- fTableEditorImpl.setCellModifier(modifier);
- }
-
- protected TableEditorImpl createTableEditorImpl() {
- return new TableEditorImpl(this) {
- Rectangle getBounds(Item item, int columnNumber) {
- return ((TableItem) item).getBounds(columnNumber);
- }
-
- int getColumnCount() {
- return getTable().getColumnCount();
- }
-
- Item[] getSelection() {
- return getTable().getSelection();
- }
-
- void setEditor(Control w, Item item, int columnNumber) {
- fTableEditor.setEditor(w, (TableItem) item, columnNumber);
- }
-
- void setSelection(StructuredSelection selection, boolean b) {
- AsynchronousTableViewer.this.setSelection(selection, b);
- }
-
- void showSelection() {
- getTable().showSelection();
- }
-
- void setLayoutData(CellEditor.LayoutData layoutData) {
- fTableEditor.grabHorizontal = layoutData.grabHorizontal;
- fTableEditor.horizontalAlignment = layoutData.horizontalAlignment;
- fTableEditor.minimumWidth = layoutData.minimumWidth;
- }
-
- void handleDoubleClickEvent() {
- Viewer viewer = getViewer();
- fireDoubleClick(new DoubleClickEvent(viewer, viewer.getSelection()));
- fireOpen(new OpenEvent(viewer, viewer.getSelection()));
- }
- };
- }
-
- protected ISelection newSelectionFromWidget() {
- Control control = getControl();
- if (control == null || control.isDisposed()) {
- return StructuredSelection.EMPTY;
- }
- List list = getSelectionFromWidget();
- return new StructuredSelection(list);
- }
-
- public CellEditor[] getCellEditors() {
- return fTableEditorImpl.getCellEditors();
- }
-
- public ICellModifier getCellModifier() {
- return fTableEditorImpl.getCellModifier();
- }
-
- public boolean isCellEditorActive() {
- return fTableEditorImpl.isCellEditorActive();
- }
-
- /**
- * This is not asynchronous. This method must be called in the UI Thread.
- */
- public void cancelEditing() {
- fTableEditorImpl.cancelEditing();
- }
-
- /**
- * This is not asynchronous. This method must be called in the UI Thread.
- *
- * @param element
- * The element to edit. Each element maps to a row in the Table.
- * @param column
- * The column to edit
- */
- public void editElement(Object element, int column) {
- fTableEditorImpl.editElement(element, column);
- }
-
- protected int indexForElement(Object element) {
- ViewerSorter sorter = getSorter();
- if (sorter == null)
- return fTable.getItemCount();
- int count = fTable.getItemCount();
- int min = 0, max = count - 1;
- while (min <= max) {
- int mid = (min + max) / 2;
- Object data = fTable.getItem(mid).getData();
- int compare = sorter.compare(this, data, element);
- if (compare == 0) {
- // find first item > element
- while (compare == 0) {
- ++mid;
- if (mid >= count) {
- break;
- }
- data = fTable.getItem(mid).getData();
- compare = sorter.compare(this, data, element);
- }
- return mid;
- }
- if (compare < 0)
- min = mid + 1;
- else
- max = mid - 1;
- }
- return min;
- }
-
- public void add(Object element) {
- if (element != null)
- add(new Object[] { element });
- }
-
- public void add(Object[] elements) {
- if (elements == null || elements.length == 0)
- return; // done
- ((AsynchronousTableModel)getModel()).add(elements);
- }
-
- public void remove(Object element) {
- if (element != null)
- remove(new Object[] { element });
- }
-
- public void remove(final Object[] elements) {
- if (elements == null || elements.length == 0)
- return; // done
- ((AsynchronousTableModel)getModel()).remove(elements);
- }
-
- public void insert(Object element, int position) {
- if (element != null)
- insert(new Object[] { element }, position);
- }
-
- public void insert(Object[] elements, int position) {
- if (elements == null || elements.length == 0)
- return;
- ((AsynchronousTableModel)getModel()).insert(elements, position);
- }
-
- public void replace(Object element, Object replacement) {
- if (element == null || replacement == null)
- throw new IllegalArgumentException("unexpected null parameter"); //$NON-NLS-1$
- ((AsynchronousTableModel)getModel()).replace(element, replacement);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousViewer#createModel()
- */
- protected AsynchronousModel createModel() {
- return new AsynchronousTableModel(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousViewer#setItemCount(org.eclipse.swt.widgets.Widget, int)
- */
- protected void setItemCount(Widget parent, int itemCount) {
- fTable.setItemCount(itemCount);
- }
-
- protected int getVisibleItemCount(int top) {
- int itemCount = fTable.getItemCount();
- return Math.min((fTable.getBounds().height / fTable.getItemHeight()) + 2, itemCount - top);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousViewer#createUpdatePolicy()
- */
- public AbstractUpdatePolicy createUpdatePolicy() {
- return new TableUpdatePolicy();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousViewer#getParentWidget(org.eclipse.swt.widgets.Widget)
- */
- protected Widget getParentWidget(Widget widget) {
- if (widget instanceof TableItem) {
- return ((TableItem)widget).getParent();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousViewer#getChildWidget(org.eclipse.swt.widgets.Widget, int)
- */
- protected Widget getChildWidget(Widget parent, int index) {
- if (index < fTable.getItemCount()) {
- return fTable.getItem(index);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousViewer#clear(org.eclipse.swt.widgets.Widget)
- */
- protected void clear(Widget item) {
- if (item instanceof TableItem) {
- int i = fTable.indexOf((TableItem)item);
- if (i >= 0) {
- fTable.clear(i);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.AsynchronousViewer#clearChild(org.eclipse.swt.widgets.Widget, int)
- */
- protected void clearChild(Widget parent, int childIndex) {
- if (parent instanceof Table) {
- fTable.clear(childIndex);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.AsynchronousViewer#clearChildren(org.eclipse.swt.widgets.Widget)
- */
- protected void clearChildren(Widget item) {
- if (item instanceof Table) {
- fTable.clearAll();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.AsynchronousViewer#indexOf(org.eclipse.swt.widgets.Widget, org.eclipse.swt.widgets.Widget)
- */
- protected int indexOf(Widget parent, Widget child) {
- if (parent instanceof Table) {
- return ((Table)parent).indexOf((TableItem)child);
- }
- return -1;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java
deleted file mode 100644
index e5878c461..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java
+++ /dev/null
@@ -1,1193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Assert;
-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.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelSelectionPolicy;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelSelectionPolicyFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IStatusMonitor;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.progress.WorkbenchJob;
-
-/**
- * A viewer that retrieves labels and content asynchronously via adapters and supports
- * duplicate elements in the viewer. Retrieving content and labels asynchronously allows
- * for arbitrary latency without blocking the UI thread.
- * <p>
- * This viewer uses adapters to retrieve labels and content rather than
- * a label provider and content provider. As such, the label provider for this viewer
- * is <code>null</code> by default. The content provider returned by this viewer is
- * non-<code>null</code> to conform to the viewer specification, but performs no
- * useful function.
- * </p>
- * <p>
- * The selection in this viewer is also set asynchronously. When the selection is set,
- * the viewer attempts to perform the selection. If the elements in the specified selection
- * are not yet in the viewer, the portion of the selection that could not be honored
- * becomes a pending selection. As more elements are added to viewer, the pending selection
- * is attempted to be set.
- * </p>
- * @since 3.2
- */
-public abstract class AsynchronousViewer extends StructuredViewer implements Listener {
-
- /**
- * Model of elements for this viewer
- */
- private AsynchronousModel fModel;
-
- /**
- * Cache of images used for elements in this tree viewer. Label updates
- * use the method <code>getImage(...)</code> to cache images for
- * image descriptors. The images are disposed when this viewer is disposed.
- */
- private Map fImageCache = new HashMap();
-
- /**
- * Cache of the fonts used for elements in this tree viewer. Label updates
- * use the method <code>getFont(...)</code> to cache fonts for
- * FontData objects. The fonts are disposed with the viewer.
- */
- private Map fFontCache = new HashMap();
-
- /**
- * Cache of the colors used for elements in this tree viewer. Label updates
- * use the method <code>getColor(...)</code> to cache colors for
- * RGB values. The colors are disposed with the viewer.
- */
- private Map fColorCache = new HashMap();
-
- /**
- * The context in which this viewer is being used - i.e. what part it is contained
- * in any any preference settings associated with it.
- */
- private IPresentationContext fContext;
-
- private ISelection fPendingSelection;
-
- private ISelection fCurrentSelection;
-
- /**
- * Array used to store indices of the path to an item in the viewer being mapped
- * by a 'set data' callback. Indices are bottom up. For example when 'set data' for
- * the 3rd child of the 4th child of the 2nd root element were being asked for,
- * the first 3 indices would look like: [3, 4, 2, ....]. We re-use an array to avoid
- * creating a new one all the time. The array grows as needed to accommodate deep
- * elements.
- */
- private int[] fSetDataIndicies = new int[5];
-
- /**
- * The update policy for this viewer.
- */
- private AbstractUpdatePolicy fUpdatePolicy;
-
- protected static final String OLD_LABEL = "old_label"; //$NON-NLS-1$
- protected static final String OLD_IMAGE = "old_image"; //$NON-NLS-1$
-
- // debug flags
- public static boolean DEBUG_VIEWER = false;
-
- static {
- DEBUG_VIEWER = DebugUIPlugin.DEBUG && "true".equals( //$NON-NLS-1$
- Platform.getDebugOption("org.eclipse.debug.ui/debug/viewers/viewer")); //$NON-NLS-1$
- }
-
- /**
- * Creates a new viewer
- */
- protected AsynchronousViewer() {
- setContentProvider(new NullContentProvider());
- setUseHashlookup(true);
- }
-
- /**
- * Hash lookup is required, don't let subclasses change behavior.
- */
- public final void setUseHashlookup(boolean enable) {
- Assert.isTrue(enable);
- super.setUseHashlookup(enable);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.StructuredViewer#hookControl(org.eclipse.swt.widgets.Control)
- */
- protected void hookControl(Control control) {
- super.hookControl(control);
- control.addListener(SWT.SetData, this);
- }
-
- /**
- * Clients must call this methods when this viewer is no longer needed
- * so it can perform cleanup.
- */
- public synchronized void dispose() {
- Iterator images = fImageCache.values().iterator();
- while (images.hasNext()) {
- Image image = (Image) images.next();
- image.dispose();
- }
- fImageCache.clear();
-
- Iterator fonts = fFontCache.values().iterator();
- while (fonts.hasNext()) {
- Font font = (Font) fonts.next();
- font.dispose();
- }
- fFontCache.clear();
-
- Iterator colors = fColorCache.values().iterator();
- while (colors.hasNext()) {
- Color color = (Color) colors.next();
- color.dispose();
- }
- fColorCache.clear();
-
- if (fModel != null) {
- fModel.dispose();
- }
- if (fUpdatePolicy != null) {
- fUpdatePolicy.dispose();
- }
- if (fContext != null) {
- ((PresentationContext)fContext).dispose();
- }
- }
-
- /**
- * Updates all occurrences of the given element in this viewer.
- *
- * @param element element to update
- */
- public void update(Object element) {
- ModelNode[] nodes = getModel().getNodes(element);
- if (nodes != null) {
- for (int i = 0; i < nodes.length; i++) {
- updateLabel(nodes[i]);
- }
- }
- }
-
- /**
- * Updates the label for a specific element (node) in the model.
- *
- * @param node node to update
- * @param item its associated item
- */
- protected void updateLabel(ModelNode node) {
- // the input is not displayed
- if (!node.getElement().equals(getInput())) {
- getModel().updateLabel(node);
- }
- }
-
- /**
- * Returns the presentation context to be used in update requests.
- * Clients may override this method if required to provide special
- * implementations of contexts.
- *
- * @return presentation context
- */
- public IPresentationContext getPresentationContext() {
- return fContext;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.StructuredViewer#unmapAllElements()
- */
- protected synchronized void unmapAllElements() {
- super.unmapAllElements();
- AsynchronousModel model = getModel();
- if (model != null) {
- model.dispose();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.Viewer#inputChanged(java.lang.Object, java.lang.Object)
- */
- protected synchronized void inputChanged(Object input, Object oldInput) {
- fPendingSelection = null;
- if (fCurrentSelection != null) {
- updateSelection(new StructuredSelection());
- fCurrentSelection = null;
- }
- if (fUpdatePolicy == null) {
- fUpdatePolicy = createUpdatePolicy();
- fUpdatePolicy.init(this);
- }
- if (fModel != null) {
- fModel.dispose();
- }
- fModel = createModel();
- fModel.init(input);
- if (input != null) {
- mapElement(fModel.getRootNode(), getControl());
- getControl().setData(fModel.getRootNode().getElement());
- } else {
- unmapAllElements();
- getControl().setData(null);
- }
- refresh();
- }
-
- /**
- * Creates a new empty model for this viewer that
- * is *not* initialized.
- *
- * @return a new model
- */
- protected abstract AsynchronousModel createModel();
-
- /**
- * Creates and returns this viewers update policy.
- * @return update policy
- */
- public abstract AbstractUpdatePolicy createUpdatePolicy();
-
- Image[] getImages(ImageDescriptor[] descriptors) {
- if (descriptors == null || descriptors.length == 0) {
- String[] columns = getPresentationContext().getColumns();
- if (columns == null) {
- return new Image[1];
- } else {
- return new Image[columns.length];
- }
- }
- Image[] images = new Image[descriptors.length];
- for (int i = 0; i < images.length; i++) {
- images[i] = getImage(descriptors[i]);
- }
- return images;
- }
-
- /**
- * Returns an image for the given image descriptor or <code>null</code>. Adds the image
- * to a cache of images if it does not already exist. The cache is cleared when this viewer
- * is disposed.
- *
- * @param descriptor image descriptor or <code>null</code>
- * @return image or <code>null</code>
- */
- protected Image getImage(ImageDescriptor descriptor) {
- if (descriptor == null) {
- return null;
- }
- Image image = (Image) fImageCache.get(descriptor);
- if (image == null) {
- image = new Image(getControl().getDisplay(), descriptor.getImageData());
- fImageCache.put(descriptor, image);
- }
- return image;
- }
-
- protected Font[] getFonts(FontData[] fontDatas) {
- if (fontDatas == null || fontDatas.length == 0) {
- String[] columns = getPresentationContext().getColumns();
- if (columns == null) {
- return new Font[1];
- } else {
- return new Font[columns.length];
- }
- }
-
- Font[] fonts = new Font[fontDatas.length];
- for (int i = 0; i < fonts.length; i++) {
- fonts[i] = getFont(fontDatas[i]);
- }
- return fonts;
- }
-
- /**
- * Returns a font for the given font data or <code>null</code>. Adds the font to this viewer's font
- * cache which is disposed when this viewer is disposed.
- *
- * @param fontData font data or <code>null</code>
- * @return font font or <code>null</code>
- */
- protected Font getFont(FontData fontData) {
- if (fontData == null) {
- return null;
- }
- Font font = (Font) fFontCache.get(fontData);
- if (font == null) {
- font = new Font(getControl().getDisplay(), fontData);
- fFontCache.put(fontData, font);
- }
- return font;
- }
-
- protected Color[] getColors(RGB[] rgb) {
- if (rgb == null || rgb.length == 0) {
- String[] columns = getPresentationContext().getColumns();
- if (columns == null) {
- return new Color[1];
- } else {
- return new Color[columns.length];
- }
- }
- Color[] colors = new Color[rgb.length];
- for (int i = 0; i < colors.length; i++) {
- colors[i] = getColor(rgb[i]);
- }
- return colors;
- }
- /**
- * Returns a color for the given RGB or <code>null</code>. Adds the color to this viewer's color
- * cache which is disposed when this viewer is disposed.
- *
- * @param rgb RGB or <code>null</code>
- * @return color or <code>null</code>
- */
- protected Color getColor(RGB rgb) {
- if (rgb == null) {
- return null;
- }
- Color color = (Color) fColorCache.get(rgb);
- if (color == null) {
- color = new Color(getControl().getDisplay(), rgb);
- fColorCache.put(rgb, color);
- }
- return color;
- }
-
- /**
- * Sets the context for this viewer.
- *
- * @param context
- */
- public void setContext(IPresentationContext context) {
- fContext = context;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.StructuredViewer#doFindItem(java.lang.Object)
- */
- protected Widget doFindItem(Object element) {
- // this viewer maps model nodes to widgets, so the element is a ModelNode
- AsynchronousModel model = getModel();
- if (model != null) {
- if (element.equals(model.getRootNode())) {
- return doFindInputItem(element);
- }
- Widget[] widgets = findItems(element);
- if (widgets.length > 0) {
- return widgets[0];
- }
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.StructuredViewer#doFindInputItem(java.lang.Object)
- */
- protected Widget doFindInputItem(Object element) {
- if (element instanceof ModelNode) {
- ModelNode node = (ModelNode) element;
- if (node.getElement().equals(getInput())) {
- return getControl();
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.StructuredViewer#doUpdateItem(org.eclipse.swt.widgets.Widget, java.lang.Object, boolean)
- */
- protected void doUpdateItem(Widget item, Object element, boolean fullMap) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.StructuredViewer#internalRefresh(java.lang.Object)
- */
- protected void internalRefresh(Object element) {
- // get the nodes in the model
- AsynchronousModel model = getModel();
- if (model != null) {
- ModelNode[] nodes = model.getNodes(element);
- if (nodes != null) {
- for (int i = 0; i < nodes.length; i++) {
- ModelNode node = nodes[i];
- // get the widget for the node
- Widget item = findItem(node);
- if (item != null) {
- internalRefresh(node);
- }
- }
- }
- }
- }
-
- /**
- * Refreshes a specific occurrence of an element (a node).
- *
- * @param node node to update
- *
- * Subclasses should override and call super
- */
- protected void internalRefresh(ModelNode node) {
- updateLabel(node);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers.ISelection, boolean)
- */
- public synchronized void setSelection(ISelection selection, boolean reveal) {
- setSelection(selection, reveal, false);
- }
-
- /**
- * Sets the selection in this viewer.
- *
- * @param selection new selection
- * @param reveal whether to reveal the selection
- * @param force whether to force the selection change without consulting the model
- * selection policy
- */
- public synchronized void setSelection(ISelection selection, final boolean reveal, boolean force) {
- Control control = getControl();
- if (control == null || control.isDisposed()) {
- return;
- }
- if (!acceptsSelection(selection)) {
- selection = getEmptySelection();
- }
- if (!force && !overrideSelection(fCurrentSelection, selection)) {
- return;
- }
-
- fPendingSelection = selection;
-
- if (getControl().getDisplay().getThread() == Thread.currentThread()) {
- attemptSelection(reveal);
- } else {
- WorkbenchJob job = new WorkbenchJob("attemptSelection") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- attemptSelection(reveal);
- return Status.OK_STATUS;
- }
-
- };
- job.setSystem(true);
- job.schedule();
- }
- }
-
-
- /**
- * Returns whether the candidate selection should override the current
- * selection.
- *
- * @param current
- * @param curr
- * @return
- */
- protected boolean overrideSelection(ISelection current, ISelection candidate) {
- IModelSelectionPolicy selectionPolicy = getSelectionPolicy(current);
- if (selectionPolicy == null) {
- return true;
- }
- if (selectionPolicy.contains(candidate, getPresentationContext())) {
- return selectionPolicy.overrides(current, candidate, getPresentationContext());
- }
- return !selectionPolicy.isSticky(current, getPresentationContext());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.StructuredViewer#getSelection()
- */
- public ISelection getSelection() {
- Control control = getControl();
- if (control == null || control.isDisposed() || fCurrentSelection == null) {
- return StructuredSelection.EMPTY;
- }
- return fCurrentSelection;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.StructuredViewer#handleSelect(org.eclipse.swt.events.SelectionEvent)
- */
- protected void handleSelect(SelectionEvent event) {
- // handle case where an earlier selection listener disposed the control.
- Control control = getControl();
- if (control != null && !control.isDisposed()) {
- updateSelection(newSelectionFromWidget());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.StructuredViewer#handlePostSelect(org.eclipse.swt.events.SelectionEvent)
- */
- protected void handlePostSelect(SelectionEvent e) {
- SelectionChangedEvent event = new SelectionChangedEvent(this, newSelectionFromWidget());
- firePostSelectionChanged(event);
- }
-
- /**
- * Creates and returns a new selection from this viewer, based on the selected
- * elements in the widget.
- *
- * @return a new selection
- */
- protected abstract ISelection newSelectionFromWidget();
-
- /**
- * Returns the selection policy associated with the given selection
- * or <code>null</code> if none.
- *
- * @param selection or <code>null</code>
- * @return selection policy or <code>null</code>
- */
- protected IModelSelectionPolicy getSelectionPolicy(ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- Object element = ss.getFirstElement();
- if (element instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) element;
- IModelSelectionPolicyFactory factory = (IModelSelectionPolicyFactory) adaptable.getAdapter(IModelSelectionPolicyFactory.class);
- if (factory != null) {
- return factory.createModelSelectionPolicyAdapter(adaptable, getPresentationContext());
- }
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.StructuredViewer#setSelectionToWidget(org.eclipse.jface.viewers.ISelection, boolean)
- */
- final protected void setSelectionToWidget(ISelection selection, final boolean reveal) {
- // NOT USED
- throw new IllegalArgumentException("This method should not be called"); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.StructuredViewer#setSelectionToWidget(java.util.List, boolean)
- */
- final protected void setSelectionToWidget(List l, boolean reveal) {
- // NOT USED
- throw new IllegalArgumentException("This method should not be called"); //$NON-NLS-1$
- }
-
- /**
- * Attempts to update any pending selection.
- *
- * @param reveal whether to reveal the selection
- */
- protected void attemptSelection(boolean reveal) {
- ISelection currentSelection = null;
- synchronized (this) {
- if (fPendingSelection != null) {
- ISelection remaining = doAttemptSelectionToWidget(fPendingSelection, reveal);
- if (remaining.isEmpty()) {
- remaining = null;
- }
- if (!fPendingSelection.equals(remaining)) {
- fPendingSelection = remaining;
- currentSelection = newSelectionFromWidget();
- if (isSuppressEqualSelections() && currentSelection.equals(fCurrentSelection)) {
- return;
- }
- }
- }
- }
- if (currentSelection != null) {
- updateSelection(currentSelection);
- firePostSelectionChanged(new SelectionChangedEvent(this, currentSelection));
- }
- }
-
- /**
- * Controls whether selection change notification is sent even when
- * successive selections are equal.
- *
- * TODO: what we really want is to fire selection change on ACTIVATE model
- * change, even when selection is the same.
- *
- * @return whether to suppress change notification for equal successive
- * selections
- */
- protected boolean isSuppressEqualSelections() {
- return true;
- }
-
- /**
- * Attempts to selection the specified selection and returns a selection
- * representing the portion of the selection that could not be honored
- * and still needs to be selected.
- *
- * @param selection selection to attempt
- * @param reveal whether to reveal the selection
- * @return remaining selection
- */
- protected abstract ISelection doAttemptSelectionToWidget(ISelection selection, boolean reveal);
-
- /**
- * Returns whether this viewer supports the given selection.
- *
- * @param selection a selection
- * @return whether this viewer supports the given selection
- */
- protected abstract boolean acceptsSelection(ISelection selection);
-
- /**
- * Returns an empty selection supported by this viewer.
- *
- * @return an empty selection supported by this viewer
- */
- protected abstract ISelection getEmptySelection();
-
- /**
- * A content provider that does nothing.
- */
- private class NullContentProvider implements IStructuredContentProvider {
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- public Object[] getElements(Object inputElement) {
- return null;
- }
- }
-
- /**
- * Notification that a presentation update has failed.
- * Subclasses may override as required. The default implementation
- * does nothing.
- *
- * @param monitor monitor for the presentation request that failed
- * @param status status of update
- */
- protected void handlePresentationFailure(IStatusMonitor monitor, IStatus status) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.StructuredViewer#preservingSelection(java.lang.Runnable)
- */
- protected synchronized void preservingSelection(Runnable updateCode) {
- if (fPendingSelection == null || fPendingSelection.isEmpty()) {
- ISelection oldSelection = null;
- try {
- // preserve selection
- oldSelection = fCurrentSelection;
- // perform the update
- updateCode.run();
- } finally {
- // restore selection
- if (oldSelection == null) {
- oldSelection = new StructuredSelection();
- }
- if (getControl().getDisplay().getThread() == Thread.currentThread()) {
- if (!oldSelection.equals(newSelectionFromWidget())) {
- restoreSelection(oldSelection);
- }
- } else {
- WorkbenchJob job = new WorkbenchJob("attemptSelection") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- synchronized (AsynchronousViewer.this) {
- if (!getControl().isDisposed()) {
- if (fPendingSelection == null || fPendingSelection.isEmpty()) {
- ISelection tempSelection = fCurrentSelection;
- if (tempSelection == null) {
- tempSelection = new StructuredSelection();
- }
- if (!tempSelection.equals(newSelectionFromWidget())) {
- restoreSelection(tempSelection);
- }
- }
- }
- }
- return Status.OK_STATUS;
- }
-
- };
- job.setSystem(true);
- job.schedule();
- }
- }
- } else {
- updateCode.run();
- }
- }
-
- protected synchronized void restoreSelection(ISelection oldSelection) {
- ISelection remaining = doAttemptSelectionToWidget(oldSelection, false);
- // send out notification if old and new differ
- fCurrentSelection = newSelectionFromWidget();
- if (!selectionExists(fCurrentSelection)) {
- if (selectionExists(oldSelection)) {
- // old selection exists in the model, but not widget
- fCurrentSelection = oldSelection;
- } else {
- fCurrentSelection = getEmptySelection();
- }
- }
- if (!fCurrentSelection.equals(oldSelection)) {
- handleInvalidSelection(oldSelection, fCurrentSelection);
- // if the remaining selection still exists in the model, make it pending
- if (selectionExists(remaining)) {
- setSelection(remaining);
- }
- }
- }
-
- /**
- * Returns whether the selection exists in the model
- */
- protected boolean selectionExists(ISelection selection) {
- if (selection.isEmpty()) {
- return false;
- }
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- Iterator iterator = ss.iterator();
- while (iterator.hasNext()) {
- Object element = iterator.next();
- if (getModel().getNodes(element) == null) {
- return false;
- }
- }
- }
- return true;
- }
-
- /**
- * Sets the color attributes of the given widget.
- *
- * @param widget the widget to update
- * @param foreground foreground color of the widget or <code>null</code> if default
- * @param background background color of the widget or <code>null</code> if default
- */
- protected abstract void setColors(Widget widget, RGB foreground[], RGB background[]);
-
- /**
- * Sets the label attributes of the given widget.
- *
- * @param widget the widget to update
- * @param text label text
- * @param image label image or <code>null</code>
- */
- protected abstract void setLabels(Widget widget, String[] text, ImageDescriptor[] image);
-
- /**
- * Sets the font attributes of the given widget.
- *
- * @param widget widget to update
- * @param font font of the widget or <code>null</code> if default.
- */
- protected abstract void setFonts(Widget widget, FontData[] font);
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.StructuredViewer#updateSelection(org.eclipse.jface.viewers.ISelection)
- */
- protected synchronized void updateSelection(ISelection selection) {
- fCurrentSelection = selection;
- super.updateSelection(selection);
- }
-
-
-
- /**
- * Notification the given model proxy has been added to this viewer's model.
- *
- * @param proxy
- */
- protected void modelProxyAdded(IModelProxy proxy) {
- if (fUpdatePolicy instanceof IModelChangedListener) {
- proxy.addModelChangedListener((IModelChangedListener)fUpdatePolicy);
- }
- }
-
- /**
- * Notification the given model proxy has been removed from this viewer's model.
- *
- * @param proxy
- */
- protected void modelProxyRemoved(IModelProxy proxy) {
- if (fUpdatePolicy instanceof IModelChangedListener) {
- proxy.removeModelChangedListener((IModelChangedListener)fUpdatePolicy);
- }
- }
-
- /**
- * Returns this viewer's model
- *
- * @return model
- */
- protected AsynchronousModel getModel() {
- return fModel;
- }
-
- /**
- * A node in the model has been updated
- *
- * @param node
- */
- protected void nodeChanged(ModelNode node) {
- Widget widget = findItem(node);
- if (widget != null) {
- clear(widget);
- attemptPendingUpdates();
- }
- }
-
- /**
- * @return if there are any more pending updates in the viewer
- */
- public synchronized boolean hasPendingUpdates() {
- return getModel().hasPendingUpdates();
- }
-
- /**
- * Notification from the model that the update for the given request
- * has completed.
- *
- * @param monitor
- */
- protected void updateComplete(IStatusMonitor monitor) {
- }
-
- /**
- * Clears the given widget
- *
- * @param item
- */
- protected abstract void clear(Widget item);
-
- /**
- * Clears the children of the widget.
- *
- * @param item
- */
- protected abstract void clearChildren(Widget item);
-
- /**
- * Clears the child at the given index.
- *
- * @param parent
- * @param childIndex
- */
- protected abstract void clearChild(Widget parent, int childIndex);
-
- /**
- * Returns the child widget at the given index for the given parent or
- * <code>null</code>
- *
- * @param parent
- * @param index
- * @return
- */
- protected abstract Widget getChildWidget(Widget parent, int index);
-
- /**
- * Sets the item count for a parent widget
- *
- * @param parent
- * @param itemCount
- */
- protected abstract void setItemCount(Widget parent, int itemCount);
-
- /**
- * Attempt pending updates. Subclasses may override but should call super.
- */
- protected void attemptPendingUpdates() {
- attemptSelection(false);
- }
-
- /**
- * Notification a node's children have changed.
- * Updates the child count for the parent's widget
- * and clears children to be updated.
- *
- * @param parentNode
- */
- protected void nodeChildrenChanged(ModelNode parentNode) {
- Widget widget = findItem(parentNode);
- if (widget != null && !widget.isDisposed()) {
- int childCount = parentNode.getChildCount();
- setItemCount(widget, childCount);
- clearChildren(widget);
- attemptPendingUpdates();
- }
- }
-
- /**
- * Notification children have been added to the end
- * of the given parent.
- *
- * @param parentNode
- */
- protected void nodeChildrenAdded(ModelNode parentNode) {
- Widget widget = findItem(parentNode);
- if (widget != null && !widget.isDisposed()) {
- int childCount = parentNode.getChildCount();
- setItemCount(widget, childCount);
- attemptPendingUpdates();
- }
- }
-
- /**
- * Notification children have been added to the end
- * of the given parent.
- *
- * @param parentNode
- */
- protected void nodeChildRemoved(ModelNode parentNode, int index) {
- Widget widget = findItem(parentNode);
- if (widget != null && !widget.isDisposed()) {
- Widget childWidget = getChildWidget(widget, index);
- int childCount = parentNode.getChildCount();
- // if the child widget exists, dispose it so item state remains, otherwise update child count
- if (childWidget == null) {
- setItemCount(widget, childCount);
- } else {
- childWidget.dispose();
- }
- for (int i = index; i < childCount; i ++) {
- clearChild(widget, i);
- }
- attemptPendingUpdates();
- }
- }
-
- /**
- * Unmaps the node from its widget and all of its children nodes from
- * their widgets.
- *
- * @param node
- */
- protected void unmapNode(ModelNode node) {
- unmapElement(node);
- ModelNode[] childrenNodes = node.getChildrenNodes();
- if (childrenNodes != null) {
- for (int i = 0; i < childrenNodes.length; i++) {
- unmapNode(childrenNodes[i]);
- }
- }
- }
-
- /**
- * Returns the node corresponding to the given widget or <code>null</code>
- * @param widget widget for which a node is requested
- * @return node or <code>null</code>
- */
- protected ModelNode findNode(Widget widget) {
- ModelNode[] nodes = getModel().getNodes(widget.getData());
- if (nodes != null) {
- for (int i = 0; i < nodes.length; i++) {
- ModelNode node = nodes[i];
- Widget item = findItem(node);
- if (widget == item) {
- return node;
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the item for the node or <code>null</code>
- * @param node
- * @return
- */
- protected Widget findItem(ModelNode node) {
- return findItem((Object)node);
- }
-
- /*
- * (non-Javadoc)
- *
- * A virtual item has been exposed in the control, map its data.
- *
- * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
- */
- public void handleEvent(final Event event) {
- update((Item)event.item, event.index);
- }
-
- /**
- * Update the given item.
- *
- * @param item item to update
- * @param index index of item in parent's children
- */
- protected void update(Item item, int index) {
- restoreLabels(item);
- int level = 0;
-
- Widget parentItem = getParentWidget(item);
- if (DEBUG_VIEWER) {
- DebugUIPlugin.debug("SET DATA [" + index + "]: " + parentItem); //$NON-NLS-1$//$NON-NLS-2$
- }
- ModelNode node = null;
- // first, see if the parent element is in the model
- // and look directly for the child
- if (parentItem != null) {
- ModelNode[] nodes = getModel().getNodes(parentItem.getData());
- if (nodes != null) {
- for (int i = 0; i < nodes.length; i++) {
- ModelNode parentNode = nodes[i];
- Widget parentWidget = findItem(parentNode);
- if (parentWidget == parentItem) {
- ModelNode[] childrenNodes = parentNode.getChildrenNodes();
- if (childrenNodes != null && index < childrenNodes.length) {
- node = childrenNodes[index];
- }
- }
- }
- }
- }
-
- // otherwise, build a path to the model node
- if (node == null) {
- setNodeIndex(index, level);
- while (parentItem instanceof Item) {
- level++;
- Widget parent = getParentWidget(parentItem);
- int pindex = indexOf(parent, parentItem);
- if (pindex < 0) {
- return;
- }
- setNodeIndex(pindex, level);
- parentItem = parent;
- }
-
- node = getModel().getRootNode();
- if (node == null) {
- if (DEBUG_VIEWER) {
- DebugUIPlugin.debug("\tFAILED - root model node is null"); //$NON-NLS-1$
- }
- return;
- }
- for (int i = level; i >= 0; i--) {
- ModelNode[] childrenNodes = node.getChildrenNodes();
- if (childrenNodes == null) {
- if (DEBUG_VIEWER) {
- DebugUIPlugin.debug("\tFAILED - no children nodes for " + node); //$NON-NLS-1$
- }
- return;
- }
- int pindex = getNodeIndex(i);
- if (pindex < childrenNodes.length) {
- node = childrenNodes[pindex];
- } else {
- if (DEBUG_VIEWER) {
- DebugUIPlugin.debug("\tFAILED - no children nodes for " + node); //$NON-NLS-1$
- }
- return;
- }
- }
- }
-
-
- // map the node to the element and refresh it
- if (node != null) {
- mapElement(node, item);
- item.setData(node.getElement());
- if (DEBUG_VIEWER) {
- DebugUIPlugin.debug("\titem mapped: " + node); //$NON-NLS-1$
- }
- internalRefresh(node);
- } else {
- if (DEBUG_VIEWER) {
- DebugUIPlugin.debug("\tFAILED - unable to find corresponding node"); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * Sets the index of a child node being mapped at the given expansion level
- * in the tree.
- *
- * @param nodeIndex
- * @param level
- */
- private void setNodeIndex(int nodeIndex, int level) {
- if (level > (fSetDataIndicies.length - 1)) {
- // grow the array
- int[] next = new int[level+5];
- System.arraycopy(fSetDataIndicies, 0, next, 0, fSetDataIndicies.length);
- fSetDataIndicies = next;
- }
- fSetDataIndicies[level] = nodeIndex;
- }
-
- /**
- * Returns the index of a child node being mapped at the given expansion level in
- * the tree.
- *
- * @param level
- * @return
- */
- private int getNodeIndex(int level) {
- return fSetDataIndicies[level];
- }
-
- protected abstract int indexOf(Widget parent, Widget child);
-
- protected abstract void restoreLabels(Item item);
-
- /**
- * Returns the parent widget for the given widget or <code>null</code>
- *
- * @param widget
- * @return parent widget or <code>null</code>
- */
- protected abstract Widget getParentWidget(Widget widget);
-
- /**
- * Updates the children of the given node.
- *
- * @param parent
- * node of which to update children
- */
- protected void updateChildren(ModelNode parent) {
- getModel().updateChildren(parent);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ChildrenRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ChildrenRequestMonitor.java
deleted file mode 100644
index 6050992fb..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ChildrenRequestMonitor.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.debug.internal.ui.viewers.provisional.IChildrenRequestMonitor;
-
-/**
- * Implementation for <code>IChildrenRequestMonitor</code>. Collects
- * children from an asynchronous tree content adapter.
- * <p>
- * Not intended to be subclassed or instantiated by clients. For use
- * speficially with <code>AsynchronousTreeViewer</code>.
- * </p>
- * @since 3.2
- */
-class ChildrenRequestMonitor extends AsynchronousRequestMonitor implements IChildrenRequestMonitor {
-
- private boolean fFirstUpdate = true;
-
- /**
- * Collection of children retrieved
- */
- private List fChildren = new ArrayList();
-
- /**
- * Constucts a monitor to retrieve and update the children of the given
- * node.
- *
- * @param parent parent to retrieve children for
- * @param model model being updated
- */
- ChildrenRequestMonitor(ModelNode parent, AsynchronousModel model) {
- super(parent, model);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.viewers.IChildrenRequestMonitor#addChild(java.lang.Object)
- */
- public void addChild(Object child) {
- synchronized (fChildren) {
- fChildren.add(child);
- }
-
- scheduleViewerUpdate(250);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.viewers.IChildrenRequestMonitor#addChildren(java.lang.Object[])
- */
- public void addChildren(Object[] children) {
- synchronized (fChildren) {
- for (int i = 0; i < children.length; i++) {
- fChildren.add(children[i]);
- }
- }
-
- scheduleViewerUpdate(0);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.viewers.AsynchronousRequestMonitor#contains(org.eclipse.debug.ui.viewers.AsynchronousRequestMonitor)
- */
- protected boolean contains(AsynchronousRequestMonitor update) {
- return (update instanceof ChildrenRequestMonitor) && contains(update.getNode());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.viewers.AsynchronousRequestMonitor#performUpdate()
- */
- protected void performUpdate() {
- synchronized (fChildren) {
- if (fFirstUpdate) {
- getModel().setChildren(getNode(), fChildren);
- fFirstUpdate = false;
- } else {
- for (Iterator iter = fChildren.iterator(); iter.hasNext();) {
- Object child = iter.next();
- getModel().add(getNode(), child);
- }
- }
- fChildren.clear();
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/FindElementDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/FindElementDialog.java
deleted file mode 100644
index 4ef42ab5b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/FindElementDialog.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-
-/**
- * A dialog used to select elements from a list.
- *
- * @since 3.3
- *
- */
-public class FindElementDialog extends ElementListSelectionDialog {
-
- /**
- * Constructs a dialog to navigate to an element in the given viewer.
- *
- * @param shell shell to open on
- * @param provider label provider
- * @param elements elements to choose from
- */
- public FindElementDialog(Shell shell, ILabelProvider provider, Object[] elements) {
- super(shell, provider);
- setElements(elements);
- setMultipleSelection(false);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.dialogs.ElementListSelectionDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- Control comp = super.createDialogArea(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(comp, IDebugHelpContextIds.FIND_ELEMENT_DIALOG);
- return comp;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ILabelResult.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ILabelResult.java
deleted file mode 100644
index cde762d8e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ILabelResult.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.swt.graphics.Image;
-
-
-/**
- * Results of collecting an asynchronous label in a tree.
- *
- * @since 3.2
- */
-public interface ILabelResult {
-
- /**
- * Returns the labels for the element. One for each column.
- *
- * @return
- */
- public String[] getLabels();
-
- /**
- * Returns the images for the element.
- *
- * @return
- */
- public Image[] getImages();
-
- /**
- * Returns the element the label is for.
- *
- * @return
- */
- public Object getElement();
-
- /**
- * Returns the path to the element in the tree.
- *
- * @return
- */
- public TreePath getTreePath();
-
- /**
- * Returns this element's depth in the tree.
- *
- * @return
- */
- public int getDepth();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelRequestMonitor.java
deleted file mode 100644
index 152a33248..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelRequestMonitor.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-import org.eclipse.debug.internal.ui.viewers.provisional.ILabelRequestMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Widget;
-
-/**
- * Implementation of an <code>ILabelRequestMonitor</code>. Collects label
- * attributes from an asynchronous label adapter.
- * <p>
- * Not intended to be subclassed or instantiated by clients. For use speficially
- * with <code>AsynchronousViewer</code>.
- * </p>
- *
- * @since 3.2
- */
-class LabelRequestMonitor extends AsynchronousRequestMonitor implements ILabelRequestMonitor {
-
- /**
- * Retrieved label text. Only <code>null</code> if cancelled or failed.
- */
- private String[] fLabels;
-
- /**
- * Retrieved image descriptor or <code>null</code>
- */
- private ImageDescriptor[] fImageDescriptors;
-
- /**
- * Retrieved font data or <code>null</code>
- */
- private FontData[] fFontDatas;
-
- /**
- * Retieved colors or <code>null</code>
- */
- private RGB[] fForegrounds;
- private RGB[] fBackgrounds;
-
- /**
- * Cosntructs a request to upate the label of the given node in the give
- * model.
- *
- * @param node node to update
- * @param model model containing the node
- */
- public LabelRequestMonitor(ModelNode node, AsynchronousModel model) {
- super(node, model);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.viewers.AsynchronousRequestMonitor#performUpdate()
- */
- protected void performUpdate() {
- AsynchronousViewer viewer = getModel().getViewer();
- Widget widget = viewer.findItem(getNode());
- if (widget != null && !widget.isDisposed()) {
- viewer.setLabels(widget, fLabels, fImageDescriptors);
- viewer.setColors(widget, fForegrounds, fBackgrounds);
- viewer.setFonts(widget, fFontDatas);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.viewers.AsynchronousRequestMonitor#contains(org.eclipse.debug.ui.viewers.AsynchronousRequestMonitor)
- */
- protected boolean contains(AsynchronousRequestMonitor update) {
- return update instanceof LabelRequestMonitor && update.getNode() == getNode();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.viewers.ILabelRequestMonitor#setLabel(java.lang.String)
- */
- public void setLabels(String[] text) {
- fLabels = text;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.viewers.ILabelRequestMonitor#setFontData(org.eclipse.swt.graphics.FontData)
- */
- public void setFontDatas(FontData[] fontData) {
- fFontDatas = fontData;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.viewers.ILabelRequestMonitor#setImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)
- */
- public void setImageDescriptors(ImageDescriptor[] image) {
- fImageDescriptors = image;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.viewers.ILabelRequestMonitor#setForeground(org.eclipse.swt.graphics.RGB)
- */
- public void setForegrounds(RGB[] foreground) {
- fForegrounds = foreground;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.viewers.ILabelRequestMonitor#setBackground(org.eclipse.swt.graphics.RGB)
- */
- public void setBackgrounds(RGB[] background) {
- fBackgrounds = background;
- }
-
- protected RGB[] getBackgrounds() {
- return fBackgrounds;
- }
-
- protected RGB[] getForegrounds() {
- return fForegrounds;
- }
-
- protected FontData[] getFontDatas() {
- return fFontDatas;
- }
-
- protected String[] getLabels() {
- return fLabels;
- }
-
- protected ImageDescriptor[] getImageDescriptors() {
- return fImageDescriptors;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelResult.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelResult.java
deleted file mode 100644
index 2e04a1af8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelResult.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.swt.graphics.Image;
-
-
-/**
- * @since 3.2
- *
- */
-class LabelResult extends LabelRequestMonitor implements ILabelResult {
-
- public LabelResult(ModelNode node, AsynchronousModel model) {
- super(node, model);
- }
-
- protected synchronized void scheduleViewerUpdate(long ms) {
- notifyAll();
- }
-
- public synchronized boolean isDone() {
- return super.isDone();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.ILabelResult#getElement()
- */
- public Object getElement() {
- return getNode().getElement();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.ILabelResult#getImages()
- */
- public Image[] getImages() {
- return getModel().getViewer().getImages(getImageDescriptors());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.ILabelResult#getLabels()
- */
- public String[] getLabels() {
- return super.getLabels();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.ILabelResult#getTreePath()
- */
- public TreePath getTreePath() {
- return getNode().getTreePath();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.ILabelResult#getDepth()
- */
- public int getDepth() {
- int level = 0;
- ModelNode node = getNode().getParentNode();
- while (node != null) {
- node = node.getParentNode();
- level++;
- }
- return level;
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ModelNode.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ModelNode.java
deleted file mode 100644
index ee2eddeff..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ModelNode.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.TreePath;
-
-/**
- * A node in an asynchronous model.
- *
- * @since 3.2
- */
-public class ModelNode {
-
- private Object fElement; // model element
- private boolean fIsContainer; // whether this element may have children
- private ModelNode fParent; // parent node or null for root
- private ModelNode[] fChildren; // child nodes, possibly null
- private boolean fDisposed; // whether this node has been disposed
-
- public ModelNode(ModelNode parent, Object element) {
- fParent = parent;
- fElement = element;
- }
-
- public synchronized Object getElement() {
- return fElement;
- }
-
- public synchronized void remap(Object element) {
- fElement = element;
- }
-
- public ModelNode getParentNode() {
- return fParent;
- }
-
- public synchronized boolean isContainer() {
- return fIsContainer;
- }
-
- public synchronized ModelNode[] getChildrenNodes() {
- return fChildren;
- }
-
- public synchronized boolean isDisposed() {
- return fDisposed;
- }
-
- public synchronized void dispose() {
- fDisposed = true;
- ModelNode[] childrenNodes = getChildrenNodes();
- if (childrenNodes != null) {
- for (int i = 0; i < childrenNodes.length; i++) {
- childrenNodes[i].dispose();
- }
- }
- }
-
- /**
- * Returns whether this node corresponds to the given path
- *
- * @param path tree path
- */
- public synchronized boolean correspondsTo(TreePath path) {
- int index = path.getSegmentCount() - 1;
- ModelNode node = this;
- while (index >= 0 && node != null) {
- Object pathElement = path.getSegment(index);
- if (pathElement.equals(node.getElement())) {
- index--;
- node = node.getParentNode();
- } else {
- return false;
- }
- }
- return index == -1;
- }
-
- /**
- * Returns a tree path corresponding to this node.
- *
- * @return
- */
- public synchronized TreePath getTreePath() {
- List path = new ArrayList();
- ModelNode node = this;
- while (node != null) {
- path.add(0, node.getElement());
- node = node.getParentNode();
- }
- return new TreePath(path.toArray());
- }
-
- /**
- * Adds the given child to this node.
- *
- * @param child
- */
- public synchronized void addChild(ModelNode child) {
- if (fChildren == null) {
- fChildren = new ModelNode[] {child};
- } else {
- ModelNode[] kids = new ModelNode[fChildren.length + 1];
- System.arraycopy(fChildren, 0, kids, 0, fChildren.length);
- kids[fChildren.length] = child;
- fChildren = kids;
- }
- }
-
- /**
- * Removes the given child from this node.
- *
- * @param child
- */
- public synchronized void removeChild(ModelNode child) {
- if (fChildren != null) {
- for (int i = 0; i < fChildren.length; i++) {
- ModelNode kid = fChildren[i];
- if (child == kid) {
- ModelNode[] newNodes= new ModelNode[fChildren.length - 1];
- System.arraycopy(fChildren, 0, newNodes, 0, i);
- if (i < newNodes.length) {
- System.arraycopy(fChildren, i + 1, newNodes, i, newNodes.length - i);
- }
- fChildren = newNodes;
- return;
- }
- }
- }
- }
-
- /**
- * Sets the children for this node
- *
- * @param children
- */
- public synchronized void setChildren(ModelNode[] children) {
- if (children != null && children.length == 0) {
- fChildren = null;
- setIsContainer(false);
- } else {
- fChildren = children;
- }
- }
-
- /**
- * Returns the number of children for this node.
- *
- * @return
- */
- public synchronized int getChildCount() {
- if (fChildren == null) {
- if (isContainer()) {
- return 1;
- }
- return 0;
- }
- return fChildren.length;
- }
-
- /**
- * Returns the index of the given child in this parent, or -1
- *
- * @param child
- */
- public synchronized int getChildIndex(ModelNode child) {
- if (fChildren != null) {
- for (int i = 0; i < fChildren.length; i++) {
- if (child == fChildren[i]) {
- return i;
- }
- }
- }
- return -1;
- }
-
- /**
- * Sets whether this node has children.
- *
- * @param container
- */
- public synchronized void setIsContainer(boolean container) {
- fIsContainer = container;
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer();
- if (isDisposed()) {
- buf.append("[DISPOSED] "); //$NON-NLS-1$
- }
- if (isContainer()) {
- buf.append("[+] "); //$NON-NLS-1$
- }
- buf.append(getElement());
- return buf.toString();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/PartPresentationContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/PartPresentationContext.java
deleted file mode 100644
index 9ecf2ee7a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/PartPresentationContext.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * A presentation context tied to a part.
- *
- * @since 3.3
- */
-public class PartPresentationContext extends PresentationContext {
-
- private IWorkbenchPart fPart;
-
- /**
- * Constructs a part presentation context.
- *
- * @param part part
- */
- public PartPresentationContext(IWorkbenchPart part) {
- super(part.getSite().getId());
- fPart = part;
- }
-
- public IWorkbenchPart getPart() {
- return fPart;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableAddRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableAddRequestMonitor.java
deleted file mode 100644
index 360186c45..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableAddRequestMonitor.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-
-/**
- * @since 3.2
- *
- */
-public class TableAddRequestMonitor extends AsynchronousRequestMonitor {
-
- protected Object[] fElements;
-
- /**
- * @param node
- * @param model
- */
- TableAddRequestMonitor(ModelNode parent, Object elements[], AsynchronousModel model) {
- super(parent, model);
- fElements = elements;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousRequestMonitor#performUpdate()
- */
- protected void performUpdate() {
- ((AsynchronousTableModel)getModel()).added(fElements);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousRequestMonitor#contains(org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousRequestMonitor)
- */
- protected boolean contains(AsynchronousRequestMonitor update) {
- return false;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableEditorImpl.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableEditorImpl.java
deleted file mode 100644
index e4fda98fc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableEditorImpl.java
+++ /dev/null
@@ -1,355 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ICellEditorListener;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Item;
-
-/**
- * This class is copied from package org.eclipse.jface.viewers.TableEditorImpl
- * because the original has package access only.
- *
- * TODO: complain to UI about package access to API class.
- *
- */
-public abstract class TableEditorImpl {
- private CellEditor fCellEditor;
- private CellEditor[] fCellEditors;
- private ICellModifier fCellModifier;
- private String[] fColumnProperties;
- private Item fTableItem;
- private int fColumnNumber;
- private ICellEditorListener fCellEditorListener;
- private FocusListener fFocusListener;
- private MouseListener fMouseListener;
- private int fDoubleClickExpirationTime;
- private StructuredViewer fViewer;
-
- TableEditorImpl(StructuredViewer viewer) {
- fViewer = viewer;
- initCellEditorListener();
- }
-
- /**
- * Returns this <code>TableViewerImpl</code> viewer
- *
- * @return the viewer
- */
- public StructuredViewer getViewer() {
- return fViewer;
- }
-
- private void activateCellEditor() {
- if (fCellEditors != null) {
- if (fCellEditors[fColumnNumber] != null && fCellModifier != null) {
- Object element = fTableItem.getData();
- String property = fColumnProperties[fColumnNumber];
- if (fCellModifier.canModify(element, property)) {
- fCellEditor = fCellEditors[fColumnNumber];
- // table.showSelection();
- fCellEditor.addListener(fCellEditorListener);
- Object value = fCellModifier.getValue(element, property);
- fCellEditor.setValue(value);
- // Tricky flow of control here:
- // activate() can trigger callback to cellEditorListener
- // which will clear cellEditor
- // so must get control first, but must still call activate()
- // even if there is no control.
- final Control control = fCellEditor.getControl();
- fCellEditor.activate();
- if (control == null)
- return;
- setLayoutData(fCellEditor.getLayoutData());
- setEditor(control, fTableItem, fColumnNumber);
- fCellEditor.setFocus();
- if (fFocusListener == null) {
- fFocusListener = new FocusAdapter() {
- public void focusLost(FocusEvent e) {
- applyEditorValue();
- }
- };
- }
- control.addFocusListener(fFocusListener);
- fMouseListener = new MouseAdapter() {
- public void mouseDown(MouseEvent e) {
- // time wrap?
- // check for expiration of doubleClickTime
- if (e.time <= fDoubleClickExpirationTime) {
- control.removeMouseListener(fMouseListener);
- cancelEditing();
- handleDoubleClickEvent();
- } else if (fMouseListener != null) {
- control.removeMouseListener(fMouseListener);
- }
- }
- };
- control.addMouseListener(fMouseListener);
- }
- }
- }
- }
-
- /**
- * Activate a cell editor for the given mouse position.
- */
- private void activateCellEditor(MouseEvent event) {
- if (fTableItem == null || fTableItem.isDisposed()) {
- // item no longer exists
- return;
- }
- int columnToEdit;
- int columns = getColumnCount();
- if (columns == 0) {
- // If no TableColumn, Table acts as if it has a single column
- // which takes the whole width.
- columnToEdit = 0;
- } else {
- columnToEdit = -1;
- for (int i = 0; i < columns; i++) {
- Rectangle bounds = getBounds(fTableItem, i);
- if (bounds.contains(event.x, event.y)) {
- columnToEdit = i;
- break;
- }
- }
- if (columnToEdit == -1) {
- return;
- }
- }
-
- fColumnNumber = columnToEdit;
- activateCellEditor();
- }
-
- /**
- * Deactivates the currently active cell editor.
- */
- public void applyEditorValue() {
- CellEditor c = fCellEditor;
- if (c != null) {
- // null out cell editor before calling save
- // in case save results in applyEditorValue being re-entered
- // see 1GAHI8Z: ITPUI:ALL - How to code event notification when
- // using cell editor ?
- fCellEditor = null;
- Item t = fTableItem;
- // don't null out table item -- same item is still selected
- if (t != null && !t.isDisposed()) {
- saveEditorValue(c, t);
- }
- setEditor(null, null, 0);
- c.removeListener(fCellEditorListener);
- Control control = c.getControl();
- if (control != null) {
- if (fMouseListener != null) {
- control.removeMouseListener(fMouseListener);
- }
- if (fFocusListener != null) {
- control.removeFocusListener(fFocusListener);
- }
- }
- c.deactivate();
- }
- }
-
- /**
- * Cancels the active cell editor, without saving the value back to the
- * domain model.
- */
- public void cancelEditing() {
- if (fCellEditor != null) {
- setEditor(null, null, 0);
- fCellEditor.removeListener(fCellEditorListener);
- CellEditor oldEditor = fCellEditor;
- fCellEditor = null;
- oldEditor.deactivate();
- }
- }
-
- /**
- * Start editing the given element.
- *
- * @param element
- * @param column
- */
- public void editElement(Object element, int column) {
- if (fCellEditor != null)
- applyEditorValue();
-
- setSelection(new StructuredSelection(element), true);
- Item[] selection = getSelection();
- if (selection.length != 1)
- return;
-
- fTableItem = selection[0];
-
- // Make sure selection is visible
- showSelection();
- fColumnNumber = column;
- activateCellEditor();
-
- }
-
- abstract Rectangle getBounds(Item item, int columnNumber);
-
- /**
- * Return the array of CellEditors used in the viewer
- *
- * @return the cell editors
- */
- public CellEditor[] getCellEditors() {
- return fCellEditors;
- }
-
- /**
- * Get the cell modifier
- *
- * @return the cell modifier
- */
- public ICellModifier getCellModifier() {
- return fCellModifier;
- }
-
- abstract int getColumnCount();
-
- /**
- * Return the properties for the column
- *
- * @return the array of column properties
- */
- public Object[] getColumnProperties() {
- return fColumnProperties;
- }
-
- abstract Item[] getSelection();
-
- /**
- * Handles the mouse down event; activates the cell editor.
- *
- * @param event
- * the mouse event that should be handled
- */
- public void handleMouseDown(MouseEvent event) {
- if (event.button != 1)
- return;
-
- if (fCellEditor != null)
- applyEditorValue();
-
- // activate the cell editor immediately. If a second mouseDown
- // is received prior to the expiration of the doubleClick time then
- // the cell editor will be deactivated and a doubleClick event will
- // be processed.
- //
- fDoubleClickExpirationTime = event.time + Display.getCurrent().getDoubleClickTime();
-
- Item[] items = getSelection();
- // Do not edit if more than one row is selected.
- if (items.length != 1) {
- fTableItem = null;
- return;
- }
- fTableItem = items[0];
- activateCellEditor(event);
- }
-
- private void initCellEditorListener() {
- fCellEditorListener = new ICellEditorListener() {
- public void editorValueChanged(boolean oldValidState, boolean newValidState) {
- // Ignore.
- }
-
- public void cancelEditor() {
- TableEditorImpl.this.cancelEditing();
- }
-
- public void applyEditorValue() {
- TableEditorImpl.this.applyEditorValue();
- }
- };
- }
-
- /**
- * Return whether there is an active cell editor.
- *
- * @return <code>true</code> if there is an active cell editor; otherwise
- * <code>false</code> is returned.
- */
- public boolean isCellEditorActive() {
- return fCellEditor != null;
- }
-
- /**
- * Saves the value of the currently active cell editor, by delegating to the
- * cell modifier.
- */
- private void saveEditorValue(CellEditor cellEditor, Item tableItem) {
- if (fCellModifier != null) {
- if (!cellEditor.isValueValid()) {
- // /Do what ???
- }
- String property = null;
- if (fColumnProperties != null && fColumnNumber < fColumnProperties.length)
- property = fColumnProperties[fColumnNumber];
- fCellModifier.modify(tableItem, property, cellEditor.getValue());
- }
- }
-
- /**
- * Set the cell editors
- *
- * @param editors
- */
- public void setCellEditors(CellEditor[] editors) {
- fCellEditors = editors;
- }
-
- /**
- * Set the cell modifier
- *
- * @param modifier
- */
- public void setCellModifier(ICellModifier modifier) {
- fCellModifier = modifier;
- }
-
- /**
- * Set the column properties
- *
- * @param columnProperties
- */
- public void setColumnProperties(String[] columnProperties) {
- fColumnProperties = columnProperties;
- }
-
- abstract void setEditor(Control w, Item item, int fColumnNumber);
-
- abstract void setLayoutData(CellEditor.LayoutData layoutData);
-
- abstract void setSelection(StructuredSelection selection, boolean b);
-
- abstract void showSelection();
-
- abstract void handleDoubleClickEvent();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableInsertRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableInsertRequestMonitor.java
deleted file mode 100644
index 57f15cdd4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableInsertRequestMonitor.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-
-/**
- * @since 3.2
- *
- */
-public class TableInsertRequestMonitor extends TableAddRequestMonitor {
-
- private int fIndex;
-
- /**
- * @param node
- * @param model
- */
- TableInsertRequestMonitor(ModelNode parent, Object elements[], int index, AsynchronousModel model) {
- super(parent, elements, model);
- fIndex = index;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousRequestMonitor#performUpdate()
- */
- protected void performUpdate() {
- ((AsynchronousTableModel)getModel()).inserted(fElements, fIndex);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableRemoveRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableRemoveRequestMonitor.java
deleted file mode 100644
index 421ade779..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableRemoveRequestMonitor.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-
-/**
- * @since 3.2
- *
- */
-public class TableRemoveRequestMonitor extends TableAddRequestMonitor {
-
- /**
- * @param parent
- * @param elements
- * @param model
- */
- TableRemoveRequestMonitor(ModelNode parent, Object[] elements, AsynchronousModel model) {
- super(parent, elements, model);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousRequestMonitor#performUpdate()
- */
- protected void performUpdate() {
- ((AsynchronousTableModel)getModel()).removed(fElements);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableReplaceRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableReplaceRequestMonitor.java
deleted file mode 100644
index ca66b8696..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableReplaceRequestMonitor.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-
-/**
- * @since 3.2
- *
- */
-public class TableReplaceRequestMonitor extends AsynchronousRequestMonitor {
-
- private Object fOriginal;
- private Object fReplacement;
-
- /**
- * @param node
- * @param model
- */
- TableReplaceRequestMonitor(ModelNode node, Object element, Object replacement, AsynchronousModel model) {
- super(node, model);
- fReplacement = replacement;
- fOriginal = element;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousRequestMonitor#performUpdate()
- */
- protected void performUpdate() {
- ((AsynchronousTableModel)getModel()).replaced(fOriginal, fReplacement);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousRequestMonitor#contains(org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousRequestMonitor)
- */
- protected boolean contains(AsynchronousRequestMonitor update) {
- return false;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableUpdatePolicy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableUpdatePolicy.java
deleted file mode 100644
index b3f176362..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableUpdatePolicy.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-/**
- * Default update policy updates a viewer based on model deltas.
- *
- * @since 3.2
- */
-public class TableUpdatePolicy extends org.eclipse.debug.internal.ui.viewers.AbstractUpdatePolicy implements IModelChangedListener {
-
- public void modelChanged(IModelDelta delta, IModelProxy proxy) {
- updateNodes(new IModelDelta[] {delta});
- }
-
- private void handleState(IModelDelta node) {
- AsynchronousViewer viewer = getViewer();
- if (viewer != null) {
- Object element = node.getElement();
- viewer.update(element);
- updateSelection(element, node.getFlags());
- }
- }
- private void handleContent(IModelDelta node) {
- AsynchronousViewer viewer = getViewer();
- if (viewer != null) {
- Object element = node.getElement();
- viewer.refresh(element);
- updateSelection(element, node.getFlags());
- }
- }
-
- private void updateSelection(Object element, int flags) {
- AsynchronousViewer viewer = getViewer();
- if (viewer != null) {
- if ((flags & IModelDelta.SELECT) != 0) {
- getViewer().setSelection(new StructuredSelection(element));
- }
- }
- }
-
- protected void updateNodes(IModelDelta[] nodes) {
- for (int i = 0; i < nodes.length; i++) {
- IModelDelta node = nodes[i];
- int flags = node.getFlags();
-
- if ((flags & IModelDelta.STATE) != 0) {
- handleState(node);
- }
- if ((flags & IModelDelta.CONTENT) != 0) {
- handleContent(node);
- }
- if ((flags & IModelDelta.ADDED) != 0) {
- handleAdd(node);
- }
- if ((flags & IModelDelta.REMOVED) != 0) {
- handleRemove(node);
- }
- if ((flags & IModelDelta.REPLACED) != 0) {
- handleReplace(node);
- }
- if ((flags & IModelDelta.INSERTED) != 0) {
- handleInsert(node);
- }
-
- IModelDelta[] childNodes = node.getChildDeltas();
- updateNodes(childNodes);
- }
- }
-
- private void handleInsert(IModelDelta node) {
- AsynchronousTableViewer viewer = (AsynchronousTableViewer) getViewer();
- if (viewer != null) {
- viewer.insert(node.getElement(), node.getIndex());
- updateSelection(node.getElement(), node.getFlags());
- }
- }
-
- private void handleReplace(IModelDelta node) {
- AsynchronousTableViewer viewer = (AsynchronousTableViewer) getViewer();
- if (viewer != null) {
- viewer.replace(node.getElement(), node.getReplacementElement());
- updateSelection(node.getReplacementElement(), node.getFlags());
- }
- }
-
- protected void handleAdd(IModelDelta node) {
- ((AsynchronousTableViewer) getViewer()).add(node.getElement());
- updateSelection(node.getElement(), node.getFlags());
- }
-
- protected void handleRemove(IModelDelta node) {
- ((AsynchronousTableViewer) getViewer()).remove(node.getElement());
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/AbstractBreadcrumb.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/AbstractBreadcrumb.java
deleted file mode 100644
index 6d518b21f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/AbstractBreadcrumb.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech (Wind River) - adapted breadcrumb for use in Debug view (Bug 252677)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.breadcrumb;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.IOpenListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.OpenEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Widget;
-
-
-/**
- * Breadcrumb base class. It creates the breadcrumb viewer and manages
- * its activation.
- * <p>
- * Clients must implement the abstract methods.
- * </p>
- *
- * @since 3.5
- */
-public abstract class AbstractBreadcrumb {
-
- private BreadcrumbViewer fBreadcrumbViewer;
-
- private boolean fHasFocus;
-
- private Composite fComposite;
-
- private Listener fDisplayFocusListener;
- private Listener fDisplayKeyListener;
-
- public AbstractBreadcrumb() {
- }
-
- /**
- * The active element of the editor.
- *
- * @return the active element of the editor, or <b>null</b> if none
- */
- protected abstract Object getCurrentInput();
-
- /**
- * Create and configure the viewer used to display the parent chain.
- *
- * @param parent the parent composite
- * @return the viewer
- */
- protected abstract BreadcrumbViewer createViewer(Composite parent);
-
- /**
- * Open the element in a new editor if possible.
- *
- * @param selection element the element to open
- * @return true if the element could be opened
- */
- protected abstract boolean open(ISelection selection);
-
- /**
- * The breadcrumb has been activated. Implementors must retarget the editor actions to the
- * breadcrumb aware actions.
- */
- protected abstract void activateBreadcrumb();
-
- /**
- * The breadcrumb has been deactivated. Implementors must retarget the breadcrumb actions to the
- * editor actions.
- */
- protected abstract void deactivateBreadcrumb();
-
- /**
- * Returns the selection provider for this breadcrumb.
- *
- * @return the selection provider for this breadcrumb
- */
- public ISelectionProvider getSelectionProvider() {
- return fBreadcrumbViewer;
- }
-
- /**
- * Set the input of the breadcrumb to the given element
- *
- * @param element the input element can be <code>null</code>
- */
- public void setInput(Object element) {
- if (element == null || fBreadcrumbViewer == null || fBreadcrumbViewer.getControl().isDisposed())
- return;
-
- Object input= fBreadcrumbViewer.getInput();
- if (input == element || element.equals(input)) {
- refresh();
- return;
- }
-
- fBreadcrumbViewer.setInput(element);
- }
-
- protected void refresh() {
- if (!fBreadcrumbViewer.getControl().isDisposed()) {
- fBreadcrumbViewer.refresh();
- }
- }
-
- /**
- * Activates the breadcrumb. This sets the keyboard focus
- * inside this breadcrumb and retargets the editor
- * actions.
- */
- public void activate() {
- if (fBreadcrumbViewer.getSelection().isEmpty())
- fBreadcrumbViewer.setSelection(new StructuredSelection(fBreadcrumbViewer.getInput()));
- fBreadcrumbViewer.setFocus();
- }
-
- /**
- * A breadcrumb is active if it either has the focus or another workbench part has the focus and
- * the breadcrumb had the focus before the other workbench part was made active.
- *
- * @return <code>true</code> if this breadcrumb is active
- */
- public boolean isActive() {
- return true;
- }
-
- /**
- * Create breadcrumb content.
- *
- * @param parent the parent of the content
- * @return the control containing the created content
- */
- public Control createContent(Composite parent) {
- Assert.isTrue(fComposite == null, "Content must only be created once."); //$NON-NLS-1$
-
- boolean rtl= (parent.getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0;
- //boolean rtl = true;
-
- fComposite= new Composite(parent, rtl ? SWT.RIGHT_TO_LEFT : SWT.NONE);
- GridData data= new GridData(SWT.FILL, SWT.TOP, true, false);
- fComposite.setLayoutData(data);
- GridLayout gridLayout= new GridLayout(1, false);
- gridLayout.marginWidth= 0;
- gridLayout.marginHeight= 0;
- gridLayout.verticalSpacing= 0;
- gridLayout.horizontalSpacing= 0;
- fComposite.setLayout(gridLayout);
-
- fDisplayFocusListener= new Listener() {
- public void handleEvent(Event event) {
- if (fComposite.isDisposed()) return;
-
- if (isBreadcrumbEvent(event)) {
- if (fHasFocus)
- return;
-
- focusGained();
- } else {
- if (!fHasFocus)
- return;
-
- focusLost();
- }
- }
- };
- Display.getCurrent().addFilter(SWT.FocusIn, fDisplayFocusListener);
-
- fBreadcrumbViewer= createViewer(fComposite);
-
- fBreadcrumbViewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- Object element= ((IStructuredSelection) event.getSelection()).getFirstElement();
- if (element == null)
- return;
-
- BreadcrumbItem item= (BreadcrumbItem) fBreadcrumbViewer.doFindItem(element);
- if (item == null)
- return;
- item.openDropDownMenu();
- }
- });
-
- fBreadcrumbViewer.addOpenListener(new IOpenListener() {
- public void open(OpenEvent event) {
- doOpen(event.getSelection());
- }
- });
-
- return fComposite;
- }
-
- /**
- * Dispose all resources hold by this breadcrumb.
- */
- public void dispose() {
- if (fDisplayFocusListener != null) {
- Display.getDefault().removeFilter(SWT.FocusIn, fDisplayFocusListener);
- }
- deinstallDisplayListeners();
- }
-
- /**
- * Either reveal the selection in the editor or open the selection in a new editor. If both fail
- * open the child pop up of the selected element.
- *
- * @param selection the selection to open
- */
- private void doOpen(ISelection selection) {
- if (open(selection)) {
- fBreadcrumbViewer.setInput(getCurrentInput());
- }
- }
-
- /**
- * Focus has been transfered into the breadcrumb.
- */
- private void focusGained() {
- if (fHasFocus)
- focusLost();
-
- fHasFocus= true;
-
- installDisplayListeners();
-
- activateBreadcrumb();
- }
-
- /**
- * Focus has been revoked from the breadcrumb.
- */
- private void focusLost() {
- fHasFocus= false;
-
- deinstallDisplayListeners();
-
- deactivateBreadcrumb();
- }
-
- /**
- * Installs all display listeners.
- */
- private void installDisplayListeners() {
- //Sanity check
- deinstallDisplayListeners();
-
- fDisplayKeyListener= new Listener() {
- public void handleEvent(Event event) {
- if (event.keyCode != SWT.ESC)
- return;
-
- if (!isBreadcrumbEvent(event))
- return;
- }
- };
- Display.getDefault().addFilter(SWT.KeyDown, fDisplayKeyListener);
- }
-
- /**
- * Removes all previously installed display listeners.
- */
- private void deinstallDisplayListeners() {
- if (fDisplayKeyListener != null) {
- Display.getDefault().removeFilter(SWT.KeyDown, fDisplayKeyListener);
- fDisplayKeyListener= null;
- }
- }
-
- /**
- * Tells whether the given event was issued inside the breadcrumb viewer's control.
- *
- * @param event the event to inspect
- * @return <code>true</code> if event was generated by a breadcrumb child
- */
- private boolean isBreadcrumbEvent(Event event) {
- if (fBreadcrumbViewer == null)
- return false;
-
- Widget item= event.widget;
- if (!(item instanceof Control))
- return false;
-
- Shell dropDownShell= fBreadcrumbViewer.getDropDownShell();
- if (dropDownShell != null && isChild((Control) item, dropDownShell))
- return true;
-
- return isChild((Control) item, fBreadcrumbViewer.getControl());
- }
-
- private boolean isChild(Control child, Control parent) {
- if (child == null)
- return false;
-
- if (child == parent)
- return true;
-
- return isChild(child.getParent(), parent);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItem.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItem.java
deleted file mode 100644
index d70e7aa92..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItem.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech (Wind River) - adapted breadcrumb for use in Debug view (Bug 252677)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.breadcrumb;
-
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * An item in a breadcrumb viewer.
- * <p>
- * The item shows a label and an image. It also has the ability to expand, that is to open a drop
- * down menu.
- * </p>
- * <p>
- * The drop down allows to select any child of the items input element. The item shows the label and
- * icon of its data element, if any.
- * </p>
- *
- * @since 3.5
- */
-class BreadcrumbItem extends Item {
-
- private TreePath fPath;
-
- private final BreadcrumbViewer fParent;
- private Composite fContainer;
-
- private BreadcrumbItemDropDown fExpandBlock;
- private BreadcrumbItemDetails fDetailsBlock;
-
- private boolean fIsLast;
-
- /**
- * A new breadcrumb item which is shown inside the given viewer.
- *
- * @param viewer the items viewer
- * @param parent the container containing the item
- */
- public BreadcrumbItem(BreadcrumbViewer viewer, Composite parent) {
- super(parent, SWT.NONE);
-
- fParent= viewer;
-
- fContainer= new Composite(parent, SWT.NONE);
- fContainer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
- GridLayout layout= new GridLayout(2, false);
- layout.marginBottom= 1;
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- layout.horizontalSpacing= 0;
- fContainer.setLayout(layout);
-
- fExpandBlock= new BreadcrumbItemDropDown(this, fContainer);
- fDetailsBlock= new BreadcrumbItemDetails(this, fContainer);
- }
-
- /**
- * Returns this items viewer.
- *
- * @return the viewer showing this item
- */
- public BreadcrumbViewer getViewer() {
- return fParent;
- }
-
- /*
- * @see org.eclipse.swt.widgets.Widget#dispose()
- */
- public void dispose() {
- fContainer.dispose();
- super.dispose();
- }
-
- public TreePath getPath() {
- return fPath;
- }
-
- public void setPath(TreePath path) {
- fPath = path;
- }
-
- /**
- * Should this item show a text label.
- *
- * @param enabled true if it should
- */
- void setShowText(boolean enabled) {
- fDetailsBlock.setTextVisible(enabled);
- }
-
- /**
- * Does this item show a text label?
- *
- * @return true if it does.
- */
- boolean isShowText() {
- return fDetailsBlock.isTextVisible();
- }
-
- /**
- * Returns the width of this item.
- *
- * @return the width of this item
- */
- int getWidth() {
- return fDetailsBlock.getWidth() + fExpandBlock.getWidth() + 2;
- }
-
- /**
- * Sets whether this item has to be marked as
- * selected or not.
- *
- * @param selected true if marked as selected
- */
- void setSelected(boolean selected) {
- fDetailsBlock.setSelected(selected);
- }
-
- /**
- * Sets whether this item has the keyboard focus.
- *
- * @param state <code>true</code> if it has focus, <code>false</code> otherwise
- */
- void setFocus(boolean state) {
- fDetailsBlock.setFocus(state);
- }
-
- /**
- * Returns whether this item has the keyboard focus.
- *
- * @return <code>true</code> if this item has the keyboard focus
- */
- boolean hasFocus() {
- return fDetailsBlock.hasFocus();
- }
-
- /**
- * Set whether this is the last item in the breadcrumb item chain or not.
- *
- * @param isLast <code>true</code> if this is the last item, <code>false</code> otherwise
- */
- void setIsLastItem(boolean isLast) {
- fIsLast= isLast;
-
- GridData data= (GridData) fContainer.getLayoutData();
- data.grabExcessHorizontalSpace= isLast;
- }
-
- /**
- * Expand this item, shows the drop down menu.
- */
- void openDropDownMenu() {
- fExpandBlock.showMenu();
- }
-
- /**
- * @return true if this item is expanded
- */
- boolean isMenuShown() {
- return fExpandBlock.isMenuShown();
- }
-
- /**
- * Returns the drop down shell.
- *
- * @return the shell of the drop down if shown, <code>null</code> otherwise
- */
- Shell getDropDownShell() {
- return fExpandBlock.getDropDownShell();
- }
-
- /**
- * Returns the bounds of this item.
- *
- * @return the bounds of this item
- */
- public Rectangle getBounds() {
- return fContainer.getBounds();
- }
-
- /**
- * Set the tool tip of the item to the given text.
- *
- * @param text the tool tip for the item
- */
- public void setToolTip(String text) {
- fDetailsBlock.setToolTip(text);
- }
-
- /*
- * @see org.eclipse.swt.widgets.Item#setText(java.lang.String)
- */
- public void setText(String string) {
- super.setText(string);
- fDetailsBlock.setText(string);
-
- //more or less space might be required for the label
- if (fIsLast)
- fContainer.layout(true, true);
- }
-
- /*
- * @see org.eclipse.swt.widgets.Item#setImage(org.eclipse.swt.graphics.Image)
- */
- public void setImage(Image image) {
- super.setImage(image);
- fDetailsBlock.setImage(image);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDetails.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDetails.java
deleted file mode 100644
index 8aa09ca1e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDetails.java
+++ /dev/null
@@ -1,423 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech (Wind River) - adapted breadcrumb for use in Debug view (Bug 252677)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.breadcrumb;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MenuDetectEvent;
-import org.eclipse.swt.events.MenuDetectListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * The label and icon part of the breadcrumb item.
- *
- * @since 3.5
- */
-class BreadcrumbItemDetails {
-
- private final Label fElementImage;
- private final Label fElementText;
- private final Composite fDetailComposite;
- private final BreadcrumbItem fParent;
- private final Composite fTextComposite;
- private final Composite fImageComposite;
-
- private boolean fTextVisible;
- private boolean fSelected;
- private boolean fHasFocus;
-
-
- public BreadcrumbItemDetails(BreadcrumbItem parent, Composite parentContainer) {
- fParent= parent;
- fTextVisible= true;
-
- fDetailComposite= new Composite(parentContainer, SWT.NONE);
- fDetailComposite.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
- GridLayout layout= new GridLayout(2, false);
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- layout.horizontalSpacing= 0;
- fDetailComposite.setLayout(layout);
- addElementListener(fDetailComposite);
-
- fImageComposite= new Composite(fDetailComposite, SWT.NONE);
- fImageComposite.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
- layout= new GridLayout(1, false);
- layout.marginHeight= 1;
- layout.marginWidth= 2;
- fImageComposite.setLayout(layout);
- fImageComposite.addPaintListener(new PaintListener() {
- public void paintControl(PaintEvent e) {
- if (fHasFocus && !isTextVisible()) {
- e.gc.drawFocus(e.x, e.y, e.width, e.height);
- }
- }
- });
- installFocusComposite(fImageComposite);
- addElementListener(fImageComposite);
-
- fElementImage= new Label(fImageComposite, SWT.NONE);
- GridData layoutData= new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
- fElementImage.setLayoutData(layoutData);
- addElementListener(fElementImage);
-
- fTextComposite= new Composite(fDetailComposite, SWT.NONE);
- fTextComposite.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
- layout= new GridLayout(1, false);
- layout.marginHeight= 2;
- layout.marginWidth= 2;
- fTextComposite.setLayout(layout);
- addElementListener(fTextComposite);
- fTextComposite.addPaintListener(new PaintListener() {
- public void paintControl(PaintEvent e) {
- if (fHasFocus && isTextVisible()) {
- e.gc.drawFocus(e.x, e.y, e.width, e.height);
- }
- }
- });
- installFocusComposite(fTextComposite);
- addElementListener(fTextComposite);
-
- fElementText= new Label(fTextComposite, SWT.NONE);
-
- layoutData= new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
- fElementText.setLayoutData(layoutData);
- addElementListener(fElementText);
-
- fTextComposite.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
- e.result= fElementText.getText();
- }
- });
- fImageComposite.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
- e.result= fElementText.getText();
- }
- });
-
- fDetailComposite.setTabList(new Control[] { fTextComposite });
- }
-
- /**
- * Returns whether this element has the keyboard focus.
- *
- * @return true if this element has the keyboard focus.
- */
- public boolean hasFocus() {
- return fHasFocus;
- }
-
- /**
- * Sets the tool tip to the given text.
- *
- * @param text the tool tip
- */
- public void setToolTip(String text) {
- if (isTextVisible()) {
- fElementText.getParent().setToolTipText(text);
- fElementText.setToolTipText(text);
-
- fElementImage.setToolTipText(text);
- } else {
- fElementText.getParent().setToolTipText(null);
- fElementText.setToolTipText(null);
-
- fElementImage.setToolTipText(text);
- }
- }
-
- /**
- * Sets the image to the given image.
- *
- * @param image the image to use
- */
- public void setImage(Image image) {
- if (image != fElementImage.getImage()) {
- fElementImage.setImage(image);
- }
- }
-
- /**
- * Sets the text to the given text.
- *
- * @param text the text to use
- */
- public void setText(String text) {
- if (text == null) {
- text= ""; //$NON-NLS-1$
- }
- if (!text.equals(fElementText.getText())) {
- fElementText.setText(text);
- }
- }
-
- /**
- * Returns the width of this element.
- *
- * @return current width of this element
- */
- public int getWidth() {
- int result= 2;
-
- if (fElementImage.getImage() != null)
- result+= fElementImage.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
-
- if (fTextVisible && fElementText.getText().length() > 0)
- result+= fElementText.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
-
- return result;
- }
-
- public void setTextVisible(boolean enabled) {
- if (fTextVisible == enabled)
- return;
-
- fTextVisible= enabled;
-
- GridData data= (GridData) fTextComposite.getLayoutData();
- data.exclude= !enabled;
- fTextComposite.setVisible(enabled);
-
- if (fTextVisible) {
- fDetailComposite.setTabList(new Control[] { fTextComposite });
- } else {
- fDetailComposite.setTabList(new Control[] { fImageComposite });
- }
-
- if (fHasFocus) {
- if (isTextVisible()) {
- fTextComposite.setFocus();
- } else {
- fImageComposite.setFocus();
- }
- }
- updateSelection();
- }
-
- /**
- * Tells whether this item shows a text or only an image.
- *
- * @return <code>true</code> if it shows a text and an image, false if it only shows the image
- */
- public boolean isTextVisible() {
- return fTextVisible;
- }
-
- public void setSelected(boolean selected) {
- if (selected == fSelected)
- return;
-
- fSelected= selected;
-
- updateSelection();
- }
-
- public void setFocus(boolean enabled) {
- if (enabled == fHasFocus)
- return;
-
- fHasFocus= enabled;
- if (fHasFocus) {
- if (isTextVisible()) {
- fTextComposite.setFocus();
- } else {
- fImageComposite.setFocus();
- }
- }
- updateSelection();
- }
-
- private void updateSelection() {
- Color background;
- Color foreground;
-
- if (fSelected) {
- background= Display.getDefault().getSystemColor(SWT.COLOR_LIST_SELECTION);
- foreground= Display.getDefault().getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT);
- } else {
- foreground= null;
- background= null;
- }
-
- if (isTextVisible()) {
- fTextComposite.setBackground(background);
- fElementText.setBackground(background);
- fElementText.setForeground(foreground);
-
- fImageComposite.setBackground(null);
- fElementImage.setBackground(null);
- } else {
- fImageComposite.setBackground(background);
- fElementImage.setBackground(background);
-
- fTextComposite.setBackground(null);
- fElementText.setBackground(null);
- fElementText.setForeground(null);
- }
-
- fTextComposite.redraw();
- fImageComposite.redraw();
- }
-
- /**
- * Install focus and key listeners to the given composite.
- *
- * @param composite the composite which may get focus
- */
- private void installFocusComposite(Composite composite) {
- composite.addTraverseListener(new TraverseListener() {
- public void keyTraversed(TraverseEvent e) {
- if (e.detail == SWT.TRAVERSE_TAB_NEXT || e.detail == SWT.TRAVERSE_TAB_PREVIOUS) {
- int index= fParent.getViewer().getIndexOfItem(fParent);
- if (e.detail == SWT.TRAVERSE_TAB_NEXT) {
- index++;
- } else {
- index--;
- }
-
- if (index > 0 && index < fParent.getViewer().getItemCount()) {
- fParent.getViewer().selectItem(fParent.getViewer().getItem(index));
- }
-
- e.doit= true;
- }
- }
- });
- composite.addKeyListener(new KeyListener() {
- public void keyPressed(KeyEvent e) {
- BreadcrumbViewer viewer= fParent.getViewer();
-
- switch (e.keyCode) {
- case SWT.ARROW_LEFT:
- if (fSelected) {
- viewer.doTraverse(false);
- e.doit= false;
- } else {
- viewer.selectItem(fParent);
- }
- break;
- case SWT.ARROW_RIGHT:
- if (fSelected) {
- viewer.doTraverse(true);
- e.doit= false;
- } else {
- viewer.selectItem(fParent);
- }
- break;
- case SWT.ARROW_DOWN:
- case SWT.ARROW_UP:
- case SWT.KEYPAD_ADD:
- if (!fSelected) {
- viewer.selectItem(fParent);
- }
- openDropDown();
- e.doit= false;
- break;
- case SWT.CR:
- if (!fSelected) {
- viewer.selectItem(fParent);
- }
- viewer.fireOpen();
- break;
- default:
- if (e.character == ' ') {
- if (!fSelected) {
- viewer.selectItem(fParent);
- }
- openDropDown();
- e.doit= false;
- }
- break;
- }
- }
-
- private void openDropDown() {
- Shell shell = fParent.getDropDownShell();
- if (shell == null) {
- fParent.openDropDownMenu();
- shell = fParent.getDropDownShell();
- }
- shell.setFocus();
- }
-
- public void keyReleased(KeyEvent e) {
- }
- });
-
- composite.addFocusListener(new FocusListener() {
- public void focusGained(FocusEvent e) {
- if (!fHasFocus) {
- fHasFocus= true;
- updateSelection();
- }
- }
-
- public void focusLost(FocusEvent e) {
- if (fHasFocus) {
- fHasFocus= false;
- updateSelection();
- }
- }
- });
- }
-
- /**
- * Add mouse listeners to the given control.
- *
- * @param control the control to which may be clicked
- */
- private void addElementListener(Control control) {
- control.addMouseListener(new MouseListener() {
- public void mouseDoubleClick(MouseEvent e) {
- }
-
- public void mouseDown(MouseEvent e) {
- BreadcrumbViewer viewer= fParent.getViewer();
- Shell shell= fParent.getDropDownShell();
- viewer.selectItem(fParent);
- if (shell == null && e.button == 1 && e.stateMask == 0) {
- fParent.getViewer().fireDoubleClick();
- }
- }
-
- public void mouseUp(MouseEvent e) {
- }
- });
- control.addMenuDetectListener(new MenuDetectListener() {
- public void menuDetected(MenuDetectEvent e) {
- BreadcrumbViewer viewer= fParent.getViewer();
- viewer.selectItem(fParent);
- fParent.getViewer().fireMenuDetect(e);
- }
- });
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java
deleted file mode 100644
index c601a4bd2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java
+++ /dev/null
@@ -1,562 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech (Wind River) - adapted breadcrumb for use in Debug view (Bug 252677)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.breadcrumb;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.jface.resource.CompositeImageDescriptor;
-import org.eclipse.jface.util.Geometry;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.ShellEvent;
-import org.eclipse.swt.events.ShellListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Monitor;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.Widget;
-
-
-/**
- * The part of the breadcrumb item with the drop down menu.
- *
- * @since 3.5
- */
-class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite {
-
- /**
- * Tells whether this class is in debug mode.
- */
- private static boolean DEBUG= DebugUIPlugin.DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.debug.ui/debug/breadcrumb")); //$NON-NLS-1$//$NON-NLS-2$
-
- private static final boolean IS_MAC_WORKAROUND= "carbon".equals(SWT.getPlatform()); //$NON-NLS-1$
-
- /**
- * An arrow image descriptor. The images color is related to the list
- * fore- and background color. This makes the arrow visible even in high contrast
- * mode. If <code>ltr</code> is true the arrow points to the right, otherwise it
- * points to the left.
- */
- private final class AccessibelArrowImage extends CompositeImageDescriptor {
-
- private final static int ARROW_SIZE= 5;
-
- private final boolean fLTR;
-
- public AccessibelArrowImage(boolean ltr) {
- fLTR= ltr;
- }
-
- /*
- * @see org.eclipse.jface.resource.CompositeImageDescriptor#drawCompositeImage(int, int)
- */
- protected void drawCompositeImage(int width, int height) {
- Display display= fParentComposite.getDisplay();
-
- Image image= new Image(display, ARROW_SIZE, ARROW_SIZE * 2);
-
- GC gc= new GC(image);
-
- Color triangle= createColor(SWT.COLOR_LIST_FOREGROUND, SWT.COLOR_LIST_BACKGROUND, 20, display);
- Color aliasing= createColor(SWT.COLOR_LIST_FOREGROUND, SWT.COLOR_LIST_BACKGROUND, 30, display);
- gc.setBackground(triangle);
-
- if (fLTR) {
- gc.fillPolygon(new int[] { mirror(0), 0, mirror(ARROW_SIZE), ARROW_SIZE, mirror(0), ARROW_SIZE * 2 });
- } else {
- gc.fillPolygon(new int[] { ARROW_SIZE, 0, 0, ARROW_SIZE, ARROW_SIZE, ARROW_SIZE * 2 });
- }
-
- gc.setForeground(aliasing);
- gc.drawLine(mirror(0), 1, mirror(ARROW_SIZE - 1), ARROW_SIZE);
- gc.drawLine(mirror(ARROW_SIZE - 1), ARROW_SIZE, mirror(0), ARROW_SIZE * 2 - 1);
-
- gc.dispose();
- triangle.dispose();
- aliasing.dispose();
-
- ImageData imageData= image.getImageData();
- for (int y= 1; y < ARROW_SIZE; y++) {
- for (int x= 0; x < y; x++) {
- imageData.setAlpha(mirror(x), y, 255);
- }
- }
- for (int y= 0; y < ARROW_SIZE; y++) {
- for (int x= 0; x <= y; x++) {
- imageData.setAlpha(mirror(x), ARROW_SIZE * 2 - y - 1, 255);
- }
- }
-
- int offset= fLTR ? 0 : -1;
- drawImage(imageData, (width / 2) - (ARROW_SIZE / 2) + offset, (height / 2) - ARROW_SIZE - 1);
-
- image.dispose();
- }
-
- private int mirror(int x) {
- if (fLTR)
- return x;
-
- return ARROW_SIZE - x - 1;
- }
-
- /*
- * @see org.eclipse.jface.resource.CompositeImageDescriptor#getSize()
- */
- protected Point getSize() {
- return new Point(10, 16);
- }
-
- private Color createColor(int color1, int color2, int ratio, Display display) {
- RGB rgb1= display.getSystemColor(color1).getRGB();
- RGB rgb2= display.getSystemColor(color2).getRGB();
-
- RGB blend= BreadcrumbViewer.blend(rgb2, rgb1, ratio);
-
- return new Color(display, blend);
- }
- }
-
- private static final int DROP_DOWN_HIGHT= 300;
- private static final int DROP_DOWN_WIDTH= 500;
-
- private final BreadcrumbItem fParent;
- private final Composite fParentComposite;
- private final ToolBar fToolBar;
-
- private boolean fMenuIsShown;
- private boolean fEnabled;
- private Shell fShell;
-
- public BreadcrumbItemDropDown(BreadcrumbItem parent, Composite composite) {
- fParent= parent;
- fParentComposite= composite;
- fMenuIsShown= false;
- fEnabled= true;
-
- fToolBar= new ToolBar(composite, SWT.FLAT);
- fToolBar.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
- fToolBar.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
- e.result= BreadcrumbMessages.BreadcrumbItemDropDown_showDropDownMenu_action_toolTip;
- }
- });
- ToolBarManager manager= new ToolBarManager(fToolBar);
-
- final Action showDropDownMenuAction= new Action(null, SWT.NONE) {
- public void run() {
- Shell shell= fParent.getDropDownShell();
- if (shell != null)
- return;
-
- shell= fParent.getViewer().getDropDownShell();
- if (shell != null && !shell.isDisposed())
- shell.close();
-
- showMenu();
-
- fShell.setFocus();
- }
- };
-
- showDropDownMenuAction.setImageDescriptor(new AccessibelArrowImage(isLeft()));
- showDropDownMenuAction.setToolTipText(BreadcrumbMessages.BreadcrumbItemDropDown_showDropDownMenu_action_toolTip);
- manager.add(showDropDownMenuAction);
-
- manager.update(true);
- if (IS_MAC_WORKAROUND) {
- manager.getControl().addMouseListener(new MouseAdapter() {
- // see also BreadcrumbItemDetails#addElementListener(Control)
- public void mouseDown(MouseEvent e) {
- showDropDownMenuAction.run();
- }
- });
- }
- }
-
- /**
- * Return the width of this element.
- *
- * @return the width of this element
- */
- public int getWidth() {
- return fToolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
- }
-
- /**
- * Set whether the drop down menu is available.
- *
- * @param enabled true if available
- */
- public void setEnabled(boolean enabled) {
- fEnabled= enabled;
-
- fToolBar.setVisible(enabled);
- }
-
- /**
- * Tells whether the menu is shown.
- *
- * @return true if the menu is open
- */
- public boolean isMenuShown() {
- return fMenuIsShown;
- }
-
- /**
- * Returns the shell used for the drop down menu if it is shown.
- *
- * @return the drop down shell or <code>null</code>
- */
- public Shell getDropDownShell() {
- if (!isMenuShown())
- return null;
-
- return fShell;
- }
-
- /**
- * Opens the drop down menu.
- */
- public void showMenu() {
- if (DEBUG)
- System.out.println("BreadcrumbItemDropDown.showMenu()"); //$NON-NLS-1$
-
- if (!fEnabled || fMenuIsShown)
- return;
-
- fMenuIsShown= true;
-
- fShell= new Shell(fToolBar.getShell(), SWT.RESIZE | SWT.TOOL | SWT.ON_TOP);
- if (DEBUG)
- System.out.println(" creating new shell"); //$NON-NLS-1$
-
- GridLayout layout= new GridLayout(1, false);
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- fShell.setLayout(layout);
-
- Composite composite= new Composite(fShell, SWT.NONE);
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- GridLayout gridLayout= new GridLayout(1, false);
- gridLayout.marginHeight= 0;
- gridLayout.marginWidth= 0;
- composite.setLayout(gridLayout);
-
- TreePath path= fParent.getPath();
-
- Control control = fParent.getViewer().createDropDown(composite, this, path);
-
- control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- setShellBounds(fShell);
- fShell.setVisible(true);
- installCloser(fShell);
- }
-
- /**
- * The closer closes the given shell when the focus is lost.
- *
- * @param shell the shell to install the closer to
- */
- private void installCloser(final Shell shell) {
- final Listener focusListener= new Listener() {
- public void handleEvent(Event event) {
- Widget focusElement= event.widget;
- boolean isFocusBreadcrumbTreeFocusWidget= focusElement == shell || focusElement instanceof Control && ((Control)focusElement).getShell() == shell;
- boolean isFocusWidgetParentShell= focusElement instanceof Control && ((Control)focusElement).getShell().getParent() == shell;
-
- switch (event.type) {
- case SWT.FocusIn:
- if (DEBUG)
- System.out.println("focusIn - is breadcrumb tree: " + isFocusBreadcrumbTreeFocusWidget); //$NON-NLS-1$
-
- if (!isFocusBreadcrumbTreeFocusWidget && !isFocusWidgetParentShell) {
- if (DEBUG)
- System.out.println("==> closing shell since focus in other widget"); //$NON-NLS-1$
- shell.close();
- }
- break;
-
- case SWT.FocusOut:
- if (DEBUG)
- System.out.println("focusOut - is breadcrumb tree: " + isFocusBreadcrumbTreeFocusWidget); //$NON-NLS-1$
-
- if (event.display.getActiveShell() == null) {
- if (DEBUG)
- System.out.println("==> closing shell since event.display.getActiveShell() != shell"); //$NON-NLS-1$
- shell.close();
- }
- break;
-
- default:
- Assert.isTrue(false);
- }
- }
- };
-
- final Display display= shell.getDisplay();
- display.addFilter(SWT.FocusIn, focusListener);
- display.addFilter(SWT.FocusOut, focusListener);
-
- final ControlListener controlListener= new ControlListener() {
- public void controlMoved(ControlEvent e) {
- if (!shell.isDisposed()) {
- shell.close();
- }
- }
-
- public void controlResized(ControlEvent e) {
- if (!shell.isDisposed()) {
- shell.close();
- }
- }
- };
- fToolBar.getShell().addControlListener(controlListener);
-
- shell.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- if (DEBUG)
- System.out.println("==> shell disposed"); //$NON-NLS-1$
-
- display.removeFilter(SWT.FocusIn, focusListener);
- display.removeFilter(SWT.FocusOut, focusListener);
-
- if (!fToolBar.isDisposed()) {
- fToolBar.getShell().removeControlListener(controlListener);
- }
- }
- });
- shell.addShellListener(new ShellListener() {
- public void shellActivated(ShellEvent e) {
- }
-
- public void shellClosed(ShellEvent e) {
- if (DEBUG)
- System.out.println("==> shellClosed"); //$NON-NLS-1$
-
- if (!fMenuIsShown)
- return;
-
- fMenuIsShown= false;
- }
-
- public void shellDeactivated(ShellEvent e) {
- }
-
- public void shellDeiconified(ShellEvent e) {
- }
-
- public void shellIconified(ShellEvent e) {
- }
- });
- }
-
- /**
- * Calculates a useful size for the given shell.
- *
- * @param shell the shell to calculate the size for.
- */
- private void setShellBounds(Shell shell) {
-
- Rectangle rect= fParentComposite.getBounds();
- Rectangle toolbarBounds= fToolBar.getBounds();
-
- Point size = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT, false);
- int height= Math.min(size.y, DROP_DOWN_HIGHT);
- // TODO: Because of bug 258196 the drop down does not resize correctly
- // on GTK. As a workaround temporarily increase the initial width of
- // the drop down to 500.
- //int width= Math.max(Math.min(size.x, DROP_DOWN_WIDTH), 250);
- int width= Math.max(Math.min(size.x, DROP_DOWN_WIDTH), 500);
-
- int imageBoundsX= 0;
- if (fParent.getImage() != null) {
- imageBoundsX= fParent.getImage().getImageData().width;
- }
-
- Rectangle trim= fShell.computeTrim(0, 0, width, height);
- int x= toolbarBounds.x + toolbarBounds.width + 2 + trim.x - imageBoundsX;
- if (!isLeft())
- x+= width;
-
- int y = rect.y;
- if (isTop())
- y+= rect.height;
- else
- y-= height;
-
- Point pt= new Point(x, y);
- pt= fParentComposite.toDisplay(pt);
-
- Rectangle monitor= getClosestMonitor(shell.getDisplay(), pt).getClientArea();
- int overlap= (pt.x + width) - (monitor.x + monitor.width);
- if (overlap > 0)
- pt.x-= overlap;
- if (pt.x < monitor.x)
- pt.x= monitor.x;
-
- shell.setLocation(pt);
- shell.setSize(width, height);
- }
-
- /**
- * Returns the monitor whose client area contains the given point. If no monitor contains the
- * point, returns the monitor that is closest to the point.
- * <p>
- * Copied from <code>org.eclipse.jface.window.Window.getClosestMonitor(Display, Point)</code>
- * </p>
- *
- * @param display the display showing the monitors
- * @param point point to find (display coordinates)
- * @return the monitor closest to the given point
- */
- private static Monitor getClosestMonitor(Display display, Point point) {
- int closest= Integer.MAX_VALUE;
-
- Monitor[] monitors= display.getMonitors();
- Monitor result= monitors[0];
-
- for (int i= 0; i < monitors.length; i++) {
- Monitor current= monitors[i];
-
- Rectangle clientArea= current.getClientArea();
-
- if (clientArea.contains(point))
- return current;
-
- int distance= Geometry.distanceSquared(Geometry.centerPoint(clientArea), point);
- if (distance < closest) {
- closest= distance;
- result= current;
- }
- }
-
- return result;
- }
-
- /**
- * Set the size of the given shell such that more content can be shown. The shell size does not
- * exceed {@link #DROP_DOWN_HIGHT} and {@link #DROP_DOWN_WIDTH}.
- *
- * @param shell the shell to resize
- */
- private void resizeShell(final Shell shell) {
- Point size= shell.getSize();
- int currentWidth= size.x;
- int currentHeight= size.y;
-
- if (currentHeight >= DROP_DOWN_HIGHT && currentWidth >= DROP_DOWN_WIDTH)
- return;
-
- Point preferedSize= shell.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
-
- int newWidth;
- if (currentWidth >= DROP_DOWN_WIDTH) {
- newWidth= currentWidth;
- } else {
- newWidth= Math.min(Math.max(preferedSize.x, currentWidth), DROP_DOWN_WIDTH);
- }
- int newHeight;
- if (currentHeight >= DROP_DOWN_HIGHT) {
- newHeight= currentHeight;
- } else {
- newHeight= Math.min(Math.max(preferedSize.y, currentHeight), DROP_DOWN_HIGHT);
- }
-
- if (newHeight != currentHeight || newWidth != currentWidth) {
- shell.setRedraw(false);
- try {
- shell.setSize(newWidth, newHeight);
-
- Point location = shell.getLocation();
- Point newLocation = location;
- if (!isLeft()) {
- newLocation = new Point(newLocation.x - (newWidth - currentWidth), newLocation.y);
- }
- if (!isTop()) {
- newLocation = new Point(newLocation.x, newLocation.y - (newHeight - currentHeight));
- }
- if (!location.equals(newLocation)) {
- shell.setLocation(newLocation.x, newLocation.y);
- }
- } finally {
- shell.setRedraw(true);
- }
- }
- }
-
- /**
- * Tells whether this the breadcrumb is in LTR mode or RTL mode. Or whether the breadcrumb
- * is on the right-side status coolbar, which has the same effect on layout.
- *
- * @return <code>true</code> if the breadcrumb in left-to-right mode, <code>false</code>
- * otherwise
- */
- private boolean isLeft() {
- return (fParentComposite.getStyle() & SWT.RIGHT_TO_LEFT) == 0 &&
- (fParent.getViewer().getStyle() & SWT.RIGHT) == 0;
- }
-
- /**
- * Tells whether this the breadcrumb is in LTR mode or RTL mode. Or whether the breadcrumb
- * is on the right-side status coolbar, which has the same effect on layout.
- *
- * @return <code>true</code> if the breadcrumb in left-to-right mode, <code>false</code>
- * otherwise
- */
- private boolean isTop() {
- return (fParent.getViewer().getStyle() & SWT.BOTTOM) == 0;
- }
-
- public void close() {
- if (fShell != null && !fShell.isDisposed()) {
- fShell.close();
- }
- }
-
- public void notifySelection(ISelection selection) {
- fParent.getViewer().fireMenuSelection(selection);
- }
-
- public void updateSize() {
- if (fShell != null && !fShell.isDisposed()) {
- resizeShell(fShell);
- }
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbMessages.java
deleted file mode 100644
index e9f6e88bc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbMessages.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech (Wind River) - adapted breadcrumb for use in Debug view (Bug 252677)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.breadcrumb;
-
-import org.eclipse.osgi.util.NLS;
-
-
-/**
- * Helper class to get NLSed messages.
- *
- * @since 3.5
- */
-public class BreadcrumbMessages extends NLS {
-
- private static final String BUNDLE_NAME= BreadcrumbMessages.class.getName();
-
- public static String BreadcrumbItemDropDown_showDropDownMenu_action_toolTip;
-
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, BreadcrumbMessages.class);
- }
-
- private BreadcrumbMessages() {
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbMessages.properties
deleted file mode 100644
index a584ca2de..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbMessages.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2009 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-# Pawel Piech (Wind River) - adapted breadcrumb for use in Debug view (Bug 252677)
-###############################################################################
-
-BreadcrumbItemDropDown_showDropDownMenu_action_toolTip=Show Children
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java
deleted file mode 100644
index 52ec2db1c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java
+++ /dev/null
@@ -1,876 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech (Wind River) - adapted breadcrumb for use in Debug view (Bug 252677)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.breadcrumb;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ITreePathContentProvider;
-import org.eclipse.jface.viewers.ITreePathLabelProvider;
-import org.eclipse.jface.viewers.OpenEvent;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.ViewerLabel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.MenuDetectEvent;
-import org.eclipse.swt.events.MenuDetectListener;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Widget;
-
-
-/**
- * A breadcrumb viewer shows a the parent chain of its input element in a list. Each breadcrumb item
- * of that list can be expanded and a sibling of the element presented by the breadcrumb item can be
- * selected.
- * <p>
- * Content providers for breadcrumb viewers must implement the <code>ITreePathContentProvider</code>
- * interface.
- * </p>
- * <p>
- * Label providers for breadcrumb viewers must implement the <code>ITreePathLabelProvider</code> interface.
- * </p>
- *
- * @since 3.5
- */
-public abstract class BreadcrumbViewer extends StructuredViewer {
-
- private static final boolean IS_GTK= "gtk".equals(SWT.getPlatform()); //$NON-NLS-1$
-
- private final int fStyle;
- private final Composite fContainer;
- private final ArrayList fBreadcrumbItems;
- private final ListenerList fMenuListeners;
-
- private Image fGradientBackground;
- private BreadcrumbItem fSelectedItem;
-
- /**
- * Create a new <code>BreadcrumbViewer</code>.
- * <p>
- * Style is one of:
- * <ul>
- * <li>SWT.NONE</li>
- * <li>SWT.VERTICAL</li>
- * <li>SWT.HORIZONTAL</li>
- * <li>SWT.BOTTOM</li>
- * <li>SWT.RIGHT</li>
- * </ul>
- *
- * @param parent the container for the viewer
- * @param style the style flag used for this viewer
- */
- public BreadcrumbViewer(Composite parent, int style) {
- fStyle = style;
- fBreadcrumbItems= new ArrayList();
- fMenuListeners= new ListenerList();
-
- fContainer= new Composite(parent, SWT.NONE);
- GridData layoutData= new GridData(SWT.FILL, SWT.TOP, true, false);
- fContainer.setLayoutData(layoutData);
- fContainer.addTraverseListener(new TraverseListener() {
- public void keyTraversed(TraverseEvent e) {
- e.doit= true;
- }
- });
- fContainer.setBackgroundMode(SWT.INHERIT_DEFAULT);
-
- fContainer.addListener(SWT.Resize, new Listener() {
- public void handleEvent(Event event) {
- int height= fContainer.getClientArea().height;
-
- if (fGradientBackground == null || fGradientBackground.getBounds().height != height) {
- Image image= createGradientImage(height, event.display);
- fContainer.setBackgroundImage(image);
-
- if (fGradientBackground != null)
- fGradientBackground.dispose();
- fGradientBackground= image;
- }
- }
- });
-
-
- fContainer.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- if (fGradientBackground != null) {
- fGradientBackground.dispose();
- fGradientBackground = null;
- }
- }
- });
-
- hookControl(fContainer);
-
- int columns= 1000;
- if ((SWT.VERTICAL & style) != 0) {
- columns= 2;
- }
-
- GridLayout gridLayout= new GridLayout(columns, false);
- gridLayout.marginWidth= 0;
- gridLayout.marginHeight= 0;
- gridLayout.verticalSpacing= 0;
- gridLayout.horizontalSpacing= 0;
- fContainer.setLayout(gridLayout);
-
- fContainer.addListener(SWT.Resize, new Listener() {
- public void handleEvent(Event event) {
- updateSize();
- fContainer.layout(true, true);
- }
- });
- }
-
- int getStyle() {
- return fStyle;
- }
-
- /**
- * Configure the given drop down viewer. The given input is used for the viewers input. Clients
- * must at least set the label and the content provider for the viewer.
- *
- * @param viewer the viewer to configure
- * @param input the input for the viewer
- */
- protected abstract Control createDropDown(Composite parent, IBreadcrumbDropDownSite site, TreePath path);
-
- /*
- * @see org.eclipse.jface.viewers.Viewer#getControl()
- */
- public Control getControl() {
- return fContainer;
- }
-
- /*
- * @see org.eclipse.jface.viewers.StructuredViewer#reveal(java.lang.Object)
- */
- public void reveal(Object element) {
- //all elements are always visible
- }
-
- /**
- * Transfers the keyboard focus into the viewer.
- */
- public void setFocus() {
- fContainer.setFocus();
-
- if (fSelectedItem != null) {
- fSelectedItem.setFocus(true);
- } else {
- if (fBreadcrumbItems.size() == 0)
- return;
-
- BreadcrumbItem item= (BreadcrumbItem) fBreadcrumbItems.get(fBreadcrumbItems.size() - 1);
- item.setFocus(true);
- }
- }
-
- /**
- * @return true if any of the items in the viewer is expanded
- */
- public boolean isDropDownOpen() {
- for (int i= 0, size= fBreadcrumbItems.size(); i < size; i++) {
- BreadcrumbItem item= (BreadcrumbItem) fBreadcrumbItems.get(i);
- if (item.isMenuShown())
- return true;
- }
-
- return false;
- }
-
- /**
- * The shell used for the shown drop down or <code>null</code>
- * if no drop down is shown at the moment.
- *
- * @return the drop downs shell or <code>null</code>
- */
- public Shell getDropDownShell() {
- for (int i= 0, size= fBreadcrumbItems.size(); i < size; i++) {
- BreadcrumbItem item= (BreadcrumbItem) fBreadcrumbItems.get(i);
- if (item.isMenuShown())
- return item.getDropDownShell();
- }
-
- return null;
- }
-
- /**
- * Add the given listener to the set of listeners which will be informed
- * when a context menu is requested for a breadcrumb item.
- *
- * @param listener the listener to add
- */
- public void addMenuDetectListener(MenuDetectListener listener) {
- fMenuListeners.add(listener);
- }
-
- /**
- * Remove the given listener from the set of menu detect listeners.
- * Does nothing if the listener is not element of the set.
- *
- * @param listener the listener to remove
- */
- public void removeMenuDetectListener(MenuDetectListener listener) {
- fMenuListeners.remove(listener);
- }
-
- /*
- * @see org.eclipse.jface.viewers.StructuredViewer#assertContentProviderType(org.eclipse.jface.viewers.IContentProvider)
- */
- protected void assertContentProviderType(IContentProvider provider) {
- super.assertContentProviderType(provider);
- Assert.isTrue(provider instanceof ITreePathContentProvider);
- }
-
- /*
- * @see org.eclipse.jface.viewers.Viewer#inputChanged(java.lang.Object, java.lang.Object)
- */
- protected void inputChanged(final Object input, Object oldInput) {
- if (fContainer.isDisposed())
- return;
-
- disableRedraw();
- try {
- preservingSelection(new Runnable() {
- public void run() {
- buildItemChain(input);
- }
- });
- } finally {
- enableRedraw();
- }
- }
-
- /*
- * @see org.eclipse.jface.viewers.StructuredViewer#doFindInputItem(java.lang.Object)
- */
- protected Widget doFindInputItem(Object element) {
- if (element == null)
- return null;
-
- if (element == getInput() || element.equals(getInput()))
- return doFindItem(element);
-
- return null;
- }
-
- /*
- * @see org.eclipse.jface.viewers.StructuredViewer#doFindItem(java.lang.Object)
- */
- protected Widget doFindItem(Object element) {
- if (element == null)
- return null;
-
- for (int i= 0, size= fBreadcrumbItems.size(); i < size; i++) {
- BreadcrumbItem item= (BreadcrumbItem) fBreadcrumbItems.get(i);
- if (item.getData() == element || element.equals(item.getData()))
- return item;
- }
-
- return null;
- }
-
- /*
- * @see org.eclipse.jface.viewers.StructuredViewer#doUpdateItem(org.eclipse.swt.widgets.Widget, java.lang.Object, boolean)
- */
- protected void doUpdateItem(Widget widget, Object element, boolean fullMap) {
- myDoUpdateItem(widget, element, fullMap);
- }
-
- private boolean myDoUpdateItem(Widget widget, Object element, boolean fullMap) {
- if (widget instanceof BreadcrumbItem) {
- final BreadcrumbItem item= (BreadcrumbItem) widget;
-
- // remember element we are showing
- if (fullMap) {
- associate(element, item);
- } else {
- Object data= item.getData();
- if (data != null) {
- unmapElement(data, item);
- }
- item.setData(element);
- mapElement(element, item);
- }
-
- refreshItem(item);
- }
- return false;
- }
-
- /**
- * This implementation of getSelection() returns an instance of
- * ITreeSelection.
- */
- public ISelection getSelection() {
- Control control = getControl();
- if (control == null || control.isDisposed()) {
- return TreeSelection.EMPTY;
- }
- if (fSelectedItem != null) {
- TreePath path = getTreePathFromItem(fSelectedItem);
- if (path != null) {
- return new TreeSelection(new TreePath[] { path });
- }
- }
- return TreeSelection.EMPTY;
- }
-
- protected TreePath getTreePathFromItem(BreadcrumbItem item) {
- List elements = new ArrayList(fBreadcrumbItems.size());
- for (int i = 0; i < fBreadcrumbItems.size(); i++) {
- elements.add( ((BreadcrumbItem)fBreadcrumbItems.get(i)).getData() );
- if (fBreadcrumbItems.get(i).equals(item)) {
- return new TreePath(elements.toArray());
- }
- }
- return null;
- }
-
- /*
- * @see org.eclipse.jface.viewers.StructuredViewer#getSelectionFromWidget()
- */
- protected List getSelectionFromWidget() {
- if (fSelectedItem == null)
- return Collections.EMPTY_LIST;
-
- if (fSelectedItem.getData() == null)
- return Collections.EMPTY_LIST;
-
- ArrayList result= new ArrayList();
- result.add(fSelectedItem.getData());
- return result;
- }
-
- /*
- * @see org.eclipse.jface.viewers.StructuredViewer#internalRefresh(java.lang.Object)
- */
- protected void internalRefresh(Object element) {
-
- disableRedraw();
- try {
- boolean layoutChanged = false;
-
- BreadcrumbItem item= (BreadcrumbItem) doFindItem(element);
- if (item == null || element != null && element.equals(getInput())) {
- for (int i= 0, size= fBreadcrumbItems.size(); i < size; i++) {
- BreadcrumbItem item1= (BreadcrumbItem) fBreadcrumbItems.get(i);
- layoutChanged = refreshItem(item1) || layoutChanged;
- }
- } else {
- layoutChanged = refreshItem(item) || layoutChanged;
- }
-
- if (layoutChanged) {
- updateSize();
- fContainer.layout(true, true);
- }
- } finally {
- enableRedraw();
- }
- }
-
- /*
- * @see org.eclipse.jface.viewers.StructuredViewer#setSelectionToWidget(java.util.List, boolean)
- */
- protected void setSelectionToWidget(List l, boolean reveal) {
- BreadcrumbItem focusItem= null;
-
- // Unselect the currently selected items, and remember the focused item.
- for (int i= 0, size= fBreadcrumbItems.size(); i < size; i++) {
- BreadcrumbItem item= (BreadcrumbItem) fBreadcrumbItems.get(i);
- if (item.hasFocus())
- focusItem= item;
-
- item.setSelected(false);
- }
-
- if (l == null) {
- l = Collections.EMPTY_LIST;
- }
-
- // Set the new selection to items.
- fSelectedItem = null;
- for (Iterator iterator= l.iterator(); iterator.hasNext();) {
- Object element= iterator.next();
- BreadcrumbItem item= (BreadcrumbItem) doFindItem(element);
- if (item != null) {
- item.setSelected(true);
- fSelectedItem= item;
- if (item == focusItem) {
- focusItem = null;
- }
- }
- }
-
- // If there is a new selection, and it does not overlap the old selection,
- // remove the focus marker from the old focus item.
- if (fSelectedItem != null && focusItem != null) {
- focusItem.setFocus(false);
- }
- }
-
- /**
- * Set a single selection to the given item. <code>null</code> to deselect all.
- *
- * @param item the item to select or <code>null</code>
- */
- void selectItem(BreadcrumbItem item) {
- if (fSelectedItem != null)
- fSelectedItem.setSelected(false);
-
- fSelectedItem= item;
- setSelectionToWidget(getSelection(), false);
- setFocus();
-
- fireSelectionChanged(new SelectionChangedEvent(this, getSelection()));
- }
-
- /**
- * Returns the item count.
- *
- * @return number of items shown in the viewer
- */
- int getItemCount() {
- return fBreadcrumbItems.size();
- }
-
- /**
- * Returns the item for the given item index.
- *
- * @param index the index of the item
- * @return the item ad the given <code>index</code>
- */
- BreadcrumbItem getItem(int index) {
- return (BreadcrumbItem) fBreadcrumbItems.get(index);
- }
-
- /**
- * Returns the index of the given item.
- *
- * @param item the item to search
- * @return the index of the item or -1 if not found
- */
- int getIndexOfItem(BreadcrumbItem item) {
- for (int i= 0, size= fBreadcrumbItems.size(); i < size; i++) {
- BreadcrumbItem pItem= (BreadcrumbItem) fBreadcrumbItems.get(i);
- if (pItem == item)
- return i;
- }
-
- return -1;
- }
-
- /**
- * Notifies all double click listeners.
- */
- void fireDoubleClick() {
- fireDoubleClick(new DoubleClickEvent(this, getSelection()));
- }
-
- /**
- * Notifies all open listeners.
- */
- void fireOpen() {
- fireOpen(new OpenEvent(this, getSelection()));
- }
-
- /**
- * The given element was selected from a drop down menu.
- *
- * @param element the selected element
- */
- void fireMenuSelection(ISelection selection) {
- fireOpen(new OpenEvent(this, selection));
- }
-
- /**
- * A context menu has been requested for the selected breadcrumb item.
- *
- * @param event the event issued the menu detection
- */
- void fireMenuDetect(MenuDetectEvent event) {
- Object[] listeners= fMenuListeners.getListeners();
- for (int i= 0; i < listeners.length; i++) {
- ((MenuDetectListener)listeners[i]).menuDetected(event);
- }
- }
-
- /**
- * Set selection to the next or previous element if possible.
- *
- * @param next <code>true</code> if the next element should be selected, otherwise the previous
- * one will be selected
- */
- void doTraverse(boolean next) {
- if (fSelectedItem == null)
- return;
-
- int index= fBreadcrumbItems.indexOf(fSelectedItem);
- if (next) {
- if (index == fBreadcrumbItems.size() - 1) {
- BreadcrumbItem current= (BreadcrumbItem) fBreadcrumbItems.get(index);
-
- current.openDropDownMenu();
- current.getDropDownShell().setFocus();
- } else {
- BreadcrumbItem nextItem= (BreadcrumbItem) fBreadcrumbItems.get(index + 1);
- selectItem(nextItem);
- }
- } else {
- if (index == 0) {
- BreadcrumbItem root= (BreadcrumbItem) fBreadcrumbItems.get(index);
- root.openDropDownMenu();
- root.getDropDownShell().setFocus();
- } else {
- selectItem((BreadcrumbItem) fBreadcrumbItems.get(index - 1));
- }
- }
- }
-
- /**
- * Generates the parent chain of the given element.
- *
- * @param element element to build the parent chain for
- * @return the first index of an item in fBreadcrumbItems which is not
- * part of the chain
- */
- private void buildItemChain(Object input) {
- if (fBreadcrumbItems.size() > 0) {
- BreadcrumbItem last= (BreadcrumbItem) fBreadcrumbItems.get(fBreadcrumbItems.size() - 1);
- last.setIsLastItem(false);
- }
-
- int index = 0;
- boolean updateLayout = false;
- if (input != null) {
- ITreePathContentProvider contentProvider= (ITreePathContentProvider) getContentProvider();
- TreePath path = new TreePath(new Object[0]);
-
- // Top level elements need to be retrieved using getElements(), rest
- // using getChildren().
- Object[] children = contentProvider.getElements(input);
- Object element = children != null && children.length != 0 ? children[0] : null;
- while (element != null) {
- path = path.createChildPath(element);
-
- // All but last item are hidden if the viewer is in a vertical toolbar.
- children = contentProvider.getChildren(path);
- if ((getStyle() & SWT.VERTICAL) == 0 || children == null || children.length == 0) {
- updateLayout = updateOrCreateItem(index++, path, element) || updateLayout;
- }
-
- if (children != null && children.length != 0) {
- element = children[0];
- } else {
- break;
- }
-
- }
- }
-
- BreadcrumbItem last = null;
- if (index <= fBreadcrumbItems.size()) {
- last = ((BreadcrumbItem)fBreadcrumbItems.get(index - 1));
- last.setIsLastItem(true);
- }
-
- while (index < fBreadcrumbItems.size()) {
- updateLayout = true;
- BreadcrumbItem item= (BreadcrumbItem) fBreadcrumbItems.remove(fBreadcrumbItems.size() - 1);
- if (item.hasFocus() && last != null) {
- last.setFocus(true);
- }
- if (item == fSelectedItem) {
- selectItem(null);
- }
- if (item.getData() != null)
- unmapElement(item.getData());
- item.dispose();
- }
-
- if (updateLayout) {
- updateSize();
- fContainer.layout(true, true);
- }
- }
-
- /**
- * @param item Item to refresh.
- * @return returns whether the item's size and layout needs to be updated.
- */
- private boolean refreshItem(BreadcrumbItem item) {
- boolean layoutChanged = false;
-
- TreePath path = getTreePathFromItem(item);
-
- ViewerLabel label = new ViewerLabel(item.getText(), item.getImage());
- ((ITreePathLabelProvider)getLabelProvider()).updateLabel(label, path);
-
- if (label.hasNewText()) {
- item.setText(label.getText());
- layoutChanged = true;
- }
- if (label.hasNewImage()) {
- item.setImage(label.getImage());
- layoutChanged = true;
- }
- if (label.hasNewTooltipText()) {
- item.setToolTip(label.getTooltipText());
- }
- return layoutChanged;
- }
-
- /**
- * Creates or updates a breadcrumb item.
- *
- * @return whether breadcrumb layout needs to be updated due to this change
- */
- private boolean updateOrCreateItem(int index, TreePath path, Object element) {
- BreadcrumbItem item;
- if (fBreadcrumbItems.size() > index) {
- item = (BreadcrumbItem)fBreadcrumbItems.get(index);
- if (item.getData() != null) {
- unmapElement(item.getData());
- }
- } else {
- item = new BreadcrumbItem(this, fContainer);
- fBreadcrumbItems.add(item);
- }
-
- boolean updateLayout = false;
-
- if (equals(element, item.getData())) {
- item.setPath(path);
- updateLayout = myDoUpdateItem(item, element, false);
- } else {
- item.setData(element);
- item.setPath(path);
- mapElement(element, item);
- updateLayout = refreshItem(item);
- }
-
- return updateLayout;
- }
-
- /**
- * Update the size of the items such that all items are visible, if possible.
- *
- * @return <code>true</code> if any item has changed, <code>false</code> otherwise
- */
- private boolean updateSize() {
- int width= fContainer.getClientArea().width;
-
- int currentWidth= getCurrentWidth();
-
- boolean requiresLayout= false;
-
- if (currentWidth > width) {
- int index= 0;
- while (currentWidth > width && index < fBreadcrumbItems.size() - 1) {
- BreadcrumbItem viewer= (BreadcrumbItem) fBreadcrumbItems.get(index);
- if (viewer.isShowText()) {
- viewer.setShowText(false);
- currentWidth= getCurrentWidth();
- requiresLayout= true;
- }
-
- index++;
- }
-
- } else if (currentWidth < width) {
-
- int index= fBreadcrumbItems.size() - 1;
- while (currentWidth < width && index >= 0) {
-
- BreadcrumbItem viewer= (BreadcrumbItem) fBreadcrumbItems.get(index);
- if (!viewer.isShowText()) {
- viewer.setShowText(true);
- currentWidth= getCurrentWidth();
- if (currentWidth > width) {
- viewer.setShowText(false);
- index= 0;
- } else {
- requiresLayout= true;
- }
- }
-
- index--;
- }
- }
-
- return requiresLayout;
- }
-
- /**
- * Returns the current width of all items in the list.
- *
- * @return the width of all items in the list
- */
- private int getCurrentWidth() {
- int result= 0;
- for (int i= 0, size= fBreadcrumbItems.size(); i < size; i++) {
- BreadcrumbItem viewer= (BreadcrumbItem) fBreadcrumbItems.get(i);
- result+= viewer.getWidth();
- }
-
- return result;
- }
-
- /**
- * Enables redrawing of the breadcrumb.
- */
- private void enableRedraw() {
- if (IS_GTK) //flickers on GTK
- return;
-
- fContainer.setRedraw(true);
- }
-
- /**
- * Disables redrawing of the breadcrumb.
- *
- * <p>
- * <strong>A call to this method must be followed by a call to {@link #enableRedraw()}</strong>
- * </p>
- */
- private void disableRedraw() {
- if (IS_GTK) //flickers on GTK
- return;
-
- fContainer.setRedraw(false);
- }
-
- /**
- * The image to use for the breadcrumb background as specified in
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=221477
- *
- * @param height the height of the image to create
- * @param display the current display
- * @return the image for the breadcrumb background
- */
- private Image createGradientImage(int height, Display display) {
- int width= 50;
-
- Image result= new Image(display, width, height);
-
- GC gc= new GC(result);
-
- Color colorC= createColor(SWT.COLOR_WIDGET_BACKGROUND, SWT.COLOR_LIST_BACKGROUND, 35, display);
- Color colorD= createColor(SWT.COLOR_WIDGET_BACKGROUND, SWT.COLOR_LIST_BACKGROUND, 45, display);
- Color colorE= createColor(SWT.COLOR_WIDGET_BACKGROUND, SWT.COLOR_LIST_BACKGROUND, 80, display);
- Color colorF= createColor(SWT.COLOR_WIDGET_BACKGROUND, SWT.COLOR_LIST_BACKGROUND, 70, display);
- Color colorG= createColor(SWT.COLOR_WIDGET_BACKGROUND, SWT.COLOR_WHITE, 45, display);
- Color colorH= createColor(SWT.COLOR_WIDGET_NORMAL_SHADOW, SWT.COLOR_LIST_BACKGROUND, 35, display);
-
- try {
- drawLine(width, 0, colorC, gc);
- drawLine(width, 1, colorC, gc);
-
- gc.setForeground(colorD);
- gc.setBackground(colorE);
- gc.fillGradientRectangle(0, 2, width, 2 + 8, true);
-
- gc.setBackground(colorE);
- gc.fillRectangle(0, 2 + 9, width, height - 4);
-
- drawLine(width, height - 3, colorF, gc);
- drawLine(width, height - 2, colorG, gc);
- drawLine(width, height - 1, colorH, gc);
-
- } finally {
- gc.dispose();
-
- colorC.dispose();
- colorD.dispose();
- colorE.dispose();
- colorF.dispose();
- colorG.dispose();
- colorH.dispose();
- }
-
- return result;
- }
-
- private void drawLine(int width, int position, Color color, GC gc) {
- gc.setForeground(color);
- gc.drawLine(0, position, width, position);
- }
-
- private Color createColor(int color1, int color2, int ratio, Display display) {
- RGB rgb1= display.getSystemColor(color1).getRGB();
- RGB rgb2= display.getSystemColor(color2).getRGB();
-
- RGB blend= blend(rgb2, rgb1, ratio);
-
- return new Color(display, blend);
- }
-
- /**
- * Blends c1 and c2 based in the provided ratio.
- *
- * @param c1
- * first color
- * @param c2
- * second color
- * @param ratio
- * percentage of the first color in the blend (0-100)
- * @return the RGB value of the blended color
- * @since 3.1
- */
- public static RGB blend(RGB c1, RGB c2, int ratio) {
- int r = blend(c1.red, c2.red, ratio);
- int g = blend(c1.green, c2.green, ratio);
- int b = blend(c1.blue, c2.blue, ratio);
- return new RGB(r, g, b);
- }
-
- /**
- * Blends two primary color components based on the provided ratio.
- *
- * @param v1
- * first component
- * @param v2
- * second component
- * @param ratio
- * percentage of the first component in the blend
- * @return
- */
- private static int blend(int v1, int v2, int ratio) {
- int b = (ratio * v1 + (100 - ratio) * v2) / 100;
- return Math.min(255, b);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/IBreadcrumbDropDownSite.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/IBreadcrumbDropDownSite.java
deleted file mode 100644
index adea89dfd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/IBreadcrumbDropDownSite.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.breadcrumb;
-
-import org.eclipse.jface.viewers.ISelection;
-
-/**
- * Interface allowing breadcrumb drop-down implementors to communicate with their
- * containing breadcrumb.
- *
- * @since 3.5
- */
-public interface IBreadcrumbDropDownSite {
-
- /**
- * Notifies the breadcrumb that the given selection was made in the drop-down
- * viewer.
- * @param selection Selection to set to breadcrumb.
- */
- public void notifySelection(ISelection selection);
-
- /**
- * Notifies the breadcrumb that the drop-down viewer should be closed.
- */
- public void close();
-
- /**
- * Notifies the breadcrumb that the drop-down viewer's contents have
- * changed and viewer shell should be adjusted for the new size.
- */
- public void updateSize();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java
deleted file mode 100644
index 2b1b5b58a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.breadcrumb;
-
-import java.util.LinkedList;
-import java.util.List;
-
-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.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.util.OpenStrategy;
-import org.eclipse.jface.viewers.IOpenListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.jface.viewers.ITreeViewerListener;
-import org.eclipse.jface.viewers.OpenEvent;
-import org.eclipse.jface.viewers.TreeExpansionEvent;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.MouseMoveListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * A breadcrumb drop-down which shows a tree viewer. It implements mouse and
- * key listeners to handle selection and expansion behavior of the viewer.
- * This class needs to be extended to implement
- * {@link #createTreeViewer(Composite, int, TreePath)} to instantiate the
- * concrete {@link TreeViewer} object.
- *
- * @since 3.5
- */
-public abstract class TreeViewerDropDown {
-
- /**
- * Tells whether this class is in debug mode.
- */
- private static boolean DEBUG= DebugUIPlugin.DEBUG && "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.debug.ui/debug/breadcrumb")); //$NON-NLS-1$//$NON-NLS-2$
-
- /**
- * Delay to control scrolling when the mouse pointer reaches the edge of
- * the tree viewer.
- */
- private static long MOUSE_MOVE_SCROLL_DELAY = 500;
-
- /**
- * The breadcrumb site in which the viewer is created.
- */
- private IBreadcrumbDropDownSite fDropDownSite;
-
- /**
- * The tree viewer.
- */
- private TreeViewer fDropDownViewer;
-
- /**
- * Creates the viewer and installs the listeners.
- *
- * @param composite Parent control of the viewer.
- * @param site Breadcrumb site for the viewer.
- * @param path Path to the element for which the drop-down is being opened.
- * @return The control created for the viewer.
- */
- public Control createDropDown(Composite composite, IBreadcrumbDropDownSite site, TreePath path) {
-
- fDropDownSite = site;
- fDropDownViewer= createTreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL, path);
-
- fDropDownViewer.addOpenListener(new IOpenListener() {
- public void open(OpenEvent event) {
- if (DEBUG)
- System.out.println("BreadcrumbItemDropDown.showMenu()$treeViewer>open"); //$NON-NLS-1$
-
- openElement(event.getSelection());
- }
- });
-
- final Tree tree = fDropDownViewer.getTree();
-
- tree.addMouseListener(new MouseListener() {
- public void mouseUp(MouseEvent e) {
- if (DEBUG)
- System.out.println("BreadcrumbItemDropDown.showMenu()$treeViewer>mouseUp"); //$NON-NLS-1$
-
- if (e.button != 1)
- return;
-
- if ((OpenStrategy.getOpenMethod() & OpenStrategy.SINGLE_CLICK) != 0)
- return;
-
- TreeItem item= tree.getItem(new Point(e.x, e.y));
- if (item == null)
- return;
-
- List pathElements = new LinkedList();
- while(item != null) {
- Object data = item.getData();
- if (data == null) return;
- pathElements.add(0, data);
- item = item.getParentItem();
- }
-
- openElement(new TreeSelection(new TreePath(pathElements.toArray())));
- }
-
- public void mouseDown(MouseEvent e) {
- }
-
- public void mouseDoubleClick(MouseEvent e) {
- }
- });
-
- tree.addMouseMoveListener(new MouseMoveListener() {
- TreeItem fLastItem= null;
- long fLastScrollTime = 0;
-
- public void mouseMove(MouseEvent e) {
- if (tree.equals(e.getSource())) {
- Object o= tree.getItem(new Point(e.x, e.y));
- if (o instanceof TreeItem) {
- TreeItem currentItem= (TreeItem) o;
- if (!o.equals(fLastItem)) {
- fLastItem= (TreeItem) o;
- tree.setSelection(new TreeItem[] { fLastItem });
- } else if (System.currentTimeMillis() > (fLastScrollTime + MOUSE_MOVE_SCROLL_DELAY)) {
- if (e.y < tree.getItemHeight() / 4)
- {
- // Scroll up
- if (currentItem.getParentItem() == null) {
- int index= tree.indexOf((TreeItem) o);
- if (index < 1)
- return;
-
- fLastItem= tree.getItem(index - 1);
- tree.setSelection(new TreeItem[] { fLastItem });
- } else {
- Point p= tree.toDisplay(e.x, e.y);
- Item item= fDropDownViewer.scrollUp(p.x, p.y);
- fLastScrollTime = System.currentTimeMillis();
- if (item instanceof TreeItem) {
- fLastItem= (TreeItem) item;
- tree.setSelection(new TreeItem[] { fLastItem });
- }
- }
- } else if (e.y > tree.getBounds().height - tree.getItemHeight() / 4) {
- // Scroll down
- if (currentItem.getParentItem() == null) {
- int index= tree.indexOf((TreeItem) o);
- if (index >= tree.getItemCount() - 1)
- return;
-
- fLastItem= tree.getItem(index + 1);
- tree.setSelection(new TreeItem[] { fLastItem });
- } else {
- Point p= tree.toDisplay(e.x, e.y);
- Item item= fDropDownViewer.scrollDown(p.x, p.y);
- fLastScrollTime = System.currentTimeMillis();
- if (item instanceof TreeItem) {
- fLastItem= (TreeItem) item;
- tree.setSelection(new TreeItem[] { fLastItem });
- }
- }
- }
- }
- }
- }
- }
- });
-
- tree.addKeyListener(new KeyListener() {
- public void keyPressed(KeyEvent e) {
- if (e.keyCode == SWT.ARROW_UP) {
- // No elements in the tree (bug 262961).
- if (tree.getItemCount() == 0) {
- fDropDownSite.close();
- return;
- }
-
- TreeItem[] selection= tree.getSelection();
- if (selection.length != 1)
- return;
-
- int selectionIndex= tree.indexOf(selection[0]);
- if (selectionIndex != 0)
- return;
-
- fDropDownSite.close();
- }
- }
-
- public void keyReleased(KeyEvent e) {
- }
- });
-
- fDropDownViewer.addTreeListener(new ITreeViewerListener() {
- public void treeCollapsed(TreeExpansionEvent event) {
- }
-
- public void treeExpanded(TreeExpansionEvent event) {
- tree.setRedraw(false);
- new UIJob(tree.getDisplay(), IInternalDebugCoreConstants.EMPTY_STRING) {
- { setSystem(true); }
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if (!tree.isDisposed()) {
- try {
- fDropDownSite.updateSize();
- } finally {
- tree.setRedraw(true);
- }
- }
- return Status.OK_STATUS;
- }
- }.schedule();
- }
-
- });
-
- return tree;
- }
-
- /**
- * Creates and returns the tree viewer.
- *
- * @param composite Parent control of the viewer.
- * @param style Style flags to use in creating the tree viewer.
- * @param path Path to the element for which the drop-down is being opened.
- * @return The newly created tree viewer.
- */
- protected abstract TreeViewer createTreeViewer(Composite composite, int style, TreePath path);
-
- /**
- * Called when the given element was selected in the viewer. It causes the
- * breadcrumb viewer to fire an opened event. If the viewer loses focus
- * as a result of the open operation, then the drop-down is closed.
- * Otherwise the selected element is expanded.
- *
- * @param selection The selection to open.
- */
- protected void openElement(ISelection selection) {
- if (selection == null || !(selection instanceof ITreeSelection) || selection.isEmpty())
- return;
-
- // This might or might not open an editor
- fDropDownSite.notifySelection(selection);
-
- Tree tree = fDropDownViewer.getTree();
-
- boolean treeHasFocus= !tree.isDisposed() && tree.isFocusControl();
-
- if (DEBUG) {
- System.out.println(" isDisposed: " + tree.isDisposed()); //$NON-NLS-1$
- System.out.println(" shell hasFocus: " + (!tree.isDisposed() && tree.isFocusControl())); //$NON-NLS-1$
- System.out.println(" tree hasFocus: " + treeHasFocus); //$NON-NLS-1$
- }
-
- if (tree.isDisposed())
- return;
-
- if (!treeHasFocus) {
- fDropDownSite.close();
- return;
- }
-
- toggleExpansionState( ((ITreeSelection)selection).getPaths()[0]);
- }
-
- private void toggleExpansionState(TreePath path) {
- Tree tree= fDropDownViewer.getTree();
- if (fDropDownViewer.getExpandedState(path))
- fDropDownViewer.collapseToLevel(path, 1);
- else {
- tree.setRedraw(false);
- try {
- fDropDownViewer.expandToLevel(path, 1);
- fDropDownSite.updateSize();
- } finally {
- tree.setRedraw(true);
- }
- }
- }
-
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java
deleted file mode 100644
index 073ff0bcc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - Fix for viewer state save/restore [188704]
- * Pawel Piech (Wind River) - added support for a virtual tree model viewer (Bug 242489)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.jface.viewers.TreePath;
-
-/**
- * @since 3.3
- */
-class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountUpdate {
-
- private int fCount = 0;
-
- private List fBatchedRequests = null;
-
- /**
- * @param contentProvider
- */
- public ChildrenCountUpdate(ModelContentProvider contentProvider, Object viewerInput, TreePath elementPath, Object element, IElementContentProvider elementContentProvider, IPresentationContext context) {
- super(contentProvider, viewerInput, elementPath, element, elementContentProvider, context);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ViewerUpdateMonitor#performUpdate()
- */
- protected void performUpdate() {
- int viewCount = fCount;
- TreePath elementPath = getElementPath();
- if (viewCount == 0) {
- getContentProvider().clearFilters(elementPath);
- } else {
- getContentProvider().setModelChildCount(elementPath, fCount);
- viewCount = getContentProvider().modelToViewChildCount(elementPath, fCount);
- }
- if (ModelContentProvider.DEBUG_CONTENT_PROVIDER && (ModelContentProvider.DEBUG_PRESENTATION_ID == null || ModelContentProvider.DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("setChildCount(" + getElement() + ", modelCount: " + fCount + " viewCount: " + viewCount + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- getContentProvider().getViewer().setChildCount(elementPath, viewCount);
- getContentProvider().doRestore(getElementPath(), -1, true, true, false);
- }
-
- public void setChildCount(int numChildren) {
- fCount = numChildren;
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append("IChildrenCountUpdate: "); //$NON-NLS-1$
- buf.append(getElement());
- return buf.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#coalesce(org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor)
- */
- boolean coalesce(ViewerUpdateMonitor request) {
- if (request instanceof ChildrenCountUpdate) {
- if (getElementPath().equals(request.getElementPath())) {
- // duplicate request
- return true;
- } else if (getElementContentProvider().equals(request.getElementContentProvider())) {
- if (fBatchedRequests == null) {
- fBatchedRequests = new ArrayList(4);
- fBatchedRequests.add(this);
- }
- fBatchedRequests.add(request);
- return true;
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#startRequest()
- */
- void startRequest() {
- if (fBatchedRequests == null) {
- getElementContentProvider().update(new IChildrenCountUpdate[]{this});
- } else {
- IChildrenCountUpdate[] updates = (IChildrenCountUpdate[]) fBatchedRequests.toArray(new IChildrenCountUpdate[fBatchedRequests.size()]);
- // notify that the other updates have also started to ensure correct sequence
- // of model updates - **** start at index 1 since the first (0) update has
- // already notified the content provider that it has started.
- for (int i = 1; i < updates.length; i++) {
- getContentProvider().updateStarted((ViewerUpdateMonitor) updates[i]);
- }
- getElementContentProvider().update(updates);
- }
- }
-
- boolean containsUpdate(TreePath path) {
- if (getElementPath().equals(path)) {
- return true;
- } else if (fBatchedRequests != null) {
- for (int i = 0; i < fBatchedRequests.size(); i++) {
- if (((ViewerUpdateMonitor)fBatchedRequests.get(i)).getElementPath().equals(path)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#getPriority()
- */
- int getPriority() {
- return 2;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#getSchedulingPath()
- */
- TreePath getSchedulingPath() {
- TreePath path = getElementPath();
- if (path.getSegmentCount() > 0) {
- return path.getParentPath();
- }
- return path;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java
deleted file mode 100644
index 387403eae..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - Fix for viewer state save/restore [188704]
- * Pawel Piech (Wind River) - added support for a virtual tree model viewer (Bug 242489)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.jface.viewers.TreePath;
-
-/**
- * This class is public so the test suite has access - it should be default protection.
- *
- * @since 3.3
- */
-public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpdate {
-
- private Object[] fElements;
- private int fIndex;
- private int fLength;
-
- /**
- * Constructs a request to update an element
- *
- * @param node node to update
- * @param model model containing the node
- */
- public ChildrenUpdate(ModelContentProvider provider, Object viewerInput, TreePath elementPath, Object element, int index, IElementContentProvider elementContentProvider, IPresentationContext context) {
- super(provider, viewerInput, elementPath, element, elementContentProvider, context);
- fIndex = index;
- fLength = 1;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.viewers.AsynchronousRequestMonitor#performUpdate()
- */
- protected void performUpdate() {
- TreeModelContentProvider provider = (TreeModelContentProvider) getContentProvider();
- TreePath elementPath = getElementPath();
- if (fElements != null) {
- ITreeModelContentProviderTarget viewer = provider.getViewer();
- for (int i = 0; i < fElements.length; i++) {
- int modelIndex = fIndex + i;
- Object element = fElements[i];
- if (element != null) {
- int viewIndex = provider.modelToViewIndex(elementPath, modelIndex);
- if (provider.shouldFilter(elementPath, element)) {
- if (provider.addFilteredIndex(elementPath, modelIndex, element)) {
- if (ModelContentProvider.DEBUG_CONTENT_PROVIDER && (ModelContentProvider.DEBUG_PRESENTATION_ID == null || ModelContentProvider.DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("REMOVE(" + getElement() + ", modelIndex: " + modelIndex + " viewIndex: " + viewIndex + ", " + element + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
- viewer.remove(elementPath, viewIndex);
- }
- } else {
- if (provider.isFiltered(elementPath, modelIndex)) {
- provider.clearFilteredChild(elementPath, modelIndex);
- int insertIndex = provider.modelToViewIndex(elementPath, modelIndex);
- if (ModelContentProvider.DEBUG_CONTENT_PROVIDER) {
- System.out.println("insert(" + getElement() + ", modelIndex: " + modelIndex + " insertIndex: " + insertIndex + ", " + element + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
- viewer.insert(elementPath, element, insertIndex);
- } else {
- if (ModelContentProvider.DEBUG_CONTENT_PROVIDER && (ModelContentProvider.DEBUG_PRESENTATION_ID == null || ModelContentProvider.DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("replace(" + getElement() + ", modelIndex: " + modelIndex + " viewIndex: " + viewIndex + ", " + element + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- }
- viewer.replace(elementPath, viewIndex, element);
- }
- TreePath childPath = elementPath.createChildPath(element);
- provider.updateHasChildren(childPath);
- provider.doRestore(childPath, modelIndex, false, false, false);
- }
- }
- }
-
- provider.doRestore(elementPath, -1, true, true, true);
- } else {
- provider.updateHasChildren(elementPath);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate#setChild(java.lang.Object, int)
- */
- public void setChild(Object child, int index) {
- if (fElements == null) {
- fElements = new Object[fLength];
- }
- fElements[index - fIndex] = child;
- }
-
- /* (non-Javadoc)
- *
- * This method is public so the test suite has access - it should be default protection.
- *
- * @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#coalesce(org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor)
- */
- public synchronized boolean coalesce(ViewerUpdateMonitor request) {
- if (request instanceof ChildrenUpdate) {
- ChildrenUpdate cu = (ChildrenUpdate) request;
- if (getElement().equals(cu.getElement()) && getElementPath().equals(cu.getElementPath())) {
- int end = fIndex + fLength;
- int otherStart = cu.getOffset();
- int otherEnd = otherStart + cu.getLength();
- if ((otherStart >= fIndex && otherStart <= end) || (otherEnd >= fIndex && otherEnd <= end)) {
- // overlap
- fIndex = Math.min(fIndex, otherStart);
- end = Math.max(end, otherEnd);
- fLength = end - fIndex;
- if (ModelContentProvider.DEBUG_CONTENT_PROVIDER && (ModelContentProvider.DEBUG_PRESENTATION_ID == null || ModelContentProvider.DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("coalesced: " + this.toString()); //$NON-NLS-1$
- }
- return true;
- }
- }
- }
- return false;
- }
-
- boolean containsUpdate(TreePath path) {
- return getElementPath().equals(path);
- }
-
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate#getLength()
- */
- public int getLength() {
- return fLength;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate#getOffset()
- */
- public int getOffset() {
- return fIndex;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#startRequest()
- */
- void startRequest() {
- getElementContentProvider().update(new IChildrenUpdate[]{this});
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append("IChildrenUpdate: "); //$NON-NLS-1$
- buf.append(getElement());
- buf.append(" {"); //$NON-NLS-1$
- buf.append(getOffset());
- buf.append("->"); //$NON-NLS-1$
- buf.append(getOffset() + getLength());
- buf.append("}"); //$NON-NLS-1$
- return buf.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#getPriority()
- */
- int getPriority() {
- return 3;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#getSchedulingPath()
- */
- TreePath getSchedulingPath() {
- return getElementPath();
- }
-
- /**
- * Sets this request's offset. Used when modifying a waiting request when
- * the offset changes due to a removed element.
- *
- * @param offset new offset
- */
- void setOffset(int offset) {
- fIndex = offset;
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java
deleted file mode 100644
index 54e592e41..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - Fix for viewer state save/restore [188704]
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * @since 3.3
- */
-class ElementCompareRequest extends MementoUpdate implements IElementCompareRequest {
-
- private boolean fEqual;
- private final int fModelIndex;
- private ModelDelta fDelta;
- private boolean fKnowsHasChildren;
- private boolean fKnowsChildCount;
- private boolean fCheckChildrenRealized;
-
-
- /**
- * @param context
- * @param element
- * @param memento
- */
- public ElementCompareRequest(ModelContentProvider provider, Object viewerInput, Object element,
- TreePath elementPath, IMemento memento, ModelDelta delta, int modelIndex,
- boolean hasChildren, boolean knowsChildCount, boolean checkChildrenRealized)
- {
- super(provider, viewerInput, provider.getPresentationContext(), element, elementPath, memento);
- fProvider = provider;
- fDelta = delta;
- fModelIndex = modelIndex;
- fKnowsHasChildren = hasChildren;
- fKnowsChildCount = knowsChildCount;
- fCheckChildrenRealized = checkChildrenRealized;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest#setEqual(boolean)
- */
- public void setEqual(boolean equal) {
- fEqual = equal;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IProgressMonitor#done()
- */
- public void done() {
- UIJob job = new UIJob("restore delta") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if (!isCanceled()) {
- fProvider.compareFinished(ElementCompareRequest.this, fDelta);
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
-
- boolean isEqual() {
- return fEqual;
- }
-
- ModelDelta getDelta() {
- return fDelta;
- }
-
- int getModelIndex() {
- return fModelIndex;
- }
-
- void setKnowsHasChildren(boolean hasChildren) {
- fKnowsHasChildren = hasChildren;
- }
-
- boolean knowsHasChildren() {
- return fKnowsHasChildren;
- }
-
- void setKnowsChildCount(boolean childCount) {
- fKnowsChildCount = childCount;
- }
-
- boolean knowChildCount() {
- return fKnowsChildCount;
- }
-
- void setCheckChildrenRealized(boolean checkChildrenRealized) {
- fCheckChildrenRealized = checkChildrenRealized;
- }
-
- boolean checkChildrenRealized() {
- return fCheckChildrenRealized;
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append("IElementCompareRequest: "); //$NON-NLS-1$
- buf.append(getElement());
- return buf.toString();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java
deleted file mode 100644
index 0b77420d1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.ui.IMemento;
-
-/**
- * @since 3.3
- */
-class ElementMementoRequest extends MementoUpdate implements IElementMementoRequest {
-
- private IMementoManager fManager;
- private ModelDelta fDelta;
-
- /**
- * @param context
- * @param element
- * @param memento
- */
- public ElementMementoRequest(ModelContentProvider provider, Object viewerInput, IMementoManager manager, IPresentationContext context, Object element, TreePath elementPath, IMemento memento, ModelDelta delta) {
- super(provider, viewerInput, context, element, elementPath, memento);
- fManager = manager;
- fDelta = delta;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IProgressMonitor#done()
- */
- public void done() {
- if (!isCanceled() && (getStatus() == null || getStatus().isOK())) {
- // replace the element with a memento
- fDelta.setElement(getMemento());
- }
- fManager.requestComplete(this);
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append("IElementMementoRequest: "); //$NON-NLS-1$
- buf.append(getElement());
- return buf.toString();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/FilterTransform.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/FilterTransform.java
deleted file mode 100644
index 28abfc69d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/FilterTransform.java
+++ /dev/null
@@ -1,503 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.viewers.TreePath;
-
-
-/**
- * Helper class to support filtering in virtual tree viewer.
- * Translates indexes from viewer to model coordinate space (and visa versa).
- * <p>
- * This filter transform maintains a tree representing filtered elements in the
- * viewer. The filtering is performed dynamically as elements are 'replaced' in the tree
- * by a lazy tree content provider.
- * </p>
- * <p>
- * This class not intended to be subclassed or instantiated. For internal use only.
- * </p>
- * @since 3.3
- */
-public class FilterTransform {
-
- private Node root = new Node();
-
- class Node {
- private int[] filteredIndexes = null;
- private Object[] filteredElements = null;
- private Map children = null; // only set for parent nodes, indexed by child
-
- Node() {
- }
-
- boolean addFilter(TreePath path, int childIndex, int pathIndex, Object filtered) {
- if (pathIndex == path.getSegmentCount()) {
- if (filteredIndexes == null) {
- filteredIndexes = new int[]{childIndex};
- filteredElements = new Object[]{filtered};
- return true;
- }
- int location = Arrays.binarySearch(filteredIndexes, childIndex);
- if (location >= 0) {
- return false;
- }
- location = 0 - (location + 1);
- int[] next = new int[filteredIndexes.length + 1];
- Object[] filt = new Object[next.length];
- if (location == 0) {
- next[0] = childIndex;
- filt[0] = filtered;
- System.arraycopy(filteredIndexes, 0, next, 1, filteredIndexes.length);
- System.arraycopy(filteredElements, 0, filt, 1, filteredElements.length);
- } else if (location == filteredIndexes.length) {
- next[filteredIndexes.length] = childIndex;
- filt[filteredElements.length] = filtered;
- System.arraycopy(filteredIndexes, 0, next, 0, filteredIndexes.length);
- System.arraycopy(filteredElements, 0, filt, 0, filteredElements.length);
- } else {
- System.arraycopy(filteredIndexes, 0, next, 0, location);
- System.arraycopy(filteredElements, 0, filt, 0, location);
- next[location] = childIndex;
- filt[location] = filtered;
- System.arraycopy(filteredIndexes, location, next, location + 1, filteredIndexes.length - location);
- System.arraycopy(filteredElements, location, filt, location + 1, filteredElements.length - location);
- }
- filteredIndexes = next;
- filteredElements = filt;
- return true;
- }
-
- if (children == null) {
- children = new HashMap();
- }
- Object element = path.getSegment(pathIndex);
- Node node = (Node) children.get(element);
- if (node == null) {
- node = new Node();
- children.put(element, node);
- }
- return node.addFilter(path, childIndex, pathIndex + 1, filtered);
- }
-
- boolean clear(TreePath path, int pathIndex) {
- if (pathIndex == path.getSegmentCount()) {
- return true;
- }
- if (children == null) {
- return false;
- }
- Object child = path.getSegment(pathIndex);
- Node node = (Node) children.get(child);
- if (node != null) {
- if (node.clear(path, pathIndex + 1)) {
- children.remove(child);
- }
- }
- return children.isEmpty() && (filteredIndexes == null || filteredIndexes.length == 0);
- }
-
- boolean clear(TreePath path, int childIndex, int pathIndex) {
- if (pathIndex == path.getSegmentCount()) {
- if (filteredIndexes != null) {
- int location = Arrays.binarySearch(filteredIndexes, childIndex);
- if (location >= 0) {
- // remove it
- if (location == 0 && filteredIndexes.length == 1) {
- filteredIndexes = null;
- filteredElements = null;
- return true;
- }
- int[] next = new int[filteredIndexes.length - 1];
- Object[] filt = new Object[next.length];
- if (location == 0) {
- System.arraycopy(filteredIndexes, 1, next, 0, next.length);
- System.arraycopy(filteredElements, 1, filt, 0, filt.length);
- } else if (location == (filteredIndexes.length - 1)) {
- System.arraycopy(filteredIndexes, 0, next, 0, location);
- System.arraycopy(filteredElements, 0, filt, 0, location);
- } else {
- System.arraycopy(filteredIndexes, 0, next, 0, location);
- System.arraycopy(filteredElements, 0, filt, 0, location);
- System.arraycopy(filteredIndexes, location + 1, next, location, next.length - location);
- System.arraycopy(filteredElements, location + 1, filt, location, filt.length - location);
- }
- filteredIndexes = next;
- filteredElements = filt;
- return false;
- }
- } else {
- return false;
- }
- }
- if (children == null) {
- return false;
- }
- Object element = path.getSegment(pathIndex);
- Node node = (Node) children.get(element);
- if (node == null) {
- return false;
- }
- boolean remove = node.clear(path, childIndex, pathIndex + 1);
- if (remove) {
- children.remove(element);
- return filteredIndexes == null && children.isEmpty();
- } else {
- return false;
- }
- }
-
- Node find(TreePath path, int pathIndex) {
- if (pathIndex == path.getSegmentCount())
- return this;
- if (children == null) {
- return null;
- }
- Object child = path.getSegment(pathIndex);
- Node node = (Node) children.get(child);
- if (node != null) {
- return node.find(path, pathIndex + 1);
- }
- return null;
- }
-
- int viewToModel(int childIndex) {
- if (filteredIndexes == null) {
- return childIndex;
- }
- // If there are filtered children, then we want to find the
- // (n+1)th missing number in the list of filtered indexes (missing
- // entries are visible in the view). For example, if the request
- // has asked for the model index corresponding to the 4th viewer
- // index, then we want to find the 5th missing number in the
- // filtered index sequence.
-
- int count = -1; // count from 0, 1, 2...
- int missingNumbers = 0; // how many numbers missing from the filtered index
- int offset = 0; // offset into the filtered index
-
- while (missingNumbers < (childIndex + 1)) {
- count++;
- if (offset < filteredIndexes.length) {
- if (filteredIndexes[offset] == count) {
- // not missing
- offset++;
- } else {
- // missing
- missingNumbers++;
- }
- } else {
- missingNumbers++;
- }
- }
- return count;
- }
-
- int modelToView(int childIndex) {
- if (filteredIndexes == null) {
- return childIndex;
- }
- int offset = 0;
- for (int i = 0; i < filteredIndexes.length; i++) {
- if (childIndex == filteredIndexes[i] ) {
- return -1;
- } else if (childIndex > filteredIndexes[i]) {
- offset++;
- } else {
- break;
- }
- }
- return childIndex - offset;
- }
-
- int modelToViewCount(int childCount) {
- if (filteredIndexes == null) {
- return childCount;
- }
- return childCount - filteredIndexes.length;
- }
-
- boolean isFiltered(int index) {
- if (filteredIndexes != null) {
- int location = Arrays.binarySearch(filteredIndexes, index);
- return location >= 0;
- }
- return false;
- }
-
- int indexOfFilteredElement(Object element) {
- if (filteredElements != null) {
- for (int i = 0; i < filteredElements.length; i++) {
- if (element.equals(filteredElements[i])) {
- return filteredIndexes[i];
- }
- }
- }
- return -1;
- }
-
- /**
- * Sets the child count for this element, trimming any filtered elements
- * that were above this count.
- *
- * @param childCount new child count
- */
- void setModelChildCount(int childCount) {
- if (filteredIndexes != null) {
- for (int i = 0; i < filteredIndexes.length; i++) {
- if (filteredIndexes[i] >= childCount) {
- // trim
- if (i == 0) {
- filteredIndexes = null;
- return;
- } else {
- int[] temp = new int[i + 1];
- System.arraycopy(filteredIndexes, 0, temp, 0, temp.length);
- filteredIndexes = temp;
- }
- }
- }
- }
- }
-
- /**
- * Updates filter index for a removed element at the given index
- *
- * @param index index at which an element was removed
- */
- void removeElementFromFilters(int index) {
- if (filteredIndexes != null) {
- int location = Arrays.binarySearch(filteredIndexes, index);
- if (location >= 0) {
- // remove a filtered item
- if (filteredIndexes.length == 1) {
- // only filtered item
- filteredIndexes = null;
- filteredElements = null;
- } else {
- int[] next = new int[filteredIndexes.length - 1];
- Object[] filt = new Object[next.length];
- if (location == 0) {
- // first
- System.arraycopy(filteredIndexes, 1, next, 0, next.length);
- System.arraycopy(filteredElements, 1, filt, 0, filt.length);
- } else if (location == (filteredIndexes.length - 1)) {
- // last
- System.arraycopy(filteredIndexes, 0, next, 0, next.length);
- System.arraycopy(filteredElements, 0, filt, 0, filt.length);
- } else {
- // middle
- System.arraycopy(filteredIndexes, 0, next, 0, location);
- System.arraycopy(filteredElements, 0, filt, 0, location);
- System.arraycopy(filteredIndexes, location + 1, next, location, next.length - location);
- System.arraycopy(filteredElements, location + 1, filt, location, filt.length - location);
- }
- filteredIndexes = next;
- filteredElements = filt;
- }
- } else {
- location = 0 - (location + 1);
- }
- if (filteredIndexes != null) {
- // decrement remaining indexes
- for (int i = location; i < filteredIndexes.length; i ++) {
- filteredIndexes[i]--;
- }
- }
- }
- }
- }
-
- /**
- * Filters the specified child of the given parent and returns
- * whether the filter was added.
- *
- * @param parentPath path to parent element
- * @param childIndex index of filtered child relative to parent (in model coordinates)
- * @param element the filtered element
- * @return whether the filter was added - returns <code>true</code> if the filter is
- * added, and <code>false</code> if the index was already filtered
- */
- public synchronized boolean addFilteredIndex(TreePath parentPath, int childIndex, Object element) {
- return root.addFilter(parentPath, childIndex, 0, element);
- }
-
- /**
- * Clears all filtered elements.
- */
- public synchronized void clear() {
- root = new Node();
- }
-
- /**
- * Clears all filters in the subtree of the given element.
- *
- * @param path element path
- */
- public synchronized void clear(TreePath path) {
- root.clear(path, 0);
- }
-
- /**
- * Clears the given filtered index of the specified parent. I.e.
- * the child still exists, but is no longer filtered.
- *
- * @param path parent path
- * @param index index to clear
- */
- public synchronized void clear(TreePath parentPath, int index) {
- root.clear(parentPath, index, 0);
- }
-
- /**
- * Translates and returns the given model index (raw index) into
- * a view index (filtered index), or -1 if filtered.
- *
- * @param parentPath path to parent element
- * @param childIndex index of child element in model space
- * @return the given index in view coordinates, or -1 if filtered.
- */
- public synchronized int modelToViewIndex(TreePath parentPath, int childIndex) {
- Node parentNode = root.find(parentPath, 0);
- if (parentNode == null) {
- return childIndex;
- }
- return parentNode.modelToView(childIndex);
- }
-
- /**
- * Translates and returns the given view index (filtered) into
- * a model index (raw index).
- *
- * @param parentPath path to parent element
- * @param childIndex index of child element in view space
- * @return the given index in model coordinates
- */
- public synchronized int viewToModelIndex(TreePath parentPath, int childIndex) {
- Node parentNode = root.find(parentPath, 0);
- if (parentNode == null) {
- return childIndex;
- }
- return parentNode.viewToModel(childIndex);
- }
-
- /**
- * Returns the number of children for the given parent, in the model.
- *
- * @param parentPath path to parent element
- * @param viewCount number of children in the view
- * @return number of children in the model
- */
- public synchronized int viewToModelCount(TreePath parentPath, int viewCount) {
- Node parentNode = root.find(parentPath, 0);
- if (parentNode != null) {
- if (parentNode.filteredIndexes != null) {
- return viewCount + parentNode.filteredIndexes.length;
- }
- }
- return viewCount;
- }
-
- /**
- * Translates and returns the given model child count (raw) into
- * a view count (filtered).
- *
- * @param parentPath path to parent element
- * @param count child count in model space
- * @return the given count in view coordinates
- */
- public synchronized int modelToViewCount(TreePath parentPath, int count) {
- Node parentNode = root.find(parentPath, 0);
- if (parentNode == null) {
- return count;
- }
- return parentNode.modelToViewCount(count);
- }
-
- /**
- * Returns whether the given index of the specified parent is currently filtered.
- *
- * @param parentPath path to parent element
- * @param index index of child element
- * @return whether the child is currently filtered
- */
- public synchronized boolean isFiltered(TreePath parentPath, int index) {
- Node parentNode = root.find(parentPath, 0);
- if (parentNode == null) {
- return false;
- }
- return parentNode.isFiltered(index);
- }
-
- /**
- * Returns filtered children of the given parent, or <code>null</code> if none.
- *
- * @param parentPath
- * @return filtered children or <code>null</code>
- */
- public int[] getFilteredChildren(TreePath parentPath) {
- Node parentNode = root.find(parentPath, 0);
- if (parentNode == null) {
- return null;
- }
- return parentNode.filteredIndexes;
- }
-
- /**
- * Clears any filters for the given parent above the given count.
- *
- * @param parentPath path to parent element
- * @param childCount child count
- */
- public synchronized void setModelChildCount(TreePath parentPath, int childCount) {
- Node parentNode = root.find(parentPath, 0);
- if (parentNode != null) {
- parentNode.setModelChildCount(childCount);
- }
- }
-
- /**
- * The element at the given index has been removed from the parent. Update
- * indexes.
- *
- * @param parentPath path to parent element
- * @param index index of child element in model coordinates
- */
- public synchronized void removeElementFromFilters(TreePath parentPath, int index) {
- Node parentNode = root.find(parentPath, 0);
- if (parentNode != null) {
- parentNode.removeElementFromFilters(index);
- }
- }
-
- /**
- * The element has been removed from the parent. Update
- * filtered indexes, in case it was a filtered object.
- *
- * @param parentPath path to parent element
- * @param element removed element
- */
- public synchronized boolean removeElementFromFilters(TreePath parentPath, Object element) {
- Node parentNode = root.find(parentPath, 0);
- if (parentNode != null) {
- int index = parentNode.indexOfFilteredElement(element);
- if (index >= 0) {
- parentNode.removeElementFromFilters(index);
- return true;
- }
- }
- return false;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java
deleted file mode 100644
index 9572326cf..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - Fix for viewer state save/restore [188704]
- * Pawel Piech (Wind River) - added support for a virtual tree model viewer (Bug 242489)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.jface.viewers.TreePath;
-
-/**
- * @since 3.3
- */
-class HasChildrenUpdate extends ViewerUpdateMonitor implements IHasChildrenUpdate {
-
- private boolean fHasChildren = false;
-
- private List fBatchedRequests = null;
-
- /**
- * @param contentProvider
- */
- public HasChildrenUpdate(ModelContentProvider contentProvider, Object viewerInput, TreePath elementPath, Object element, IElementContentProvider elementContentProvider, IPresentationContext context) {
- super(contentProvider, viewerInput, elementPath, element, elementContentProvider, context);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ViewerUpdateMonitor#performUpdate()
- */
- protected void performUpdate() {
- ModelContentProvider contentProvider = getContentProvider();
- TreePath elementPath = getElementPath();
- if (!fHasChildren) {
- contentProvider.clearFilters(elementPath);
- }
- if (ModelContentProvider.DEBUG_CONTENT_PROVIDER && (ModelContentProvider.DEBUG_PRESENTATION_ID == null || ModelContentProvider.DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("setHasChildren(" + getElement() + " >> " + fHasChildren); //$NON-NLS-1$ //$NON-NLS-2$
- }
- contentProvider.getViewer().setHasChildren(elementPath, fHasChildren);
- if (fHasChildren) {
- contentProvider.getViewer().autoExpand(elementPath);
- }
- if (elementPath.getSegmentCount() > 0) {
- getContentProvider().doRestore(getElementPath(), -1, true, false, false);
- }
- }
-
- public void setHasChilren(boolean hasChildren) {
- fHasChildren = hasChildren;
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append("IHasChildrenUpdate: "); //$NON-NLS-1$
- buf.append(getElement());
- return buf.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#coalesce(org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor)
- */
- boolean coalesce(ViewerUpdateMonitor request) {
- if (request instanceof HasChildrenUpdate) {
- if (getElementPath().equals(request.getElementPath())) {
- // duplicate request
- return true;
- } else if (getElementContentProvider().equals(request.getElementContentProvider())) {
- if (fBatchedRequests == null) {
- fBatchedRequests = new ArrayList();
- fBatchedRequests.add(this);
- }
- fBatchedRequests.add(request);
- return true;
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#startRequest()
- */
- void startRequest() {
- if (fBatchedRequests == null) {
- getElementContentProvider().update(new IHasChildrenUpdate[]{this});
- } else {
- IHasChildrenUpdate[] updates = (IHasChildrenUpdate[]) fBatchedRequests.toArray(new IHasChildrenUpdate[fBatchedRequests.size()]);
- // notify that the other updates have also started to ensure correct sequence
- // of model updates - **** start at index 1 since the first (0) update has
- // already notified the content provider that it has started.
- for (int i = 1; i < updates.length; i++) {
- getContentProvider().updateStarted((ViewerUpdateMonitor) updates[i]);
- }
- getElementContentProvider().update(updates);
- }
- }
-
- boolean containsUpdate(TreePath path) {
- if (getElementPath().equals(path)) {
- return true;
- } else if (fBatchedRequests != null) {
- for (int i = 0; i < fBatchedRequests.size(); i++) {
- if (((ViewerUpdateMonitor)fBatchedRequests.get(i)).getElementPath().equals(path)) {
- return true;
- }
- }
- }
- return false;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#getPriority()
- */
- int getPriority() {
- return 1;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#getSchedulingPath()
- */
- TreePath getSchedulingPath() {
- TreePath path = getElementPath();
- if (path.getSegmentCount() > 0) {
- return path.getParentPath();
- }
- return path;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ILabelUpdateListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ILabelUpdateListener.java
deleted file mode 100644
index a53be350f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ILabelUpdateListener.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate;
-
-/**
- * Notified of label updates.
- *
- * @since 3.3
- */
-public interface ILabelUpdateListener {
-
- /**
- * Notification that a sequence of viewer updates are starting.
- */
- public void labelUpdatesBegin();
-
- /**
- * Notification that viewer updates are complete. Corresponds to
- * a <code>viewerUpdatesBegin()</code> notification.
- */
- public void labelUpdatesComplete();
-
- /**
- * Notification that a specific update has started within
- * a sequence of updates.
- *
- * @param update update
- */
- public void labelUpdateStarted(ILabelUpdate update);
-
- /**
- * Notification that a specific update has completed within a
- * sequence of updates.
- *
- * @param update update
- */
- public void labelUpdateComplete(ILabelUpdate update);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/IMementoManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/IMementoManager.java
deleted file mode 100644
index 92f1d43df..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/IMementoManager.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest;
-
-/**
- * @since 3.3
- */
-interface IMementoManager {
-
- /**
- * Adds the request to this manager.
- *
- * @param memento request
- */
- public void addRequest(IElementMementoRequest request);
-
- /**
- * Notification the request is complete.
- *
- * @param request
- */
- public void requestComplete(IElementMementoRequest request);
-
- /**
- * Process the queued requests. Accepts no more new requests.
- */
- public void processReqeusts();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelCheckProviderTarget.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelCheckProviderTarget.java
deleted file mode 100644
index 1348f254c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelCheckProviderTarget.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*****************************************************************
- * Copyright (c) 2009 Texas Instruments and others
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Chuong (Texas Instruments) - Initial API and implementation (Bug 286310)
- *****************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import org.eclipse.jface.viewers.TreePath;
-
-/**
- * This interface can be implemented by the viewer which uses the
- * {@link TreeModelLabelProvider} label provider and supports the
- * {@link org.eclipse.swt.SWT.CHECK} style. It allows the label provider to
- * update the viewer with check-box information retrieved from the
- * element-based label providers.
- *
- * @since 3.6
- */
-public interface ITreeModelCheckProviderTarget extends ITreeModelLabelProviderTarget {
-
- /**
- * Sets the element check state data.
- *
- * @param path
- * @param checked
- * @param grayed
- */
- public void setElementChecked(TreePath path, boolean checked, boolean grayed);
-
- /**
- * Retrieves the element check state.
- *
- * @param path
- * @return checked
- */
- public boolean getElementChecked(TreePath path);
-
- /**
- * Retrieves the element's check box grayed state.
- *
- * @param path
- * @return grayed
- */
- public boolean getElementGrayed(TreePath path);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProvider.java
deleted file mode 100644
index 1b7e93e4a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProvider.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IStateUpdateListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
-import org.eclipse.jface.viewers.ILazyTreePathContentProvider;
-import org.eclipse.jface.viewers.TreePath;
-
-/**
- * {@link TreeModelViewer} content provider interface.
- *
- * @since 3.5
- */
-public interface ITreeModelContentProvider extends ILazyTreePathContentProvider {
-
- /**
- * Bit-mask which allows all possible model delta flags.
- *
- * @since 3.6
- * @see #setModelDeltaMask(int)
- */
- public static final int ALL_MODEL_DELTA_FLAGS = ~0;
-
- /**
- * Bit-mask which allows only flags which control selection and expansion.
- *
- * @since 3.6
- * @see #setModelDeltaMask(int)
- */
- public static final int CONTROL_MODEL_DELTA_FLAGS =
- IModelDelta.EXPAND | IModelDelta.COLLAPSE | IModelDelta.SELECT | IModelDelta.REVEAL | IModelDelta.FORCE;
-
- /**
- * Bit-mask which allows only flags which update viewer's information
- * about the model.
- *
- * @since 3.6
- * @see #setModelDeltaMask(int)
- */
- public static final int UPDATE_MODEL_DELTA_FLAGS =
- IModelDelta.ADDED | IModelDelta.CONTENT | IModelDelta.INSERTED | IModelDelta.INSTALL | IModelDelta.REMOVED |
- IModelDelta.REPLACED | IModelDelta.STATE | IModelDelta.UNINSTALL;
-
- /**
- * Translates and returns the given child index from the viewer coordinate
- * space to the model coordinate space.
- *
- * @param parentPath path to parent element
- * @param index index of child element in viewer (filtered) space
- * @return index of child element in model (raw) space
- */
- public int viewToModelIndex(TreePath parentPath, int index);
-
- /**
- * Translates and returns the given child count from the viewer coordinate
- * space to the model coordinate space.
- *
- * @param parentPath path to parent element
- * @param count number of child elements in viewer (filtered) space
- * @return number of child elements in model (raw) space
- */
- public int viewToModelCount(TreePath parentPath, int count);
-
- /**
- * Translates and returns the given child index from the model coordinate
- * space to the viewer coordinate space.
- *
- * @param parentPath path to parent element
- * @param index index of child element in model (raw) space
- * @return index of child element in viewer (filtered) space or -1 if filtered
- */
- public int modelToViewIndex(TreePath parentPath, int index);
-
- /**
- * Returns whether the given element is filtered.
- *
- * @param parentElementOrTreePath
- * the parent element or path
- * @param element
- * the child element
- * @return whether to filter the element
- */
- public boolean shouldFilter(Object parentElementOrTreePath, Object element);
-
- /**
- * Notification the given element is being unmapped.
- *
- * @param path
- */
- public void unmapPath(TreePath path);
-
- /**
- * Sets the bit mask which will be used to filter the {@link IModelDelta}
- * coming from the model. Any delta flags which are hidden by the mask
- * will be ignored.
- *
- * @param the bit mask for <code>IModelDelta</code> flags
- *
- * @since 3.6
- */
- public void setModelDeltaMask(int mask);
-
- /**
- * Returns the current model delta mask.
- *
- * @return bit mask used to filter model delta events.
- *
- * @see #setModelDeltaMask(int)
- * @since 3.6
- */
- public int getModelDeltaMask();
-
- /**
- * Translates and returns the given child count from the model coordinate
- * space to the viewer coordinate space.
- *
- * @param parentPath path to parent element
- * @param count child count element in model (raw) space
- * @return child count in viewer (filtered) space
- */
- public int modelToViewChildCount(TreePath parentPath, int count);
-
- /**
- * Registers the specified listener for view update notifications.
- */
- public void addViewerUpdateListener(IViewerUpdateListener listener);
-
- /**
- * Removes the specified listener from update notifications.
- */
- public void removeViewerUpdateListener(IViewerUpdateListener listener);
-
- /**
- * Registers the given listener for model delta notification.
- * This listener is called immediately after the viewer processes
- * the delta.
- */
- public void addModelChangedListener(IModelChangedListener listener);
-
- /**
- * Removes the given listener from model delta notification.
- */
- public void removeModelChangedListener(IModelChangedListener listener);
-
-
- /**
- * Registers the specified listener for state update notifications.
- * @since 3.6
- */
- public void addStateUpdateListener(IStateUpdateListener listener);
-
- /**
- * Removes the specified listener from state update notifications.
- * @since 3.6
- */
- public void removeStateUpdateListener(IStateUpdateListener listener);
-
- /**
- * Instructs the content provider to process the given model delta. This
- * mechanism can be used to control the view's layout (expanding, selecting
- * , etc.)
- *
- * @param delta The model delta to process.
- * @param mask Mask that can be used to suppress processing of some of the
- * delta flags
- *
- * @since 3.6
- */
- public void updateModel(IModelDelta delta, int mask);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProviderTarget.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProviderTarget.java
deleted file mode 100644
index dee5a1ec8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelContentProviderTarget.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-/**
- * This interface must be implemented by the viewer which uses the
- * {@link TreeModelContentProvider} content provider. It allows the content
- * provider to update the viewer with information retrieved from the
- * content, proxy, memento, and other element-based providers.
- *
- * @since 3.5
- */
-public interface ITreeModelContentProviderTarget extends ITreeModelViewer {
-
- /**
- * Returns this viewer's filters.
- *
- * @return an array of viewer filters
- * @see StructuredViewer#setFilters(ViewerFilter[])
- */
- public ViewerFilter[] getFilters();
-
- /**
- * Reveals the given element in the viewer.
- * @param path Path to the element's parent.
- * @param index Index of the element to be revealed.
- */
- public void reveal(TreePath path, int index);
-
- /**
- * Triggers an update of the given element's state. If multiple instances
- * of the given element are found in the tree, they will all be updated.
- *
- * @param element Element to update.
- */
- public void update(Object element);
-
- /**
- * Triggers an update of the given element and its children. If
- * multiple instances of the given element are found in the tree,
- * they will all be updated.
- *
- * @param element Element to update.
- */
- public void refresh(Object element);
-
- /**
- * Triggers a full update of all the elements in the tree.
- *
- * @param element Element to update.
- */
- public void refresh();
-
- /**
- * Sets the given object to be the element at the given index of the given parent.
- * <p>
- * This method should only be called by the viewer framework.
- * </p>
- *
- * @param parentOrTreePath Parent object, or a tree path of the parent element.
- * @param index Index at which to set the new element.
- * @param element Element object.
- */
- public void replace(Object parentOrTreePath, final int index, Object element);
-
- /**
- * Set the number of children of the given element or tree path. To set the
- * number of children of the invisible root of the tree, you can pass the
- * input object or an empty tree path.
- * <p>
- * This method should only be called by the viewer framework.
- * </p>
- *
- * @param elementOrTreePath The element, or tree path.
- * @param count
- */
- public void setChildCount(final Object elementOrTreePath, final int count);
-
- /**
- * Inform the viewer about whether the given element or tree path has
- * children. Avoid calling this method if the number of children has
- * already been set.
- * <p>
- * This method should only be called by the viewer framework.
- * </p>
- *
- * @param elementOrTreePath
- * the element, or tree path
- * @param hasChildren
- */
- public void setHasChildren(final Object elementOrTreePath, final boolean hasChildren);
-
- /**
- * Performs auto expand on an element at the specified path if the auto expand
- * level dictates the element should be expanded.
- * <p>
- * This method should only be called by the viewer framework.
- * </p>
- *
- * @param elementPath tree path to element to consider for expansion
- */
- public void autoExpand(TreePath elementPath);
-
- /**
- * Sets whether the node corresponding to the given element or tree path is
- * expanded or collapsed.
- * <p>
- * This method should only be called by the viewer framework.
- * </p>
- *
- * @param elementOrTreePath
- * the element, or the tree path to the element
- * @param expanded
- * <code>true</code> if the node is expanded, and
- * <code>false</code> if collapsed
- */
- public void setExpandedState(Object elementOrTreePath, boolean expanded);
-
- /**
- * Expands all ancestors of the given element or tree path so that the given
- * element becomes visible in this viewer's tree control, and then expands
- * the subtree rooted at the given element to the given level.
- * <p>
- * This method should only be called by the viewer framework.
- * </p>
- *
- * @param elementOrTreePath
- * the element
- * @param level
- * non-negative level, or <code>ALL_LEVELS</code> to expand all
- * levels of the tree
- */
- public void expandToLevel(Object elementOrTreePath, int level);
-
-
-
- /**
- * Removes the given element from the viewer. The selection is updated if
- * necessary.
- * <p>
- * This method should only be called by the viewer framework.
- * </p>
- *
- * @param elementsOrTreePaths
- * the element, or the tree path to the element
- */
- public void remove(Object elementOrTreePath);
-
- /**
- * Removes the element at the specified index of the parent. The selection is updated if required.
- * <p>
- * This method should only be called by the viewer framework.
- * </p>
- *
- * @param parentOrTreePath the parent element, the input element, or a tree path to the parent element
- * @param index child index
- */
- public void remove(Object parentOrTreePath, final int index);
-
- /**
- * Inserts the given element as a new child element of the given parent
- * element at the given position. If this viewer has a sorter, the position
- * is ignored and the element is inserted at the correct position in the
- * sort order.
- * <p>
- * This method should only be called by the viewer framework.
- * </p>
- *
- * @param parentElementOrTreePath
- * the parent element, or the tree path to the parent
- * @param element
- * the element
- * @param position
- * a 0-based position relative to the model, or -1 to indicate
- * the last position
- */
- public void insert(Object parentOrTreePath, Object element, int position);
-
- /**
- * Returns whether the candidate selection should override the current
- * selection.
- */
- public boolean overrideSelection(ISelection current, ISelection candidate);
-
- /**
- * Returns whether the node corresponding to the given element or tree path
- * is expanded or collapsed.
- *
- * @param elementOrTreePath
- * the element
- * @return <code>true</code> if the node is expanded, and
- * <code>false</code> if collapsed
- */
- public boolean getExpandedState(Object elementOrTreePath);
-
- /**
- * Returns whether the given element has children.
- *
- * @since 3.6
- */
- public boolean getHasChildren(Object elementOrTreePath);
-
- /**
- * Returns the child count of the element at the given path. <br>
- * Note: The child count may be incorrect if the element is not
- * expanded in the tree.
- */
- public int getChildCount(TreePath path);
-
- /**
- * Returns the element which is a child of the element at the
- * given path, with the given index.
- */
- public Object getChildElement(TreePath path, int index);
-
- /**
- * Returns the tree path of the element that is at the top of the
- * viewer.
- */
- public TreePath getTopElementPath();
-
- /**
- * Finds the index of the given element with a parent of given path.
- *
- * @return The element's index, or -1 if not found.
- */
- public int findElementIndex(TreePath parentPath, Object element);
-
- /**
- * Returns a boolean indicating whether all the child elements of the
- * given parent have been realized already.
- *
- * @param parentPath
- * @return
- *
- * @since 3.6
- */
- public boolean getElementChildrenRealized(TreePath parentPath);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelLabelProvider.java
deleted file mode 100644
index b2c2d5cd9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelLabelProvider.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * {@link TreeModelViewer} label provider interface. In addition to
- * implementing this interface, the label provider for the TreeModelViewer
- * must also extend CellLabelProvider.
- *
- * @since 3.5
- */
-public interface ITreeModelLabelProvider extends IBaseLabelProvider {
-
- public boolean update(TreePath elementPath);
-
- /**
- * Registers the specified listener for view label update notifications.
- */
- public void addLabelUpdateListener(ILabelUpdateListener listener);
-
- /**
- * Removes the specified listener from view label update notifications.
- */
- public void removeLabelUpdateListener(ILabelUpdateListener listener);
-
- /**
- * Returns an image for the given image descriptor or <code>null</code>. Adds the image
- * to a cache of images if it does not already exist.
- *
- * @param descriptor image descriptor or <code>null</code>
- * @return image or <code>null</code>
- */
- public Image getImage(ImageDescriptor descriptor);
-
- /**
- * Returns a font for the given font data or <code>null</code>. Adds the font to the font
- * cache if not yet created.
- *
- * @param fontData font data or <code>null</code>
- * @return font font or <code>null</code>
- */
- public Font getFont(FontData fontData);
-
- /**
- * Returns a color for the given RGB or <code>null</code>. Adds the color to the color
- * cache if not yet created.
- *
- * @param rgb RGB or <code>null</code>
- * @return color or <code>null</code>
- */
- public Color getColor(RGB rgb);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelLabelProviderTarget.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelLabelProviderTarget.java
deleted file mode 100644
index add8a89be..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelLabelProviderTarget.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * This interface must be implemented by the viewer which uses the
- * {@link TreeModelLabelProvider} label provider. It allows the label
- * provider to update the viewer with information retrieved from the
- * element-based label providers.
- *
- * @since 3.5
- */
-public interface ITreeModelLabelProviderTarget extends ITreeModelViewer {
-
- /**
- * Sets the element's display information.
- * <p>
- * This method should only be called by the viewer framework.
- * </p>
- *
- * @param path Element path.
- * @param numColumns Number of columns in the data.
- * @param labels Array of labels. The array cannot to be
- * <code>null</code>, but values within the array may be.
- * @param images Array of image descriptors, may be <code>null</code>.
- * @param fontDatas Array of fond data objects, may be <code>null</code>.
- * @param foregrounds Array of RGB values for foreground colors, may be
- * <code>null</code>.
- * @param backgrounds Array of RGB values for background colors, may be
- * <code>null</code>.
- */
- public void setElementData(TreePath path, int numColumns, String[] labels, ImageDescriptor[] images, FontData[] fontDatas, RGB[] foregrounds, RGB[] backgrounds);
-
- /**
- * Returns identifiers of the visible columns in this viewer, or <code>null</code>
- * if there is currently no column presentation.
- *
- * @return visible columns or <code>null</code>
- */
- public String[] getVisibleColumns();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelViewer.java
deleted file mode 100644
index a23191780..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelViewer.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IStateUpdateListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualTreeModelViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.ViewerLabel;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Interface of an tree model viewer. It declares the common methods for the
- * JFace-based {@link TreeModelViewer} and the UI-less
- * {@link VirtualTreeModelViewer}.
- *
- * @since 3.5
- */
-public interface ITreeModelViewer extends ISelectionProvider {
-
- /**
- * Constant indicating that all levels of the tree should be expanded or
- * collapsed.
- *
- * @see #setAutoExpandLevel(int)
- * @see #getAutoExpandLevel()
- */
- public static final int ALL_LEVELS = -1;
-
- /**
- * Returns the Display object that this viewer is in. The
- * display object can be used by clients to access the display thread
- * to call the viewer methods.
- */
- public Display getDisplay();
-
- /**
- * Returns this viewer's presentation context.
- *
- * @return presentation context
- */
- public IPresentationContext getPresentationContext();
-
- /**
- * Returns the current input of this viewer, or <code>null</code>
- * if none. The viewer's input provides the "model" for the viewer's
- * content.
- */
- public Object getInput();
-
- /**
- * Sets the input of this viewer. Setting the input resets the
- * viewer's contents and triggers an update starting at the input
- * element.
- * @param object Input element, or <code>null</code> if none.
- */
- public void setInput(Object object);
-
- /**
- * Returns the current selection in viewer.
- */
- public ISelection getSelection();
-
- /**
- * Sets a new selection for this viewer and optionally makes it visible.
- *
- * @param selection the new selection
- * @param reveal <code>true</code> if the selection is to be made
- * visible, and <code>false</code> otherwise
- * @param force <code>true</code> if the selection should override the
- * model selection policy
- */
- public void setSelection(ISelection selection, boolean reveal, boolean force);
-
- /**
- * Returns the auto-expand level.
- *
- * @return non-negative level, or <code>ALL_LEVELS</code> if all levels of
- * the tree are expanded automatically
- * @see #setAutoExpandLevel
- */
- public int getAutoExpandLevel();
-
- /**
- * Sets the auto-expand level to be used when the input of the viewer is set
- * using {@link #setInput(Object)}. The value 0 means that there is no
- * auto-expand; 1 means that the invisible root element is expanded (since
- * most concrete implementations do not show the root element, there is usually
- * no practical difference between using the values 0 and 1); 2 means that
- * top-level elements are expanded, but not their children; 3 means that
- * top-level elements are expanded, and their children, but not
- * grandchildren; and so on.
- * <p>
- * The value <code>ALL_LEVELS</code> means that all subtrees should be
- * expanded.
- * </p>
- *
- * @param level
- * non-negative level, or <code>ALL_LEVELS</code> to expand all
- * levels of the tree
- */
- public void setAutoExpandLevel(int level);
-
- /**
- * Returns the label data for the given element and for the given column,
- * Returns <code>null</code> if the given element is not found or is not
- * materialized in the virtual viewer. Clients may listen to label update
- * events to be notified when element labels are updated.
- *
- * @param path Path of the element.
- * @param columnIdx ID of the column for which to return the label data.
- * @return Label object containing the label information. Can be
- * <code>null</code> if the given element is not found or is not
- * materialized in the virtual viewer.
- */
- public ViewerLabel getElementLabel(TreePath path, String columnId);
-
- /**
- * Registers the specified listener for view update notifications.
- */
- public void addViewerUpdateListener(IViewerUpdateListener listener);
-
- /**
- * Removes the specified listener from update notifications.
- */
- public void removeViewerUpdateListener(IViewerUpdateListener listener);
-
- /**
- * Registers the specified listener for state update notifications.
- * @since 3.6
- */
- public void addStateUpdateListener(IStateUpdateListener listener);
-
- /**
- * Removes the specified listener from state update notifications.
- * @since 3.6
- */
- public void removeStateUpdateListener(IStateUpdateListener listener);
-
- /**
- * Registers the specified listener for view label update notifications.
- */
- public void addLabelUpdateListener(ILabelUpdateListener listener);
-
- /**
- * Removes the specified listener from view label update notifications.
- */
- public void removeLabelUpdateListener(ILabelUpdateListener listener);
-
- /**
- * Registers the given listener for model delta notification.
- * This listener is called immediately after the viewer processes
- * the delta.
- */
- public void addModelChangedListener(IModelChangedListener listener);
-
- /**
- * Removes the given listener from model delta notification.
- */
- public void removeModelChangedListener(IModelChangedListener listener);
-
- /**
- * Writes state information into a delta for the sub-tree at the given
- * path. It adds delta nodes and IModelDelta.EXPAND and IModelDelta.SELECT
- * as it parses the sub-tree.
- * @param path Path where to start saving the state.
- * @param delta The delta where the state is to be saved.
- * @param flagsToSave The flags to preserve during the state save. The
- * supported flags are <code>IModelDelta.SELECT</code>,
- * <code>IModelDelta.EXPAND</code>, <code>IModelDelta.COLLAPSE</code>.
- *
- * @since 3.6
- */
- public void saveElementState(TreePath path, ModelDelta delta, int flagsToSave);
-
- /**
- * Causes the viewer to process the given delta as if it came from a
- * model proxy. This method is intended to be used to restore state
- * saved using {@link #saveElementState(TreePath, ModelDelta)}.
- *
- * @param delta Delta to process.
- */
- public void updateViewer(IModelDelta delta);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java
deleted file mode 100644
index 1177bb805..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java
+++ /dev/null
@@ -1,2439 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech (Wind River) - added support for a virtual tree model viewer (Bug 242489)
- * Patrick Chuong (Texas Instruments) - added support for checkbox (Bug 286310)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.core.commands.Request;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ICheckUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ICheckboxModelProxy;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementEditor;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelSelectionPolicy;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IStateUpdateListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.IBasicPropertyConstants;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ILazyTreePathContentProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerLabel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.IMemento;
-
-/**
- * A tree viewer that displays a model.
- *
- * @since 3.3
- */
-public class InternalTreeModelViewer extends TreeViewer
- implements ITreeModelViewer, ITreeModelContentProviderTarget, ITreeModelLabelProviderTarget, ITreeModelCheckProviderTarget
-{
-
- private IPresentationContext fContext;
-
- /**
- * Current column presentation or <code>null</code>
- */
- private IColumnPresentation fColumnPresentation = null;
-
- /**
- * Map of columns presentation id to its visible columns id's (String[])
- * When a columns presentation is not in the map, default settings are used.
- */
- private Map fVisibleColumns = new HashMap();
-
- /**
- * Map of column id's to persisted sizes
- */
- private Map fColumnSizes = new HashMap();
-
- /**
- * Map of column presentation id's to an array of integers representing the column order
- * for that presentation, or <code>null</code> if default.
- */
- private Map fColumnOrder = new HashMap();
-
- /**
- * Map of column presentation id to whether columns should be displayed
- * for that presentation (the user can toggle columns on/off when a
- * presentation is optional.
- */
- private Map fShowColumns = new HashMap();
-
- /**
- * Item's tree path cache
- */
- private static final String TREE_PATH_KEY = "TREE_PATH_KEY"; //$NON-NLS-1$
-
- /**
- * Memento type for column sizes. Sizes are keyed by column presentation id
- */
- private static final String COLUMN_SIZES = "COLUMN_SIZES"; //$NON-NLS-1$
- /**
- * Memento type for the column order for a presentation context.
- * A memento is created for each column presentation
- */
- private static final String COLUMN_ORDER = "COLUMN_ORDER"; //$NON-NLS-1$
- /**
- * Memento type for the visible columns for a presentation context.
- * A memento is created for each column presentation keyed by column number
- */
- private static final String VISIBLE_COLUMNS = "VISIBLE_COLUMNS"; //$NON-NLS-1$
- /**
- * Memento type for whether columns are visible for a presentation context.
- * Booleans are keyed by column presentation id
- */
- private static final String SHOW_COLUMNS = "SHOW_COLUMNS"; //$NON-NLS-1$
- /**
- * Memento key for the number of visible columns in a VISIBLE_COLUMNS memento
- * or for the width of a column
- */
- private static final String SIZE = "SIZE"; //$NON-NLS-1$
- /**
- * Memento key prefix a visible column
- */
- private static final String COLUMN = "COLUMN"; //$NON-NLS-1$
-
- /**
- * True while performing an insert... we allow insert with filters
- */
- private boolean fInserting = false;
-
- /**
- * Whether to notify the content provider when an element is unmapped
- */
- private boolean fNotifyUnmap = true;
-
- /**
- * Flag indicating whether the viewer is a pop-up viewer. A pop-up viewer
- * is transient and does not automatically expand and select elements up
- * when requested by the model. It also does not dispose the presentation
- * context when its control is disposed.
- *
- * @since 3.5
- */
- private boolean fIsPopup;
-
- /**
- * Persist column sizes when they change.
- *
- * @since 3.2
- */
- class ColumnListener implements ControlListener {
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.ControlListener#controlMoved(org.eclipse.swt.events.ControlEvent)
- */
- public void controlMoved(ControlEvent e) {
- persistColumnOrder();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.ControlListener#controlResized(org.eclipse.swt.events.ControlEvent)
- */
- public void controlResized(ControlEvent e) {
- persistColumnSizes();
- }
- }
-
- private ColumnListener fListener = new ColumnListener();
-
- /**
- * Proxy to cell modifier/editor support
- */
- class CellModifierProxy implements ICellModifier {
-
- private ICellModifier fModifier;
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String)
- */
- public boolean canModify(Object element, String property) {
- IElementEditor editor = ViewerAdapterService.getElementEditor(element);
- if (editor != null) {
- fModifier = editor.getCellModifier(getPresentationContext(), element);
- if (fModifier != null) {
- if (fModifier.canModify(element, property)) {
- // install cell editor
- CellEditor cellEditor = editor.getCellEditor(getPresentationContext(), property, element, (Composite)getControl());
- if (cellEditor != null) {
- disposeCellEditors();
- CellEditor[] newEditors = new CellEditor[getVisibleColumns().length];
- for (int i = 0; i < newEditors.length; i++) {
- newEditors[i] = cellEditor;
- }
- setCellEditors(newEditors);
- return true;
- }
- }
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String)
- */
- public Object getValue(Object element, String property) {
- if (fModifier != null) {
- return fModifier.getValue(element, property);
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object)
- */
- public void modify(Object element, String property, Object value) {
- if (fModifier != null) {
- if (element instanceof Item) {
- element = ((Item)element).getData();
- }
- fModifier.modify(element, property, value);
- }
- }
-
- /**
- * Disposes client's column editor and cell editors
- */
- protected void dispose() {
- fModifier = null;
- disposeCellEditors();
- setCellEditors(null);
- }
-
- /**
- * Disposes current cell editors
- */
- protected void disposeCellEditors() {
- CellEditor[] cellEditors = getCellEditors();
- if (cellEditors != null) {
- for (int i = 0; i < cellEditors.length; i++) {
- CellEditor editor = cellEditors[i];
- if (editor != null) {
- editor.dispose();
- }
- }
- }
- }
-
- }
-
- private CellModifierProxy fCellModifier;
-
- /**
- * A handle to an element in a model.
- */
- class VirtualElement {
- /**
- * Tree item associated with the element, or <code>null</code> for the root element
- */
- private TreeItem fItem;
-
- /**
- * Model element (can be <code>null</code> until retrieved)
- */
- private Object fElement;
-
- /**
- * Associated label update or <code>null</code> if the element was already
- * present in the tree.
- */
- private VirtualLabelUpdate fLabel;
-
- /**
- * Children elements or <code>null</code> if none
- */
- private VirtualElement[] fChildren = null;
-
- /**
- * Whether this element would be filtered from the viewer
- */
- private boolean fFiltered = false;
-
- /**
- * Listens for update when populating this virtual element in the tree viewer
- */
- class UpdateListener implements IViewerUpdateListener {
-
- /**
- * The parent pending update
- */
- private TreePath fParentPath;
-
- /**
- * The child index pending update
- */
- private int fIndex;
-
- /**
- * Whether the update has completed
- */
- private boolean fDone = false;
-
- /**
- * Constructs a new listener waiting
- * @param parentPath
- * @param childIndex
- */
- UpdateListener(TreePath parentPath, int childIndex) {
- fParentPath = parentPath;
- fIndex = childIndex;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener#updateComplete(org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
- */
- public void updateComplete(IViewerUpdate update) {
- if (update instanceof IChildrenUpdate) {
- IChildrenUpdate cu = (IChildrenUpdate) update;
- if (cu.getElementPath().equals(fParentPath)) {
- if (fIndex >= cu.getOffset() && fIndex <= (cu.getOffset() + cu.getLength())) {
- fDone = true;
- }
- }
- }
- }
-
- /**
- * Returns whether the update has completed.
- *
- * @return whether the update has completed
- */
- boolean isComplete() {
- return fDone;
- }
-
- public void updateStarted(IViewerUpdate update) {
- }
- public void viewerUpdatesBegin() {
- }
- public void viewerUpdatesComplete() {
- }
- }
-
- /**
- * Constructs a new virtual element for the given tree item and all
- * of its expanded children. Has to be called in the UI thread.
- * The model is used to count unrealized elements.
- *
- * Note only never re-use objects already in the tree as they may be out
- * of synch.
- *
- * @param item tree item
- * @param model virtual model
- * @param root subtree to consider or <code>null</code> if all
- * @param indexes children to consider or <code>null</code>
- */
- VirtualElement(TreeItem item, VirtualModel model, TreePath root, int[] indexes) {
- fItem = item;
- model.incVirtual();
- if (item.getExpanded()) {
- TreeItem[] items = item.getItems();
- fChildren = createChildren(items, model, root, indexes);
- }
- }
-
- /**
- * Constructs a new virtual element for the given tree and all expanded
- * children. The model is passed in to count unrealized elements.
- *
- * @param tree tree
- * @param model virtual model
- * @param root subtree scope or <code>null</code> for all
- * @param indexes child indexes to consider or <code>null</code>
- */
- VirtualElement(Tree tree, VirtualModel model, TreePath root, int[] indexes) {
- fElement = tree.getData();
- TreeItem[] items = tree.getItems();
- if (items.length > 0) {
- fChildren = createChildren(items, model, root, indexes);
- }
- }
-
- /**
- * Creates and returns children elements.
- *
- * @param items tree items
- * @param model model
- * @param root subtree to consider or all if <code>null</code>
- * @param indexes children of the root to consider or <code>null</code>
- * @return children
- */
- private VirtualElement[] createChildren(TreeItem[] items, VirtualModel model, TreePath root, int[] indexes) {
- VirtualElement[] kids = new VirtualElement[items.length];
- if (root == null || root.getSegmentCount() == 0) {
- if (indexes == null) {
- for (int i = 0; i < items.length; i++) {
- kids[i] = new VirtualElement(items[i], model, null, null);
- }
- } else {
- for (int i = 0; i < indexes.length; i++) {
- int index = indexes[i];
- kids[index] = new VirtualElement(items[index], model, null, null);
- }
- }
- } else {
- for (int i = 0; i < items.length; i++) {
- TreeItem treeItem = items[i];
- if (treeItem.getData() != null) {
- TreePath path = getTreePathFromItem(treeItem);
- if (root.startsWith(path, null)) {
- if (root.getSegmentCount() > path.getSegmentCount()) {
- kids[i] = new VirtualElement(treeItem, model, root, indexes);
- } else {
- kids[i] = new VirtualElement(treeItem, model, null, indexes);
- }
- break;
- }
- }
- }
- }
- return kids;
- }
-
- /**
- * Returns whether this element would be filtered from the viewer.
- *
- * @return whether filtered
- */
- public boolean isFiltered() {
- return fFiltered;
- }
-
- /**
- * Causes the tree item associated with this model element to be realized.
- * Must be called in the UI thread.
- *
- * @return tree path to associated element, or <code>null</code> if the operation
- * fails
- */
- public TreePath realize() {
- if (fItem.getData() != null) {
- return getTreePathFromItem(fItem);
- }
- int index = -1;
- TreePath parentPath = null;
- if (fItem.getParentItem() == null) {
- index = getTree().indexOf(fItem);
- parentPath = TreePath.EMPTY;
- } else {
- index = fItem.getParentItem().indexOf(fItem);
- parentPath = getTreePathFromItem(fItem.getParentItem());
- }
- UpdateListener listener = new UpdateListener(parentPath, index);
- addViewerUpdateListener(listener);
- ((ILazyTreePathContentProvider)getContentProvider()).updateElement(parentPath, index);
- Display display = getTree().getDisplay();
- while (!listener.isComplete()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
- removeViewerUpdateListener(listener);
- if (fItem.getData() != null) {
- return getTreePathFromItem(fItem);
- }
- return null;
- }
-
- /**
- * Schedules updates to retrieve unrealized children of this node.
- *
- * @param parentPath path to this element
- * @param model model
- */
- void retrieveChildren(TreePath parentPath, VirtualModel model) {
- VirtualChildrenUpdate update = null;
- if (fChildren != null) {
- int prevModelIndex = Integer.MAX_VALUE;
- for (int i = 0; i < fChildren.length; i++) {
- VirtualElement element = fChildren[i];
- if (element == null) {
- if (update != null) {
- // non-consecutive updates, schedule and keep going
- model.scheduleUpdate(update);
- update = null;
- }
- } else {
- int modelIndex = ((ITreeModelContentProvider)getContentProvider()).viewToModelIndex(parentPath, i);
- if (update == null) {
- update = new VirtualChildrenUpdate(parentPath, this, model);
- } else if ((modelIndex - prevModelIndex) > 1) {
- // non-consecutive updates, schedule and keep going
- model.scheduleUpdate(update);
- update = new VirtualChildrenUpdate(parentPath, this, model);
- }
- update.add(modelIndex);
- prevModelIndex = modelIndex;
- }
- }
- }
- if (update != null) {
- model.scheduleUpdate(update);
- }
- }
-
- /**
- * Sets the underlying model object.
- *
- * @param path path to the element
- */
- void setElement(Object data) {
- fElement = data;
- }
-
- /**
- * Sets the label update associated with this element
- *
- * @param update
- */
- void setLabelUpdate(VirtualLabelUpdate update) {
- fLabel = update;
- }
-
- /**
- * Returns the image for this element or <code>null</code> if none
- *
- * @return image or <code>null</code> if none
- */
- public Image getImage() {
- if (fLabel == null) {
- return fItem.getImage();
- } else {
- return ((ITreeModelLabelProvider)getLabelProvider()).getImage(fLabel.fImage);
- }
- }
-
- /**
- * Returns the labels for the element - one for each column requested.
- *
- * @return column labels
- */
- public String[] getLabel() {
- if (fLabel == null) {
- String[] visibleColumns = getVisibleColumns();
- String[] label = new String[visibleColumns == null ? 1 : visibleColumns.length];
- for (int i = 0; i < label.length; i++) {
- label[i] = fItem.getText(i);
- }
- return label;
- }
- return fLabel.fText;
-
- }
-
- /**
- * Returns the children of this element or <code>null</code> if none.
- *
- * @return children or <code>null</code> if none
- */
- public VirtualElement[] getChildren() {
- return fChildren;
- }
-
- }
-
- /**
- * Common function for virtual updates.
- */
- class VirtualUpdate extends Request implements IViewerUpdate {
-
- /**
- * Path to the element being updated, or EMPTY for viewer input.
- */
- private TreePath fPath;
-
- /**
- * Element being updated.
- */
- VirtualElement fVirtualElement;
-
- /**
- * Associated virtual model
- */
- VirtualModel fModel = null;
-
- /**
- * Creates a new update based for the given element and model
- */
- public VirtualUpdate(VirtualModel model, VirtualElement element, TreePath elementPath) {
- fPath = elementPath;
- fModel = model;
- fVirtualElement = element;
- }
-
- /**
- * Returns the associated virtual element.
- *
- * @return virtual element
- */
- protected VirtualElement getVirtualElement() {
- return fVirtualElement;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElement()
- */
- public Object getElement() {
- if (fPath.getSegmentCount() == 0) {
- return getViewerInput();
- }
- return fPath.getLastSegment();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElementPath()
- */
- public TreePath getElementPath() {
- return fPath;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getPresentationContext()
- */
- public IPresentationContext getPresentationContext() {
- return InternalTreeModelViewer.this.getPresentationContext();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getViewerInput()
- */
- public Object getViewerInput() {
- return InternalTreeModelViewer.this.getInput();
- }
-
- }
-
- /**
- * Represents all expanded items in this viewer's tree. The model is virtual - i.e. not
- * all items have their associated model elements/labels retrieved from the model. The
- * model can be populated in a non-UI thread.
- */
- class VirtualModel {
-
- /**
- * Update requests in progress (children updates and label updates)
- */
- private List fPendingUpdates = new ArrayList();
-
- /**
- * Whether population has been canceled.
- */
- private boolean fCanceled = false;
-
- /**
- * Root element in the model.
- */
- private VirtualElement fRoot = null;
-
- /**
- * Progress monitor to use during retrieval of virtual elements
- */
- private IProgressMonitor fMonitor = null;
-
- /**
- * Column IDs to generate labels for or <code>null</code> if no columns.
- */
- private String[] fColumnIds;
-
- /**
- * Count of the number of virtual (unrealized) elements in this model
- * when it was created.
- */
- private int fVirtualCount = 0;
-
- /**
- * Creates a virtual model for this tree viewer limited to the given
- * subtrees. Includes the entire model if root is <code>null</code>.
- *
- * @param root limits model to given subtree scope, or <code>null</code>
- * @param childIndexes children of the root to consider or <code>null</code>
- */
- VirtualModel(TreePath root, int[] childIndexes) {
- fRoot = new VirtualElement(getTree(), this, root, childIndexes);
- }
-
- /**
- * Increments the counter of virtual elements in the model.
- */
- void incVirtual() {
- fVirtualCount++;
- }
-
- /**
- * update progress monitor
- *
- * @param work
- */
- void worked(int work) {
- fMonitor.worked(work);
- }
-
- /**
- * Schedules a children update.
- */
- private synchronized void scheduleUpdate(IChildrenUpdate update) {
- Object element = update.getElement();
- if (element == null) {
- element = getInput();
- }
- IElementContentProvider provider = ViewerAdapterService.getContentProvider(element);
- if (provider != null) {
- fPendingUpdates.add(update);
- provider.update(new IChildrenUpdate[]{update});
- }
- }
-
- /**
- * Populates this models elements that have not yet been retrieved from the model,
- * returning all elements in the model, or <code>null</code> if canceled.
- *
- * @param monitor progress monitor for progress reporting and for checking if canceled
- * @param taskName used in progress monitor, for example "Find..."
- * @param columnIds labels to generate or <code>null</code> if no columns are to be used
- * @return model elements or <code>null</code> if canceled
- */
- public VirtualElement populate(IProgressMonitor monitor, String taskName, String[] columnIds) {
- fMonitor = monitor;
- fColumnIds = columnIds;
- monitor.beginTask(taskName, fVirtualCount * 2);
- boolean done = false;
- fRoot.retrieveChildren(TreePath.EMPTY, this);
- synchronized (this) {
- done = fPendingUpdates.isEmpty();
- }
- while (!done) {
- synchronized (this) {
- try {
- wait(500);
- } catch (InterruptedException e) {
- }
- }
- if (monitor.isCanceled()) {
- cancel();
- return null;
- }
- synchronized (this) {
- done = fPendingUpdates.isEmpty();
- }
- }
- monitor.done();
- return fRoot;
- }
-
- /**
- * Cancels all pending updates.
- */
- void cancel() {
- synchronized (this) {
- fCanceled = true;
- Iterator iterator = fPendingUpdates.iterator();
- while (iterator.hasNext()) {
- IViewerUpdate update = (IViewerUpdate) iterator.next();
- update.cancel();
- }
- fPendingUpdates.clear();
- }
- }
- private synchronized boolean isCanceled() {
- return fCanceled;
- }
-
- /**
- * Notification the given children update is complete. Schedules associated label
- * updates if the request or the population of the model has not been canceled.
- *
- * @param update completed children update request
- */
- synchronized void done(VirtualChildrenUpdate update) {
- if (!isCanceled()) {
- fPendingUpdates.remove(update);
- if (!update.isCanceled()) {
- VirtualElement[] children = update.fVirtualElement.fChildren;
- TreePath parent = update.getElementPath();
- IElementLabelProvider provider = null;
- List requests = new ArrayList();
- int start = update.getOffset();
- int end = start + update.getLength();
- for (int i = start; i < end; i++) {
- int viewIndex = ((ITreeModelContentProvider)getContentProvider()).modelToViewIndex(parent, i);
- VirtualElement proxy = children[viewIndex];
- if (proxy.fFiltered) {
- fMonitor.worked(1); // don't need the label, this one is already done
- } else {
- Object element = proxy.fElement;
- if (element != null) { // null indicates other updates coming later
- VirtualLabelUpdate labelUpdate = new VirtualLabelUpdate(update.fModel, proxy, parent.createChildPath(element));
- proxy.setLabelUpdate(labelUpdate);
- IElementLabelProvider next = ViewerAdapterService.getLabelProvider(element);
- if (next != null) {
- fPendingUpdates.add(labelUpdate);
- }
- if (provider == null) {
- provider = next;
- requests.add(labelUpdate);
- } else if (next != null) {
- if (provider.equals(next)) {
- requests.add(labelUpdate);
- } else {
- // schedule queued requests, label provider has changed
- provider.update((ILabelUpdate[])requests.toArray(new ILabelUpdate[requests.size()]));
- requests.clear();
- requests.add(labelUpdate);
- provider = next;
- }
- }
- }
- }
- }
- if (provider != null && !requests.isEmpty()) {
- provider.update((ILabelUpdate[])requests.toArray(new ILabelUpdate[requests.size()]));
- }
- }
- notifyAll();
- }
- }
-
- /**
- * Notification the given label update is complete. Updates progress reporting
- * and updates pending updates.
- *
- * @param update label update that was completed
- */
- synchronized void done(VirtualLabelUpdate update) {
- if (!isCanceled()) {
- fPendingUpdates.remove(update);
- fMonitor.worked(1);
- }
- if (fPendingUpdates.isEmpty()) {
- notifyAll();
- }
- }
- }
-
- /**
- * Request to update a range of children.
- */
- class VirtualChildrenUpdate extends VirtualUpdate implements IChildrenUpdate {
-
- private int fOffset = -1;
- private int fLength = 0;
-
- /**
- * @param elementPath
- */
- public VirtualChildrenUpdate(TreePath parentPath, VirtualElement parent, VirtualModel model) {
- super(model, parent, parentPath);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate#getLength()
- */
- public int getLength() {
- return fLength;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate#getOffset()
- */
- public int getOffset() {
- return fOffset;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate#setChild(java.lang.Object, int)
- */
- public void setChild(Object child, int offset) {
- int viewIndex = ((ITreeModelContentProvider)getContentProvider()).modelToViewIndex(getElementPath(), offset);
- VirtualElement virtualChild = getVirtualElement().fChildren[viewIndex];
- virtualChild.setElement(child);
- ITreeModelContentProvider provider = (ITreeModelContentProvider) getContentProvider();
- virtualChild.fFiltered = provider.shouldFilter(getElementPath(), child);
- if (!virtualChild.fFiltered) {
- virtualChild.retrieveChildren(getElementPath().createChildPath(child), fModel);
- }
- fModel.worked(1);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.commands.Request#done()
- */
- public void done() {
- fModel.done(this);
- }
-
- /**
- * @param treeItem
- * @param i
- */
- void add(int i) {
- if (fOffset == -1) {
- fOffset = i;
- }
- fLength++;
- }
-
- }
-
- class VirtualLabelUpdate extends VirtualUpdate implements ILabelUpdate {
-
- /**
- * Constructs a label request for the given element;
- *
- * @param elementPath
- */
- public VirtualLabelUpdate(VirtualModel coordinator, VirtualElement element, TreePath elementPath) {
- super(coordinator, element, elementPath);
- }
-
- private String[] fText;
- private ImageDescriptor fImage;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate#getColumnIds()
- */
- public String[] getColumnIds() {
- return fModel.fColumnIds;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate#setBackground(org.eclipse.swt.graphics.RGB, int)
- */
- public void setBackground(RGB background, int columnIndex) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate#setFontData(org.eclipse.swt.graphics.FontData, int)
- */
- public void setFontData(FontData fontData, int columnIndex) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate#setForeground(org.eclipse.swt.graphics.RGB, int)
- */
- public void setForeground(RGB foreground, int columnIndex) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate#setImageDescriptor(org.eclipse.jface.resource.ImageDescriptor, int)
- */
- public void setImageDescriptor(ImageDescriptor image, int columnIndex) {
- fImage = image;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate#setLabel(java.lang.String, int)
- */
- public void setLabel(String text, int columnIndex) {
- if (fText == null) {
- if (getColumnIds() == null) {
- fText = new String[1];
- } else {
- fText = new String[getColumnIds().length];
- }
- }
- fText[columnIndex] = text;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.commands.Request#done()
- */
- public void done() {
- fModel.done(this);
- }
-
- }
-
- /**
- * @param parent
- * @param style
- */
- public InternalTreeModelViewer(Composite parent, int style, IPresentationContext context) {
- super(parent, style);
- if ((style & SWT.VIRTUAL) == 0) {
- throw new IllegalArgumentException("style must include SWT.VIRTUAL"); //$NON-NLS-1$
- }
- setUseHashlookup(true);
- fCellModifier = new CellModifierProxy();
- fContext = context;
- setContentProvider(createContentProvider());
- setLabelProvider(createLabelProvider());
-
- fIsPopup = (style & SWT.POP_UP) != 0;
- if (fIsPopup) {
- ((ITreeModelContentProvider)getContentProvider()).setModelDeltaMask(
- ~ITreeModelContentProvider.ALL_MODEL_DELTA_FLAGS & ~ITreeModelContentProvider.CONTROL_MODEL_DELTA_FLAGS);
- }
- if ((style & SWT.CHECK) != 0) {
- context.setProperty(ICheckUpdate.PROP_CHECK, Boolean.TRUE);
- }
- }
-
- /**
- * @return content provider for this tree viewer
- */
- protected ITreeModelContentProvider createContentProvider()
- {
- return new TreeModelContentProvider();
- }
-
- /**
- * @return label provider for this tree viewer
- */
- protected ITreeModelLabelProvider createLabelProvider()
- {
- return new TreeModelLabelProvider(this);
- }
-
- /* (non-Javadoc)
- *
- * Workaround for bug 159461: when an item is cleared it's label is cleared. To avoid
- * flashing, restore its label to its previous value.
- *
- * @see org.eclipse.jface.viewers.TreeViewer#hookControl(org.eclipse.swt.widgets.Control)
- */
- protected void hookControl(Control control) {
- Tree treeControl = (Tree) control;
- treeControl.addListener(SWT.SetData, new Listener() {
- public void handleEvent(Event event) {
- // to avoid flash, reset previous label data
- TreeItem item = (TreeItem) event.item;
- preserveItem(item);
- }
- });
- super.hookControl(control);
- }
-
- /**
- * @param item
- */
- private void preserveItem(TreeItem item) {
- Object[] labels = (Object[]) item.getData(PREV_LABEL_KEY);
- if (labels != null) {
- for (int i = 0; i < labels.length; i++) {
- if (labels[i] != null) {
- item.setText(i, (String)labels[i]);
- }
- }
- }
- Object[] images = (Object[]) item.getData(PREV_IMAGE_KEY);
- if (images != null) {
- for (int i = 0; i < images.length; i++) {
- item.setImage(i, (Image) images[i]);
- }
- }
- Object[] fonts = (Object[]) item.getData(PREV_FONT_KEY);
- if (fonts != null) {
- for (int i = 0; i < fonts.length; i++) {
- item.setFont(i, (Font) fonts[i]);
- }
- }
- Object[] foregrounds = (Object[]) item.getData(PREV_FOREGROUND_KEY);
- if (foregrounds != null) {
- for (int i = 0; i < foregrounds.length; i++) {
- item.setForeground(i, (Color) foregrounds[i]);
- }
- }
- Object[] backgrounds = (Object[]) item.getData(PREV_BACKGROUND_KEY);
- if (backgrounds != null) {
- for (int i = 0; i < backgrounds.length; i++) {
- item.setBackground(i, (Color) backgrounds[i]);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.StructuredViewer#handleInvalidSelection
- *
- * Override the default handler for invalid selection to allow model
- * selection policy to select the new selection.
- */
- protected void handleInvalidSelection(ISelection selection, ISelection newSelection) {
- IModelSelectionPolicy selectionPolicy = ViewerAdapterService.getSelectionPolicy(selection, getPresentationContext());
- if (selectionPolicy != null) {
- while (!selection.equals(newSelection)) {
- ISelection temp = newSelection;
- selection = selectionPolicy.replaceInvalidSelection(selection, newSelection);
- if (selection == null) {
- selection = TreeSelection.EMPTY;
- }
- if (!temp.equals(selection)) {
- setSelectionToWidget(selection, false);
- newSelection = getSelection();
- } else {
- break;
- }
- }
- }
- super.handleInvalidSelection(selection, newSelection);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ContentViewer#handleDispose(org.eclipse.swt.events.DisposeEvent)
- */
- protected void handleDispose(DisposeEvent event) {
- if (fColumnPresentation != null) {
- fColumnPresentation.dispose();
- }
- fCellModifier.dispose();
-
- if (!fIsPopup) {
- fContext.dispose();
- }
- super.handleDispose(event);
- }
-
- /**
- * Returns this viewer's presentation context.
- *
- * @return presentation context
- */
- public IPresentationContext getPresentationContext() {
- return fContext;
- }
-
- protected void unmapElement(Object element, Widget widget) {
- if (fNotifyUnmap) {
- // TODO: should we update the filter with the "new non-identical element"?
- ((ITreeModelContentProvider) getContentProvider()).unmapPath((TreePath) widget.getData(TREE_PATH_KEY));
- }
- super.unmapElement(element, widget);
- }
-
- protected void associate(Object element, Item item) {
- // see AbstractTreeViewer.associate(...)
- Object data = item.getData();
- if (data != null && data != element && equals(data, element)) {
- // elements are equal but not identical
- // -> being removed from map, but should not change filters
- try {
- fNotifyUnmap = false;
- super.associate(element, item);
- } finally {
- fNotifyUnmap = true;
- }
- } else {
- super.associate(element, item);
- }
- }
-
- /* (non-Javadoc)
- *
- * We need tree paths when disposed/unmapped in any order so cache the tree path.
- *
- * @see org.eclipse.jface.viewers.TreeViewer#mapElement(java.lang.Object, org.eclipse.swt.widgets.Widget)
- */
- protected void mapElement(Object element, Widget widget) {
- super.mapElement(element, widget);
- if (widget instanceof Item) {
- widget.setData(TREE_PATH_KEY, getTreePathFromItem((Item)widget));
- } else {
- widget.setData(TREE_PATH_KEY, ModelContentProvider.EMPTY_TREE_PATH);
- }
- }
-
- /* (non-Javadoc)
- *
- * Override because we allow inserting with filters present.
- *
- * @see org.eclipse.jface.viewers.AbstractTreeViewer#insert(java.lang.Object, java.lang.Object, int)
- */
- public void insert(Object parentElementOrTreePath, Object element, int position) {
- try {
- fInserting = true;
- super.insert(parentElementOrTreePath, element, position);
- } finally {
- fInserting = false;
- }
- }
-
- /* (non-Javadoc)
- *
- * Override because we allow inserting with filters present.
- *
- * @see org.eclipse.jface.viewers.StructuredViewer#hasFilters()
- */
- protected boolean hasFilters() {
- if (fInserting) {
- return false;
- }
- return super.hasFilters();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.AbstractTreeViewer#inputChanged(java.lang.Object, java.lang.Object)
- */
- protected void inputChanged(Object input, Object oldInput) {
- super.inputChanged(input, oldInput);
- resetColumns(input);
- }
-
- /**
- * Configures the columns for the given viewer input.
- *
- * @param input
- */
- protected void resetColumns(Object input) {
- if (input != null) {
- // only change columns if the input is non-null (persist when empty)
- IColumnPresentationFactory factory = ViewerAdapterService.getColumnPresentationFactory(input);
- PresentationContext context = (PresentationContext) getPresentationContext();
- String type = null;
- if (factory != null) {
- type = factory.getColumnPresentationId(context, input);
- }
- if (type != null) {
- if (fColumnPresentation != null) {
- if (!fColumnPresentation.getId().equals(type)) {
- // dispose old, create new
- fColumnPresentation.dispose();
- fColumnPresentation = null;
- }
- }
- if (fColumnPresentation == null) {
- fColumnPresentation = factory.createColumnPresentation(context, input);
- if (fColumnPresentation != null) {
- fColumnPresentation.init(context);
- configureColumns();
- }
- }
- } else {
- if (fColumnPresentation != null) {
- fColumnPresentation.dispose();
- fColumnPresentation = null;
- configureColumns();
- }
- }
- }
- }
-
- /**
- * Configures the columns based on the current settings.
- *
- * @param input
- */
- protected void configureColumns() {
- if (fColumnPresentation != null) {
- IColumnPresentation build = null;
- if (isShowColumns(fColumnPresentation.getId())) {
- build = fColumnPresentation;
- }
- buildColumns(build);
- } else {
- // get rid of columns
- buildColumns(null);
- }
- }
-
- /**
- * Toggles columns on/off for the current column presentation, if any.
- *
- * @param show whether to show columns if the current input supports
- * columns
- */
- public void setShowColumns(boolean show) {
- if (show) {
- if (!isShowColumns()) {
- fShowColumns.remove(fColumnPresentation.getId());
- }
- } else {
- if (isShowColumns()){
- fShowColumns.put(fColumnPresentation.getId(), Boolean.FALSE);
- }
- }
- refreshColumns();
- }
-
- /**
- * Resets any persisted column size for the given columns
- */
- public void resetColumnSizes(String[] columnIds) {
- for (int i = 0; i < columnIds.length; i++) {
- fColumnSizes.remove(columnIds[i]);
- }
- }
-
- /**
- * Sets the id's of visible columns, or <code>null</code> to set default columns.
- * Only effects the current column presentation.
- *
- * @param ids visible columns
- */
- public void setVisibleColumns(String[] ids) {
- if (ids != null && ids.length == 0) {
- ids = null;
- }
- IColumnPresentation presentation = getColumnPresentation();
- if (presentation != null) {
- fColumnOrder.remove(presentation.getId());
- fVisibleColumns.remove(presentation.getId());
- if (ids != null) {
- // put back in table if not default
- String[] columns = presentation.getInitialColumns();
- if (columns.length == ids.length) {
- for (int i = 0; i < columns.length; i++) {
- if (!ids[i].equals(columns[i])) {
- fVisibleColumns.put(presentation.getId(), ids);
- break;
- }
- }
- } else {
- fVisibleColumns.put(presentation.getId(), ids);
- }
- }
- PresentationContext presentationContext = (PresentationContext) getPresentationContext();
- presentationContext.setColumns(getVisibleColumns());
- refreshColumns();
- }
- }
-
- /**
- * Refreshes the columns in the view, based on the viewer input.
- */
- protected void refreshColumns() {
- configureColumns();
- refresh();
- }
-
- /**
- * Returns whether columns are being displayed currently.
- *
- * @return
- */
- public boolean isShowColumns() {
- if (fColumnPresentation != null) {
- return isShowColumns(fColumnPresentation.getId());
- }
- return false;
- }
-
- /**
- * Returns whether columns can be toggled on/off for the current input.
- *
- * @return whether columns can be toggled on/off for the current input
- */
- public boolean canToggleColumns() {
- return fColumnPresentation != null && fColumnPresentation.isOptional();
- }
-
- protected boolean isShowColumns(String columnPresentationId) {
- Boolean bool = (Boolean) fShowColumns.get(columnPresentationId);
- if (bool == null) {
- return true;
- }
- return bool.booleanValue();
- }
-
- /**
- * Creates new columns for the given presentation.
- *
- * TODO: does this need to be asynchronous?
- *
- * @param presentation
- */
- protected void buildColumns(IColumnPresentation presentation) {
- // dispose current columns, persisting their weights
- Tree tree = getTree();
- final TreeColumn[] columns = tree.getColumns();
- String[] visibleColumnIds = getVisibleColumns();
- for (int i = 0; i < columns.length; i++) {
- TreeColumn treeColumn = columns[i];
- treeColumn.removeControlListener(fListener);
- treeColumn.dispose();
- }
- PresentationContext presentationContext = (PresentationContext) getPresentationContext();
- if (presentation != null) {
- for (int i = 0; i < visibleColumnIds.length; i++) {
- String id = visibleColumnIds[i];
- String header = presentation.getHeader(id);
- // TODO: allow client to specify style
- TreeColumn column = new TreeColumn(tree, SWT.LEFT, i);
- column.setMoveable(true);
- column.setText(header);
- column.setWidth(1);
- ImageDescriptor image = presentation.getImageDescriptor(id);
- if (image != null) {
- column.setImage(((ITreeModelLabelProvider)getLabelProvider()).getImage(image));
- }
- column.setData(id);
- }
- int[] order = (int[]) fColumnOrder.get(presentation.getId());
- if (order != null) {
- tree.setColumnOrder(order);
- }
- tree.setHeaderVisible(true);
- tree.setLinesVisible(true);
- presentationContext.setColumns(getVisibleColumns());
- setColumnProperties(getVisibleColumns());
- setCellModifier(fCellModifier);
- } else {
- tree.setHeaderVisible(false);
- tree.setLinesVisible(false);
- presentationContext.setColumns(null);
- setCellModifier(null);
- setColumnProperties(null);
- }
-
-
- int avg = tree.getSize().x;
- if (visibleColumnIds != null)
- avg /= visibleColumnIds.length;
-
- if (avg == 0) {
- tree.addPaintListener(new PaintListener() {
- public void paintControl(PaintEvent e) {
- Tree tree2 = getTree();
- String[] visibleColumns = getVisibleColumns();
- if (visibleColumns != null) {
- int avg1 = tree2.getSize().x / visibleColumns.length;
- initColumns(avg1);
- }
- tree2.removePaintListener(this);
- }
- });
- } else {
- initColumns(avg);
- }
- }
-
- private void initColumns(int widthHint) {
- TreeColumn[] columns = getTree().getColumns();
- for (int i = 0; i < columns.length; i++) {
- TreeColumn treeColumn = columns[i];
- Integer width = (Integer) fColumnSizes.get(treeColumn.getData());
- if (width == null) {
- treeColumn.setWidth(widthHint);
- } else {
- treeColumn.setWidth(width.intValue());
- }
- treeColumn.addControlListener(fListener);
- }
- }
-
- /**
- * Returns the current column presentation for this viewer, or <code>null</code>
- * if none.
- *
- * @return column presentation or <code>null</code>
- */
- public IColumnPresentation getColumnPresentation() {
- return fColumnPresentation;
- }
-
- /**
- * Returns identifiers of the visible columns in this viewer, or <code>null</code>
- * if there is currently no column presentation.
- *
- * @return visible columns or <code>null</code>
- */
- public String[] getVisibleColumns() {
- if (isShowColumns()) {
- IColumnPresentation presentation = getColumnPresentation();
- if (presentation != null) {
- String[] columns = (String[]) fVisibleColumns.get(presentation.getId());
- if (columns == null) {
- return presentation.getInitialColumns();
- }
- return columns;
- }
- }
- return null;
- }
-
- /**
- * Persists column sizes in cache
- */
- protected void persistColumnSizes() {
- Tree tree = getTree();
- TreeColumn[] columns = tree.getColumns();
- for (int i = 0; i < columns.length; i++) {
- TreeColumn treeColumn = columns[i];
- Object id = treeColumn.getData();
- fColumnSizes.put(id, new Integer(treeColumn.getWidth()));
- }
- }
-
- /**
- * Persists column ordering
- */
- protected void persistColumnOrder() {
- IColumnPresentation presentation = getColumnPresentation();
- if (presentation != null) {
- Tree tree = getTree();
- int[] order = tree.getColumnOrder();
- if (order.length > 0) {
- for (int i = 0; i < order.length; i++) {
- if (i != order[i]) {
- // non default order
- fColumnOrder.put(presentation.getId(), order);
- return;
- }
- }
- }
- // default order
- fColumnOrder.remove(presentation.getId());
- }
- }
-
- /**
- * Save viewer state into the given memento.
- *
- * @param memento
- */
- public void saveState(IMemento memento) {
- if (!fColumnSizes.isEmpty()) {
- Iterator iterator = fColumnSizes.entrySet().iterator();
- while (iterator.hasNext()) {
- Map.Entry entry = (Entry) iterator.next();
- IMemento sizes = memento.createChild(COLUMN_SIZES, (String)entry.getKey());
- sizes.putInteger(SIZE, ((Integer)entry.getValue()).intValue());
- }
- }
- if (!fShowColumns.isEmpty()) {
- Iterator iterator = fShowColumns.entrySet().iterator();
- while (iterator.hasNext()) {
- Map.Entry entry = (Entry) iterator.next();
- IMemento sizes = memento.createChild(SHOW_COLUMNS, (String)entry.getKey());
- sizes.putString(SHOW_COLUMNS, ((Boolean)entry.getValue()).toString());
- }
- }
- if (!fVisibleColumns.isEmpty()) {
- Iterator iterator = fVisibleColumns.entrySet().iterator();
- while (iterator.hasNext()) {
- Map.Entry entry = (Entry) iterator.next();
- String id = (String) entry.getKey();
- IMemento visible = memento.createChild(VISIBLE_COLUMNS, id);
- String[] columns = (String[]) entry.getValue();
- visible.putInteger(SIZE, columns.length);
- for (int i = 0; i < columns.length; i++) {
- visible.putString(COLUMN+Integer.toString(i), columns[i]);
- }
- }
- }
- if (!fColumnOrder.isEmpty()) {
- Iterator iterator = fColumnOrder.entrySet().iterator();
- while (iterator.hasNext()) {
- Map.Entry entry = (Entry) iterator.next();
- String id = (String) entry.getKey();
- IMemento orderMemento = memento.createChild(COLUMN_ORDER, id);
- int[] order = (int[]) entry.getValue();
- orderMemento.putInteger(SIZE, order.length);
- for (int i = 0; i < order.length; i++) {
- orderMemento.putInteger(COLUMN+Integer.toString(i), order[i]);
- }
- }
- }
- // save presentation context properties
- IPresentationContext context = getPresentationContext();
- if (context instanceof PresentationContext) {
- PresentationContext pc = (PresentationContext) context;
- pc.saveProperites(memento);
-
- }
- }
-
- /**
- * Initializes viewer state from the memento
- *
- * @param memento
- */
- public void initState(IMemento memento) {
- IMemento[] mementos = memento.getChildren(COLUMN_SIZES);
- for (int i = 0; i < mementos.length; i++) {
- IMemento child = mementos[i];
- String id = child.getID();
- Integer size = child.getInteger(SIZE);
- if (size != null) {
- fColumnSizes.put(id, size);
- }
- }
- mementos = memento.getChildren(SHOW_COLUMNS);
- for (int i = 0; i < mementos.length; i++) {
- IMemento child = mementos[i];
- String id = child.getID();
- Boolean bool = Boolean.valueOf(child.getString(SHOW_COLUMNS));
- if (!bool.booleanValue()) {
- fShowColumns.put(id, bool);
- }
- }
- mementos = memento.getChildren(VISIBLE_COLUMNS);
- for (int i = 0; i < mementos.length; i++) {
- IMemento child = mementos[i];
- String id = child.getID();
- Integer integer = child.getInteger(SIZE);
- if (integer != null) {
- int length = integer.intValue();
- String[] columns = new String[length];
- for (int j = 0; j < length; j++) {
- columns[j] = child.getString(COLUMN+Integer.toString(j));
- }
- fVisibleColumns.put(id, columns);
- }
- }
- mementos = memento.getChildren(COLUMN_ORDER);
- for (int i = 0; i < mementos.length; i++) {
- IMemento child = mementos[i];
- String id = child.getID();
- Integer integer = child.getInteger(SIZE);
- if (integer != null) {
- int length = integer.intValue();
- int[] order = new int[length];
- for (int j = 0; j < length; j++) {
- order[j] = child.getInteger(COLUMN+Integer.toString(j)).intValue();
- }
- fColumnOrder.put(id, order);
- }
- }
- // restore presentation context properties
- // save presentation context properties
- IPresentationContext context = getPresentationContext();
- if (context instanceof PresentationContext) {
- PresentationContext pc = (PresentationContext) context;
- pc.initProperties(memento);
- }
- }
-
- /**
- * Returns whether the candidate selection should override the current
- * selection.
- *
- * @param current
- * @param curr
- * @return
- */
- public boolean overrideSelection(ISelection current, ISelection candidate) {
- IModelSelectionPolicy selectionPolicy = ViewerAdapterService.getSelectionPolicy(current, getPresentationContext());
- if (selectionPolicy == null) {
- return true;
- }
- if (selectionPolicy.contains(candidate, getPresentationContext())) {
- return selectionPolicy.overrides(current, candidate, getPresentationContext());
- }
- return !selectionPolicy.isSticky(current, getPresentationContext());
- }
-
- /* (non-Javadoc)
- *
- * Consider selection policy
- *
- * @see org.eclipse.jface.viewers.StructuredViewer#setSelection(org.eclipse.jface.viewers.ISelection, boolean)
- */
- public void setSelection(ISelection selection, boolean reveal) {
- if (!overrideSelection(getSelection(), selection)) {
- return;
- }
- super.setSelection(selection, reveal);
- }
-
- /**
- * Sets the selection in the viewer to the specified selection.
- *
- * @param selection the selection
- * @param reveal whether to reveal the selection
- * @param force whether to force the selection (i.e. <code>true</code> to
- * override the model selection policy)
- */
- public void setSelection(ISelection selection, boolean reveal, boolean force) {
- if (force) {
- super.setSelection(selection, reveal);
- } else {
- setSelection(selection, reveal);
- }
- }
-
- /**
- * Registers the specified listener for view update notifications.
- *
- * @param listener listener
- */
- public void addViewerUpdateListener(IViewerUpdateListener listener) {
- ((ITreeModelContentProvider)getContentProvider()).addViewerUpdateListener(listener);
- }
-
- /**
- * Removes the specified listener from update notifications.
- *
- * @param listener listener
- */
- public void removeViewerUpdateListener(IViewerUpdateListener listener) {
- ITreeModelContentProvider cp = (ITreeModelContentProvider)getContentProvider();
- if (cp != null) {
- cp.removeViewerUpdateListener(listener);
- }
- }
-
- /**
- * Registers the given listener for model delta notification.
- *
- * @param listener model delta listener
- */
- public void addModelChangedListener(IModelChangedListener listener) {
- ((ITreeModelContentProvider)getContentProvider()).addModelChangedListener(listener);
- }
-
- /**
- * Unregisters the given listener from model delta notification.
- *
- * @param listener model delta listener
- */
- public void removeModelChangedListener(IModelChangedListener listener) {
- ITreeModelContentProvider cp = (ITreeModelContentProvider)getContentProvider();
- if (cp != null) {
- cp.removeModelChangedListener(listener);
- }
- }
-
- public void addStateUpdateListener(IStateUpdateListener listener) {
- ((ITreeModelContentProvider)getContentProvider()).addStateUpdateListener(listener);
- }
-
- public void removeStateUpdateListener(IStateUpdateListener listener) {
- ITreeModelContentProvider cp = (ITreeModelContentProvider)getContentProvider();
- if (cp != null) {
- cp.removeStateUpdateListener(listener);
- }
- }
-
- /*
- * (non-Javadoc) Method declared in AbstractTreeViewer.
- */
- protected void doUpdateItem(final Item item, Object element) {
- if (!(item instanceof TreeItem)) {
- return;
- }
- TreeItem treeItem = (TreeItem) item;
- if (treeItem.isDisposed()) {
- unmapElement(element, treeItem);
- return;
- }
-
- if ( !((ITreeModelLabelProvider)getLabelProvider()).update(getTreePathFromItem(item)) ) {
- if (element instanceof String) {
- item.setData(PREV_LABEL_KEY, new String[] { (String)element } );
- }
- }
-
-
- // As it is possible for user code to run the event
- // loop check here.
- if (item.isDisposed()) {
- unmapElement(element, item);
- }
- }
-
- /**
- * Collects all expanded items from this tree viewer and returns them as part of
- * a virtual model. This must be called in a UI thread to traverse the tree items.
- * The model can the be populated in a non-UI thread.
- *
- * Alternatively a root element can be specified with a set of child indexes to
- * consider. All children of the specified children are added to the model.
- *
- * @param root subtree to consider or <code>null</code> if all
- * @param childIndexes indexes of root element to consider, or <code>null</code> if all
- * @return virtual model
- */
- VirtualModel buildVirtualModel(TreePath root, int[] childIndexes) {
- return new VirtualModel(root, childIndexes);
- }
-
- public void addLabelUpdateListener(ILabelUpdateListener listener) {
- ((ITreeModelLabelProvider)getLabelProvider()).addLabelUpdateListener(listener);
- }
-
- public void removeLabelUpdateListener(ILabelUpdateListener listener) {
- if (!getControl().isDisposed()) {
- ((ITreeModelLabelProvider)getLabelProvider()).removeLabelUpdateListener(listener);
- }
- }
-
- /**
- * Returns the item for the element at the given tree path or <code>null</code>
- * if none.
- *
- * @param path tree path
- * @return item or <code>null</code>
- */
- public Widget findItem(TreePath path) {
- if (path.getSegmentCount() == 0) {
- return getTree();
- }
- Widget[] items = super.findItems(path.getLastSegment());
- if (items.length == 1) {
- return items[0];
- }
- for (int i = 0; i < items.length; i++) {
- if (getTreePathFromItem((Item)items[i]).equals(path)) {
- return items[i];
- }
- }
- return null;
- }
-
- public Item[] getChildren(Widget widget) {
- return super.getChildren(widget);
- }
-
- /**
- * Returns the tree path for the given item.
- * @param item
- * @return {@link TreePath}
- */
- protected TreePath getTreePathFromItem(Item item) {
- return super.getTreePathFromItem(item);
- }
-
-//**************************************************************************
-// These methods were copied from TreeViewer as a workaround for bug 183463:
-// Expanded nodes in tree viewer flash on refresh
-
- /*
- * (non-Javadoc)
- *
- * workaround for bug 183463
- *
- * @see org.eclipse.jface.viewers.AbstractTreeViewer#internalRefreshStruct(org.eclipse.swt.widgets.Widget,
- * java.lang.Object, boolean)
- */
- protected void internalRefreshStruct(Widget widget, Object element,
- boolean updateLabels) {
- // clear all starting with the given widget
- if (widget instanceof Tree) {
- ((Tree) widget).clearAll(true);
- } else if (widget instanceof TreeItem) {
- ((TreeItem) widget).clearAll(true);
- }
- int index = 0;
- Widget parent = null;
- if (widget instanceof TreeItem) {
- TreeItem treeItem = (TreeItem) widget;
- parent = treeItem.getParentItem();
- if (parent == null) {
- parent = treeItem.getParent();
- }
- if (parent instanceof Tree) {
- index = ((Tree) parent).indexOf(treeItem);
- } else {
- index = ((TreeItem) parent).indexOf(treeItem);
- }
- }
- virtualRefreshExpandedItems(parent, widget, element, index);
- }
-
- /**
- * Traverses the visible (expanded) part of the tree and updates child
- * counts.
- * <p>
- * workaround for bug 183463
- * </p>
- * @param parent the parent of the widget, or <code>null</code> if the widget is the tree
- * @param widget
- * @param element
- * @param index the index of the widget in the children array of its parent, or 0 if the widget is the tree
- */
- private void virtualRefreshExpandedItems(Widget parent, Widget widget, Object element, int index) {
- if (widget instanceof Tree) {
- if (element == null) {
- ((Tree) widget).setItemCount(0);
- return;
- }
- virtualLazyUpdateChildCount(widget, getChildren(widget).length);
- } else if (((TreeItem) widget).getExpanded()) {
- // prevent SetData callback
- preserveItem((TreeItem)widget);
- //((TreeItem)widget).setText(" "); //$NON-NLS-1$
- virtualLazyUpdateWidget(parent, index);
- } else {
- return;
- }
- Item[] items = getChildren(widget);
- for (int i = 0; i < items.length; i++) {
- Item item = items[i];
- Object data = item.getData();
- virtualRefreshExpandedItems(widget, item, data, i);
- }
- }
-
- /**
- * workaround for bug 183463
- *
- * Update the child count
- * @param widget
- * @param currentChildCount
- */
- private void virtualLazyUpdateChildCount(Widget widget, int currentChildCount) {
- TreePath treePath;
- if (widget instanceof Item) {
- treePath = getTreePathFromItem((Item) widget);
- } else {
- treePath = TreePath.EMPTY;
- }
- ((ILazyTreePathContentProvider) getContentProvider())
- .updateChildCount(treePath, currentChildCount);
- }
-
- /**
- * Update the widget at index.
- * <p>
- * workaround for bug 183463
- * </p>
- * @param widget
- * @param index
- */
- private void virtualLazyUpdateWidget(Widget widget, int index) {
- TreePath treePath;
- if (widget instanceof Item) {
- if (widget.getData() == null) {
- // we need to materialize the parent first
- // see bug 167668
- // however, that would be too risky
- // see bug 182782 and bug 182598
- // so we just ignore this call altogether
- // and don't do this: virtualMaterializeItem((TreeItem) widget);
- return;
- }
- treePath = getTreePathFromItem((Item) widget);
- } else {
- treePath = TreePath.EMPTY;
- }
- ((ILazyTreePathContentProvider) getContentProvider())
- .updateElement(treePath, index);
- }
-
-//**************************************************************************
-// Another couple of methods copied from TreeViewer to workaround the UI bug 266189.
-//
- protected void createChildren(Widget widget) {
- Object element = widget.getData();
- if (element == null && widget instanceof TreeItem) {
- // parent has not been materialized
- virtualMaterializeItem((TreeItem) widget);
- // try getting the element now that updateElement was called
- element = widget.getData();
- }
- if (element == null) {
- // give up because the parent is still not materialized
- return;
- }
- Item[] children = getChildren(widget);
- if (children.length == 1 && children[0].getData() == null) {
- // found a dummy node
- virtualLazyUpdateChildCount(widget, children.length);
- children = getChildren(widget);
- }
- // DO NOT touch all children
- return;
- }
-
- private void virtualMaterializeItem(TreeItem treeItem) {
- if (treeItem.getData() != null) {
- // already materialized
- return;
- }
-
- int index;
- Widget parent = treeItem.getParentItem();
- if (parent == null) {
- parent = treeItem.getParent();
- }
- Object parentElement = parent.getData();
- if (parentElement != null) {
- if (parent instanceof Tree) {
- index = ((Tree) parent).indexOf(treeItem);
- } else {
- index = ((TreeItem) parent).indexOf(treeItem);
- }
- virtualLazyUpdateWidget(parent, index);
- }
- }
-
-
- /**
- * Performs auto expand on an element at the specified path if the auto expand
- * level dictates the element should be expanded.
- *
- * @param elementPath tree path to element to consider for expansion
- */
- public void autoExpand(TreePath elementPath) {
- int level = getAutoExpandLevel();
- if (level > 0 || level == ITreeModelViewer.ALL_LEVELS) {
- if (level == ITreeModelViewer.ALL_LEVELS || level >= elementPath.getSegmentCount()) {
- expandToLevel(elementPath, 1);
- }
- }
- }
-
- public int findElementIndex(TreePath parentPath, Object element) {
- Widget parentItem = findItem(parentPath);
- if (parentItem != null) {
- Item[] children = getChildren(parentItem);
- for (int i = 0; i < children.length; i++) {
- Item item = children[i];
- Object data = item.getData();
- if ( (element != null && element.equals(data)) || (element == null && data == null) ) {
- return i;
- }
- }
- }
- return -1;
- }
-
- public boolean getElementChildrenRealized(TreePath parentPath) {
- Widget parentItem = findItem(parentPath);
- if (parentItem != null) {
- Item[] children = getChildren(parentItem);
- for (int i = 0; i < children.length; i++) {
- if (children[i].getData() == null) {
- return false;
- }
- }
- }
- return true;
- }
-
- public Display getDisplay() {
- Control control = getControl();
- if (control != null) {
- return control.getDisplay();
- }
- return null;
- }
-
- protected static final String[] STATE_PROPERTIES = new String[]{ IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_IMAGE };
-
- public void update(Object element) {
- update(element, STATE_PROPERTIES);
- }
-
- /**
- * Label data cache keys
- * TODO: workaround for bug 159461
- */
- static String PREV_LABEL_KEY = "PREV_LABEL_KEY"; //$NON-NLS-1$
- static String PREV_IMAGE_KEY = "PREV_IMAGE_KEY"; //$NON-NLS-1$
- static String PREV_FONT_KEY = "PREV_FONT_KEY"; //$NON-NLS-1$
- static String PREV_FOREGROUND_KEY = "PREV_FOREGROUND_KEY"; //$NON-NLS-1$
- static String PREV_BACKGROUND_KEY = "PREV_BACKGROUND_KEY"; //$NON-NLS-1$
-
- public void setElementData(TreePath path, int numColumns, String[] labels, ImageDescriptor[] imageDescriptors,
- FontData[] fontDatas, RGB[] _foregrounds, RGB[] _backgrounds)
- {
- Widget widget = findItem(path);
- String[] columnIds = getVisibleColumns();
-
- if (widget != null && widget instanceof TreeItem && !widget.isDisposed()) {
- TreeItem item = (TreeItem)widget;
- /*Object data = item.getData();
- int itemCount = item.getItemCount();
- item.clearAll(false);
- item.setData(data);
- item.setItemCount(itemCount);*/
-
- for (int i=0; i<numColumns; i++){
- // text might be null if the launch has been terminated
- item.setText(i,(labels[i] == null ? IInternalDebugCoreConstants.EMPTY_STRING : labels[i]));
- }
- item.setData(PREV_LABEL_KEY, labels);
-
- if (imageDescriptors == null) {
- for (int i=0; i<numColumns; i++){
- item.setImage(i,null);
- }
- item.setData(PREV_IMAGE_KEY, null);
- } else {
- Image[] images = new Image[imageDescriptors.length];
- for (int i = 0; i < imageDescriptors.length; i++) {
- images[i] = ((ITreeModelLabelProvider)getLabelProvider()).getImage(imageDescriptors[i]);
- }
- if (columnIds == null) {
- item.setImage(images[0]);
- } else {
- item.setImage(images);
- }
- item.setData(PREV_IMAGE_KEY, images);
- }
-
- if (_foregrounds == null) {
- for (int i=0; i<numColumns; i++){
- item.setForeground(i,null);
- }
- item.setData(PREV_FOREGROUND_KEY, null);
- } else {
- Color[] foregrounds = new Color[_foregrounds.length];
- for (int i = 0; i< foregrounds.length; i++) {
- foregrounds[i] = ((ITreeModelLabelProvider)getLabelProvider()).getColor(_foregrounds[i]);
- }
- if (columnIds == null) {
- item.setForeground(0,foregrounds[0]);
- } else {
- for (int i = 0; i< foregrounds.length; i++) {
- item.setForeground(i, foregrounds[i]);
- }
- }
- item.setData(PREV_FOREGROUND_KEY, foregrounds);
- }
-
- if (_backgrounds == null) {
- for (int i=0; i<numColumns; i++){
- item.setBackground(i,null);
- }
- item.setData(PREV_BACKGROUND_KEY, null);
- } else {
- Color[] backgrounds = new Color[_backgrounds.length];
- for (int i = 0; i< backgrounds.length; i++) {
- backgrounds[i] = ((ITreeModelLabelProvider)getLabelProvider()).getColor(_backgrounds[i]);
- }
- if (columnIds == null) {
- item.setBackground(0,backgrounds[0]);
- } else {
- for (int i = 0; i< backgrounds.length; i++) {
- item.setBackground(i, backgrounds[i]);
- }
- }
- item.setData(PREV_BACKGROUND_KEY, backgrounds);
- }
-
- if (fontDatas == null) {
- for (int i=0; i<numColumns; i++){
- item.setFont(i,null);
- }
- item.setData(PREV_FONT_KEY, null);
- } else {
- Font[] fonts = new Font[fontDatas.length];
- for (int i = 0; i < fontDatas.length; i++) {
- fonts[i] = ((ITreeModelLabelProvider)getLabelProvider()).getFont(fontDatas[i]);
- }
- if (columnIds == null) {
- item.setFont(0,fonts[0]);
- } else {
- for (int i = 0; i < fonts.length; i++) {
- item.setFont(i, fonts[i]);
- }
- }
- item.setData(PREV_FONT_KEY, fonts);
- }
- }
- }
-
- public ViewerLabel getElementLabel(TreePath path, String columnId) {
- if (path.getSegmentCount() == 0) {
- return null;
- }
-
- int columnIdx = -1;
- String[] visibleColumns = getVisibleColumns();
- if (columnId != null && visibleColumns != null) {
- int i = 0;
- for (i = 0; i < visibleColumns.length; i++) {
- if (columnId.equals(getVisibleColumns()[i])) {
- columnIdx = i;
- break;
- }
- }
- if (i == visibleColumns.length) {
- return null;
- }
- } else {
- columnIdx = 0;
- }
- TreeItem item = (TreeItem)findItem(path);
-
- if (item != null) {
- ViewerLabel label = new ViewerLabel(item.getText(columnIdx), item.getImage(columnIdx));
- label.setFont(item.getFont(columnIdx));
- label.setBackground(item.getBackground(columnIdx));
- label.setForeground(item.getForeground(columnIdx));
- return label;
- }
- return null;
- }
-
- public void reveal(TreePath path, int index) {
- Widget item = findItem(path);
- TreeItem[] children = null;
- if (item instanceof TreeItem) {
- children = ((TreeItem)item).getItems();
- } else if (item instanceof Tree) {
- children = ((Tree)item).getItems();
- }
- if (children != null && index < children.length) {
- getTree().setTopItem(children[index]);
- }
- }
-
- public int getChildCount(TreePath path) {
- if (path.getSegmentCount() == 0) {
- return ((Tree)getControl()).getItemCount();
- } else {
- Widget[] items = internalFindItems(path);
- if (items.length > 0) {
- if (items[0] instanceof TreeItem) {
- return ((TreeItem)items[0]).getItemCount();
- }
- }
- }
- return -1;
- }
-
- public Object getChildElement(TreePath path, int index) {
- TreeItem childItem = null;
- if (path.getSegmentCount() == 0) {
- Tree tree = (Tree)getControl();
- try {
- childItem = tree.getItem(index);
- } catch (IllegalArgumentException e) {}
- } else {
- try {
- Widget[] items = internalFindItems(path);
- if (items.length > 0) {
- if (items[0] instanceof TreeItem) {
- childItem = ((TreeItem)items[0]).getItem(index);
- }
- }
- } catch (IllegalArgumentException e) {}
- }
- if (childItem != null) {
- return childItem.getData();
- }
- return null;
- }
-
- public TreePath getTopElementPath() {
- TreeItem topItem = ((Tree)getControl()).getTopItem();
- if (topItem != null && topItem.getData() != null) {
- return getTreePathFromItem(topItem);
- }
- return null;
- }
-
- public void saveElementState(TreePath path, ModelDelta delta, int flagsToSave) {
- Tree tree = (Tree) getControl();
- TreeItem[] selection = tree.getSelection();
- Set set = new HashSet();
- for (int i = 0; i < selection.length; i++) {
- set.add(selection[i]);
- }
-
- TreeItem[] items = null;
- Widget w = internalGetWidgetToSelect(path);
- if (w instanceof Tree) {
- delta.setChildCount(
- ((ITreeModelContentProvider)getContentProvider()).viewToModelCount(path, tree.getItemCount()));
- if ((flagsToSave & IModelDelta.EXPAND) != 0) {
- delta.setFlags(delta.getFlags() | IModelDelta.EXPAND);
- }
- items = tree.getItems();
- } else if (w instanceof TreeItem) {
- TreeItem item = (TreeItem)w;
- int itemCount = item.getItemCount();
- delta.setChildCount(((ITreeModelContentProvider)getContentProvider()).viewToModelCount(path, itemCount));
- if (item.getExpanded()) {
- if ((flagsToSave & IModelDelta.EXPAND) != 0) {
- delta.setFlags(delta.getFlags() | IModelDelta.EXPAND);
- }
- } else if ((flagsToSave & IModelDelta.COLLAPSE) != 0 && itemCount > 0){
- delta.setFlags(delta.getFlags() | IModelDelta.COLLAPSE);
- }
-
- if (set.contains(item) && (flagsToSave & IModelDelta.SELECT) != 0) {
- delta.setFlags(delta.getFlags() | IModelDelta.SELECT);
- }
- items = ((TreeItem)w).getItems();
- }
- if (items != null) {
- for (int i = 0; i < items.length; i++) {
- doSaveElementState(path, delta, items[i], set, i, flagsToSave);
- }
- }
- }
-
- private void doSaveElementState(TreePath parentPath, ModelDelta delta, TreeItem item, Collection set, int index, int flagsToSave) {
- Object element = item.getData();
- if (element != null) {
- boolean expanded = item.getExpanded();
- boolean selected = set.contains(item);
- int itemCount = item.getItemCount();
- int flags = IModelDelta.NO_CHANGE;
- if (expanded && (flagsToSave & IModelDelta.EXPAND) != 0) {
- flags = flags | IModelDelta.EXPAND;
- }
- if (!expanded && (flagsToSave & IModelDelta.COLLAPSE) != 0 && itemCount > 0) {
- flags = flags | IModelDelta.COLLAPSE;
- }
- if (selected && (flagsToSave & IModelDelta.SELECT) != 0) {
- flags = flags | IModelDelta.SELECT;
- }
- if (expanded || flags != IModelDelta.NO_CHANGE) {
- int modelIndex = ((ITreeModelContentProvider)getContentProvider()).viewToModelIndex(parentPath, index);
- TreePath elementPath = parentPath.createChildPath(element);
- int numChildren = ((ITreeModelContentProvider)getContentProvider()).viewToModelCount(elementPath, itemCount);
- ModelDelta childDelta = delta.addNode(element, modelIndex, flags, numChildren);
- if (expanded) {
- TreeItem[] items = item.getItems();
- for (int i = 0; i < items.length; i++) {
- doSaveElementState(elementPath, childDelta, items[i], set, i, flagsToSave);
- }
- }
- }
- }
- }
-
- public void updateViewer(IModelDelta delta) {
- ((ITreeModelContentProvider)getContentProvider()).updateModel(delta, ITreeModelContentProvider.ALL_MODEL_DELTA_FLAGS);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.ITreeModelCheckProvider#setElementChecked(org.eclipse.jface.viewers.TreePath, boolean, boolean)
- */
- public void setElementChecked(TreePath path, boolean checked, boolean grayed) {
- Widget widget = findItem(path);
-
- if (widget != null && widget instanceof TreeItem && !widget.isDisposed()) {
- TreeItem item = (TreeItem)widget;
-
- item.setChecked(checked);
- item.setGrayed(grayed);
- }
- }
-
- public boolean getElementChecked(TreePath path) {
- Widget widget = findItem(path);
-
- if (widget != null && widget instanceof TreeItem && !widget.isDisposed()) {
- TreeItem item = (TreeItem)widget;
-
- return item.getChecked();
- }
- return false;
- }
-
- /**
- * Retrieves the element's check box grayed state.
- *
- * @param path
- * @return grayed
- */
- public boolean getElementGrayed(TreePath path) {
- Widget widget = findItem(path);
-
- if (widget != null && widget instanceof TreeItem && !widget.isDisposed()) {
- TreeItem item = (TreeItem)widget;
-
- return item.getGrayed();
- }
- return false;
- }
-
- public boolean getHasChildren(Object elementOrTreePath) {
- if (elementOrTreePath instanceof TreePath &&
- ((TreePath)elementOrTreePath).getSegmentCount() == 0)
- {
- return getTree().getItemCount() > 0;
- }
-
- Widget[] items = internalFindItems(elementOrTreePath);
- if (items != null && items.length > 0) {
- if (items[0] instanceof TreeItem) {
- return ((TreeItem)items[0]).getItemCount() > 0;
- } else {
- return ((Tree)items[0]).getItemCount() > 0;
- }
- }
-
- return false;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.StructuredViewer#handleSelect(org.eclipse.swt.events.SelectionEvent)
- */
- protected void handleSelect(SelectionEvent event) {
- if (event.detail == SWT.CHECK) {
- TreeItem item = (TreeItem) event.item;
- super.handleSelect(event);
-
- Object element = item.getData();
- if (element != null) {
- boolean checked = item.getChecked();
-
- TreePath path = getTreePathFromItem(item);
-
- boolean accepted = false;
- IContentProvider contentProvider = getContentProvider();
- if (contentProvider instanceof TreeModelContentProvider) {
- IModelProxy elementProxy = ((TreeModelContentProvider) contentProvider).getElementProxy(path);
- if (elementProxy instanceof ICheckboxModelProxy) {
- accepted = ((ICheckboxModelProxy) elementProxy).setChecked(getPresentationContext(), getInput(), path, checked);
- }
- }
-
- // if the listen rejects the change or there is not ICheckboxModelProxy, than revert the check state
- if (!accepted)
- item.setChecked(!checked);
- }
- } else {
- super.handleSelect(event);
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
deleted file mode 100644
index 8c545c34f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
+++ /dev/null
@@ -1,1470 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.internal.ui.viewers.model.VirtualItem.Index;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelSelectionPolicy;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IStateUpdateListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.viewers.ViewerLabel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * A tree model viewer without a UI component.
- * @since 3.5
- */
-public class InternalVirtualTreeModelViewer extends Viewer
- implements VirtualTree.IVirtualItemListener,
- ITreeModelViewer,
- ITreeModelContentProviderTarget,
- ITreeModelLabelProviderTarget
-{
-
- /**
- * Memento type for the visible columns for a presentation context.
- * A memento is created for each column presentation keyed by column number
- */
- private static final String VISIBLE_COLUMNS = "VISIBLE_COLUMNS"; //$NON-NLS-1$
-
- /**
- * Memento type for whether columns are visible for a presentation context.
- * Booleans are keyed by column presentation id
- */
- private static final String SHOW_COLUMNS = "SHOW_COLUMNS"; //$NON-NLS-1$
- /**
- * Memento key for the number of visible columns in a VISIBLE_COLUMNS memento
- * or for the width of a column
- */
- private static final String SIZE = "SIZE"; //$NON-NLS-1$
- /**
- * Memento key prefix a visible column
- */
- private static final String COLUMN = "COLUMN"; //$NON-NLS-1$
-
- /**
- * Item's tree path cache
- */
- private static final String TREE_PATH_KEY = "TREE_PATH_KEY"; //$NON-NLS-1$
-
- /**
- * The display that this virtual tree viewer is associated with. It is used
- * for access to the UI thread.
- */
- private Display fDisplay;
-
- /**
- * The object that allows the model to identify what this view
- * is presenting.
- */
- private IPresentationContext fContext;
-
- /**
- * Input into the viewer.
- */
- private Object fInput;
-
- /**
- * The tree of items in this viewer.
- */
- private VirtualTree fTree;
-
- /**
- * Mapping of data elements in the tree to the items that hold them. The
- * tree may contain the same element in several places, so the map values
- * are lists.
- */
- private Map fItemsMap = new HashMap();
-
- /**
- * Whether to notify the content provider when an element is unmapped.
- * Used to suppress the notification during an associate operation.
- */
- private boolean fNotifyUnmap = true;
-
- /**
- * The label provider, must be the tree model provider.
- */
- private TreeModelLabelProvider fLabelProvider;
-
- /**
- * The content provider must be a tree model provider.
- */
- private TreeModelContentProvider fContentProvider;
-
- /**
- * Flag indicating whether the viewer is currently executing an operation
- * at the end of which the selection will be restored.
- */
- private boolean fPreservingSelecction;
-
- /**
- * Flag indicating that the selection should not be restored at the end
- * of a preserving-selection operation.
- */
- private boolean fRestoreSelection;
-
- /**
- * Level to which the tree should automatically expand elements.
- * <code>-1<code> indicates that all levels shoudl be expanded.
- */
- private int fAutoExpandToLevel = 0;
-
- /**
- * Current column presentation or <code>null</code>
- */
- private IColumnPresentation fColumnPresentation = null;
-
- /**
- * Map of columns presentation id to its visible columns id's (String[])
- * When a columns presentation is not in the map, default settings are used.
- */
- private Map fVisibleColumns = new HashMap();
-
- /**
- * Map of column presentation id to whether columns should be displayed
- * for that presentation (the user can toggle columns on/off when a
- * presentation is optional.
- */
- private Map fShowColumns = new HashMap();
-
- private UIJob fValidateJob;
-
- public InternalVirtualTreeModelViewer(Display display, int style, IPresentationContext context) {
- fDisplay = display;
- fContext = context;
- fTree = new VirtualTree(style);
- fTree.addItemListener(this);
-
- fContentProvider = new TreeModelContentProvider();
- fLabelProvider = new TreeModelLabelProvider(this);
-
- if ((style & SWT.POP_UP) != 0) {
- ((ITreeModelContentProvider)getContentProvider()).setModelDeltaMask(
- ~ITreeModelContentProvider.ALL_MODEL_DELTA_FLAGS | ITreeModelContentProvider.CONTROL_MODEL_DELTA_FLAGS);
- }
- }
-
- public Object getInput() {
- return fInput;
- }
-
- public Control getControl() {
- // The virtual viewer does not have an SWT control associated with it.
- // Fortunately this method is not used by the base Viewer class.
- return null;
- }
-
- public Display getDisplay() {
- return fDisplay;
- }
-
- public void setInput(Object input) {
- Object oldInput = fInput;
- getContentProvider().inputChanged(this, oldInput, input);
- fInput = input;
- fTree.setData(fInput);
- inputChanged(oldInput, fInput);
- refresh();
- }
-
- public void replace(Object parentElementOrTreePath, final int index, Object element) {
- VirtualItem[] selectedItems = fTree.getSelection();
- TreeSelection selection = (TreeSelection) getSelection();
- VirtualItem[] itemsToDisassociate;
- if (parentElementOrTreePath instanceof TreePath) {
- TreePath elementPath = ((TreePath) parentElementOrTreePath).createChildPath(element);
- itemsToDisassociate = findItems(elementPath);
- } else {
- itemsToDisassociate = findItems(element);
- }
-
- VirtualItem[] parentItems = findItems(parentElementOrTreePath);
- for (int i = 0; i < parentItems.length; i++) {
- VirtualItem parentItem = parentItems[i];
- if (index < parentItem.getItemCount()) {
- VirtualItem item = parentItem.getItem(new Index(index));
- selection = adjustSelectionForReplace(selectedItems, selection, item, element, parentItem.getData());
- // disassociate any different item that represents the
- // same element under the same parent (the tree)
- for (int j = 0; j < itemsToDisassociate.length; j++) {
- VirtualItem itemToDisassociate = itemsToDisassociate[j];
- if (itemToDisassociate != item && itemsToDisassociate[j].getParent() == parentItem) {
- disassociate(itemToDisassociate);
- itemToDisassociate.getParent().clear(itemToDisassociate.getIndex());
- }
- }
- //Object oldData = item.getData();
- associate(element, item);
- doUpdate(item);
- VirtualItem[] children = item.getItems();
- for (int j = 0; j < children.length; j++) {
- children[j].setNeedsDataUpdate();
- }
- }
- }
- // Restore the selection if we are not already in a nested
- // preservingSelection:
- if (!fPreservingSelecction) {
- internalSetSelection(selection, false);
- // send out notification if old and new differ
- ISelection newSelection = getSelection();
- if (!newSelection.equals(selection)) {
- handleInvalidSelection(selection, newSelection);
- }
- }
- validate();
- }
-
- VirtualTree getTree() {
- return fTree;
- }
-
- public void insert(Object parentOrTreePath, Object element, int position) {
- if (parentOrTreePath instanceof TreePath) {
- VirtualItem parentItem = findItem((TreePath) parentOrTreePath);
- if (parentItem != null) {
- VirtualItem item = parentItem.addItem(position);
- item.setData(element);
- mapElement(element, item);
- doUpdate(item);
- }
- } else {
- // TODO: Implement insert() for element
- }
- validate();
- }
-
- public void remove(final Object parentOrTreePath, final int index) {
- final List oldSelection = new LinkedList(Arrays
- .asList(((TreeSelection) getSelection()).getPaths()));
- preservingSelection(new Runnable() {
- public void run() {
- TreePath removedPath = null;
- VirtualItem[] parentItems = findItems(parentOrTreePath);
- for (int i = 0; i < parentItems.length; i++) {
- VirtualItem parentItem = parentItems[i];
- if (parentItem.isDisposed())
- continue;
-
- // Parent item is not expanded so just update its contents so that
- // the plus sign gets refreshed.
- if (!parentItem.getExpanded()) {
- parentItem.setNeedsCountUpdate();
- parentItem.setItemCount(-1);
- virtualLazyUpdateHasChildren(parentItem);
- }
-
- if (index < parentItem.getItemCount()) {
- VirtualItem item =parentItem.getItem(new VirtualItem.Index(index));
-
- if (item.getData() != null) {
- removedPath = getTreePathFromItem(item);
- disassociate(item);
- }
- parentItem.remove(item.getIndex());
- }
- }
-
- if (removedPath != null) {
- boolean removed = false;
- for (Iterator it = oldSelection.iterator(); it.hasNext();) {
- TreePath path = (TreePath) it.next();
- if (path.startsWith(removedPath, null)) {
- it.remove();
- removed = true;
- }
- }
- if (removed) {
- setSelection(
- new TreeSelection((TreePath[]) oldSelection.toArray(new TreePath[oldSelection.size()])),
- false);
- }
- }
- }
- });
- }
-
- public void remove(Object elementOrPath) {
- if (elementOrPath.equals(getInput()) || TreePath.EMPTY.equals(elementOrPath)) {
- setInput(null);
- return;
- }
-
- VirtualItem[] items = findItems(elementOrPath);
- if (items.length > 0) {
- for (int j = 0; j < items.length; j++) {
- disassociate(items[j]);
- items[j].getParent().remove(items[j].getIndex());
- }
- }
- }
-
- private TreeSelection adjustSelectionForReplace(VirtualItem[] selectedItems, TreeSelection selection,
- VirtualItem item, Object element, Object parentElement)
- {
- if (item.getData() != null || selectedItems.length == selection.size() || parentElement == null) {
- // Don't do anything - we are not seeing an instance of bug 185673
- return selection;
- }
- for (int i = 0; i < selectedItems.length; i++) {
- if (item == selectedItems[i]) {
- // The current item was selected, but its data is null.
- // The data will be replaced by the given element, so to keep
- // it selected, we have to add it to the selection.
- TreePath[] originalPaths = selection.getPaths();
- int length = originalPaths.length;
- TreePath[] paths = new TreePath[length + 1];
- System.arraycopy(originalPaths, 0, paths, 0, length);
- // set the element temporarily so that we can call getTreePathFromItem
- item.setData(element);
- paths[length] = getTreePathFromItem(item);
- item.setData(null);
- return new TreeSelection(paths, selection.getElementComparer());
- }
- }
- // The item was not selected, return the given selection
- return selection;
- }
-
-
- public void reveal(TreePath path, final int index) {
- // TODO: implement reveal()
- }
-
- public int findElementIndex(TreePath parentPath, Object element) {
- VirtualItem parentItem = findItem(parentPath);
- if (parentItem != null) {
- VirtualItem item = parentItem.findItem(element);
- if (item != null) {
- return item.getIndex().intValue();
- }
- }
- return -1;
- }
-
- public boolean getElementChildrenRealized(TreePath parentPath) {
- VirtualItem parentItem = findItem(parentPath);
- if (parentItem != null) {
- return !parentItem.childrenNeedDataUpdate();
- }
- return true;
- }
-
-
- private ITreeModelLabelProvider getLabelProvider() {
- return fLabelProvider;
- }
-
- private ITreeModelContentProvider getContentProvider() {
- return fContentProvider;
- }
-
- public static int ALL_LEVELS = -1;
-
- public void refresh() {
- refresh(fTree);
- validate();
- }
-
- public void refresh(Object element) {
- VirtualItem[] items = findItems(element);
- for (int i = 0; i < items.length; i++) {
- refresh(items[i]);
- validate();
- }
- }
-
- private void refresh(VirtualItem item) {
- if (!item.needsDataUpdate()) {
- if (item.getParent() != null) {
- item.setNeedsLabelUpdate();
- virtualLazyUpdateHasChildren(item);
- }
-
- VirtualItem[] items = item.getItems();
- for (int i = 0; i < items.length; i++) {
- items[i].setNeedsDataUpdate();
- }
- }
- refreshStruct(item);
- }
-
- private void refreshStruct(VirtualItem item) {
- boolean expanded = false;
- if (item.getParent() == null) {
- // root item
- virtualLazyUpdateChildCount(item);
- expanded = true;
- } else {
- if (item.getExpanded()) {
- virtualLazyUpdateData(item);
- expanded = true;
- }
- }
-
- VirtualItem[] items = item.getItems();
- for (int i = 0; i < items.length; i++) {
- if (expanded) {
- refreshStruct(items[i]);
- } else {
- item.clear(new VirtualItem.Index(i));
- }
- }
- }
-
- private void validate() {
- if (fValidateJob == null) {
- fValidateJob = new UIJob(getDisplay(), "Virtual viewer validate job") {
- {
- setSystem(true);
- }
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- fValidateJob = null;
- fTree.validate();
- return Status.OK_STATUS;
- }
- };
- fValidateJob.schedule();
- }
- }
-
- protected void inputChanged(Object input, Object oldInput) {
- resetColumns(input);
- }
-
- public int getAutoExpandLevel() {
- return fAutoExpandToLevel;
- }
-
- public void setAutoExpandLevel(int level) {
- fAutoExpandToLevel = level;
- }
-
- private VirtualItem findItem(TreePath path) {
- VirtualItem item = fTree;
- if (path.getSegmentCount() == 0) {
- return fTree;
- }
-
- for (int i = 0; item != null && i < path.getSegmentCount(); i++) {
- Object segment = path.getSegment(i);
- item = item.findItem(segment);
- }
- return item;
- }
-
- static private final VirtualItem[] EMPTY_ITEMS_ARRAY = new VirtualItem[0];
-
- private VirtualItem[] findItems(Object elementOrTreePath) {
- if (elementOrTreePath instanceof TreePath) {
- VirtualItem item = findItem((TreePath) elementOrTreePath);
- return item == null ? EMPTY_ITEMS_ARRAY : new VirtualItem[] { item };
- } else if (getInput().equals(elementOrTreePath)) {
- return new VirtualItem[] { getTree() };
- } else {
- List itemsList = (List) fItemsMap.get(elementOrTreePath);
- if (itemsList == null) {
- return EMPTY_ITEMS_ARRAY;
- } else {
- return (VirtualItem[]) itemsList.toArray(new VirtualItem[itemsList.size()]);
- }
- }
- }
-
- public void setElementData(TreePath path, int numColumns, String[] labels, ImageDescriptor[] images,
- FontData[] fontDatas, RGB[] foregrounds, RGB[] backgrounds) {
- VirtualItem item = findItem(path);
- if (item != null) {
- item.setData(VirtualItem.LABEL_KEY, labels);
- item.setData(VirtualItem.IMAGE_KEY, images);
- item.setData(VirtualItem.FOREGROUND_KEY, foregrounds);
- item.setData(VirtualItem.BACKGROUND_KEY, backgrounds);
- item.setData(VirtualItem.FONT_KEY, fontDatas);
- }
- }
-
- public void setChildCount(final Object elementOrTreePath, final int count) {
- preservingSelection(new Runnable() {
- public void run() {
- VirtualItem[] items = findItems(elementOrTreePath);
- for (int i = 0; i < items.length; i++) {
- VirtualItem[] children = items[i].getItems();
- for (int j = 0; j < children.length; j++) {
- if (children[j].getData() != null && children[j].getIndex().intValue() >= count) {
- disassociate(children[j]);
- }
- }
-
- items[i].setItemCount(count);
- }
- }
- });
- validate();
- }
-
- public void setHasChildren(final Object elementOrTreePath, final boolean hasChildren) {
- preservingSelection(new Runnable() {
- public void run() {
- VirtualItem[] items = findItems(elementOrTreePath);
- for (int i = 0; i < items.length; i++) {
- VirtualItem item = items[i];
-
- if (!hasChildren) {
- VirtualItem[] children = item.getItems();
- for (int j = 0; j < children.length; j++) {
- if (children[j].getData() != null) {
- disassociate(children[j]);
- }
- }
- }
-
- item.setHasItems(hasChildren);
- if (hasChildren) {
- if (!item.getExpanded()) {
- item.setItemCount(-1);
- } else {
- virtualLazyUpdateChildCount(item);
- }
- }
- }
- }
- });
- }
-
- public boolean getHasChildren(Object elementOrTreePath) {
- VirtualItem[] items = findItems(elementOrTreePath);
- if (items.length > 0) {
- return items[0].hasItems();
- }
- return false;
- }
-
- private void virtualLazyUpdateHasChildren(VirtualItem item) {
- TreePath treePath;
- treePath = getTreePathFromItem(item);
- item.clearNeedsCountUpdate();
- getContentProvider().updateHasChildren(treePath);
- }
-
- private void virtualLazyUpdateChildCount(VirtualItem item) {
- item.clearNeedsCountUpdate();
- getContentProvider().updateChildCount(getTreePathFromItem(item), item.getItemCount());
- }
-
- private void virtualLazyUpdateData(VirtualItem item) {
- item.clearNeedsDataUpdate();
- getContentProvider().updateElement(getTreePathFromItem(item.getParent()), item.getIndex().intValue());
- }
-
- private void virtualLazyUpdateLabel(VirtualItem item) {
- item.clearNeedsLabelUpdate();
- if ( !getLabelProvider().update(getTreePathFromItem(item)) ) {
- if (item.getData() instanceof String) {
- item.setData(VirtualItem.LABEL_KEY, new String[] { (String)item.getData() } );
- }
- }
- }
-
- private TreePath getTreePathFromItem(VirtualItem item) {
- List segments = new LinkedList();
- while (item.getParent() != null) {
- segments.add(0, item.getData());
- item = item.getParent();
- }
- return new TreePath(segments.toArray());
- }
-
- private void unmapElement(Object element, VirtualItem item) {
- if (fNotifyUnmap) {
- // TODO: should we update the filter with the "new non-identical element"?
- IContentProvider provider = getContentProvider();
- if (provider instanceof ModelContentProvider) {
- ((ModelContentProvider) provider).unmapPath((TreePath) item.getData(TREE_PATH_KEY));
- }
- }
-
- List itemsList = (List) fItemsMap.get(element);
- if (itemsList != null) {
- itemsList.remove(item);
- if (itemsList.isEmpty()) {
- fItemsMap.remove(element);
- }
- }
- }
-
- private void mapElement(Object element, VirtualItem item) {
- // Get the items set for given element, if it doesn't exist, create it.
- // When retrieving the set, also remove it from the map, it will be
- // re-inserted to make sure that the new instance of element is used
- // in case the element has changed but the elment is equal to the old
- // one.
- List itemsList = (List) fItemsMap.remove(element);
- if (itemsList == null) {
- itemsList = new ArrayList(1);
- }
-
- if (!itemsList.contains(item)) {
- itemsList.add(item);
- }
-
- // Insert the set back into the map.
- fItemsMap.put(element, itemsList);
-
- item.setData(TREE_PATH_KEY, getTreePathFromItem(item));
- }
-
- public void revealed(VirtualItem item) {
- if (item.needsDataUpdate()) {
- virtualLazyUpdateData(item);
- } else if (item.getData() != null) {
- if (item.needsLabelUpdate()) {
- virtualLazyUpdateLabel(item);
- }
- if (item.needsCountUpdate() && item.getExpanded()) {
- virtualLazyUpdateChildCount(item);
- }
- }
- }
-
- public void disposed(VirtualItem item) {
- if (!fTree.isDisposed()) {
- Object data = item.getData();
- if (data != null) {
- unmapElement(data, item);
- }
- }
- }
-
- private void associate(Object element, VirtualItem item) {
- Object data = item.getData();
- if (data != null && data != element && data.equals(element)) {
- // elements are equal but not identical
- // -> being removed from map, but should not change filters
- try {
- fNotifyUnmap = false;
- doAssociate(element, item);
- } finally {
- fNotifyUnmap = true;
- }
- } else {
- doAssociate(element, item);
- }
-
- }
-
- private void doAssociate(Object element, VirtualItem item) {
- Object data = item.getData();
- if (data != null && data != element && data.equals(element)) {
- // workaround for PR 1FV62BT
- // assumption: elements are equal but not identical
- // -> remove from map but don't touch children
- unmapElement(data, item);
- item.setData(element);
- mapElement(element, item);
- } else {
- // recursively disassociate all
- if (data != element) {
- if (data != null) {
- unmapElement(element, item);
- disassociate(item);
- }
- item.setData(element);
- }
- // Always map the element, even if data == element,
- // since unmapAllElements() can leave the map inconsistent
- // See bug 2741 for details.
- mapElement(element, item);
- }
- }
-
- private void disassociate(VirtualItem item) {
- unmapElement(item.getData(), item);
-
- // Clear the map before we clear the data
- item.setData(null);
-
- // Disassociate the children
- VirtualItem[] items = item.getItems();
- for (int i = 0; i < items.length; i++) {
- if (items[i].getData() != null) {
- disassociate(items[i]);
- }
- }
- }
-
- public void setSelection(ISelection selection, boolean reveal) {
- setSelection(selection, reveal, false);
- }
-
- /**
- * Sets the selection in the viewer to the specified selection.
- *
- * @param selection the selection
- * @param reveal whether to reveal the selection
- * @param force whether to force the selection (i.e. <code>true</code> to
- * override the model selection policy)
- */
- public void setSelection(ISelection selection, boolean reveal, boolean force) {
- if (!force && !overrideSelection(getSelection(), selection)) {
- return;
- }
-
- if (!fPreservingSelecction) {
- internalSetSelection(selection, reveal);
- fireSelectionChanged(new SelectionChangedEvent(this, selection));
- } else {
- fRestoreSelection = false;
- internalSetSelection(selection, reveal);
- }
- }
-
- private void internalSetSelection(ISelection selection, boolean reveal) {
- if (selection instanceof ITreeSelection) {
- TreePath[] paths = ((ITreeSelection) selection).getPaths();
- List newSelection = new ArrayList(paths.length);
- for (int i = 0; i < paths.length; ++i) {
- // Use internalExpand since item may not yet be created. See
- // 1G6B1AR.
- VirtualItem item = findItem(paths[i]);
- if (item != null) {
- newSelection.add(item);
- }
- }
- fTree.setSelection((VirtualItem[]) newSelection.toArray(new VirtualItem[newSelection.size()]));
-
- // Although setting the selection in the control should reveal it,
- // setSelection may be a no-op if the selection is unchanged,
- // so explicitly reveal items in the selection here.
- // See bug 100565 for more details.
- if (reveal && newSelection.size() > 0) {
- // Iterate backwards so the first item in the list
- // is the one guaranteed to be visible
- for (int i = (newSelection.size() - 1); i >= 0; i--) {
- fTree.showItem((VirtualItem) newSelection.get(i));
- }
- }
- } else {
- fTree.setSelection(EMPTY_ITEMS_ARRAY);
- }
-
- // Make sure that the new selection is properly revealed.
- validate();
- }
-
- public void update(Object element) {
- VirtualItem[] items = findItems(element);
- for (int i = 0; i < items.length; i++) {
- doUpdate(items[i]);
- }
- }
-
- public void doUpdate(VirtualItem item) {
- item.setNeedsLabelUpdate();
- validate();
- }
-
- public ISelection getSelection() {
- if (fTree.isDisposed()) {
- return TreeSelection.EMPTY;
- }
- VirtualItem[] items = fTree.getSelection();
- ArrayList list = new ArrayList(items.length);
- for (int i = 0; i < items.length; i++) {
- if (items[i].getData() != null) {
- list.add(getTreePathFromItem(items[i]));
- }
- }
- return new TreeSelection((TreePath[]) list.toArray(new TreePath[list.size()]));
- }
-
- private void preservingSelection(Runnable updateCode) {
-
- ISelection oldSelection = null;
- try {
- // preserve selection
- oldSelection = getSelection();
- fPreservingSelecction = fRestoreSelection = true;
-
- // perform the update
- updateCode.run();
-
- } finally {
- fPreservingSelecction = false;
-
- // restore selection
- if (fRestoreSelection) {
- internalSetSelection(oldSelection, false);
- }
-
- // send out notification if old and new differ
- ISelection newSelection = getSelection();
- if (!newSelection.equals(oldSelection)) {
- handleInvalidSelection(oldSelection, newSelection);
- }
- }
- }
-
- public void expandToLevel(Object elementOrTreePath, int level) {
- VirtualItem[] items = findItems(elementOrTreePath);
- if (items.length > 0) {
- expandToLevel(items[0], level);
- }
- validate();
- }
-
- public void setExpandedState(Object elementOrTreePath, boolean expanded) {
- VirtualItem[] items = findItems(elementOrTreePath);
- for (int i = 0; i < items.length; i++) {
- items[i].setExpanded(expanded);
- }
- validate();
- }
-
- public boolean getExpandedState(Object elementOrTreePath) {
- VirtualItem[] items = findItems(elementOrTreePath);
- if (items.length > 0) {
- return items[0].getExpanded();
- }
- return false;
- }
-
- private void expandToLevel(VirtualItem item, int level) {
- if (level == ALL_LEVELS || level > 0) {
- if (!item.hasItems()) {
- return;
- }
-
- item.setExpanded(true);
-
- if (item.getData() == null) {
- virtualLazyUpdateData(item);
- // Cannot expand children if data is null.
- return;
- }
-
- if (level == ALL_LEVELS || level > 1) {
- VirtualItem[] children = item.getItems();
- int newLevel = (level == ALL_LEVELS ? ALL_LEVELS
- : level - 1);
- for (int i = 0; i < children.length; i++) {
- expandToLevel(children[i], newLevel);
- }
- }
- }
- }
-
- private void handleInvalidSelection(ISelection selection, ISelection newSelection) {
- IModelSelectionPolicy selectionPolicy = ViewerAdapterService.getSelectionPolicy(selection, getPresentationContext());
- if (selectionPolicy != null) {
- while (!selection.equals(newSelection)) {
- ISelection temp = newSelection;
- selection = selectionPolicy.replaceInvalidSelection(selection, newSelection);
- if (selection == null) {
- selection = TreeSelection.EMPTY;
- }
- if (!temp.equals(selection)) {
- internalSetSelection(selection, false);
- newSelection = getSelection();
- } else {
- break;
- }
- }
- }
-
- fireSelectionChanged(new SelectionChangedEvent(this, newSelection));
- }
-
- /**
- * Returns whether the candidate selection should override the current
- * selection.
- *
- * @param current
- * @param curr
- * @return
- */
- public boolean overrideSelection(ISelection current, ISelection candidate) {
- IModelSelectionPolicy selectionPolicy = ViewerAdapterService.getSelectionPolicy(current, getPresentationContext());
- if (selectionPolicy == null) {
- return true;
- }
- if (selectionPolicy.contains(candidate, getPresentationContext())) {
- return selectionPolicy.overrides(current, candidate, getPresentationContext());
- }
- return !selectionPolicy.isSticky(current, getPresentationContext());
- }
-
- private static ViewerFilter[] EMPTY_FILTER_ARRAY = new ViewerFilter[0];
-
- public ViewerFilter[] getFilters() {
- // TODO: Add filter support
- return EMPTY_FILTER_ARRAY;
- }
-
- public void dispose() {
- if (fColumnPresentation != null) {
- fColumnPresentation.dispose();
- }
- fContext.dispose();
-
- if (fContentProvider != null) {
- fContentProvider.dispose();
- fContentProvider = null;
- }
- if (fLabelProvider != null) {
- fLabelProvider.dispose();
- fLabelProvider = null;
- }
-
- fTree.removeItemListener(this);
- fTree.dispose();
- }
-
- /**
- * Returns this viewer's presentation context.
- *
- * @return presentation context
- */
- public IPresentationContext getPresentationContext() {
- return fContext;
- }
-
- /**
- * Configures the columns for the given viewer input.
- *
- * @param input
- */
- private void resetColumns(Object input) {
- if (input != null) {
- // only change columns if the input is non-null (persist when empty)
- IColumnPresentationFactory factory = ViewerAdapterService.getColumnPresentationFactory(input);
- PresentationContext context = (PresentationContext) getPresentationContext();
- String type = null;
- if (factory != null) {
- type = factory.getColumnPresentationId(context, input);
- }
- if (type != null) {
- if (fColumnPresentation != null) {
- if (!fColumnPresentation.getId().equals(type)) {
- // dispose old, create new
- fColumnPresentation.dispose();
- fColumnPresentation = null;
- }
- }
- if (fColumnPresentation == null) {
- fColumnPresentation = factory.createColumnPresentation(context, input);
- if (fColumnPresentation != null) {
- fColumnPresentation.init(context);
- configureColumns();
- }
- }
- } else {
- if (fColumnPresentation != null) {
- fColumnPresentation.dispose();
- fColumnPresentation = null;
- configureColumns();
- }
- }
- }
- }
-
- /**
- * Configures the columns based on the current settings.
- *
- * @param input
- */
- protected void configureColumns() {
- if (fColumnPresentation != null) {
- IColumnPresentation build = null;
- if (isShowColumns(fColumnPresentation.getId())) {
- build = fColumnPresentation;
- }
- buildColumns(build);
- } else {
- // get rid of columns
- buildColumns(null);
- }
- }
-
- /**
- * Toggles columns on/off for the current column presentation, if any.
- *
- * @param show whether to show columns if the current input supports
- * columns
- */
- public void setShowColumns(boolean show) {
- if (show) {
- if (!isShowColumns()) {
- fShowColumns.remove(fColumnPresentation.getId());
- }
- } else {
- if (isShowColumns()){
- fShowColumns.put(fColumnPresentation.getId(), Boolean.FALSE);
- }
- }
- refreshColumns();
- }
-
- /**
- * Refreshes the columns in the view, based on the viewer input.
- */
- protected void refreshColumns() {
- configureColumns();
- refresh();
- }
-
- /**
- * Returns whether columns are being displayed currently.
- *
- * @return
- */
- public boolean isShowColumns() {
- if (fColumnPresentation != null) {
- return isShowColumns(fColumnPresentation.getId());
- }
- return false;
- }
-
- /**
- * Returns whether columns can be toggled on/off for the current input.
- *
- * @return whether columns can be toggled on/off for the current input
- */
- public boolean canToggleColumns() {
- return fColumnPresentation != null && fColumnPresentation.isOptional();
- }
-
- protected boolean isShowColumns(String columnPresentationId) {
- Boolean bool = (Boolean) fShowColumns.get(columnPresentationId);
- if (bool == null) {
- return true;
- }
- return bool.booleanValue();
- }
-
- /**
- * Creates new columns for the given presentation.
- *
- * @param presentation
- */
- protected void buildColumns(IColumnPresentation presentation) {
- PresentationContext presentationContext = (PresentationContext) getPresentationContext();
- if (presentation != null) {
- presentationContext.setColumns(getVisibleColumns());
- } else {
- presentationContext.setColumns(null);
- }
- }
-
- /**
- * Returns identifiers of the visible columns in this viewer, or <code>null</code>
- * if there is currently no column presentation.
- *
- * @return visible columns or <code>null</code>
- */
- public String[] getVisibleColumns() {
- if (isShowColumns()) {
- IColumnPresentation presentation = getColumnPresentation();
- if (presentation != null) {
- String[] columns = (String[]) fVisibleColumns.get(presentation.getId());
- if (columns == null) {
- return presentation.getInitialColumns();
- }
- return columns;
- }
- }
- return null;
- }
-
- /**
- * Sets the id's of visible columns, or <code>null</code> to set default columns.
- * Only effects the current column presentation.
- *
- * @param ids visible columns
- */
- public void setVisibleColumns(String[] ids) {
- if (ids != null && ids.length == 0) {
- ids = null;
- }
- IColumnPresentation presentation = getColumnPresentation();
- if (presentation != null) {
- fVisibleColumns.remove(presentation.getId());
- if (ids != null) {
- // put back in table if not default
- String[] columns = presentation.getInitialColumns();
- if (columns.length == ids.length) {
- for (int i = 0; i < columns.length; i++) {
- if (!ids[i].equals(columns[i])) {
- fVisibleColumns.put(presentation.getId(), ids);
- break;
- }
- }
- } else {
- fVisibleColumns.put(presentation.getId(), ids);
- }
- }
- PresentationContext presentationContext = (PresentationContext) getPresentationContext();
- presentationContext.setColumns(getVisibleColumns());
- refreshColumns();
- }
- }
-
-
-
-
- /**
- * Returns the current column presentation for this viewer, or <code>null</code>
- * if none.
- *
- * @return column presentation or <code>null</code>
- */
- public IColumnPresentation getColumnPresentation() {
- return fColumnPresentation;
- }
-
- /**
- * Save viewer state into the given memento.
- *
- * @param memento
- */
- public void saveState(IMemento memento) {
- if (!fShowColumns.isEmpty()) {
- Iterator iterator = fShowColumns.entrySet().iterator();
- while (iterator.hasNext()) {
- Map.Entry entry = (Entry) iterator.next();
- IMemento sizes = memento.createChild(SHOW_COLUMNS, (String)entry.getKey());
- sizes.putString(SHOW_COLUMNS, ((Boolean)entry.getValue()).toString());
- }
- }
- if (!fVisibleColumns.isEmpty()) {
- Iterator iterator = fVisibleColumns.entrySet().iterator();
- while (iterator.hasNext()) {
- Map.Entry entry = (Entry) iterator.next();
- String id = (String) entry.getKey();
- IMemento visible = memento.createChild(VISIBLE_COLUMNS, id);
- String[] columns = (String[]) entry.getValue();
- visible.putInteger(SIZE, columns.length);
- for (int i = 0; i < columns.length; i++) {
- visible.putString(COLUMN+Integer.toString(i), columns[i]);
- }
- }
- }
- // save presentation context properties
- IPresentationContext context = getPresentationContext();
- if (context instanceof PresentationContext) {
- PresentationContext pc = (PresentationContext) context;
- pc.saveProperites(memento);
-
- }
- }
-
- /**
- * Initializes viewer state from the memento
- *
- * @param memento
- */
- public void initState(IMemento memento) {
- IMemento[] mementos = memento.getChildren(SHOW_COLUMNS);
- for (int i = 0; i < mementos.length; i++) {
- IMemento child = mementos[i];
- String id = child.getID();
- Boolean bool = Boolean.valueOf(child.getString(SHOW_COLUMNS));
- if (!bool.booleanValue()) {
- fShowColumns.put(id, bool);
- }
- }
- mementos = memento.getChildren(VISIBLE_COLUMNS);
- for (int i = 0; i < mementos.length; i++) {
- IMemento child = mementos[i];
- String id = child.getID();
- Integer integer = child.getInteger(SIZE);
- if (integer != null) {
- int length = integer.intValue();
- String[] columns = new String[length];
- for (int j = 0; j < length; j++) {
- columns[j] = child.getString(COLUMN+Integer.toString(j));
- }
- fVisibleColumns.put(id, columns);
- }
- }
- // restore presentation context properties
- // save presentation context properties
- IPresentationContext context = getPresentationContext();
- if (context instanceof PresentationContext) {
- PresentationContext pc = (PresentationContext) context;
- pc.initProperties(memento);
- }
- }
-
- public void addViewerUpdateListener(IViewerUpdateListener listener) {
- getContentProvider().addViewerUpdateListener(listener);
- }
-
- public void removeViewerUpdateListener(IViewerUpdateListener listener) {
- ITreeModelContentProvider cp = getContentProvider();
- if (cp != null) {
- cp.removeViewerUpdateListener(listener);
- }
- }
-
- public void addModelChangedListener(IModelChangedListener listener) {
- getContentProvider().addModelChangedListener(listener);
- }
-
- public void removeModelChangedListener(IModelChangedListener listener) {
- ITreeModelContentProvider cp = getContentProvider();
- if (cp != null) {
- cp.removeModelChangedListener(listener);
- }
- }
-
- public void addStateUpdateListener(IStateUpdateListener listener) {
- getContentProvider().addStateUpdateListener(listener);
- }
-
- public void removeStateUpdateListener(IStateUpdateListener listener) {
- ITreeModelContentProvider cp = getContentProvider();
- if (cp != null) {
- cp.removeStateUpdateListener(listener);
- }
- }
-
- public void addLabelUpdateListener(ILabelUpdateListener listener) {
- getLabelProvider().addLabelUpdateListener(listener);
- }
-
- public void removeLabelUpdateListener(ILabelUpdateListener listener) {
- getLabelProvider().removeLabelUpdateListener(listener);
- }
-
- /**
- * Performs auto expand on an element at the specified path if the auto expand
- * level dictates the element should be expanded.
- *
- * @param elementPath tree path to element to consider for expansion
- */
- public void autoExpand(TreePath elementPath) {
- int level = getAutoExpandLevel();
- if (level > 0 || level == ITreeModelViewer.ALL_LEVELS) {
- if (level == ITreeModelViewer.ALL_LEVELS || level >= elementPath.getSegmentCount()) {
- expandToLevel(elementPath, 1);
- }
- }
- }
-
- public int getChildCount(TreePath path) {
- int childCount = -1;
- VirtualItem[] items = findItems(path);
- if (items.length > 0) {
- childCount = items[0].getItemCount();
- // Mimic the jface viewer behavior which returns 1 for child count
- // for an item that has children but is not yet expanded.
- if (childCount == -1 && items[0].hasItems()) {
- childCount = 1;
- }
- }
- return childCount;
- }
-
- public Object getChildElement(TreePath path, int index) {
- VirtualItem[] items = findItems(path);
- if (items.length > 0) {
- if (index < items[0].getItemCount()) {
- return items[0].getItem(new VirtualItem.Index(index)).getData();
- }
- }
- return null;
- }
-
- public TreePath getTopElementPath() {
- return null;
- }
-
- public void saveElementState(TreePath path, ModelDelta delta, int flagsToSave) {
- VirtualTree tree = getTree();
- VirtualItem[] selection = tree.getSelection();
- Set set = new HashSet();
- for (int i = 0; i < selection.length; i++) {
- set.add(selection[i]);
- }
-
- VirtualItem[] items = null;
- VirtualItem parent = findItem(path);
-
- if (parent != null) {
- delta.setChildCount(((ModelContentProvider)getContentProvider()).viewToModelCount(path, parent.getItemCount()));
- if (parent.getExpanded()) {
- if ((flagsToSave & IModelDelta.EXPAND) != 0) {
- delta.setFlags(delta.getFlags() | IModelDelta.EXPAND);
- }
- } else if ((flagsToSave & IModelDelta.COLLAPSE) != 0 && parent.hasItems()){
- delta.setFlags(delta.getFlags() | IModelDelta.COLLAPSE);
- }
-
- if (set.contains(parent) && (flagsToSave & IModelDelta.SELECT) != 0) {
- delta.setFlags(delta.getFlags() | IModelDelta.SELECT);
- }
-
- items = parent.getItems();
- for (int i = 0; i < items.length; i++) {
- doSaveElementState(path, delta, items[i], set, flagsToSave);
- }
- }
- }
-
- private void doSaveElementState(TreePath parentPath, ModelDelta delta, VirtualItem item, Collection set, int flagsToSave) {
- Object element = item.getData();
- if (element != null) {
- boolean expanded = item.getExpanded();
- boolean selected = set.contains(item);
- int flags = IModelDelta.NO_CHANGE;
- if (expanded && (flagsToSave & IModelDelta.EXPAND) != 0) {
- flags = flags | IModelDelta.EXPAND;
- }
- if (!expanded && (flagsToSave & IModelDelta.COLLAPSE) != 0 && item.hasItems()){
- flags = flags | IModelDelta.COLLAPSE;
- }
- if (selected && (flagsToSave & IModelDelta.SELECT) != 0) {
- flags = flags | IModelDelta.SELECT;
- }
- if (expanded || flags != IModelDelta.NO_CHANGE) {
- int modelIndex = ((ModelContentProvider)getContentProvider()).viewToModelIndex(parentPath, item.getIndex().intValue());
- TreePath elementPath = parentPath.createChildPath(element);
- int numChildren = ((ModelContentProvider)getContentProvider()).viewToModelCount(elementPath, item.getItemCount());
- ModelDelta childDelta = delta.addNode(element, modelIndex, flags, numChildren);
- if (expanded) {
- VirtualItem[] items = item.getItems();
- for (int i = 0; i < items.length; i++) {
- doSaveElementState(elementPath, childDelta, items[i], set, flagsToSave);
- }
- }
- }
- }
- }
-
- public void updateViewer(IModelDelta delta) {
- ((ITreeModelContentProvider)getContentProvider()).updateModel(delta, ITreeModelContentProvider.ALL_MODEL_DELTA_FLAGS);
- }
-
- public ViewerLabel getElementLabel(TreePath path, String columnId) {
- if (path.getSegmentCount() == 0) {
- return null;
- }
-
- int columnIdx = -1;
- String[] visibleColumns = getVisibleColumns();
- if (columnId != null && visibleColumns != null) {
- int i = 0;
- for (i = 0; i < visibleColumns.length; i++) {
- if (columnId.equals(getVisibleColumns()[i])) {
- columnIdx = i;
- break;
- }
- }
- if (i == visibleColumns.length) {
- return null;
- }
- } else {
- columnIdx = 0;
- }
- VirtualItem item = findItem(path);
-
- if (item != null) {
- ViewerLabel label = new ViewerLabel(getText(item, columnIdx), getImage(item, columnIdx));
- label.setFont(getFont(item, columnIdx));
- label.setBackground(getBackground(item, columnIdx));
- label.setForeground(getForeground(item, columnIdx));
- return label;
- }
- return null;
- }
-
- private String getText(VirtualItem item, int columnIdx) {
- String[] texts = (String[])item.getData(VirtualItem.LABEL_KEY);
- if (texts != null && texts.length > columnIdx) {
- return texts[columnIdx];
- }
- return null;
- }
-
- private Image getImage(VirtualItem item, int columnIdx) {
- ImageDescriptor[] imageDescriptors = (ImageDescriptor[]) item.getData(VirtualItem.IMAGE_KEY);
- if (imageDescriptors != null && imageDescriptors.length > columnIdx) {
- return getLabelProvider().getImage(imageDescriptors[columnIdx]);
- }
- return null;
- }
-
- private Font getFont(VirtualItem item, int columnIdx) {
- FontData[] fontDatas = (FontData[]) item.getData(VirtualItem.FONT_KEY);
- if (fontDatas != null) {
- return getLabelProvider().getFont(fontDatas[columnIdx]);
- }
- return null;
- }
-
- public Color getForeground(VirtualItem item, int columnIdx) {
- RGB[] rgbs = (RGB[]) item.getData(VirtualItem.FOREGROUND_KEY);
- if (rgbs != null) {
- return getLabelProvider().getColor(rgbs[columnIdx]);
- }
- return null;
- }
-
- public Color getBackground(VirtualItem item, int columnIdx) {
- RGB[] rgbs = (RGB[]) item.getData(VirtualItem.BACKGROUND_KEY);
- if (rgbs != null) {
- return getLabelProvider().getColor(rgbs[columnIdx]);
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java
deleted file mode 100644
index ab991f695..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech (Wind River) - added support for a virtual tree model viewer (Bug 242489)
- * Patrick Chuong (Texas Instruments) - added support for checkbox (Bug 286310)
- * John Cortell (Freescale) - updated javadoc tags (Bug 292301)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import org.eclipse.debug.internal.core.commands.Request;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ICheckUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * @since 3.3
- */
-class LabelUpdate extends Request implements ILabelUpdate, ICheckUpdate {
-
- private TreePath fElementPath;
- private String[] fColumnIds;
- private RGB[] fBackgrounds;
- private RGB[] fForegrounds;
- private ImageDescriptor[] fImageDescriptors;
- private String[] fLabels;
- private FontData[] fFontDatas;
- private TreeModelLabelProvider fProvider;
- private ITreeModelLabelProviderTarget fTreeViewer;
- private int fNumColumns;
- private IPresentationContext fContext;
- private Object fViewerInput;
- private boolean fChecked;
- private boolean fGrayed;
-
- /**
- * @param viewerInput input at the time the request was made
- * @param elementPath element the label is for
- * @param item item the label is for
- * @param provider label provider to callback to
- * @param columnIds column identifiers or <code>null</code>
- * @param context presentation context
- */
- public LabelUpdate(Object viewerInput, TreePath elementPath, TreeModelLabelProvider provider, ITreeModelLabelProviderTarget treeViewer, String[] columnIds, IPresentationContext context) {
- fContext = context;
- fViewerInput = viewerInput;
- fElementPath = elementPath;
- fProvider = provider;
- fColumnIds = columnIds;
- fNumColumns = 1;
- if (columnIds != null) {
- fNumColumns = columnIds.length;
- }
- fLabels = new String[fNumColumns];
- fTreeViewer = treeViewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate#getColumnIds()
- */
- public String[] getColumnIds() {
- return fColumnIds;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElementPath()
- */
- public TreePath getElementPath() {
- return fElementPath;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate#setBackground(org.eclipse.swt.graphics.RGB, int)
- */
- public void setBackground(RGB background, int columnIndex) {
- if (background == null) {
- return;
- }
- if (fBackgrounds == null) {
- fBackgrounds = new RGB[fNumColumns];
- }
- fBackgrounds[columnIndex] = background;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate#setFontData(org.eclipse.swt.graphics.FontData, int)
- */
- public void setFontData(FontData fontData, int columnIndex) {
- if (fontData == null) {
- return;
- }
- if (fFontDatas == null) {
- fFontDatas = new FontData[fNumColumns];
- }
- fFontDatas[columnIndex] = fontData;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate#setForeground(org.eclipse.swt.graphics.RGB, int)
- */
- public void setForeground(RGB foreground, int columnIndex) {
- if (foreground == null) {
- return;
- }
- if (fForegrounds == null) {
- fForegrounds = new RGB[fNumColumns];
- }
- fForegrounds[columnIndex] = foreground;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate#setImageDescriptor(org.eclipse.jface.resource.ImageDescriptor, int)
- */
- public void setImageDescriptor(ImageDescriptor image, int columnIndex) {
- if (image == null) {
- return;
- }
- if (fImageDescriptors == null) {
- fImageDescriptors = new ImageDescriptor[fNumColumns];
- }
- fImageDescriptors[columnIndex] = image;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate#setLabel(java.lang.String, int)
- */
- public void setLabel(String text, int columnIndex) {
- fLabels[columnIndex] = text;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getPresentationContext()
- */
- public IPresentationContext getPresentationContext() {
- return fContext;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.commands.Request#done()
- */
- public void done() {
- fProvider.complete(this);
- }
-
- /**
- * Applies settings to viewer cell
- */
- public void update() {
- fTreeViewer.setElementData(fElementPath, fNumColumns, fLabels, fImageDescriptors, fFontDatas, fForegrounds, fBackgrounds);
- if (fTreeViewer instanceof ITreeModelCheckProviderTarget)
- ((ITreeModelCheckProviderTarget) fTreeViewer).setElementChecked(fElementPath, fChecked, fGrayed);
-
- fProvider.updateComplete(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElement()
- */
- public Object getElement() {
- return getElementPath().getLastSegment();
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append("ILabelUpdate: "); //$NON-NLS-1$
- buf.append(getElement());
- return buf.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getViewerInput()
- */
- public Object getViewerInput() {
- return fViewerInput;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.ICheckUpdate#setChecked(boolean, boolean)
- */
- public void setChecked(boolean checked, boolean grayed) {
- fChecked = checked;
- fGrayed = grayed;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java
deleted file mode 100644
index 67681686e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import org.eclipse.debug.internal.core.commands.Request;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.ui.IMemento;
-
-/**
- * @since 3.3
- */
-abstract class MementoUpdate extends Request implements IViewerUpdate {
-
- private IPresentationContext fContext;
- private Object fElement;
- private TreePath fElementPath;
- private IMemento fMemento;
- protected ModelContentProvider fProvider;
- protected Object fViewerInput;
-
- /**
- * Constructs a viewer state request.
- *
- * @param viewer viewer
- * @param element element
- * @param memento memento
- */
- public MementoUpdate(ModelContentProvider provider, Object viewerInput, IPresentationContext context, Object element, TreePath elementPath, IMemento memento) {
- fContext = context;
- fElement = element;
- fElementPath = elementPath;
- fMemento = memento;
- fProvider = provider;
- fViewerInput = viewerInput;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getPresentationContext()
- */
- public IPresentationContext getPresentationContext() {
- return fContext;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElement()
- */
- public Object getElement() {
- return fElement;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElementPath()
- */
- public TreePath getElementPath() {
- return fElementPath;
- }
-
- public IMemento getMemento() {
- return fMemento;
- }
-
- public ModelContentProvider getContentProvider() {
- return fProvider;
- }
-
- public Object getElement(TreePath path) {
- return fProvider.getElement(path);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getViewerInput()
- */
- public Object getViewerInput() {
- return fViewerInput;
- }
-
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ModelContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ModelContentProvider.java
deleted file mode 100644
index 133df6b70..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ModelContentProvider.java
+++ /dev/null
@@ -1,2041 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech - Wind River - Bug 205335: ModelContentProvider does not cancel stale updates when switching viewer input
- * Wind River Systems - Fix for viewer state save/restore [188704]
- * Pawel Piech (Wind River) - added support for a virtual tree model viewer (Bug 242489)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import java.io.IOException;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.IRequest;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDeltaVisitor;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory2;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IStateUpdateListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.XMLMemento;
-import org.eclipse.ui.progress.UIJob;
-import org.eclipse.ui.progress.WorkbenchJob;
-
-/**
- * Content provider for a virtual viewer.
- *
- * @since 3.3
- */
-abstract class ModelContentProvider implements IContentProvider, IModelChangedListener {
-
- private ITreeModelContentProviderTarget fViewer;
-
- /**
- * Mask used to filter delta updates coming from the model.
- */
- private int fModelDeltaMask = ~0;
-
- /**
- * Map tree paths to model proxy responsible for element
- *
- * Used to install different model proxy instances for one element depending
- * on the tree path.
- */
- private Map fTreeModelProxies = new HashMap(); // tree model proxy by
- // element tree path
-
- /**
- * Map element to model proxy responsible for it.
- *
- * Used to install a single model proxy which is responsible for all
- * instances of an element in the model tree.
- */
- private Map fModelProxies = new HashMap(); // model proxy by element
-
- /**
- * Map of nodes that have been filtered from the viewer.
- */
- private FilterTransform fTransform = new FilterTransform();
-
- /**
- * Model listeners
- */
- private ListenerList fModelListeners = new ListenerList();
-
- /**
- * Viewer update listeners
- */
- private ListenerList fUpdateListeners = new ListenerList();
-
- /**
- * State update listeners
- */
- private ListenerList fStateUpdateListeners = new ListenerList();
-
- /**
- * Map of updates in progress: element path -> list of requests
- */
- private Map fRequestsInProgress = new HashMap();
-
- /**
- * Map of dependent requests waiting for parent requests to complete:
- * element path -> list of requests
- */
- private Map fWaitingRequests = new HashMap();
-
- /**
- * Map of viewer states keyed by viewer input mementos
- */
- private Map fViewerStates = new LRUMap(20);
-
- /**
- * Pending viewer state to be restored
- */
- private ModelDelta fPendingState = null;
-
- private static class CompareRequestKey {
- CompareRequestKey(TreePath path, IModelDelta delta) {
- fPath = path;
- fDelta = delta;
- }
-
- TreePath fPath;
-
- IModelDelta fDelta;
-
- public boolean equals(Object obj) {
- if (obj instanceof CompareRequestKey) {
- CompareRequestKey key = (CompareRequestKey) obj;
- return key.fDelta.equals(fDelta) && key.fPath.equals(fPath);
- }
- return false;
- }
-
- public int hashCode() {
- return fDelta.hashCode() + fPath.hashCode();
- }
- }
-
- private Map fCompareRequestsInProgress = new LinkedHashMap();
-
- /**
- * Set of IMementoManager's that are currently saving state
- */
- private Set fPendingStateSaves = new HashSet();
-
- /**
- * Used to queue a viewer input for state restore
- */
- private Object fQueuedRestore = null;
-
- /**
- * Dummy marker element used in the state delta. The marker indicates that a
- * given element in the pending state delta has been removed. It replaces
- * the original element so that it may optionally be garbage collected.
- */
- private final static String ELEMENT_REMOVED = "ELEMENT_REMOVED"; //$NON-NLS-1$
-
- /**
- * Used to determine when restoration delta has been processed
- */
- protected class CheckState implements IModelDeltaVisitor {
- private boolean complete = true;
-
- private IModelDelta topDelta = null;
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.debug.internal.ui.viewers.provisional.IModelDeltaVisitor
- * #visit(org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta,
- * int)
- */
- public boolean visit(IModelDelta delta, int depth) {
- // Filster out the CONTENT flags from the delta flags, the content
- // flag is only used as a marker indicating that all the sub-elements
- // of a given delta have been retrieved.
- int flags = (delta.getFlags() & ~IModelDelta.CONTENT);
-
- if (flags != IModelDelta.NO_CHANGE) {
- IModelDelta parentDelta = delta.getParentDelta();
- // Remove the delta if :
- // - The parent delta has no more flags on it (the content flag is removed as well),
- // which means that parent element's children have been completely exposed.
- // - There are no more pending updates for the element.
- // - If element is a memento, there are no state requests pending.
- if (parentDelta != null && parentDelta.getFlags() == IModelDelta.NO_CHANGE) {
- TreePath deltaPath = getViewerTreePath(delta);
- if ( !areElementUpdatesPending(deltaPath) &&
- (!(delta.getElement() instanceof IMemento) || !areMementoUpdatesPending(delta)) )
- {
- removeDelta(delta);
- return false;
- }
- }
-
- if (flags == IModelDelta.REVEAL && !(delta.getElement() instanceof IMemento)) {
- topDelta = delta;
- } else {
- complete = false;
- return false;
- }
- }
- return true;
- }
-
- public boolean isComplete() {
- return complete;
- }
-
- public IModelDelta getTopItemDelta() {
- return topDelta;
- }
-
- private boolean areElementUpdatesPending(TreePath path) {
- synchronized (fRequestsInProgress) {
- TreePath parentPath = path.getParentPath();
- List requests = (List) fWaitingRequests.get(path);
- if (requests != null) {
- for (int i = 0; i < requests.size(); i++) {
- ViewerUpdateMonitor update = (ViewerUpdateMonitor) requests.get(i);
- if (update instanceof ChildrenUpdate) {
- return true;
- }
- }
- }
- requests = (List) fWaitingRequests.get(parentPath);
- if (requests != null) {
- for (int i = 0; i < requests.size(); i++) {
- ViewerUpdateMonitor update = (ViewerUpdateMonitor) requests.get(i);
- if (update.containsUpdate(path)) {
- return true;
- }
- }
- }
- requests = (List) fRequestsInProgress.get(path);
- if (requests != null) {
- for (int i = 0; i < requests.size(); i++) {
- ViewerUpdateMonitor update = (ViewerUpdateMonitor) requests.get(i);
- if (update instanceof ChildrenUpdate) {
- return true;
- }
- }
- }
- requests = (List) fRequestsInProgress.get(parentPath);
- if (requests != null) {
- for (int i = 0; i < requests.size(); i++) {
- ViewerUpdateMonitor update = (ViewerUpdateMonitor) requests.get(i);
- if (update.getElement().equals(path.getLastSegment())) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- private boolean areMementoUpdatesPending(IModelDelta delta) {
- for (Iterator itr = fCompareRequestsInProgress.keySet().iterator(); itr.hasNext();) {
- CompareRequestKey key = (CompareRequestKey) itr.next();
- if (delta.getElement().equals(key.fDelta.getElement())) {
- return true;
- }
- }
- return false;
- }
-
- private void removeDelta(IModelDelta delta) {
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("\tRESTORE REMOVED: " + delta.getElement()); //$NON-NLS-1$
- }
-
- delta.accept(new IModelDeltaVisitor() {
- public boolean visit(IModelDelta _visitorDelta, int depth) {
- ModelDelta visitorDelta = (ModelDelta) _visitorDelta;
- visitorDelta.setElement(ELEMENT_REMOVED);
- visitorDelta.setFlags(IModelDelta.NO_CHANGE);
- return true;
- }
- });
-
- }
- }
-
- /**
- * LRU cache for viewer states
- */
- class LRUMap extends LinkedHashMap {
- private static final long serialVersionUID = 1L;
-
- private int fMaxSize;
-
- LRUMap(int maxSize) {
- super();
- fMaxSize = maxSize;
- }
-
- protected boolean removeEldestEntry(Entry eldest) {
- return size() > fMaxSize;
- }
- }
-
- /**
- * Update type constants
- */
- static final int UPDATE_SEQUENCE_BEGINS = 0;
-
- static final int UPDATE_SEQUENCE_COMPLETE = 1;
-
- static final int UPDATE_BEGINS = 2;
-
- static final int UPDATE_COMPLETE = 3;
-
- /**
- * Additional state update type constants
- */
- static final int STATE_SAVE_SEQUENCE_BEGINS = 4;
-
- static final int STATE_SAVE_SEQUENCE_COMPLETE = 5;
-
- static final int STATE_RESTORE_SEQUENCE_BEGINS = 6;
-
- static final int STATE_RESTORE_SEQUENCE_COMPLETE = 7;
-
- /**
- * Constant for an empty tree path.
- */
- protected static final TreePath EMPTY_TREE_PATH = new TreePath(new Object[] {});
-
- // debug flags
- public static String DEBUG_PRESENTATION_ID = null;
-
- public static boolean DEBUG_CONTENT_PROVIDER = false;
-
- public static boolean DEBUG_UPDATE_SEQUENCE = false;
-
- public static boolean DEBUG_STATE_SAVE_RESTORE = false;
-
- public static boolean DEBUG_DELTAS = false;
-
- static {
- DEBUG_PRESENTATION_ID = Platform.getDebugOption("org.eclipse.debug.ui/debug/viewers/presentationId"); //$NON-NLS-1$
- if (!DebugUIPlugin.DEBUG || "".equals(DEBUG_PRESENTATION_ID)) { //$NON-NLS-1$
- DEBUG_PRESENTATION_ID = null;
- }
- DEBUG_CONTENT_PROVIDER = DebugUIPlugin.DEBUG && "true".equals( //$NON-NLS-1$
- Platform.getDebugOption("org.eclipse.debug.ui/debug/viewers/contentProvider")); //$NON-NLS-1$
- DEBUG_UPDATE_SEQUENCE = DebugUIPlugin.DEBUG && "true".equals( //$NON-NLS-1$
- Platform.getDebugOption("org.eclipse.debug.ui/debug/viewers/updateSequence")); //$NON-NLS-1$
- DEBUG_STATE_SAVE_RESTORE = DebugUIPlugin.DEBUG && "true".equals( //$NON-NLS-1$
- Platform.getDebugOption("org.eclipse.debug.ui/debug/viewers/stateSaveRestore")); //$NON-NLS-1$
- DEBUG_DELTAS = DebugUIPlugin.DEBUG && "true".equals( //$NON-NLS-1$
- Platform.getDebugOption("org.eclipse.debug.ui/debug/viewers/deltas")); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public synchronized void dispose() {
- // cancel pending updates
- synchronized (fRequestsInProgress) {
- Iterator iterator = fRequestsInProgress.values().iterator();
- while (iterator.hasNext()) {
- List requests = (List) iterator.next();
- Iterator reqIter = requests.iterator();
- while (reqIter.hasNext()) {
- ((IRequest) reqIter.next()).cancel();
- }
- }
- fWaitingRequests.clear();
- }
- fModelListeners.clear();
- fUpdateListeners.clear();
- fStateUpdateListeners.clear();
- disposeAllModelProxies();
- fViewer = null;
- }
-
- public synchronized boolean isDisposed() {
- return fViewer == null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface
- * .viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public synchronized void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- fViewer = (ITreeModelContentProviderTarget) viewer;
- if (oldInput != null) {
- for (Iterator itr = fCompareRequestsInProgress.values().iterator(); itr.hasNext();) {
- ((ElementCompareRequest) itr.next()).cancel();
- itr.remove();
- }
- saveViewerState(oldInput);
- }
- if (newInput != oldInput) {
- cancelSubtreeUpdates(TreePath.EMPTY);
- disposeAllModelProxies();
- cancelSubtreeUpdates(TreePath.EMPTY);
- fTransform.clear();
- if (newInput != null) {
- installModelProxy(newInput, TreePath.EMPTY);
- restoreViewerState(newInput);
- }
- }
- }
-
- /**
- * Restores the viewer state unless a save is taking place. If a save is
- * taking place, the restore is queued.
- *
- * @param input
- * viewer input
- */
- protected synchronized void restoreViewerState(final Object input) {
- fPendingState = null;
- if (isSavingState()) {
- fQueuedRestore = input;
- } else {
- startRestoreViewerState(input);
- }
- }
-
- /**
- * Restores viewer state for the given input
- *
- * @param input
- * viewer input
- */
- private synchronized void startRestoreViewerState(final Object input) {
- fPendingState = null;
- final IElementMementoProvider defaultProvider = ViewerAdapterService.getMementoProvider(input);
- if (defaultProvider != null) {
- // build a model delta representing expansion and selection state
- final ModelDelta delta = new ModelDelta(input, IModelDelta.NO_CHANGE);
- final XMLMemento inputMemento = XMLMemento.createWriteRoot("VIEWER_INPUT_MEMENTO"); //$NON-NLS-1$
- final IMementoManager manager = new IMementoManager() {
-
- private IElementMementoRequest fRequest;
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.debug.internal.ui.viewers.model.provisional.viewers
- * .
- * IMementoManager#requestComplete(org.eclipse.debug.internal.ui
- * .viewers.model.provisional.IElementMementoRequest)
- */
- public synchronized void requestComplete(IElementMementoRequest request) {
- notifyStateUpdate(input, UPDATE_COMPLETE, request);
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext()
- .getId()))) {
- System.out.println("\tSTATE END: " + request); //$NON-NLS-1$
- }
-
- if (!request.isCanceled() && (request.getStatus() == null || request.getStatus().isOK())) {
- XMLMemento keyMemento = (XMLMemento) delta.getElement();
- StringWriter writer = new StringWriter();
- try {
- keyMemento.save(writer);
- final String keyMementoString = writer.toString();
- final ModelDelta stateDelta = (ModelDelta) fViewerStates.get(keyMementoString);
- if (stateDelta != null) {
- stateDelta.setElement(input);
- // begin restoration
- UIJob job = new UIJob("restore state") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if (!isDisposed() && input.equals(getViewer().getInput())) {
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID
- .equals(getPresentationContext().getId()))) {
- System.out.println("\tRESTORE: " + stateDelta.toString()); //$NON-NLS-1$
- }
- fViewerStates.remove(keyMementoString);
- fPendingState = stateDelta;
- doInitialRestore(fPendingState);
- } else {
- notifyStateUpdate(input, STATE_RESTORE_SEQUENCE_BEGINS, null);
- }
- return Status.OK_STATUS;
- }
-
- };
- job.setSystem(true);
- job.schedule();
- } else {
- notifyStateUpdate(input, STATE_RESTORE_SEQUENCE_BEGINS, null);
- }
- } catch (IOException e) {
- DebugUIPlugin.log(e);
- }
- } else {
- notifyStateUpdate(input, STATE_RESTORE_SEQUENCE_BEGINS, null);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.debug.internal.ui.viewers.model.provisional.viewers
- * .IMementoManager#processReqeusts()
- */
- public void processReqeusts() {
- notifyStateUpdate(input, STATE_RESTORE_SEQUENCE_BEGINS, null);
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext()
- .getId()))) {
- System.out.println("\tSTATE BEGIN: " + fRequest); //$NON-NLS-1$
- }
- notifyStateUpdate(input, UPDATE_BEGINS, fRequest);
- defaultProvider.encodeElements(new IElementMementoRequest[] { fRequest });
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.debug.internal.ui.viewers.model.provisional.viewers
- * .
- * IMementoManager#addRequest(org.eclipse.debug.internal.ui.viewers
- * .model.provisional.IElementMementoRequest)
- */
- public synchronized void addRequest(IElementMementoRequest req) {
- fRequest = req;
- }
-
- };
- manager.addRequest(new ElementMementoRequest(ModelContentProvider.this, getViewer().getInput(), manager,
- getPresentationContext(), delta.getElement(), getViewerTreePath(delta), inputMemento, delta));
- manager.processReqeusts();
- }
- }
-
- /**
- * Restore selection/expansion based on items already in the viewer
- */
- protected abstract void doInitialRestore(ModelDelta delta);
-
- /**
- * @param delta
- */
- abstract void doRestore(final ModelDelta delta, boolean knowsHasChildren, boolean knowsChildCount,
- boolean checkChildrenRealized);
-
- protected void appendToPendingStateDelta(TreePath path) {
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("STATE APPEND BEGIN: " + path.getLastSegment()); //$NON-NLS-1$
- }
-
- // build a model delta representing expansion and selection state
- final ModelDelta appendDeltaRoot = new ModelDelta(getViewer().getInput(), IModelDelta.NO_CHANGE);
- ModelDelta delta = appendDeltaRoot;
- for (int i = 0; i < path.getSegmentCount(); i++) {
- delta = delta.addNode(path.getSegment(i), IModelDelta.NO_CHANGE);
- }
-
- fViewer.saveElementState(path, delta, IModelDelta.COLLAPSE | IModelDelta.EXPAND | IModelDelta.SELECT);
-
- // Append a marker CONTENT flag to all the delta nodes that contain the
- // EXPAND node. These
- // markers are used by the restore logic to know when a delta node can
- // be removed.
- delta.accept(new IModelDeltaVisitor() {
- public boolean visit(IModelDelta delta, int depth) {
- if ((delta.getFlags() & IModelDelta.EXPAND) != 0) {
- ((ModelDelta) delta).setFlags(delta.getFlags() | IModelDelta.CONTENT);
- }
- return true;
- }
- });
-
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("\tAPPEND DELTA: " + appendDeltaRoot); //$NON-NLS-1$
- }
-
- if (fPendingState != null) {
- // If the restore for the current input was never completed,
- // preserve
- // that restore along with the restore that was completed.
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("\tAPPEND OUTSTANDING RESTORE: " + fPendingState); //$NON-NLS-1$
- }
-
- IModelDeltaVisitor pendingStateVisitor = new IModelDeltaVisitor() {
- public boolean visit(IModelDelta pendingDeltaNode, int depth) {
- // Ignore the top element.
- if (pendingDeltaNode.getParentDelta() == null) {
- return true;
- }
-
- // Find the node in the save delta which is the parent
- // of to the current pending delta node.
- // If the parent node cannot be found, it means that
- // most likely the user collapsed the parent node before
- // the children were ever expanded.
- // If the pending state node already exists in the parent
- // node, it is already processed and we can skip it.
- // If the pending state node does not contain any flags,
- // we can also skip it.
- ModelDelta saveDeltaNode = findSaveDelta(appendDeltaRoot, pendingDeltaNode);
- if (saveDeltaNode != null && !isDeltaInParent(pendingDeltaNode, saveDeltaNode)
- && pendingDeltaNode.getFlags() != IModelDelta.NO_CHANGE) {
- saveDeltaNode.setChildCount(pendingDeltaNode.getParentDelta().getChildCount());
- copyIntoDelta(pendingDeltaNode, saveDeltaNode);
- } else {
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext()
- .getId()))) {
- System.out.println("\tSKIPPED: " + pendingDeltaNode.getElement()); //$NON-NLS-1$
- }
- }
-
- // If the pending delta node has a memento element, its
- // children should also be mementos therefore the copy
- // delta operation should have added all the children
- // of this pending delta node into the save delta.
- if (pendingDeltaNode.getElement() instanceof IMemento) {
- return false;
- } else {
- return pendingDeltaNode.getChildCount() > 0;
- }
- }
- };
- fPendingState.accept(pendingStateVisitor);
- }
-
- if (appendDeltaRoot.getChildDeltas().length > 0) {
- // Set the new delta root as the pending state delta.
- if (fPendingState == null) {
- notifyStateUpdate(appendDeltaRoot.getElement(), STATE_RESTORE_SEQUENCE_BEGINS, null);
- }
- fPendingState = appendDeltaRoot;
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("STATE APPEND COMPLETE " + fPendingState); //$NON-NLS-1$
- }
- } else {
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("STATE APPEND CANCELED: No Data"); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * Perform any restoration required for the given tree path.
- *
- * @param path
- */
- protected synchronized void doRestore(final TreePath path, final int modelIndex, final boolean knowsHasChildren,
- final boolean knowsChildCount, final boolean checkChildrenRealized) {
- if (fPendingState == null) {
- return;
- }
-
- IModelDeltaVisitor visitor = new IModelDeltaVisitor() {
- public boolean visit(final IModelDelta delta, int depth) {
-
- Object element = delta.getElement();
- Object potentialMatch = depth != 0 ? path.getSegment(depth - 1) : getViewer().getInput();
- // Only process if the depth in the delta matches the tree path.
- if (depth == path.getSegmentCount()) {
- if (element instanceof IMemento) {
- IElementMementoProvider provider = ViewerAdapterService.getMementoProvider(potentialMatch);
- if (provider == null) {
- provider = ViewerAdapterService.getMementoProvider(getViewer().getInput());
- }
- if (provider != null) {
- CompareRequestKey key = new CompareRequestKey(path, delta);
- ElementCompareRequest existingRequest = (ElementCompareRequest) fCompareRequestsInProgress
- .get(key);
- if (existingRequest != null) {
- // Check all the running compare updates for a
- // matching tree path.
- // If found, just update the flags.
- existingRequest.setKnowsHasChildren(knowsHasChildren);
- existingRequest.setKnowsChildCount(knowsChildCount);
- existingRequest.setCheckChildrenRealized(checkChildrenRealized);
- } else {
- // Start a new compare request
- ElementCompareRequest compareRequest = new ElementCompareRequest(
- ModelContentProvider.this, getViewer().getInput(), potentialMatch, path,
- (IMemento) element, (ModelDelta) delta, modelIndex, knowsHasChildren,
- knowsChildCount, checkChildrenRealized);
- fCompareRequestsInProgress.put(key, compareRequest);
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID
- .equals(getPresentationContext().getId()))) {
- System.out.println("\tSTATE BEGIN: " + compareRequest); //$NON-NLS-1$
- }
- notifyStateUpdate(fPendingState.getElement(), UPDATE_BEGINS, compareRequest);
- provider.compareElements(new IElementCompareRequest[] { compareRequest });
- }
- }
- } else if (element.equals(potentialMatch)) {
- // Element comparison already succeeded, and it matches
- // our element.
- // Call restore with delta to process the delta flags.
- doRestore((ModelDelta) delta, knowsHasChildren, knowsChildCount, checkChildrenRealized);
- }
- return false;
- }
- // Only follow the paths that match the delta.
- return element.equals(potentialMatch);
- }
- };
- fPendingState.accept(visitor);
- }
-
- void compareFinished(ElementCompareRequest request, ModelDelta delta) {
- notifyStateUpdate(request.getViewerInput(), UPDATE_COMPLETE, request);
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("\tSTATE END: " + request + " = " + false); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- fCompareRequestsInProgress.remove(request);
- if (!request.isCanceled()) {
- if (request.isEqual()) {
- delta.setElement(request.getElement());
- doRestore(delta, request.knowsHasChildren(), request.knowChildCount(), request.checkChildrenRealized());
- } else if (request.getModelIndex() != -1) {
- // Comparison failed.
- // Check if the delta has a reveal flag, and if its index
- // matches the index
- // of the element that it was compared against. If this is the
- // case,
- // strip the reveal flag from the delta as it is most likely not
- // applicable
- // anymore.
- if ((delta.getFlags() & IModelDelta.REVEAL) != 0 && delta.getIndex() == request.getModelIndex()) {
- delta.setFlags(delta.getFlags() & ~IModelDelta.REVEAL);
- }
- }
- }
- }
-
- /**
- * Saves the viewer's state for the previous input. * @param oldInput
- */
- protected void saveViewerState(Object input) {
- IElementMementoProvider stateProvider = ViewerAdapterService.getMementoProvider(input);
- if (stateProvider != null) {
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("STATE SAVE BEGIN: " + input); //$NON-NLS-1$
- }
-
- // build a model delta representing expansion and selection state
- final ModelDelta saveDeltaRoot = new ModelDelta(input, IModelDelta.NO_CHANGE);
- buildViewerState(saveDeltaRoot);
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("\tSAVE DELTA FROM VIEW:\n" + saveDeltaRoot); //$NON-NLS-1$
- }
-
- if (fPendingState != null) {
- // If the restore for the current input was never completed,
- // preserve
- // that restore along with the restore that was completed.
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("\tSAVE OUTSTANDING RESTORE: " + fPendingState); //$NON-NLS-1$
- }
-
- IModelDeltaVisitor pendingStateVisitor = new IModelDeltaVisitor() {
- public boolean visit(IModelDelta pendingDeltaNode, int depth) {
- // Ignore the top element.
- if (pendingDeltaNode.getParentDelta() == null) {
- return true;
- }
-
- // Find the node in the save delta which is the parent
- // of to the current pending delta node.
- // If the parent node cannot be found, it means that
- // most likely the user collapsed the parent node before
- // the children were ever expanded.
- // If the pending state node already exists in the
- // parent
- // node, it is already processed and we can skip it.
- // If the pending state node does not contain any flags,
- // we can also skip it.
- ModelDelta saveDeltaNode = findSaveDelta(saveDeltaRoot, pendingDeltaNode);
- if (saveDeltaNode != null && !isDeltaInParent(pendingDeltaNode, saveDeltaNode)
- && pendingDeltaNode.getFlags() != IModelDelta.NO_CHANGE) {
- // There should be only one delta element with
- // the REVEAL flag in the entire save delta. The
- // reveal flag in the pending delta trumps the one
- // in the save delta because most likely the restore
- // operation did not yet complete the reveal
- // operation.
- if ((pendingDeltaNode.getFlags() & IModelDelta.REVEAL) != 0) {
- clearRevealFlag(saveDeltaRoot);
- }
- saveDeltaNode.setChildCount(pendingDeltaNode.getParentDelta().getChildCount());
- copyIntoDelta(pendingDeltaNode, saveDeltaNode);
- } else {
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID
- .equals(getPresentationContext().getId()))) {
- System.out.println("\tSKIPPED: " + pendingDeltaNode.getElement()); //$NON-NLS-1$
- }
- }
-
- // If the pending delta node has a memento element, its
- // children should also be mementos therefore the copy
- // delta operation should have added all the children
- // of this pending delta node into the save delta.
- if (pendingDeltaNode.getElement() instanceof IMemento) {
- return false;
- } else {
- return pendingDeltaNode.getChildCount() > 0;
- }
- }
- };
- fPendingState.accept(pendingStateVisitor);
- }
-
- if (saveDeltaRoot.getChildDeltas().length > 0) {
- // encode delta with mementos in place of elements, in non-UI
- // thread
- encodeDelta(saveDeltaRoot, stateProvider);
- } else {
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("STATE SAVE CANCELED, NO DATA"); //$NON-NLS-1$
- }
- }
- }
- }
-
- private void clearRevealFlag(ModelDelta saveRootDelta) {
- IModelDeltaVisitor clearDeltaVisitor = new IModelDeltaVisitor() {
- public boolean visit(IModelDelta delta, int depth) {
- if ((delta.getFlags() & IModelDelta.REVEAL) != 0) {
- ((ModelDelta) delta).setFlags(delta.getFlags() & ~IModelDelta.REVEAL);
- }
- return true;
- }
- };
- saveRootDelta.accept(clearDeltaVisitor);
- }
-
- private ModelDelta findSaveDelta(ModelDelta saveDeltaRoot, IModelDelta pendingStateDelta) {
- // Create a path of elements to the pendingStateDelta.
- LinkedList deltaPath = new LinkedList();
- IModelDelta delta = pendingStateDelta;
- while (delta.getParentDelta() != null) {
- delta = delta.getParentDelta();
- deltaPath.addFirst(delta);
- }
-
- // For each element in the path of the pendingStateDelta, find the
- // corresponding
- // element in the partially restored delta being saved.
- Iterator itr = deltaPath.iterator();
- // Skip the root element
- itr.next();
- ModelDelta saveDelta = saveDeltaRoot;
- outer: while (itr.hasNext()) {
- IModelDelta itrDelta = (IModelDelta) itr.next();
- for (int i = 0; i < saveDelta.getChildDeltas().length; i++) {
- if (deltasEqual(saveDelta.getChildDeltas()[i], itrDelta)) {
- saveDelta = (ModelDelta) saveDelta.getChildDeltas()[i];
- continue outer;
- }
- }
- return null;
- }
- return saveDelta;
- }
-
- private boolean deltasEqual(IModelDelta d1, IModelDelta d2) {
- // Note: don't compare the child count, because it is
- // incorrect for nodes which have not been expanded yet.
- return d1.getElement().equals(d2.getElement()) && d1.getIndex() == d2.getIndex();
- }
-
- private boolean isDeltaInParent(IModelDelta delta, ModelDelta destParent) {
- for (int i = 0; i < destParent.getChildDeltas().length; i++) {
- if (deltasEqual(destParent.getChildDeltas()[i], delta)) {
- return true;
- }
- }
- return false;
- }
-
- private void copyIntoDelta(IModelDelta delta, ModelDelta destParent) {
- // Search the destination and make sure that the same delta
- // doesn't exist already.
-
- ModelDelta newDelta = destParent.addNode(delta.getElement(), delta.getIndex(), delta.getFlags(), delta
- .getChildCount());
- for (int i = 0; i < delta.getChildDeltas().length; i++) {
- copyIntoDelta(delta.getChildDeltas()[i], newDelta);
- }
- }
-
- /**
- * Encodes delta elements into mementos using the given provider.
- *
- * @param delta
- * @param stateProvider
- */
- protected void encodeDelta(final ModelDelta rootDelta, final IElementMementoProvider defaultProvider) {
- final Object input = rootDelta.getElement();
- final XMLMemento inputMemento = XMLMemento.createWriteRoot("VIEWER_INPUT_MEMENTO"); //$NON-NLS-1$
- final XMLMemento childrenMemento = XMLMemento.createWriteRoot("CHILDREN_MEMENTO"); //$NON-NLS-1$
- final IMementoManager manager = new IMementoManager() {
-
- /**
- * list of memento requests
- */
- private List requests = new ArrayList();
-
- private boolean abort = false;
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.debug.internal.ui.viewers.model.provisional.viewers
- * .IMementoManager
- * #requestComplete(org.eclipse.debug.internal.ui.viewers
- * .model.provisional.IElementMementoRequest)
- */
- public synchronized void requestComplete(IElementMementoRequest request) {
- notifyStateUpdate(input, UPDATE_COMPLETE, request);
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("\tSTATE END: " + request); //$NON-NLS-1$
- }
-
- if (!abort) {
- if (!request.isCanceled() && (request.getStatus() == null || request.getStatus().isOK())) {
- requests.remove(request);
- if (requests.isEmpty()) {
- XMLMemento keyMemento = (XMLMemento) rootDelta.getElement();
- StringWriter writer = new StringWriter();
- try {
- keyMemento.save(writer);
- fViewerStates.put(writer.toString(), rootDelta);
- } catch (IOException e) {
- DebugUIPlugin.log(e);
- }
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID
- .equals(getPresentationContext().getId()))) {
- System.out.println("STATE SAVE COMPLETED: " + rootDelta); //$NON-NLS-1$
- }
- stateSaveComplete(input, this);
- }
- } else {
- abort = true;
- Iterator iterator = requests.iterator();
- while (iterator.hasNext()) {
- IElementMementoRequest req = (IElementMementoRequest) iterator.next();
- req.cancel();
- }
- requests.clear();
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext()
- .getId()))) {
- System.out.println("STATE SAVE ABORTED: " + rootDelta.getElement()); //$NON-NLS-1$
- }
- stateSaveComplete(input, this);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.debug.internal.ui.viewers.model.provisional.viewers
- * .IMementoManager#processReqeusts()
- */
- public synchronized void processReqeusts() {
- Map providers = new HashMap();
- Iterator iterator = requests.iterator();
- while (iterator.hasNext()) {
- IElementMementoRequest request = (IElementMementoRequest) iterator.next();
- notifyStateUpdate(input, UPDATE_BEGINS, request);
- IElementMementoProvider provider = ViewerAdapterService.getMementoProvider(request.getElement());
- if (provider == null) {
- provider = defaultProvider;
- }
- List reqs = (List) providers.get(provider);
- if (reqs == null) {
- reqs = new ArrayList();
- providers.put(provider, reqs);
- }
- reqs.add(request);
- }
- iterator = providers.entrySet().iterator();
- while (iterator.hasNext()) {
- Entry entry = (Entry) iterator.next();
- IElementMementoProvider provider = (IElementMementoProvider) entry.getKey();
- List reqs = (List) entry.getValue();
- provider.encodeElements((IElementMementoRequest[]) reqs.toArray(new IElementMementoRequest[reqs
- .size()]));
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.debug.internal.ui.viewers.model.provisional.viewers
- * .IMementoManager
- * #addRequest(org.eclipse.debug.internal.ui.viewers.
- * model.provisional.IElementMementoRequest)
- */
- public synchronized void addRequest(IElementMementoRequest request) {
- requests.add(request);
- }
-
- };
- IModelDeltaVisitor visitor = new IModelDeltaVisitor() {
- public boolean visit(IModelDelta delta, int depth) {
- // Add the CONTENT flag to all nodes with an EXPAND flag.
- // During restoring, this flag is used as a marker indicating
- // whether all the content of a given element has been
- // retrieved.
- if ((delta.getFlags() | IModelDelta.EXPAND) != 0) {
- ((ModelDelta)delta).setFlags(delta.getFlags() | IModelDelta.CONTENT);
- }
-
- // This is the root element, save the root element memento in 'inputMemento'.
- if (delta.getParentDelta() == null) {
- manager.addRequest(new ElementMementoRequest(ModelContentProvider.this, input, manager,
- getPresentationContext(), delta.getElement(), getViewerTreePath(delta), inputMemento,
- (ModelDelta) delta));
- } else {
- // If this is another node element, save the memento to a children memento.
- if (!(delta.getElement() instanceof XMLMemento)) {
- manager.addRequest(new ElementMementoRequest(ModelContentProvider.this, input, manager,
- getPresentationContext(), delta.getElement(), getViewerTreePath(delta), childrenMemento
- .createChild("CHILD_ELEMENT"), (ModelDelta) delta)); //$NON-NLS-1$
- }
- }
- return true;
- }
- };
- rootDelta.accept(visitor);
- stateSaveStarted(input, manager);
- manager.processReqeusts();
- }
-
- /**
- * Called when a state save is starting.
- *
- * @param manager
- */
- private synchronized void stateSaveStarted(Object input, IMementoManager manager) {
- notifyStateUpdate(input, STATE_SAVE_SEQUENCE_BEGINS, null);
- fPendingStateSaves.add(manager);
- }
-
- /**
- * Called when a state save is complete.
- *
- * @param manager
- */
- private synchronized void stateSaveComplete(Object input, IMementoManager manager) {
- notifyStateUpdate(input, STATE_SAVE_SEQUENCE_COMPLETE, null);
- fPendingStateSaves.remove(manager);
- if (fQueuedRestore != null) {
- Object temp = fQueuedRestore;
- fQueuedRestore = null;
- restoreViewerState(temp);
- }
- }
-
- /**
- * Returns whether any state saving is in progress.
- *
- * @return whether any state saving is in progress
- */
- private synchronized boolean isSavingState() {
- return !fPendingStateSaves.isEmpty();
- }
-
- /**
- * Builds a delta with the given root delta for expansion/selection state.
- *
- * @param delta
- * root delta
- */
- protected abstract void buildViewerState(ModelDelta delta);
-
- /**
- * Uninstalls the model proxy installed for the given element, if any.
- *
- * @param element
- */
- protected synchronized void disposeModelProxy(TreePath path) {
- IModelProxy proxy = (IModelProxy) fTreeModelProxies.remove(path);
- if (proxy != null) {
- proxy.dispose();
- }
- proxy = (IModelProxy) fModelProxies.remove(path.getLastSegment());
- if (proxy != null) {
- proxy.dispose();
- }
- }
-
- /**
- * Uninstalls each model proxy
- */
- protected synchronized void disposeAllModelProxies() {
- Iterator updatePolicies = fModelProxies.values().iterator();
- while (updatePolicies.hasNext()) {
- IModelProxy proxy = (IModelProxy) updatePolicies.next();
- proxy.dispose();
- }
- fModelProxies.clear();
-
- updatePolicies = fTreeModelProxies.values().iterator();
- while (updatePolicies.hasNext()) {
- IModelProxy proxy = (IModelProxy) updatePolicies.next();
- proxy.dispose();
- }
- fTreeModelProxies.clear();
- }
-
- protected synchronized IModelProxy[] getModelProxies() {
- IModelProxy[] proxies = new IModelProxy[fTreeModelProxies.size() + fModelProxies.size()];
- fTreeModelProxies.values().toArray(proxies);
- System.arraycopy(fModelProxies.values().toArray(), 0, proxies, fModelProxies.size(), fModelProxies.size());
- return proxies;
- }
-
- protected synchronized IModelProxy getElementProxy(TreePath path) {
- while (path != null) {
- IModelProxy proxy = (IModelProxy) fTreeModelProxies.get(path);
- if (proxy != null) {
- return proxy;
- }
-
- proxy = (IModelProxy) fModelProxies.get(path.getLastSegment());
- if (proxy != null) {
- return proxy;
- }
-
- path = path.getParentPath();
- }
- return null;
- }
-
- /**
- * Installs the model proxy for the given element into this content provider
- * if not already installed.
- *
- * @param element
- * element to install an update policy for
- */
- protected synchronized void installModelProxy(Object input, TreePath path) {
- if (!fTreeModelProxies.containsKey(path) && !fModelProxies.containsKey(path.getLastSegment())) {
- Object element = path.getSegmentCount() != 0 ? path.getLastSegment() : input;
- IModelProxy proxy = null;
- IModelProxyFactory2 modelProxyFactory2 = ViewerAdapterService.getModelProxyFactory2(element);
- if (modelProxyFactory2 != null) {
- proxy = modelProxyFactory2.createTreeModelProxy(input, path, getPresentationContext());
- if (proxy != null) {
- fTreeModelProxies.put(path, proxy);
- }
- }
- if (proxy == null) {
- IModelProxyFactory modelProxyFactory = ViewerAdapterService.getModelProxyFactory(element);
- if (modelProxyFactory != null) {
- proxy = modelProxyFactory.createModelProxy(element, getPresentationContext());
- if (proxy != null) {
- fModelProxies.put(element, proxy);
- }
- }
- }
-
- if (proxy != null) {
- final IModelProxy finalProxy = proxy;
- if (proxy != null) {
- Job job = new Job("Model Proxy installed notification job") {//$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- if (!monitor.isCanceled()) {
- IPresentationContext context = null;
- Viewer viewer = null;
- synchronized (ModelContentProvider.this) {
- if (!isDisposed()) {
- context = getPresentationContext();
- viewer = (Viewer) getViewer();
- }
- }
- if (context != null && !finalProxy.isDisposed()) {
- finalProxy.init(context);
- finalProxy.addModelChangedListener(ModelContentProvider.this);
- finalProxy.installed(viewer);
- }
- }
- return Status.OK_STATUS;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.jobs.Job#shouldRun()
- */
- public boolean shouldRun() {
- return !isDisposed();
- }
- };
- job.setSystem(true);
- job.schedule();
- }
- }
- }
- }
-
- /**
- * Returns the presentation context for this content provider.
- *
- * @return presentation context
- */
- protected abstract IPresentationContext getPresentationContext();
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.debug.internal.ui.viewers.provisional.IModelChangedListener
- * #modelChanged
- * (org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta)
- */
- public synchronized void modelChanged(final IModelDelta delta, final IModelProxy proxy) {
- if (fViewer != null && !proxy.isDisposed()) {
- WorkbenchJob job = new WorkbenchJob(fViewer.getDisplay(), "process model delta") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if (!proxy.isDisposed()) {
- if (DEBUG_DELTAS
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext()
- .getId()))) {
- DebugUIPlugin.debug("RECEIVED DELTA: " + delta.toString()); //$NON-NLS-1$
- }
-
- updateModel(delta, getModelDeltaMask());
-
- // Call model listeners after updating the viewer model.
- Object[] listeners = fModelListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- ((IModelChangedListener) listeners[i]).modelChanged(delta, proxy);
- }
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
- }
-
- /**
- * @see ITreeModelContentProvider#setModelDeltaMask(int)
- */
- public void setModelDeltaMask(int mask) {
- fModelDeltaMask = mask;
- }
-
- /**
- * @see ITreeModelContentProvider#getModelDeltaMask()
- */
- public int getModelDeltaMask() {
- return fModelDeltaMask;
- }
-
- public void updateModel(IModelDelta delta, int mask) {
- IModelDelta[] deltaArray = new IModelDelta[] { delta };
- updateNodes(deltaArray, mask & (IModelDelta.REMOVED | IModelDelta.UNINSTALL));
- updateNodes(deltaArray, mask & ITreeModelContentProvider.UPDATE_MODEL_DELTA_FLAGS
- & ~(IModelDelta.REMOVED | IModelDelta.UNINSTALL));
- updateNodes(deltaArray, mask & ITreeModelContentProvider.CONTROL_MODEL_DELTA_FLAGS);
- }
-
- /**
- * Updates the viewer with the following deltas.
- *
- * @param nodes
- * Model deltas to be processed.
- * @param override
- * If true, it overrides the mode which suppresses processing of
- * SELECT, REVEAL, EXPAND, COLLAPSE flags of {@link IModelDelta}.
- */
- protected void updateNodes(IModelDelta[] nodes, int mask) {
- for (int i = 0; i < nodes.length; i++) {
- IModelDelta node = nodes[i];
- int flags = node.getFlags() & mask;
-
- if ((flags & IModelDelta.ADDED) != 0) {
- handleAdd(node);
- }
- if ((flags & IModelDelta.REMOVED) != 0) {
- handleRemove(node);
- }
- if ((flags & IModelDelta.CONTENT) != 0) {
- handleContent(node);
- }
- if ((flags & IModelDelta.STATE) != 0) {
- handleState(node);
- }
- if ((flags & IModelDelta.INSERTED) != 0) {
- handleInsert(node);
- }
- if ((flags & IModelDelta.REPLACED) != 0) {
- handleReplace(node);
- }
- if ((flags & IModelDelta.INSTALL) != 0) {
- handleInstall(node);
- }
- if ((flags & IModelDelta.UNINSTALL) != 0) {
- handleUninstall(node);
- }
- if ((flags & IModelDelta.EXPAND) != 0) {
- handleExpand(node);
- }
- if ((flags & IModelDelta.COLLAPSE) != 0) {
- handleCollapse(node);
- }
- if ((flags & IModelDelta.SELECT) != 0) {
- handleSelect(node);
- }
- if ((flags & IModelDelta.REVEAL) != 0) {
- handleReveal(node);
- }
- updateNodes(node.getChildDeltas(), mask);
- }
- }
-
- protected abstract void handleState(IModelDelta delta);
-
- protected abstract void handleSelect(IModelDelta delta);
-
- protected abstract void handleExpand(IModelDelta delta);
-
- protected abstract void handleCollapse(IModelDelta delta);
-
- protected abstract void handleContent(IModelDelta delta);
-
- protected abstract void handleRemove(IModelDelta delta);
-
- protected abstract void handleAdd(IModelDelta delta);
-
- protected abstract void handleInsert(IModelDelta delta);
-
- protected abstract void handleReplace(IModelDelta delta);
-
- protected abstract void handleReveal(IModelDelta delta);
-
- protected void handleInstall(IModelDelta delta) {
- installModelProxy(getViewer().getInput(), getFullTreePath(delta));
- }
-
- protected void handleUninstall(IModelDelta delta) {
- disposeModelProxy(getFullTreePath(delta));
- }
-
- /**
- * Returns a tree path for the node including the root element.
- *
- * @param node
- * model delta
- * @return corresponding tree path
- */
- protected TreePath getFullTreePath(IModelDelta node) {
- ArrayList list = new ArrayList();
- while (node.getParentDelta() != null) {
- list.add(0, node.getElement());
- node = node.getParentDelta();
- }
- return new TreePath(list.toArray());
- }
-
- /**
- * Returns a tree path for the node, *not* including the root element.
- *
- * @param node
- * model delta
- * @return corresponding tree path
- */
- protected TreePath getViewerTreePath(IModelDelta node) {
- ArrayList list = new ArrayList();
- IModelDelta parentDelta = node.getParentDelta();
- while (parentDelta != null) {
- list.add(0, node.getElement());
- node = parentDelta;
- parentDelta = node.getParentDelta();
- }
- return new TreePath(list.toArray());
- }
-
- /**
- * Returns the viewer this content provider is working for.
- *
- * @return viewer
- */
- protected ITreeModelContentProviderTarget getViewer() {
- return fViewer;
- }
-
- /**
- * Translates and returns the given child index from the viewer coordinate
- * space to the model coordinate space.
- *
- * @param parentPath
- * path to parent element
- * @param index
- * index of child element in viewer (filtered) space
- * @return index of child element in model (raw) space
- */
- public/* protected */int viewToModelIndex(TreePath parentPath, int index) {
- return fTransform.viewToModelIndex(parentPath, index);
- }
-
- /**
- * Translates and returns the given child count from the viewer coordinate
- * space to the model coordinate space.
- *
- * @param parentPath
- * path to parent element
- * @param count
- * number of child elements in viewer (filtered) space
- * @return number of child elements in model (raw) space
- */
- public/* protected */int viewToModelCount(TreePath parentPath, int count) {
- return fTransform.viewToModelCount(parentPath, count);
- }
-
- /**
- * Translates and returns the given child index from the model coordinate
- * space to the viewer coordinate space.
- *
- * @param parentPath
- * path to parent element
- * @param index
- * index of child element in model (raw) space
- * @return index of child element in viewer (filtered) space or -1 if
- * filtered
- */
- public int modelToViewIndex(TreePath parentPath, int index) {
- return fTransform.modelToViewIndex(parentPath, index);
- }
-
- /**
- * Translates and returns the given child count from the model coordinate
- * space to the viewer coordinate space.
- *
- * @param parentPath
- * path to parent element
- * @param count
- * child count element in model (raw) space
- * @return child count in viewer (filtered) space
- */
- public int modelToViewChildCount(TreePath parentPath, int count) {
- return fTransform.modelToViewCount(parentPath, count);
- }
-
- /**
- * Notes that the child at the specified index of the given parent element
- * has been filtered from the viewer. Returns whether the child at the given
- * index was already filtered.
- *
- * @param parentPath
- * path to parent element
- * @param index
- * index of child element to be filtered
- * @param element
- * the filtered element
- * @return whether the child was already filtered
- */
- protected boolean addFilteredIndex(TreePath parentPath, int index, Object element) {
- return fTransform.addFilteredIndex(parentPath, index, element);
- }
-
- /**
- * Notes that the element at the given index has been removed from its
- * parent and filtered indexes should be updated accordingly.
- *
- * @param parentPath
- * path to parent element
- * @param index
- * index of element that was removed
- */
- protected void removeElementFromFilters(TreePath parentPath, int index) {
- fTransform.removeElementFromFilters(parentPath, index);
- }
-
- /**
- * Removes the given element from filtered elements of the given parent
- * element. Return true if the element was removed, otherwise false.
- *
- * @param parentPath
- * path to parent element
- * @param element
- * element to remove
- * @return whether the element was removed
- */
- protected boolean removeElementFromFilters(TreePath parentPath, Object element) {
- return fTransform.removeElementFromFilters(parentPath, element);
- }
-
- /**
- * The child count for a parent has been computed. Ensure any filtered items
- * above the given count are cleared.
- *
- * @param parentPath
- * path to parent element
- * @param childCount
- * number of children
- */
- protected void setModelChildCount(TreePath parentPath, int childCount) {
- fTransform.setModelChildCount(parentPath, childCount);
- }
-
- /**
- * Returns whether the given element is filtered.
- *
- * @param parentElementOrTreePath
- * the parent element or path
- * @param element
- * the child element
- * @return whether to filter the element
- */
- public boolean shouldFilter(Object parentElementOrTreePath, Object element) {
- ViewerFilter[] filters = fViewer.getFilters();
- if (filters.length > 0) {
- for (int j = 0; j < filters.length; j++) {
- if (!(filters[j].select((Viewer) fViewer, parentElementOrTreePath, element))) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Returns whether the given index of the specified parent was previously
- * filtered.
- *
- * @param parentPath
- * @param index
- * @return whether the element at the given index was filtered
- */
- protected boolean isFiltered(TreePath parentPath, int index) {
- return fTransform.isFiltered(parentPath, index);
- }
-
- /**
- * Notification the given element is being unmapped.
- *
- * @param path
- */
- public void unmapPath(TreePath path) {
- // System.out.println("Unmap " + path.getLastSegment());
- fTransform.clear(path);
- cancelSubtreeUpdates(path);
- }
-
- /**
- * Returns filtered children or <code>null</code>
- *
- * @param parent
- * @return filtered children or <code>null</code>
- */
- protected int[] getFilteredChildren(TreePath parent) {
- return fTransform.getFilteredChildren(parent);
- }
-
- protected void clearFilteredChild(TreePath parent, int modelIndex) {
- fTransform.clear(parent, modelIndex);
- }
-
- protected void clearFilters(TreePath parent) {
- fTransform.clear(parent);
- }
-
- protected synchronized void checkIfRestoreComplete() {
- if (fPendingState == null) {
- return;
- }
- CheckState state = new CheckState();
- fPendingState.accept(state);
- if (state.isComplete()) {
- if (DEBUG_STATE_SAVE_RESTORE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("STATE RESTORE COMPELTE: " + fPendingState); //$NON-NLS-1$
- }
- notifyStateUpdate(fPendingState.getElement(), STATE_RESTORE_SEQUENCE_COMPLETE, null);
- fPendingState = null;
- }
- }
-
- public void addViewerUpdateListener(IViewerUpdateListener listener) {
- fUpdateListeners.add(listener);
- }
-
- public void removeViewerUpdateListener(IViewerUpdateListener listener) {
- fUpdateListeners.remove(listener);
- }
-
- /**
- * Notification an update request has started
- *
- * @param update
- */
- void updateStarted(ViewerUpdateMonitor update) {
- boolean begin = false;
- synchronized (fRequestsInProgress) {
- begin = fRequestsInProgress.isEmpty();
- List requests = (List) fRequestsInProgress.get(update.getSchedulingPath());
- if (requests == null) {
- requests = new ArrayList();
- fRequestsInProgress.put(update.getSchedulingPath(), requests);
- }
- requests.add(update);
- }
- if (begin) {
- if (DEBUG_UPDATE_SEQUENCE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("MODEL SEQUENCE BEGINS"); //$NON-NLS-1$
- }
- notifyUpdate(UPDATE_SEQUENCE_BEGINS, null);
- }
- if (DEBUG_UPDATE_SEQUENCE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("\tBEGIN - " + update); //$NON-NLS-1$
- }
- notifyUpdate(UPDATE_BEGINS, update);
- }
-
- /**
- * Notification an update request has completed
- *
- * @param update
- */
- void updateComplete(ViewerUpdateMonitor update) {
- boolean end = false;
- synchronized (fRequestsInProgress) {
- List requests = (List) fRequestsInProgress.get(update.getSchedulingPath());
- if (requests != null) {
- requests.remove(update);
- trigger(update);
- if (requests.isEmpty()) {
- fRequestsInProgress.remove(update.getSchedulingPath());
- }
- }
- end = fRequestsInProgress.isEmpty();
- }
- notifyUpdate(UPDATE_COMPLETE, update);
- if (DEBUG_UPDATE_SEQUENCE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("\tEND - " + update); //$NON-NLS-1$
- }
- if (end) {
- if (DEBUG_UPDATE_SEQUENCE
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("MODEL SEQUENCE ENDS"); //$NON-NLS-1$
- }
- notifyUpdate(UPDATE_SEQUENCE_COMPLETE, null);
- }
- }
-
- protected void notifyUpdate(final int type, final IViewerUpdate update) {
- if (!fUpdateListeners.isEmpty()) {
- Object[] listeners = fUpdateListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final IViewerUpdateListener listener = (IViewerUpdateListener) listeners[i];
- SafeRunner.run(new ISafeRunnable() {
- public void run() throws Exception {
- switch (type) {
- case UPDATE_SEQUENCE_BEGINS:
- listener.viewerUpdatesBegin();
- break;
- case UPDATE_SEQUENCE_COMPLETE:
- listener.viewerUpdatesComplete();
- break;
- case UPDATE_BEGINS:
- listener.updateStarted(update);
- break;
- case UPDATE_COMPLETE:
- listener.updateComplete(update);
- break;
- }
- }
-
- public void handleException(Throwable exception) {
- DebugUIPlugin.log(exception);
- }
- });
- }
- }
- }
-
- public void addStateUpdateListener(IStateUpdateListener listener) {
- fStateUpdateListeners.add(listener);
- }
-
- public void removeStateUpdateListener(IStateUpdateListener listener) {
- fStateUpdateListeners.remove(listener);
- }
-
- protected void notifyStateUpdate(final Object input, final int type, final IViewerUpdate update) {
- if (!fStateUpdateListeners.isEmpty()) {
- Object[] listeners = fStateUpdateListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final IStateUpdateListener listener = (IStateUpdateListener) listeners[i];
- SafeRunner.run(new ISafeRunnable() {
- public void run() throws Exception {
- switch (type) {
- case STATE_SAVE_SEQUENCE_BEGINS:
- listener.stateSaveUpdatesBegin(input);
- break;
- case STATE_SAVE_SEQUENCE_COMPLETE:
- listener.stateSaveUpdatesComplete(input);
- break;
- case STATE_RESTORE_SEQUENCE_BEGINS:
- listener.stateRestoreUpdatesBegin(input);
- break;
- case STATE_RESTORE_SEQUENCE_COMPLETE:
- listener.stateRestoreUpdatesComplete(input);
- break;
- case UPDATE_BEGINS:
- listener.stateUpdateStarted(input, update);
- break;
- case UPDATE_COMPLETE:
- listener.stateUpdateComplete(input, update);
- break;
- }
- }
-
- public void handleException(Throwable exception) {
- DebugUIPlugin.log(exception);
- }
- });
- }
- }
- }
-
- protected void cancelSubtreeUpdates(TreePath path) {
- synchronized (fRequestsInProgress) {
- Iterator iterator = fRequestsInProgress.entrySet().iterator();
- while (iterator.hasNext()) {
- Entry entry = (Entry) iterator.next();
- TreePath entryPath = (TreePath) entry.getKey();
- if (entryPath.startsWith(path, null)) {
- List requests = (List) entry.getValue();
- Iterator reqIter = requests.iterator();
- while (reqIter.hasNext()) {
- ((IRequest) reqIter.next()).cancel();
- }
- }
- }
- List purge = new ArrayList();
- iterator = fWaitingRequests.keySet().iterator();
- while (iterator.hasNext()) {
- TreePath entryPath = (TreePath) iterator.next();
- if (entryPath.startsWith(path, null)) {
- purge.add(entryPath);
- }
- }
- iterator = purge.iterator();
- while (iterator.hasNext()) {
- fWaitingRequests.remove(iterator.next());
- }
- }
- for (Iterator itr = fCompareRequestsInProgress.keySet().iterator(); itr.hasNext();) {
- CompareRequestKey key = (CompareRequestKey) itr.next();
- if (key.fPath.startsWith(path, null)) {
- ElementCompareRequest compareRequest = (ElementCompareRequest) fCompareRequestsInProgress.get(key);
- compareRequest.cancel();
- itr.remove();
- }
- }
- }
-
- /**
- * Returns whether this given request should be run, or should wait for
- * parent update to complete.
- *
- * @param update
- * @return whether to start the given request
- */
- void schedule(ViewerUpdateMonitor update) {
- synchronized (fRequestsInProgress) {
- TreePath schedulingPath = update.getSchedulingPath();
- List requests = (List) fWaitingRequests.get(schedulingPath);
- if (requests == null) {
- // no waiting requests
- TreePath parentPath = schedulingPath;
- while (fRequestsInProgress.get(parentPath) == null) {
- parentPath = parentPath.getParentPath();
- if (parentPath == null) {
- // no running requests: start request
- update.start();
- return;
- }
- }
- // request running on parent, add to waiting list
- requests = new ArrayList();
- requests.add(update);
- fWaitingRequests.put(schedulingPath, requests);
- } else {
- // there are waiting requests: coalesce with existing request?
- Iterator reqIter = requests.iterator();
- while (reqIter.hasNext()) {
- ViewerUpdateMonitor waiting = (ViewerUpdateMonitor) reqIter.next();
- if (waiting.coalesce(update)) {
- // coalesced with existing request, done
- return;
- }
- }
- // add to list of waiting requests
- requests.add(update);
- return;
- }
- }
- }
-
- protected boolean getElementChildrenRealized(TreePath path) {
- synchronized (fRequestsInProgress) {
- List requests = (List) fWaitingRequests.get(path);
- if (requests != null) {
- for (int i = 0; i < requests.size(); i++) {
- if (requests.get(i) instanceof ChildrenUpdate) {
- return false;
- }
- }
- }
- requests = (List) fRequestsInProgress.get(path);
- if (requests != null) {
- int numChildrenUpdateRequests = 0;
- for (int i = 0; i < requests.size(); i++) {
- if (requests.get(i) instanceof ChildrenUpdate) {
- if (++numChildrenUpdateRequests > 1) {
- return false;
- }
- }
- }
- }
- }
-
- return getViewer().getElementChildrenRealized(path);
- }
-
- /**
- * Triggers waiting requests based on the given request that just completed.
- *
- * TODO: should we cancel child updates if a request has been canceled?
- *
- * @param request
- */
- void trigger(ViewerUpdateMonitor request) {
- if (fWaitingRequests.isEmpty()) {
- return;
- }
- TreePath schedulingPath = request.getSchedulingPath();
- List waiting = (List) fWaitingRequests.get(schedulingPath);
- if (waiting == null) {
- // no waiting, update the entry with the shortest path
- int length = Integer.MAX_VALUE;
- Iterator entries = fWaitingRequests.entrySet().iterator();
- Entry candidate = null;
- while (entries.hasNext()) {
- Entry entry = (Entry) entries.next();
- TreePath key = (TreePath) entry.getKey();
- if (key.getSegmentCount() < length) {
- candidate = entry;
- length = key.getSegmentCount();
- }
- }
- if (candidate != null) {
- startHighestPriorityRequest((TreePath) candidate.getKey(), (List) candidate.getValue());
- }
- } else {
- // start the highest priority request
- startHighestPriorityRequest(schedulingPath, waiting);
- }
- }
-
- /**
- * @param key
- * @param waiting
- */
- private void startHighestPriorityRequest(TreePath key, List waiting) {
- int priority = 4;
- ViewerUpdateMonitor next = null;
- Iterator requests = waiting.iterator();
- while (requests.hasNext()) {
- ViewerUpdateMonitor vu = (ViewerUpdateMonitor) requests.next();
- if (vu.getPriority() < priority) {
- next = vu;
- priority = next.getPriority();
- }
- }
- waiting.remove(next);
- if (waiting.isEmpty()) {
- fWaitingRequests.remove(key);
- }
- next.start();
- }
-
- /**
- * Registers the given listener for model delta notification.
- *
- * @param listener
- * model delta listener
- */
- public void addModelChangedListener(IModelChangedListener listener) {
- fModelListeners.add(listener);
- }
-
- /**
- * Unregisters the given listener from model delta notification.
- *
- * @param listener
- * model delta listener
- */
- public void removeModelChangedListener(IModelChangedListener listener) {
- fModelListeners.remove(listener);
- }
-
- /**
- * Returns the element corresponding to the given tree path.
- *
- * @param path
- * tree path
- * @return model element
- */
- protected Object getElement(TreePath path) {
- if (path.getSegmentCount() > 0) {
- return path.getLastSegment();
- }
- return getViewer().getInput();
- }
-
- /**
- * Reschedule any children updates in progress for the given parent that
- * have a start index greater than the given index. An element has been
- * removed at this index, invalidating updates in progress.
- *
- * @param parentPath
- * view tree path to parent element
- * @param modelIndex
- * index at which an element was removed
- */
- protected void rescheduleUpdates(TreePath parentPath, int modelIndex) {
- synchronized (fRequestsInProgress) {
- List requests = (List) fRequestsInProgress.get(parentPath);
- List reCreate = null;
- if (requests != null) {
- Iterator iterator = requests.iterator();
- while (iterator.hasNext()) {
- IViewerUpdate update = (IViewerUpdate) iterator.next();
- if (update instanceof IChildrenUpdate) {
- IChildrenUpdate childrenUpdate = (IChildrenUpdate) update;
- if (childrenUpdate.getOffset() > modelIndex) {
- childrenUpdate.cancel();
- if (reCreate == null) {
- reCreate = new ArrayList();
- }
- reCreate.add(childrenUpdate);
- if (DEBUG_CONTENT_PROVIDER
- && getPresentationContext().getId().equals(DEBUG_PRESENTATION_ID)) {
- System.out.println("canceled update in progress handling REMOVE: " + childrenUpdate); //$NON-NLS-1$
- }
- }
- }
- }
- }
- requests = (List) fWaitingRequests.get(parentPath);
- if (requests != null) {
- Iterator iterator = requests.iterator();
- while (iterator.hasNext()) {
- IViewerUpdate update = (IViewerUpdate) iterator.next();
- if (update instanceof IChildrenUpdate) {
- IChildrenUpdate childrenUpdate = (IChildrenUpdate) update;
- if (childrenUpdate.getOffset() > modelIndex) {
- ((ChildrenUpdate) childrenUpdate).setOffset(childrenUpdate.getOffset() - 1);
- if (DEBUG_CONTENT_PROVIDER
- && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID
- .equals(getPresentationContext().getId()))) {
- System.out.println("modified waiting update handling REMOVE: " + childrenUpdate); //$NON-NLS-1$
- }
- }
- }
- }
- }
- // re-schedule canceled updates at new position.
- // have to do this last else the requests would be waiting and
- // get modified.
- if (reCreate != null) {
- Iterator iterator = reCreate.iterator();
- while (iterator.hasNext()) {
- IChildrenUpdate childrenUpdate = (IChildrenUpdate) iterator.next();
- int start = childrenUpdate.getOffset() - 1;
- int end = start + childrenUpdate.getLength();
- for (int i = start; i < end; i++) {
- ((TreeModelContentProvider) this).doUpdateElement(parentPath, i);
- }
- }
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java
deleted file mode 100644
index f30f9b3cb..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java
+++ /dev/null
@@ -1,552 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IStateUpdateListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.viewers.ViewerLabel;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Specialized tree viewer which displays only sub-tree of a full model.
- *
- * @since 3.5
- */
-public class SubTreeModelViewer extends TreeModelViewer {
-
- /**
- * The tree path in the model to the root element of this viewer.
- */
- private TreePath fRootPath = TreePath.EMPTY;
-
- /**
- * Viewer delegate that content and label providers refer to for viewer data.
- */
- private DelegatingTreeModelViewer fDelegatingViewer;
-
- /**
- * Returns the root element's model tree path.
- */
- public TreePath getRootPath() {
- return fRootPath;
- }
-
- public SubTreeModelViewer(Composite parent, int style, IPresentationContext context) {
- super(parent, style, context);
- }
-
- /**
- * Sets the viewer's input and root element's path
- *
- * @param input New viewer input.
- * @param rootPath New root element path.
- */
- public void setInput(Object input, TreePath rootPath) {
- fRootPath = rootPath;
- super.setInput(input);
- }
-
- /**
- * A proxy for the sub tree viewer which is given to the content and
- * label providers. It translates the sub-tree paths in the viewer to the
- * full model paths that the providers expect.
- */
- public class DelegatingTreeModelViewer extends Viewer
- implements ITreeModelLabelProviderTarget, ITreeModelContentProviderTarget
- {
- public void reveal(TreePath path, int index) {
- if (path.startsWith(fRootPath, null)) {
- SubTreeModelViewer.this.reveal(createSubPath(path), index);
- }
- }
-
- public void replace(Object parentOrTreePath, int index, Object element) {
- if (parentOrTreePath instanceof TreePath) {
- TreePath path = (TreePath)parentOrTreePath;
- if (path.startsWith(fRootPath, null)) {
- SubTreeModelViewer.this.replace(createSubPath(path), index, element);
- }
- } else {
- SubTreeModelViewer.this.replace(parentOrTreePath, index, element);
- }
- }
-
- public void setChildCount(Object elementOrTreePath, int count) {
- if (elementOrTreePath instanceof TreePath) {
- TreePath path = (TreePath)elementOrTreePath;
- if (path.startsWith(fRootPath, null)) {
- SubTreeModelViewer.this.setChildCount(createSubPath(path), count);
- }
- } else {
- SubTreeModelViewer.this.setChildCount(elementOrTreePath, count);
- }
- }
-
- public void setHasChildren(Object elementOrTreePath, boolean hasChildren) {
- if (elementOrTreePath instanceof TreePath) {
- TreePath path = (TreePath)elementOrTreePath;
- if (path.startsWith(fRootPath, null)) {
- SubTreeModelViewer.this.setHasChildren(createSubPath(path), hasChildren);
- }
- } else {
- SubTreeModelViewer.this.setHasChildren(elementOrTreePath, hasChildren);
- }
- }
-
- public void autoExpand(TreePath elementPath) {
- // not supported
- }
-
- public void setExpandedState(Object elementOrTreePath, boolean expanded) {
- if (elementOrTreePath instanceof TreePath) {
- TreePath path = (TreePath)elementOrTreePath;
- if (path.startsWith(fRootPath, null)) {
- SubTreeModelViewer.this.setExpandedState(createSubPath(path), expanded);
- }
- } else {
- SubTreeModelViewer.this.setExpandedState(elementOrTreePath, expanded);
- }
- }
-
- public void expandToLevel(Object elementOrTreePath, int level) {
- if (elementOrTreePath instanceof TreePath) {
- TreePath path = (TreePath)elementOrTreePath;
- if (path.startsWith(fRootPath, null)) {
- SubTreeModelViewer.this.expandToLevel(createSubPath(path), level);
- }
- } else {
- SubTreeModelViewer.this.expandToLevel(elementOrTreePath, level);
- }
- }
-
- public void remove(Object elementOrTreePath) {
- if (elementOrTreePath instanceof TreePath) {
- TreePath path = (TreePath)elementOrTreePath;
- if (path.startsWith(fRootPath, null)) {
- SubTreeModelViewer.this.remove(createSubPath(path));
- }
- } else {
- SubTreeModelViewer.this.remove(elementOrTreePath);
- }
- }
-
- public void remove(Object parentOrTreePath, final int index) {
- if (parentOrTreePath instanceof TreePath) {
- TreePath path = (TreePath)parentOrTreePath;
- if (path.startsWith(fRootPath, null)) {
- SubTreeModelViewer.this.remove(createSubPath(path), index);
- }
- } else {
- SubTreeModelViewer.this.remove(parentOrTreePath, index);
- }
- }
-
- public void insert(Object parentOrTreePath, Object element, int position) {
- if (parentOrTreePath instanceof TreePath) {
- TreePath path = (TreePath)parentOrTreePath;
- if (path.startsWith(fRootPath, null)) {
- SubTreeModelViewer.this.insert(createSubPath(path), element, position);
- }
- } else {
- SubTreeModelViewer.this.insert(parentOrTreePath, element, position);
- }
- }
-
- public boolean getExpandedState(Object elementOrTreePath) {
- if (elementOrTreePath instanceof TreePath) {
- TreePath path = (TreePath)elementOrTreePath;
- if (path.startsWith(fRootPath, null)) {
- return SubTreeModelViewer.this.getExpandedState(createSubPath(path));
- }
- } else {
- return SubTreeModelViewer.this.getExpandedState(elementOrTreePath);
- }
- return false;
- }
-
- public int getChildCount(TreePath path) {
- if (path.startsWith(fRootPath, null)) {
- return SubTreeModelViewer.this.getChildCount(createSubPath(path));
- }
- return -1;
- }
-
- public boolean getHasChildren(Object elementOrTreePath) {
- if (elementOrTreePath instanceof TreePath) {
- TreePath path = (TreePath)elementOrTreePath;
- if (path.startsWith(fRootPath, null)) {
- return SubTreeModelViewer.this.getHasChildren(createSubPath(path));
- }
- } else {
- return SubTreeModelViewer.this.getHasChildren(elementOrTreePath);
- }
- return false;
- }
-
- public Object getChildElement(TreePath path, int index) {
- if (path.startsWith(fRootPath, null)) {
- return SubTreeModelViewer.this.getChildElement(createSubPath(path), index);
- }
- return null;
- }
-
- public TreePath getTopElementPath() {
- return createFullPath(SubTreeModelViewer.this.getTopElementPath());
- }
-
- public int findElementIndex(TreePath parentPath, Object element) {
- if (parentPath.startsWith(fRootPath, null)) {
- return SubTreeModelViewer.this.findElementIndex(createSubPath(parentPath), element);
- }
- return -1;
- }
-
- public boolean getElementChildrenRealized(TreePath parentPath) {
- if (parentPath.startsWith(fRootPath, null)) {
- return SubTreeModelViewer.this.getElementChildrenRealized(createSubPath(parentPath));
- }
- return true;
- }
-
- public void setElementData(TreePath path, int numColumns, String[] labels, ImageDescriptor[] images, FontData[] fontDatas, RGB[] foregrounds, RGB[] backgrounds) {
- if (path.startsWith(fRootPath, null)) {
- SubTreeModelViewer.this.setElementData(createSubPath(path), numColumns, labels, images, fontDatas, foregrounds, backgrounds);
- }
- }
-
- public Control getControl() {
- return SubTreeModelViewer.this.getControl();
- }
-
- public Object getInput() {
- return SubTreeModelViewer.this.getInput();
- }
-
- public ISelection getSelection() {
- return SubTreeModelViewer.this.getSelection();
- }
-
- public void refresh() {
- SubTreeModelViewer.this.refresh();
- }
-
- public void setInput(Object input) {
- SubTreeModelViewer.this.setInput(input);
- }
-
- public void setSelection(ISelection selection, boolean reveal) {
- SubTreeModelViewer.this.setSelection(selection, reveal);
- }
-
- public String[] getVisibleColumns() {
- return SubTreeModelViewer.this.getVisibleColumns();
- }
-
- public void addLabelUpdateListener(ILabelUpdateListener listener) {
- SubTreeModelViewer.this.addLabelUpdateListener(listener);
- }
-
- public void addModelChangedListener(IModelChangedListener listener) {
- SubTreeModelViewer.this.addModelChangedListener(listener);
- }
-
- public void addStateUpdateListener(IStateUpdateListener listener) {
- SubTreeModelViewer.this.addStateUpdateListener(listener);
- }
-
- public void addViewerUpdateListener(IViewerUpdateListener listener) {
- SubTreeModelViewer.this.addViewerUpdateListener(listener);
- }
-
- public int getAutoExpandLevel() {
- return SubTreeModelViewer.this.getAutoExpandLevel();
- }
-
- public Display getDisplay() {
- return SubTreeModelViewer.this.getDisplay();
- }
-
- public ViewerLabel getElementLabel(TreePath path, String columnId) {
- return SubTreeModelViewer.this.getElementLabel(path, columnId);
- }
-
- public IPresentationContext getPresentationContext() {
- return SubTreeModelViewer.this.getPresentationContext();
- }
-
- public void removeLabelUpdateListener(ILabelUpdateListener listener) {
- SubTreeModelViewer.this.removeLabelUpdateListener(listener);
- }
-
- public void removeModelChangedListener(IModelChangedListener listener) {
- SubTreeModelViewer.this.removeModelChangedListener(listener);
- }
-
- public void removeStateUpdateListener(IStateUpdateListener listener) {
- SubTreeModelViewer.this.removeStateUpdateListener(listener);
- }
-
- public void removeViewerUpdateListener(IViewerUpdateListener listener) {
- SubTreeModelViewer.this.removeViewerUpdateListener(listener);
- }
-
- public void saveElementState(TreePath path, ModelDelta delta, int deltaFlags) {
- SubTreeModelViewer.this.saveElementState(path, delta, deltaFlags);
- }
-
- public void setAutoExpandLevel(int level) {
- SubTreeModelViewer.this.setAutoExpandLevel(level);
- }
-
- public void setSelection(ISelection selection, boolean reveal, boolean force) {
- SubTreeModelViewer.this.setSelection(selection, reveal, force);
- }
-
- public void updateViewer(IModelDelta delta) {
- SubTreeModelViewer.this.updateViewer(delta);
- }
-
- public ViewerFilter[] getFilters() {
- return SubTreeModelViewer.this.getFilters();
- }
-
- public boolean overrideSelection(ISelection current, ISelection candidate) {
- return SubTreeModelViewer.this.overrideSelection(current, candidate);
- }
-
- public void refresh(Object element) {
- SubTreeModelViewer.this.refresh(element);
- }
-
- public void update(Object element) {
- SubTreeModelViewer.this.update(element);
- }
- }
-
-
- /**
- * Delegating content provider. It translates all the calls to the
- * underlying content provider to use full model tree paths.
- */
- private class SubTreeModelContentProvider implements ITreeModelContentProvider {
-
- private TreeModelContentProvider fBaseProvider;
-
- public SubTreeModelContentProvider() {
- fBaseProvider = new TreeModelContentProvider();
- }
-
- public void updateHasChildren(TreePath path) {
- fBaseProvider.updateHasChildren(createFullPath(path));
- }
-
- public void updateChildCount(TreePath path, int currentChildCount) {
- fBaseProvider.updateChildCount(createFullPath(path), currentChildCount);
- }
-
- public void updateElement(TreePath parentPath, int viewIndex) {
- fBaseProvider.updateElement(createFullPath(parentPath), viewIndex);
- }
-
- public int viewToModelCount(TreePath parentPath, int count) {
- return fBaseProvider.viewToModelCount(createFullPath(parentPath), count);
- }
-
- public int viewToModelIndex(TreePath parentPath, int index) {
- return fBaseProvider.viewToModelIndex(createFullPath(parentPath), index);
- }
-
- public void addModelChangedListener(IModelChangedListener listener) {
- fBaseProvider.addModelChangedListener(listener);
- }
-
- public void addStateUpdateListener(IStateUpdateListener listener) {
- fBaseProvider.addStateUpdateListener(listener);
- }
-
- public void addViewerUpdateListener(IViewerUpdateListener listener) {
- fBaseProvider.addViewerUpdateListener(listener);
- }
-
- public int getModelDeltaMask() {
- return fBaseProvider.getModelDeltaMask();
- }
-
- public int modelToViewChildCount(TreePath parentPath, int count) {
- return fBaseProvider.modelToViewChildCount(createFullPath(parentPath), count);
- }
-
- public int modelToViewIndex(TreePath parentPath, int index) {
- return fBaseProvider.modelToViewIndex(createFullPath(parentPath), index);
- }
-
- public void removeModelChangedListener(IModelChangedListener listener) {
- fBaseProvider.removeModelChangedListener(listener);
- }
-
- public void removeStateUpdateListener(IStateUpdateListener listener) {
- fBaseProvider.removeStateUpdateListener(listener);
- }
-
- public void removeViewerUpdateListener(IViewerUpdateListener listener) {
- fBaseProvider.removeViewerUpdateListener(listener);
- }
-
- public void setModelDeltaMask(int mask) {
- fBaseProvider.setModelDeltaMask(mask);
- }
-
- public boolean shouldFilter(Object parentElementOrTreePath, Object element) {
- if (parentElementOrTreePath instanceof TreePath) {
- TreePath path = (TreePath)parentElementOrTreePath;
- return fBaseProvider.shouldFilter(createFullPath(path), element);
- } else {
- return fBaseProvider.shouldFilter(parentElementOrTreePath, element);
- }
-
- }
-
- public void unmapPath(TreePath path) {
- fBaseProvider.unmapPath(createFullPath(path));
- }
-
- public void updateModel(IModelDelta delta, int mask) {
- fBaseProvider.updateModel(delta, mask);
- }
-
- public TreePath[] getParents(Object element) {
- // Not used
- return null;
- }
-
- public void dispose() {
- fBaseProvider.dispose();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- fBaseProvider.inputChanged(fDelegatingViewer, oldInput, newInput);
- }
- }
-
- /**
- * Delegating label provider. It translates all the calls to the
- * underlying label provider to use full model tree paths.
- */
- private class SubTreeModelLabelProvider extends ColumnLabelProvider
- implements ITreeModelLabelProvider
- {
-
- private TreeModelLabelProvider fBaseProvider;
-
- public SubTreeModelLabelProvider(ITreeModelLabelProviderTarget viewer) {
- fBaseProvider = new TreeModelLabelProvider(viewer);
- }
-
- public boolean update(TreePath elementPath) {
- return fBaseProvider.update( createFullPath(elementPath) );
- }
-
- public void addLabelUpdateListener(ILabelUpdateListener listener) {
- fBaseProvider.addLabelUpdateListener(listener);
- }
-
- public Color getColor(RGB rgb) {
- return fBaseProvider.getColor(rgb);
- }
-
- public Font getFont(FontData fontData) {
- return fBaseProvider.getFont(fontData);
- }
-
- public Image getImage(ImageDescriptor descriptor) {
- return fBaseProvider.getImage(descriptor);
- }
-
- public void removeLabelUpdateListener(ILabelUpdateListener listener) {
- fBaseProvider.removeLabelUpdateListener(listener);
- }
-
- public void addListener(ILabelProviderListener listener) {
- fBaseProvider.addListener(listener);
- }
-
- public void dispose() {
- fBaseProvider.dispose();
- super.dispose();
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return fBaseProvider.isLabelProperty(element, property);
- }
-
- public void removeListener(ILabelProviderListener listener) {
- fBaseProvider.removeListener(listener);
- }
- }
-
- private TreePath createFullPath(TreePath subPath) {
- Object[] segments = new Object[fRootPath.getSegmentCount() + subPath.getSegmentCount()];
- for (int i = 0; i < fRootPath.getSegmentCount(); i++) {
- segments[i] = fRootPath.getSegment(i);
- }
- for (int i = 0; i < subPath.getSegmentCount(); i++) {
- segments[i + fRootPath.getSegmentCount()] = subPath.getSegment(i);
- }
- return new TreePath(segments);
- }
-
- private TreePath createSubPath(TreePath fullPath) {
- if (fullPath.getSegmentCount() <= fRootPath.getSegmentCount()) {
- return TreePath.EMPTY;
- }
- Object[] segments = new Object[fullPath.getSegmentCount() - fRootPath.getSegmentCount()];
- for (int i = 0; i < segments.length; i++) {
- segments[i] = fullPath.getSegment(i + fRootPath.getSegmentCount());
- }
- return new TreePath(segments);
- }
-
- private DelegatingTreeModelViewer getDelegatingViewer() {
- if (fDelegatingViewer == null) {
- fDelegatingViewer = new DelegatingTreeModelViewer();
- }
- return fDelegatingViewer;
- }
-
- protected ITreeModelContentProvider createContentProvider() {
- return new SubTreeModelContentProvider();
- }
-
- protected ITreeModelLabelProvider createLabelProvider() {
- return new SubTreeModelLabelProvider(getDelegatingViewer());
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeCursor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeCursor.java
deleted file mode 100644
index 7c6125371..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeCursor.java
+++ /dev/null
@@ -1,697 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.ScrollBar;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.swt.widgets.TypedListener;
-
-/**
- * A TreeCursor provides a way for the user to navigate around a Tree with columns
- * using the keyboard. It also provides a mechanism for selecting an
- * individual cell in a tree.
- *
- * <p> Here is an example of using a TreeCursor to navigate to a cell and then edit it.
- *
- * <code><pre>
- * public static void main(String[] args) {
- * Display display = new Display();
- * Shell shell = new Shell(display);
- * shell.setLayout(new GridLayout());
- *
- * // create a a tree with 3 columns and fill with data
- * final Tree tree = new Tree(shell, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
- * tree.setLayoutData(new GridData(GridData.FILL_BOTH));
- * TreeColumn column1 = new TreeColumn(tree, SWT.NONE);
- * TreeColumn column2 = new TreeColumn(tree, SWT.NONE);
- * TreeColumn column3 = new TreeColumn(tree, SWT.NONE);
- * for (int i = 0; i &lt; 100; i++) {
- * TreeItem item = new TreeItem(tree, SWT.NONE);
- * item.setText(new String[] { "cell "+i+" 0", "cell "+i+" 1", "cell "+i+" 2"});
- * }
- * column1.pack();
- * column2.pack();
- * column3.pack();
- *
- * // create a TreeCursor to navigate around the tree
- * final TreeCursor cursor = new TreeCursor(tree, SWT.NONE);
- * // create an editor to edit the cell when the user hits "ENTER"
- * // while over a cell in the tree
- * final ControlEditor editor = new ControlEditor(cursor);
- * editor.grabHorizontal = true;
- * editor.grabVertical = true;
- *
- * cursor.addSelectionListener(new SelectionAdapter() {
- * // when the TreeEditor is over a cell, select the corresponding row in
- * // the tree
- * public void widgetSelected(SelectionEvent e) {
- * tree.setSelection(new TreeItem[] {cursor.getRow()});
- * }
- * // when the user hits "ENTER" in the TreeCursor, pop up a text editor so that
- * // they can change the text of the cell
- * public void widgetDefaultSelected(SelectionEvent e){
- * final Text text = new Text(cursor, SWT.NONE);
- * TreeItem row = cursor.getRow();
- * int column = cursor.getColumn();
- * text.setText(row.getText(column));
- * text.addKeyListener(new KeyAdapter() {
- * public void keyPressed(KeyEvent e) {
- * // close the text editor and copy the data over
- * // when the user hits "ENTER"
- * if (e.character == SWT.CR) {
- * TreeItem row = cursor.getRow();
- * int column = cursor.getColumn();
- * row.setText(column, text.getText());
- * text.dispose();
- * }
- * // close the text editor when the user hits "ESC"
- * if (e.character == SWT.ESC) {
- * text.dispose();
- * }
- * }
- * });
- * editor.setEditor(text);
- * text.setFocus();
- * }
- * });
- * // Hide the TreeCursor when the user hits the "MOD1" or "MOD2" key.
- * // This alows the user to select multiple items in the tree.
- * cursor.addKeyListener(new KeyAdapter() {
- * public void keyPressed(KeyEvent e) {
- * if (e.keyCode == SWT.MOD1 ||
- * e.keyCode == SWT.MOD2 ||
- * (e.stateMask & SWT.MOD1) != 0 ||
- * (e.stateMask & SWT.MOD2) != 0) {
- * cursor.setVisible(false);
- * }
- * }
- * });
- * // Show the TreeCursor when the user releases the "MOD2" or "MOD1" key.
- * // This signals the end of the multiple selection task.
- * tree.addKeyListener(new KeyAdapter() {
- * public void keyReleased(KeyEvent e) {
- * if (e.keyCode == SWT.MOD1 && (e.stateMask & SWT.MOD2) != 0) return;
- * if (e.keyCode == SWT.MOD2 && (e.stateMask & SWT.MOD1) != 0) return;
- * if (e.keyCode != SWT.MOD1 && (e.stateMask & SWT.MOD1) != 0) return;
- * if (e.keyCode != SWT.MOD2 && (e.stateMask & SWT.MOD2) != 0) return;
- *
- * TreeItem[] selection = tree.getSelection();
- * TreeItem row = (selection.length == 0) ? tree.getItem(tree.indexOf(tree.getTopItem())) : selection[0];
- * tree.showItem(row);
- * cursor.setSelection(row, 0);
- * cursor.setVisible(true);
- * cursor.setFocus();
- * }
- * });
- *
- * shell.open();
- * while (!shell.isDisposed()) {
- * if (!display.readAndDispatch())
- * display.sleep();
- * }
- * display.dispose();
- * }
- * </pre></code>
- *
- * <dl>
- * <dt><b>Styles:</b></dt>
- * <dd>BORDER</dd>
- * <dt><b>Events:</b></dt>
- * <dd>Selection, DefaultSelection</dd>
- * </dl>
- *
- * @since 3.3
- *
- */
-public class TreeCursor extends Canvas {
- Tree tree;
- TreeItem row = null;
- TreeColumn column = null;
- Listener treeListener, resizeListener, disposeItemListener, disposeColumnListener;
-
- // By default, invert the list selection colors
- static final int BACKGROUND = SWT.COLOR_LIST_SELECTION_TEXT;
- static final int FOREGROUND = SWT.COLOR_LIST_SELECTION;
-
-/**
- * Constructs a new instance of this class given its parent
- * table and a style value describing its behavior and appearance.
- * <p>
- * The style value is either one of the style constants defined in
- * class <code>SWT</code> which is applicable to instances of this
- * class, or must be built by <em>bitwise OR</em>'ing together
- * (that is, using the <code>int</code> "|" operator) two or more
- * of those <code>SWT</code> style constants. The class description
- * lists the style constants that are applicable to the class.
- * Style bits are also inherited from superclasses.
- * </p>
- *
- * @param parent a Tree control which will be the parent of the new instance (cannot be null)
- * @param style the style of control to construct
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
- * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
- * </ul>
- *
- * @see SWT#BORDER
- * @see Widget#checkSubclass()
- * @see Widget#getStyle()
- */
-public TreeCursor(Tree parent, int style) {
- super(parent, style);
- tree = parent;
- setBackground(null);
- setForeground(null);
-
- Listener listener = new Listener() {
- public void handleEvent(Event event) {
- switch (event.type) {
- case SWT.Dispose :
- dispose(event);
- break;
- case SWT.FocusIn :
- case SWT.FocusOut :
- redraw();
- break;
- case SWT.KeyDown :
- keyDown(event);
- break;
- case SWT.Paint :
- paint(event);
- break;
- case SWT.Traverse :
- traverse(event);
- break;
- }
- }
- };
- int[] events = new int[] {SWT.Dispose, SWT.FocusIn, SWT.FocusOut, SWT.KeyDown, SWT.Paint, SWT.Traverse};
- for (int i = 0; i < events.length; i++) {
- addListener(events[i], listener);
- }
-
- treeListener = new Listener() {
- public void handleEvent(Event event) {
- switch (event.type) {
- case SWT.MouseDown :
- tableMouseDown(event);
- break;
- case SWT.FocusIn :
- tableFocusIn(event);
- break;
- }
- }
- };
- tree.addListener(SWT.FocusIn, treeListener);
- tree.addListener(SWT.MouseDown, treeListener);
-
- disposeItemListener = new Listener() {
- public void handleEvent(Event event) {
- row = null;
- column = null;
- _resize();
- }
- };
- disposeColumnListener = new Listener() {
- public void handleEvent(Event event) {
- row = null;
- column = null;
- _resize();
- }
- };
- resizeListener = new Listener() {
- public void handleEvent(Event event) {
- _resize();
- }
- };
- ScrollBar hBar = tree.getHorizontalBar();
- if (hBar != null) {
- hBar.addListener(SWT.Selection, resizeListener);
- }
- ScrollBar vBar = tree.getVerticalBar();
- if (vBar != null) {
- vBar.addListener(SWT.Selection, resizeListener);
- }
-}
-
-/**
- * Adds the listener to the collection of listeners who will
- * be notified when the receiver's selection changes, by sending
- * it one of the messages defined in the <code>SelectionListener</code>
- * interface.
- * <p>
- * When <code>widgetSelected</code> is called, the item field of the event object is valid.
- * If the receiver has <code>SWT.CHECK</code> style set and the check selection changes,
- * the event object detail field contains the value <code>SWT.CHECK</code>.
- * <code>widgetDefaultSelected</code> is typically called when an item is double-clicked.
- * </p>
- *
- * @param listener the listener which should be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see SelectionListener
- * @see SelectionEvent
- * @see #removeSelectionListener(SelectionListener)
- *
- */
-public void addSelectionListener(SelectionListener listener) {
- checkWidget();
- if (listener == null)
- SWT.error(SWT.ERROR_NULL_ARGUMENT);
- TypedListener typedListener = new TypedListener(listener);
- addListener(SWT.Selection, typedListener);
- addListener(SWT.DefaultSelection, typedListener);
-}
-
-void dispose(Event event) {
- tree.removeListener(SWT.FocusIn, treeListener);
- tree.removeListener(SWT.MouseDown, treeListener);
- if (column != null) {
- column.removeListener(SWT.Dispose, disposeColumnListener);
- column.removeListener(SWT.Move, resizeListener);
- column.removeListener(SWT.Resize, resizeListener);
- column = null;
- }
- if (row != null) {
- row.removeListener(SWT.Dispose, disposeItemListener);
- row = null;
- }
- ScrollBar hBar = tree.getHorizontalBar();
- if (hBar != null) {
- hBar.removeListener(SWT.Selection, resizeListener);
- }
- ScrollBar vBar = tree.getVerticalBar();
- if (vBar != null) {
- vBar.removeListener(SWT.Selection, resizeListener);
- }
-}
-
-void keyDown(Event event) {
- if (row == null) return;
- switch (event.character) {
- case SWT.CR :
- notifyListeners(SWT.DefaultSelection, new Event());
- return;
- }
- int rowIndex = tree.indexOf(row);
- int columnIndex = column == null ? 0 : tree.indexOf(column);
- switch (event.keyCode) {
- case SWT.ARROW_UP :
- setRowColumn(Math.max(0, rowIndex - 1), columnIndex, true);
- break;
- case SWT.ARROW_DOWN :
- setRowColumn(Math.min(rowIndex + 1, tree.getItemCount() - 1), columnIndex, true);
- break;
- case SWT.ARROW_LEFT :
- case SWT.ARROW_RIGHT :
- {
- int columnCount = tree.getColumnCount();
- if (columnCount == 0) break;
- int[] order = tree.getColumnOrder();
- int index = 0;
- while (index < order.length) {
- if (order[index] == columnIndex) break;
- index++;
- }
- if (index == order.length) index = 0;
- int leadKey = (getStyle() & SWT.RIGHT_TO_LEFT) != 0 ? SWT.ARROW_RIGHT : SWT.ARROW_LEFT;
- if (event.keyCode == leadKey) {
- setRowColumn(rowIndex, order[Math.max(0, index - 1)], true);
- } else {
- setRowColumn(rowIndex, order[Math.min(columnCount - 1, index + 1)], true);
- }
- break;
- }
- case SWT.HOME :
- setRowColumn(0, columnIndex, true);
- break;
- case SWT.END :
- {
- int i = tree.getItemCount() - 1;
- setRowColumn(i, columnIndex, true);
- break;
- }
- case SWT.PAGE_UP :
- {
- int index = tree.indexOf(tree.getTopItem());
- if (index == rowIndex) {
- Rectangle rect = tree.getClientArea();
- TreeItem item = tree.getItem(index);
- Rectangle itemRect = item.getBounds(0);
- rect.height -= itemRect.y;
- int height = tree.getItemHeight();
- int page = Math.max(1, rect.height / height);
- index = Math.max(0, index - page + 1);
- }
- setRowColumn(index, columnIndex, true);
- break;
- }
- case SWT.PAGE_DOWN :
- {
- int index = tree.indexOf(tree.getTopItem());
- Rectangle rect = tree.getClientArea();
- TreeItem item = tree.getItem(index);
- Rectangle itemRect = item.getBounds(0);
- rect.height -= itemRect.y;
- int height = tree.getItemHeight();
- int page = Math.max(1, rect.height / height);
- int end = tree.getItemCount() - 1;
- index = Math.min(end, index + page - 1);
- if (index == rowIndex) {
- index = Math.min(end, index + page - 1);
- }
- setRowColumn(index, columnIndex, true);
- break;
- }
- }
-}
-
-void paint(Event event) {
- if (row == null) return;
- int columnIndex = column == null ? 0 : tree.indexOf(column);
- GC gc = event.gc;
- Display display = getDisplay();
- gc.setBackground(getBackground());
- gc.setForeground(getForeground());
- gc.fillRectangle(event.x, event.y, event.width, event.height);
- int x = 0;
- Point size = getSize();
- Image image = row.getImage(columnIndex);
- if (image != null) {
- Rectangle imageSize = image.getBounds();
- int imageY = (size.y - imageSize.height) / 2;
- gc.drawImage(image, x, imageY);
- x += imageSize.width;
- }
- String text = row.getText(columnIndex);
- if (text != IInternalDebugCoreConstants.EMPTY_STRING) {
- Rectangle bounds = row.getBounds(columnIndex);
- Point extent = gc.stringExtent(text);
- // Temporary code - need a better way to determine table trim
- String platform = SWT.getPlatform();
- if ("win32".equals(platform)) { //$NON-NLS-1$
- if (tree.getColumnCount() == 0 || columnIndex == 0) {
- x += 2;
- } else {
- int alignmnent = column.getAlignment();
- switch (alignmnent) {
- case SWT.LEFT:
- x += 6;
- break;
- case SWT.RIGHT:
- x = bounds.width - extent.x - 6;
- break;
- case SWT.CENTER:
- x += (bounds.width - x - extent.x) / 2;
- break;
- }
- }
- } else {
- if (tree.getColumnCount() == 0) {
- x += 5;
- } else {
- int alignmnent = column.getAlignment();
- switch (alignmnent) {
- case SWT.LEFT:
- x += 5;
- break;
- case SWT.RIGHT:
- x = bounds.width- extent.x - 2;
- break;
- case SWT.CENTER:
- x += (bounds.width - x - extent.x) / 2 + 2;
- break;
- }
- }
- }
- int textY = (size.y - extent.y) / 2;
- gc.drawString(text, x, textY);
- }
- if (isFocusControl()) {
- gc.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
- gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
- gc.drawFocus(0, 0, size.x, size.y);
- }
-}
-
-void tableFocusIn(Event event) {
- if (isDisposed())
- return;
- if (isVisible())
- setFocus();
-}
-
-void tableMouseDown(Event event) {
- if (isDisposed() || !isVisible()) return;
- Point pt = new Point(event.x, event.y);
- int lineWidth = tree.getLinesVisible() ? tree.getGridLineWidth() : 0;
- TreeItem item = tree.getItem(pt);
- if ((tree.getStyle() & SWT.FULL_SELECTION) != 0) {
- if (item == null) return;
- } else {
- int start = item != null ? tree.indexOf(item) : tree.indexOf(tree.getTopItem());
- int end = tree.getItemCount();
- Rectangle clientRect = tree.getClientArea();
- for (int i = start; i < end; i++) {
- TreeItem nextItem = tree.getItem(i);
- Rectangle rect = nextItem.getBounds(0);
- if (pt.y >= rect.y && pt.y < rect.y + rect.height + lineWidth) {
- item = nextItem;
- break;
- }
- if (rect.y > clientRect.y + clientRect.height) return;
- }
- if (item == null) return;
- }
- TreeColumn newColumn = null;
- int columnCount = tree.getColumnCount();
- if (columnCount > 0) {
- for (int i = 0; i < columnCount; i++) {
- Rectangle rect = item.getBounds(i);
- rect.width += lineWidth;
- rect.height += lineWidth;
- if (rect.contains(pt)) {
- newColumn = tree.getColumn(i);
- break;
- }
- }
- if (newColumn == null) {
- newColumn = tree.getColumn(0);
- }
- }
- setRowColumn(item, newColumn, true);
- setFocus();
- return;
-}
-
-void traverse(Event event) {
- switch (event.detail) {
- case SWT.TRAVERSE_ARROW_NEXT :
- case SWT.TRAVERSE_ARROW_PREVIOUS :
- case SWT.TRAVERSE_RETURN :
- event.doit = false;
- return;
- }
- event.doit = true;
-}
-void setRowColumn(int row, int column, boolean notify) {
- TreeItem item = row == -1 ? null : tree.getItem(row);
- TreeColumn col = column == -1 || tree.getColumnCount() == 0 ? null : tree.getColumn(column);
- setRowColumn(item, col, notify);
-}
-void setRowColumn(TreeItem row, TreeColumn column, boolean notify) {
- if (this.row == row && this.column == column) {
- return;
- }
- if (this.row != null && this.row != row) {
- this.row.removeListener(SWT.Dispose, disposeItemListener);
- this.row = null;
- }
- if (this.column != null && this.column != column) {
- this.column.removeListener(SWT.Dispose, disposeColumnListener);
- this.column.removeListener(SWT.Move, resizeListener);
- this.column.removeListener(SWT.Resize, resizeListener);
- this.column = null;
- }
- if (row != null) {
- if (this.row != row) {
- this.row = row;
- row.addListener(SWT.Dispose, disposeItemListener);
- tree.showItem(row);
- }
- if (this.column != column && column != null) {
- this.column = column;
- column.addListener(SWT.Dispose, disposeColumnListener);
- column.addListener(SWT.Move, resizeListener);
- column.addListener(SWT.Resize, resizeListener);
- tree.showColumn(column);
- }
- int columnIndex = column == null ? 0 : tree.indexOf(column);
- setBounds(row.getBounds(columnIndex));
- redraw();
- if (notify) {
- notifyListeners(SWT.Selection, new Event());
- }
- }
-}
-
-public void setVisible(boolean visible) {
- checkWidget();
- if (visible) _resize();
- super.setVisible(visible);
-}
-
-/**
- * Removes the listener from the collection of listeners who will
- * be notified when the receiver's selection changes.
- *
- * @param listener the listener which should no longer be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see SelectionListener
- * @see #addSelectionListener(SelectionListener)
- *
- * @since 3.0
- */
-public void removeSelectionListener(SelectionListener listener) {
- checkWidget();
- if (listener == null) {
- SWT.error(SWT.ERROR_NULL_ARGUMENT);
- }
- removeListener(SWT.Selection, listener);
- removeListener(SWT.DefaultSelection, listener);
-}
-
-void _resize() {
- if (row == null) {
- setBounds(-200, -200, 0, 0);
- } else {
- int columnIndex = column == null ? 0 : tree.indexOf(column);
- setBounds(row.getBounds(columnIndex));
- }
-}
-/**
- * Returns the column over which the TreeCursor is positioned.
- *
- * @return the column for the current position
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public int getColumn() {
- checkWidget();
- return column == null ? 0 : tree.indexOf(column);
-}
-/**
- * Returns the row over which the TreeCursor is positioned.
- *
- * @return the item for the current position
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- */
-public TreeItem getRow() {
- checkWidget();
- return row;
-}
-public void setBackground (Color color) {
- if (color == null) color = getDisplay().getSystemColor(BACKGROUND);
- super.setBackground(color);
- redraw();
-}
-public void setForeground (Color color) {
- if (color == null) color = getDisplay().getSystemColor(FOREGROUND);
- super.setForeground(color);
- redraw();
-}
-/**
- * Positions the TreeCursor over the cell at the given row and column in the parent table.
- *
- * @param row the index of the row for the cell to select
- * @param column the index of column for the cell to select
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- */
-public void setSelection(int row, int column) {
- checkWidget();
- int columnCount = tree.getColumnCount();
- int maxColumnIndex = columnCount == 0 ? 0 : columnCount - 1;
- if (row < 0
- || row >= tree.getItemCount()
- || column < 0
- || column > maxColumnIndex)
- SWT.error(SWT.ERROR_INVALID_ARGUMENT);
- setRowColumn(row, column, false);
-}
-/**
- * Positions the TreeCursor over the cell at the given row and column in the parent table.
- *
- * @param row the TreeItem of the row for the cell to select
- * @param column the index of column for the cell to select
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- */
-public void setSelection(TreeItem row, int column) {
- checkWidget();
- int columnCount = tree.getColumnCount();
- int maxColumnIndex = columnCount == 0 ? 0 : columnCount - 1;
- if (row == null
- || row.isDisposed()
- || column < 0
- || column > maxColumnIndex)
- SWT.error(SWT.ERROR_INVALID_ARGUMENT);
- setRowColumn(tree.indexOf(row), column, false);
-}
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
deleted file mode 100644
index abd200ebc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
+++ /dev/null
@@ -1,632 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - Fix for viewer state save/restore [188704]
- * Pawel Piech (Wind River) - added support for a virtual tree model viewer (Bug 242489)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDeltaVisitor;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
-
-/**
- * Content provider for a virtual tree.
- *
- * @since 3.3
- */
-public class TreeModelContentProvider extends ModelContentProvider implements ITreeModelContentProvider {
-
- /**
- * Re-filters any filtered children of the given parent element.
- *
- * @param path parent element
- */
- protected void refilterChildren(TreePath path) {
- if (getViewer() != null) {
- int[] filteredChildren = getFilteredChildren(path);
- if (filteredChildren != null) {
- for (int i = 0; i < filteredChildren.length; i++) {
- doUpdateElement(path, filteredChildren[i]);
- }
- }
- }
- }
-
- protected synchronized void doUpdateChildCount(TreePath path) {
- Object element = getElement(path);
- IElementContentProvider contentAdapter = ViewerAdapterService.getContentProvider(element);
- if (contentAdapter != null) {
- ChildrenCountUpdate request = new ChildrenCountUpdate(this, getViewer().getInput(), path, element, contentAdapter, getPresentationContext());
- schedule(request);
- }
- }
-
- protected synchronized void doUpdateElement(TreePath parentPath, int modelIndex) {
- Object parent = getElement(parentPath);
- IElementContentProvider contentAdapter = ViewerAdapterService.getContentProvider(parent);
- if (contentAdapter != null) {
- ChildrenUpdate request = new ChildrenUpdate(this, getViewer().getInput(), parentPath, parent, modelIndex, contentAdapter, getPresentationContext());
- schedule(request);
- }
- }
-
- protected synchronized void doUpdateHasChildren(TreePath path) {
- Object element = getElement(path);
- IElementContentProvider contentAdapter = ViewerAdapterService.getContentProvider(element);
- if (contentAdapter != null) {
- HasChildrenUpdate request = new HasChildrenUpdate(this, getViewer().getInput(), path, element, contentAdapter, getPresentationContext());
- schedule(request);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ModelContentProvider#getPresentationContext()
- */
- protected IPresentationContext getPresentationContext() {
- return ((ITreeModelViewer)getViewer()).getPresentationContext();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ModelContentProvider#handleAdd(org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta)
- */
- protected void handleAdd(IModelDelta delta) {
- IModelDelta parentDelta = delta.getParentDelta();
- TreePath parentPath = getViewerTreePath(parentDelta);
- Object element = delta.getElement();
- int count = parentDelta.getChildCount();
- if (count > 0) {
- setModelChildCount(parentPath, count);
- int modelIndex = count - 1;
- if (delta.getIndex() != -1) {
- // assume addition at end, unless index specified by delta
- modelIndex = delta.getIndex();
- }
- if (shouldFilter(parentPath, element)) {
- addFilteredIndex(parentPath, modelIndex, element);
- if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("[filtered] handleAdd(" + delta.getElement() + ") > modelIndex: " + modelIndex); //$NON-NLS-1$ //$NON-NLS-2$
- }
- // it was filtered so the child count does not change
- } else {
- if (isFiltered(parentPath, modelIndex)) {
- clearFilteredChild(parentPath, modelIndex);
- }
- int viewCount = modelToViewChildCount(parentPath, count);
- if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("handleAdd(" + delta.getElement() + ") viewIndex: " + viewCount + " modelIndex: " + modelIndex); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- getViewer().setChildCount(parentPath, viewCount);
- getViewer().autoExpand(parentPath);
- int viewIndex = modelToViewIndex(parentPath, modelIndex);
- getViewer().replace(parentPath, viewIndex, element);
- TreePath childPath = parentPath.createChildPath(element);
- updateHasChildren(childPath);
- doRestore(childPath, modelIndex, false, false, false);
- }
- } else {
- if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("handleAdd(" + delta.getElement() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- doUpdateChildCount(getViewerTreePath(delta.getParentDelta()));
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ModelContentProvider#handleContent(org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta)
- */
- protected void handleContent(IModelDelta delta) {
- if (delta.getParentDelta() == null && delta.getChildCount() == 0) {
- // if the delta is for the root, ensure the root still matches viewer input
- if (!delta.getElement().equals(getViewer().getInput())) {
- return;
- }
- }
- TreePath treePath = getViewerTreePath(delta);
- cancelSubtreeUpdates(treePath);
- appendToPendingStateDelta(treePath);
- getViewer().refresh(getElement(treePath));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.ModelContentProvider#handleCollapse(org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta)
- */
- protected void handleCollapse(IModelDelta delta) {
- TreePath elementPath = getViewerTreePath(delta);
- getViewer().setExpandedState(elementPath, false);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ModelContentProvider#handleExpand(org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta)
- */
- protected void handleExpand(IModelDelta delta) {
- // expand each parent, then this node
- IModelDelta parentDelta = delta.getParentDelta();
- if (parentDelta != null) {
- if ((parentDelta.getFlags() & IModelDelta.EXPAND) == 0) {
- handleExpand(parentDelta);
- }
- expand(delta);
- } else {
- int childCount = delta.getChildCount();
- TreePath elementPath = getViewerTreePath(delta);
- if (childCount > 0) {
- int viewCount = modelToViewChildCount(elementPath, childCount);
- if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("[expand] setChildCount(" + delta.getElement() + ", (model) " + childCount + " (view) " + viewCount); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- getViewer().setChildCount(elementPath, viewCount);
- }
- }
- }
-
- protected void expand(IModelDelta delta) {
- int childCount = delta.getChildCount();
- int modelIndex = delta.getIndex();
- ITreeModelContentProviderTarget treeViewer = getViewer();
- TreePath elementPath = getViewerTreePath(delta);
- if (modelIndex >= 0) {
- TreePath parentPath = elementPath.getParentPath();
- if (parentPath == null) {
- parentPath = TreePath.EMPTY;
- }
- int viewIndex = modelToViewIndex(parentPath, modelIndex);
- if (viewIndex >= 0) {
- if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("[expand] replace(" + delta.getParentDelta().getElement() + ", (model) " + modelIndex + " (view) " + viewIndex + ", " + delta.getElement()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- treeViewer.replace(parentPath, viewIndex, delta.getElement());
- } else {
- // Element is filtered - if no longer filtered, insert the element
- viewIndex = unfilterElement(parentPath, delta.getElement(), modelIndex);
- if (viewIndex < 0) {
- // insert did not complete
- return;
- }
- }
- }
- if (childCount > 0) {
- int viewCount = modelToViewChildCount(elementPath, childCount);
- if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("[expand] setChildCount(" + delta.getElement() + ", (model) " + childCount + " (view) " + viewCount); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- treeViewer.setChildCount(elementPath, viewCount);
- if (!treeViewer.getExpandedState(elementPath)) {
- treeViewer.expandToLevel(elementPath, 1);
- }
- }
- }
-
- /**
- * Inserts the given child element of the specified parent into the tree if the element
- * should *no* longer be filtered. Returns the view index of the newly inserted element
- * or -1 if not inserted.
- *
- * @param parentPath viewer tree path to parent element
- * @param element element to insert
- * @param modelIndex index of the element in the model
- * @return
- */
- protected int unfilterElement(TreePath parentPath, Object element, int modelIndex) {
- // Element is filtered - if no longer filtered, insert the element
- if (shouldFilter(parentPath, element)) {
- if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("[unfilter] abort unfilter element: " + element + ", (model) " + modelIndex); //$NON-NLS-1$ //$NON-NLS-2$
- }
- // still filtered, stop
- return -1;
- }
- // clear the filter an insert the element
- clearFilteredChild(parentPath, modelIndex);
- int viewIndex = modelToViewIndex(parentPath, modelIndex);
- if (viewIndex >= 0) {
- if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("[unfilter] insert(" + parentPath.getLastSegment() + ", (model) " + modelIndex + " (view) " + viewIndex + ", " + element); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- getViewer().insert(parentPath, element, viewIndex);
- return viewIndex;
- } else {
- // still filtered - should not happen
- return -1;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ModelContentProvider#handleInsert(org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta)
- */
- protected void handleInsert(IModelDelta delta) {
- // TODO: filters
- getViewer().insert(getViewerTreePath(delta.getParentDelta()), delta.getElement(), delta.getIndex());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ModelContentProvider#handleRemove(org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta)
- */
- protected void handleRemove(IModelDelta delta) {
- if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("handleRemove(" + delta.getElement() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- IModelDelta parentDelta = delta.getParentDelta();
- ITreeModelContentProviderTarget treeViewer = getViewer();
- TreePath parentPath = getViewerTreePath(parentDelta);
- Object element = delta.getElement();
- if (removeElementFromFilters(parentPath, element)) {
- // element was filtered - done
- return;
- }
- int viewIndex = -1;
- int modelIndex = delta.getIndex();
- int unmappedIndex = -1;
- int itemCount = -1;
- if (modelIndex < 0) {
- itemCount = treeViewer.getChildCount(parentPath);
- if (itemCount == -1) {
- clearFilters(parentPath);
- }
- viewIndex = treeViewer.findElementIndex(parentPath, element);
- if (viewIndex >= 0) {
- modelIndex = viewToModelIndex(parentPath, viewIndex);
- } else {
- unmappedIndex = treeViewer.findElementIndex(parentPath, null);
- }
- } else {
- viewIndex = modelToViewIndex(parentPath, modelIndex);
- }
- if (modelIndex >= 0) {
- // found the element
- if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println(" - (found) remove(" + parentPath.getLastSegment() + ", viewIndex: " + viewIndex + " modelIndex: " + modelIndex); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- rescheduleUpdates(parentPath, modelIndex);
- getViewer().remove(parentPath, viewIndex);
- removeElementFromFilters(parentPath, modelIndex);
- return;
- }
- if (unmappedIndex >= 0) {
- // did not find the element, but found an unmapped item.
- // remove the unmapped item in it's place and update filters
- if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println(" - (not found) remove(" + parentPath.getLastSegment() + ", viewIndex: " + viewIndex + " modelIndex: " + modelIndex + " unmapped index: " + unmappedIndex); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- modelIndex = viewToModelIndex(parentPath, unmappedIndex);
- rescheduleUpdates(parentPath, modelIndex);
- getViewer().remove(parentPath, unmappedIndex);
- removeElementFromFilters(parentPath, modelIndex);
- return;
- }
- int modelCount = parentDelta.getChildCount();
- if (itemCount >= 0 && modelCount >= 0) {
- if (modelToViewChildCount(parentPath, modelCount) == itemCount) {
- // item count matches the parent's child count, don't do anything
- return;
- }
- }
- // failing that, refresh the parent to properly update for non-visible/unmapped children
- // and update filtered indexes
- if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println(" - (not found) remove/refresh(" + delta.getElement()); //$NON-NLS-1$
- }
- getViewer().remove(getViewerTreePath(delta));
- clearFilters(parentPath);
- getViewer().refresh(parentDelta.getElement());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ModelContentProvider#handleReplace(org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta)
- */
- protected void handleReplace(IModelDelta delta) {
- TreePath parentPath = getViewerTreePath(delta.getParentDelta());
- getViewer().replace(parentPath, delta.getIndex(), delta.getElement());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ModelContentProvider#handleSelect(org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta)
- */
- protected void handleSelect(IModelDelta delta) {
- int modelIndex = delta.getIndex();
- ITreeModelContentProviderTarget treeViewer = getViewer();
- if (modelIndex >= 0) {
- IModelDelta parentDelta = delta.getParentDelta();
- TreePath parentPath = getViewerTreePath(parentDelta);
- int viewIndex = modelToViewIndex(parentPath, modelIndex);
- if (viewIndex >= 0) {
- // when viewIndex < 0, the element has been filtered - so we should not try to replace
- int modelCount = parentDelta.getChildCount();
- if (modelCount > 0) {
- int viewCount = modelToViewChildCount(parentPath, modelCount);
- if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("[select] setChildCount(" + parentDelta.getElement() + ", (model) " + parentDelta.getChildCount() + " (view) " + viewCount ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- treeViewer.setChildCount(parentPath, viewCount);
- }
- if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("[select] replace(" + parentDelta.getElement() + ", (model) " + modelIndex + " (view) " + viewIndex + ", " + delta.getElement()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- treeViewer.replace(parentPath, viewIndex, delta.getElement());
- }
- }
- treeViewer.setSelection(new TreeSelection(getViewerTreePath(delta)), false, (delta.getFlags() & IModelDelta.FORCE) != 0);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ModelContentProvider#handleState(org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta)
- */
- protected void handleState(IModelDelta delta) {
- getViewer().update(delta.getElement());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.ModelContentProvider#handleReveal(org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta)
- */
- protected void handleReveal(IModelDelta delta) {
- IModelDelta parentDelta = delta.getParentDelta();
- if (parentDelta != null) {
- handleExpand(parentDelta);
- reveal(delta);
- }
- }
-
- protected void reveal(IModelDelta delta) {
- int modelIndex = delta.getIndex();
- ITreeModelContentProviderTarget treeViewer = getViewer();
- TreePath elementPath = getViewerTreePath(delta);
- if (modelIndex >= 0) {
- TreePath parentPath = elementPath.getParentPath();
- if (parentPath == null) {
- parentPath = TreePath.EMPTY;
- }
- int viewIndex = modelToViewIndex(parentPath, modelIndex);
- if (viewIndex >= 0) {
- if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("[reveal] replace(" + delta.getParentDelta().getElement() + ", (model) " + modelIndex + " (view) " + viewIndex + ", " + delta.getElement()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- treeViewer.replace(parentPath, viewIndex, delta.getElement());
- } else {
- // Element is filtered - insert if filter state changed
- viewIndex = unfilterElement(parentPath, delta.getElement(), modelIndex);
- if (viewIndex < 0) {
- // insert did not complete
- return;
- }
- }
-
- // only move tree based on force flag and selection policy
- if ((delta.getFlags() & IModelDelta.FORCE) != 0 ||
- treeViewer.overrideSelection(treeViewer.getSelection(), new TreeSelection(elementPath)))
- {
- treeViewer.reveal(parentPath, viewIndex);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ModelContentProvider#buildViewerState(org.eclipse.debug.internal.ui.viewers.provisional.ModelDelta)
- */
- protected void buildViewerState(ModelDelta delta) {
- ITreeModelContentProviderTarget viewer = getViewer();
- viewer.saveElementState(EMPTY_TREE_PATH, delta, IModelDelta.SELECT | IModelDelta.EXPAND);
-
- // Add memento for top item if it is mapped to an element. The reveal memento
- // is in its own path to avoid requesting unnecessary data when restoring it.
- if (viewer.getInput() != null) {
- TreePath topElementPath = viewer.getTopElementPath();
- if (topElementPath != null) {
- ModelDelta parentDelta = delta;
- TreePath parentPath = EMPTY_TREE_PATH;
- for (int i = 0; i < topElementPath.getSegmentCount(); i++) {
- Object element = topElementPath.getSegment(i);
- int index = viewer.findElementIndex(parentPath, element);
- ModelDelta childDelta = parentDelta.getChildDelta(element);
- if (childDelta == null) {
- parentDelta = parentDelta.addNode(element, index, IModelDelta.NO_CHANGE);
- } else {
- parentDelta = childDelta;
- }
- parentPath = parentPath.createChildPath(element);
- }
- parentDelta.setFlags(parentDelta.getFlags() | IModelDelta.REVEAL);
- }
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ModelContentProvider#doInitialRestore()
- */
- protected void doInitialRestore(ModelDelta delta) {
- // Find the reveal delta and mark nodes on its path
- // to reveal as elements are updated.
- markRevealDelta(delta);
-
- // Restore visible items.
- // Note (Pawel Piech): the initial list of items is normally
- // empty, so in most cases the code below does not do anything.
- // Instead doRestore() is called when various updates complete.
- int count = getViewer().getChildCount(TreePath.EMPTY);
- for (int i = 0; i < count; i++) {
- Object data = getViewer().getChildElement(TreePath.EMPTY, i);
- if (data != null) {
- doRestore(new TreePath(new Object[]{data}), i, false, false, false);
- }
- }
-
- }
-
- /**
- * Finds the delta with the reveal flag, then it walks up this
- * delta and marks all the parents of it with the reveal flag.
- * These flags are then used by the restore logic to restore
- * and reveal all the nodes leading up to the element that should
- * be ultimately at the top.
- * @return The node just under the rootDelta which contains
- * the reveal flag. <code>null</code> if no reveal flag was found.
- */
- private ModelDelta markRevealDelta(ModelDelta rootDelta) {
- final ModelDelta[] revealDelta = new ModelDelta[1];
- IModelDeltaVisitor visitor = new IModelDeltaVisitor() {
- public boolean visit(IModelDelta delta, int depth) {
- if ( (delta.getFlags() & IModelDelta.REVEAL) != 0) {
- revealDelta[0] = (ModelDelta)delta;
- }
- // Keep recursing only if we haven't found our delta yet.
- return revealDelta[0] == null;
- }
- };
-
- rootDelta.accept(visitor);
- if (revealDelta[0] != null) {
- ModelDelta parentDelta = (ModelDelta)revealDelta[0].getParentDelta();
- while(parentDelta.getParentDelta() != null) {
- revealDelta[0] = parentDelta;
- revealDelta[0].setFlags(revealDelta[0].getFlags() | IModelDelta.REVEAL);
- parentDelta = (ModelDelta)parentDelta.getParentDelta();
- }
- }
- return revealDelta[0];
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILazyTreePathContentProvider#getParents(java.lang.Object)
- */
- public TreePath[] getParents(Object element) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILazyTreePathContentProvider#updateChildCount(org.eclipse.jface.viewers.TreePath, int)
- */
- public synchronized void updateChildCount(TreePath treePath, int currentChildCount) {
- if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("updateChildCount(" + getElement(treePath) + ", " + currentChildCount + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- refilterChildren(treePath);
- //re-filter children when asked to update the child count for an element (i.e.
- // when refreshing, see if filtered children are still filtered)
- doUpdateChildCount(treePath);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILazyTreePathContentProvider#updateElement(org.eclipse.jface.viewers.TreePath, int)
- */
- public synchronized void updateElement(TreePath parentPath, int viewIndex) {
- int modelIndex = viewToModelIndex(parentPath, viewIndex);
- if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("updateElement("+ getElement(parentPath) + ", " + viewIndex + ") > modelIndex = " + modelIndex); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- doUpdateElement(parentPath, modelIndex);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILazyTreePathContentProvider#updateHasChildren(org.eclipse.jface.viewers.TreePath)
- */
- public synchronized void updateHasChildren(TreePath path) {
- if (DEBUG_CONTENT_PROVIDER && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("updateHasChildren(" + getElement(path)); //$NON-NLS-1$
- }
- doUpdateHasChildren(path);
- }
-
- /**
- * @param delta
- */
- void doRestore(ModelDelta delta, boolean knowsHasChildren, boolean knowsChildCount, boolean checkChildrenRealized) {
- TreePath treePath = getViewerTreePath(delta);
- ITreeModelContentProviderTarget viewer = getViewer();
-
- // Attempt to expand the node only if the children are known.
- if (knowsHasChildren) {
- if ((delta.getFlags() & IModelDelta.EXPAND) != 0) {
- if (DEBUG_STATE_SAVE_RESTORE && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("\tRESTORE EXPAND: " + treePath.getLastSegment()); //$NON-NLS-1$
- }
- viewer.expandToLevel(treePath, 1);
- delta.setFlags(delta.getFlags() & ~IModelDelta.EXPAND);
- }
- if ((delta.getFlags() & IModelDelta.COLLAPSE) != 0) {
- if (DEBUG_STATE_SAVE_RESTORE && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("\tRESTORE COLLAPSE: " + treePath.getLastSegment()); //$NON-NLS-1$
- }
- getViewer().setExpandedState(treePath, false);
- delta.setFlags(delta.getFlags() & ~IModelDelta.COLLAPSE);
- }
- }
- if ((delta.getFlags() & IModelDelta.SELECT) != 0) {
- viewer.setSelection(new TreeSelection(treePath), false, false);
- delta.setFlags(delta.getFlags() & ~IModelDelta.SELECT);
- }
- if ((delta.getFlags() & IModelDelta.REVEAL) != 0) {
- delta.setFlags(delta.getFlags() & ~IModelDelta.REVEAL);
- // Look for the reveal flag in the child deltas. If
- // A child delta has the reveal flag, do not set the
- // top element yet.
- boolean setTopItem = true;
- IModelDelta[] childDeltas = delta.getChildDeltas();
- for (int i = 0; i < childDeltas.length; i++) {
- IModelDelta childDelta = childDeltas[i];
- int modelIndex = childDelta.getIndex();
- if (modelIndex >= 0 && (childDelta.getFlags() & IModelDelta.REVEAL) != 0) {
- setTopItem = false;
- }
- }
-
- if (setTopItem) {
- TreePath parentPath = treePath.getParentPath();
- int index = viewer.findElementIndex(parentPath, treePath.getLastSegment());
- if (index >= 0) {
- if (DEBUG_STATE_SAVE_RESTORE && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("\tRESTORE REVEAL: " + treePath.getLastSegment()); //$NON-NLS-1$
- }
- viewer.reveal(parentPath, index);
- }
- }
- }
-
- // If we know the child count of the element, look for the reveal
- // flag in the child deltas. For the children with reveal flag start
- // a new update.
- // If the child delta's index is out of range, strip the reveal flag
- // since it is no longer applicable.
- if (knowsChildCount) {
- int childCount = viewer.getChildCount(treePath);
- if (childCount >= 0) {
- ModelDelta[] childDeltas = (ModelDelta[])delta.getChildDeltas();
- for (int i = 0; i < childDeltas.length; i++) {
- ModelDelta childDelta = childDeltas[i];
- int modelIndex = childDelta.getIndex();
- if (modelIndex >= 0 && (childDelta.getFlags() & IModelDelta.REVEAL) != 0) {
- if (modelIndex < childCount) {
- doUpdateElement(treePath, modelIndex);
- } else {
- childDelta.setFlags(childDelta.getFlags() & ~IModelDelta.REVEAL);
- }
- }
- }
- }
- }
-
- // Some children of this element were just updated. If all its
- // children are now realized, clear out any elements that still
- // have flags, because they represent elements that were removed.
- if ((checkChildrenRealized && getElementChildrenRealized(treePath)) ||
- (knowsHasChildren && !viewer.getHasChildren(treePath)) )
- {
- if (DEBUG_STATE_SAVE_RESTORE && (DEBUG_PRESENTATION_ID == null || DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("\tRESTORE CONTENT: " + treePath.getLastSegment()); //$NON-NLS-1$
- }
- delta.setFlags(delta.getFlags() & ~IModelDelta.CONTENT);
- }
-
- checkIfRestoreComplete();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java
deleted file mode 100644
index 152efac55..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java
+++ /dev/null
@@ -1,399 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River - Pawel Piech - Added coalescing of label updates (bug 247575).
- * Pawel Piech (Wind River) - added support for a virtual tree model viewer (Bug 242489)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.ViewerCell;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * @since 3.3
- */
-public class TreeModelLabelProvider extends ColumnLabelProvider implements ITreeModelLabelProvider {
-
- private ITreeModelLabelProviderTarget fViewer;
- private List fComplete;
-
- /**
- * Cache of images used for elements in this label provider. Label updates
- * use the method <code>getImage(...)</code> to cache images for
- * image descriptors. The images are disposed with this label provider.
- */
- private Map fImageCache = new HashMap();
-
- /**
- * Cache of the fonts used for elements in this label provider. Label updates
- * use the method <code>getFont(...)</code> to cache fonts for
- * FontData objects. The fonts are disposed with this label provider.
- */
- private Map fFontCache = new HashMap();
-
- /**
- * Cache of the colors used for elements in this label provider. Label updates
- * use the method <code>getColor(...)</code> to cache colors for
- * RGB values. The colors are disposed with this label provider.
- */
- private Map fColorCache = new HashMap();
-
- /**
- * Label listeners
- */
- private ListenerList fLabelListeners = new ListenerList();
-
- /**
- * Updates waiting to be sent to the label provider. The map contains
- * lists of updates, keyed using the provider.
- * <p>
- * Note: this variable should only be accessed inside a synchronized section
- * using the enclosing label provider instance.
- * </p>
- */
- private Map fPendingUpdates = new HashMap();
-
- /**
- * A job that will send the label update requests.
- * This variable allows the job to be canceled and re-scheduled if
- * new updates are requested.
- * <p>
- * Note: this variable should only be accessed inside a synchronized section
- * using the enclosing label provider instance.
- * </p>
- */
- private UIJob fPendingUpdatesJob;
-
- /**
- * List of updates in progress
- */
- private List fUpdatesInProgress = new ArrayList();
-
- /**
- * Constructs a new label provider on the given display
- */
- public TreeModelLabelProvider(ITreeModelLabelProviderTarget viewer) {
- fViewer = viewer;
- }
-
- /**
- * Returns an image for the given image descriptor or <code>null</code>. Adds the image
- * to a cache of images if it does not already exist.
- *
- * @param descriptor image descriptor or <code>null</code>
- * @return image or <code>null</code>
- */
- public Image getImage(ImageDescriptor descriptor) {
- if (descriptor == null) {
- return null;
- }
- Image image = (Image) fImageCache.get(descriptor);
- if (image == null) {
- image = new Image(getDisplay(), descriptor.getImageData());
- fImageCache.put(descriptor, image);
- }
- return image;
- }
-
- /**
- * Returns the display to use for resource allocation.
- *
- * @return display
- */
- private Display getDisplay() {
- return fViewer.getDisplay();
- }
-
- /**
- * Returns a font for the given font data or <code>null</code>. Adds the font to the font
- * cache if not yet created.
- *
- * @param fontData font data or <code>null</code>
- * @return font font or <code>null</code>
- */
- public Font getFont(FontData fontData) {
- if (fontData == null) {
- return null;
- }
- Font font = (Font) fFontCache.get(fontData);
- if (font == null) {
- font = new Font(getDisplay(), fontData);
- fFontCache.put(fontData, font);
- }
- return font;
- }
-
- /**
- * Returns a color for the given RGB or <code>null</code>. Adds the color to the color
- * cache if not yet created.
- *
- * @param rgb RGB or <code>null</code>
- * @return color or <code>null</code>
- */
- public Color getColor(RGB rgb) {
- if (rgb == null) {
- return null;
- }
- Color color = (Color) fColorCache.get(rgb);
- if (color == null) {
- color = new Color(getDisplay(), rgb);
- fColorCache.put(rgb, color);
- }
- return color;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.BaseLabelProvider#dispose()
- */
- public void dispose() {
- synchronized (fUpdatesInProgress) {
- Iterator updatesInProgress = fUpdatesInProgress.iterator();
- while (updatesInProgress.hasNext()) {
- ILabelUpdate currentUpdate = (ILabelUpdate) updatesInProgress.next();
- currentUpdate.cancel();
- }
- }
- synchronized (this) {
- if (fPendingUpdatesJob != null) {
- fPendingUpdatesJob.cancel();
- fPendingUpdatesJob = null;
- }
- }
- Iterator images = fImageCache.values().iterator();
- while (images.hasNext()) {
- Image image = (Image) images.next();
- image.dispose();
- }
- fImageCache.clear();
-
- Iterator fonts = fFontCache.values().iterator();
- while (fonts.hasNext()) {
- Font font = (Font) fonts.next();
- font.dispose();
- }
- fFontCache.clear();
-
- Iterator colors = fColorCache.values().iterator();
- while (colors.hasNext()) {
- Color color = (Color) colors.next();
- color.dispose();
- }
- fColorCache.clear();
-
- super.dispose();
- }
-
- public synchronized void update(ViewerCell cell) {
- // NOT USED - the viewer updates each row instead
- }
-
- public synchronized boolean update(TreePath elementPath) {
- String[] visibleColumns = fViewer.getVisibleColumns();
- Object element = elementPath.getLastSegment();
- IElementLabelProvider presentation = ViewerAdapterService.getLabelProvider(element);
- if (presentation != null) {
- List updates = (List)fPendingUpdates.get(presentation);
- if (updates == null) {
- updates = new LinkedList();
- fPendingUpdates.put(presentation, updates);
- }
- updates.add(new LabelUpdate(fViewer.getInput(), elementPath, this, fViewer, visibleColumns, fViewer.getPresentationContext()));
- if (fPendingUpdatesJob != null) {
- fPendingUpdatesJob.cancel();
- }
- fPendingUpdatesJob = new UIJob(fViewer.getDisplay(), "Schedule Pending Label Updates") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- startRequests(this);
- return Status.OK_STATUS;
- }
- };
- fPendingUpdatesJob.setSystem(true);
- fPendingUpdatesJob.schedule();
- return true;
- } else {
- return false;
- }
- }
-
- private void startRequests(UIJob updateJob) {
- // Avoid calling providers inside a synchronized section. Instead
- // copy the updates map into a new variable.
- Map updates = null;
- synchronized(this) {
- if (updateJob == fPendingUpdatesJob) {
- updates = fPendingUpdates;
- fPendingUpdates = new HashMap();
- fPendingUpdatesJob = null;
- }
- }
-
- if (updates != null) {
- for (Iterator itr = updates.keySet().iterator(); itr.hasNext();) {
- IElementLabelProvider presentation = (IElementLabelProvider)itr.next();
- List list = (List)updates.get(presentation);
- for (Iterator listItr = list.iterator(); listItr.hasNext();) {
- updateStarted((ILabelUpdate)listItr.next());
- }
- presentation.update( (ILabelUpdate[])list.toArray(new ILabelUpdate[list.size()]) );
- }
- }
- }
-
- /**
- * Returns the presentation context for this label provider.
- *
- * @return presentation context
- */
- protected IPresentationContext getPresentationContext() {
- return fViewer.getPresentationContext();
- }
-
- /**
- * A label update is complete.
- *
- * @param update
- */
- protected synchronized void complete(ILabelUpdate update) {
- if (update.isCanceled()){
- updateComplete(update);
- } else {
- if (fComplete == null) {
- fComplete = new ArrayList();
- UIJob job = new UIJob(getDisplay(), "Label Updates") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- LabelUpdate[] updates = null;
- synchronized (TreeModelLabelProvider.this) {
- updates = (LabelUpdate[]) fComplete.toArray(new LabelUpdate[fComplete.size()]);
- fComplete = null;
- }
- //System.out.println("Changed Labels: " + updates.length);
- for (int i = 0; i < updates.length; i++) {
- updates[i].update();
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule(10L);
- }
- fComplete.add(update);
- }
- }
-
- public void addLabelUpdateListener(ILabelUpdateListener listener) {
- fLabelListeners.add(listener);
- }
-
- public void removeLabelUpdateListener(ILabelUpdateListener listener) {
- fLabelListeners.remove(listener);
- }
-
- /**
- * Notification an update request has started
- *
- * @param update
- */
- void updateStarted(ILabelUpdate update) {
- boolean begin = false;
- synchronized (fUpdatesInProgress) {
- begin = fUpdatesInProgress.isEmpty();
- fUpdatesInProgress.add(update);
- }
- if (begin) {
- if (ModelContentProvider.DEBUG_UPDATE_SEQUENCE && (ModelContentProvider.DEBUG_PRESENTATION_ID == null || ModelContentProvider.DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("LABEL SEQUENCE BEGINS"); //$NON-NLS-1$
- }
- notifyUpdate(ModelContentProvider.UPDATE_SEQUENCE_BEGINS, null);
- }
- if (ModelContentProvider.DEBUG_UPDATE_SEQUENCE && (ModelContentProvider.DEBUG_PRESENTATION_ID == null || ModelContentProvider.DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("\tBEGIN - " + update); //$NON-NLS-1$
- }
- notifyUpdate(ModelContentProvider.UPDATE_BEGINS, update);
- }
-
- /**
- * Notification an update request has completed
- *
- * @param update
- */
- void updateComplete(ILabelUpdate update) {
- boolean end = false;
- synchronized (fUpdatesInProgress) {
- fUpdatesInProgress.remove(update);
- end = fUpdatesInProgress.isEmpty();
- }
- if (ModelContentProvider.DEBUG_UPDATE_SEQUENCE && (ModelContentProvider.DEBUG_PRESENTATION_ID == null || ModelContentProvider.DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("\tEND - " + update); //$NON-NLS-1$
- }
- notifyUpdate(ModelContentProvider.UPDATE_COMPLETE, update);
- if (end) {
- if (ModelContentProvider.DEBUG_UPDATE_SEQUENCE && (ModelContentProvider.DEBUG_PRESENTATION_ID == null || ModelContentProvider.DEBUG_PRESENTATION_ID.equals(getPresentationContext().getId()))) {
- System.out.println("LABEL SEQUENCE ENDS"); //$NON-NLS-1$
- }
- notifyUpdate(ModelContentProvider.UPDATE_SEQUENCE_COMPLETE, null);
- }
- }
-
- protected void notifyUpdate(final int type, final ILabelUpdate update) {
- if (!fLabelListeners.isEmpty()) {
- Object[] listeners = fLabelListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final ILabelUpdateListener listener = (ILabelUpdateListener) listeners[i];
- SafeRunner.run(new ISafeRunnable() {
- public void run() throws Exception {
- switch (type) {
- case ModelContentProvider.UPDATE_SEQUENCE_BEGINS:
- listener.labelUpdatesBegin();
- break;
- case ModelContentProvider.UPDATE_SEQUENCE_COMPLETE:
- listener.labelUpdatesComplete();
- break;
- case ModelContentProvider.UPDATE_BEGINS:
- listener.labelUpdateStarted(update);
- break;
- case ModelContentProvider.UPDATE_COMPLETE:
- listener.labelUpdateComplete(update);
- break;
- }
- }
- public void handleException(Throwable exception) {
- DebugUIPlugin.log(exception);
- }
- });
- }
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java
deleted file mode 100644
index 539e806c4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - Pawel Piech: Bug 213244 - VariableAdapterService should also call IAdaptable.getAdapter() for adaptables that implement this method directly.
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementEditor;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory2;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelSelectionPolicy;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelSelectionPolicyFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputProvider;
-import org.eclipse.debug.internal.ui.views.launch.DebugElementAdapterFactory;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * Helper class to retrieve adapters associated with viewers.
- *
- * @since 3.4
- */
-public class ViewerAdapterService {
-
-
- /**
- * Returns the content provider for the given element or
- * <code>null</code> if none.
- *
- * @param element element to retrieve adapter for
- * @return content provider or <code>null</code>
- */
- public static IElementContentProvider getContentProvider(Object element) {
- return (IElementContentProvider)getAdapter(element, IElementContentProvider.class);
- }
-
- /**
- * Returns the label provider for the given element or
- * <code>null</code> if none.
- *
- * @param element element to retrieve adapter for
- * @return label provider or <code>null</code>
- */
- public static IElementLabelProvider getLabelProvider(Object element) {
- IElementLabelProvider lp = (IElementLabelProvider)getAdapter(element, IElementLabelProvider.class);
- if (lp == null && element instanceof String) {
- // there are no adapters registered for Strings
- return (IElementLabelProvider) new DebugElementAdapterFactory().getAdapter(element, IElementLabelProvider.class);
- }
- return lp;
- }
-
- /**
- * Returns the column presentation factory for the given element or <code>null</code>.
- *
- * @param element element to retrieve adapter for
- * @return column presentation factory of <code>null</code>
- */
- public static IColumnPresentationFactory getColumnPresentationFactory(Object element) {
- return (IColumnPresentationFactory)getAdapter(element, IColumnPresentationFactory.class);
- }
-
- /**
- * Returns the model proxy factory for the given element or
- * <code>null</code> if none.
- *
- * @param element element to retrieve adapter for
- * @return model proxy factory or <code>null</code>
- */
- public static IModelProxyFactory getModelProxyFactory(Object element) {
- return (IModelProxyFactory)getAdapter(element, IModelProxyFactory.class);
- }
-
- /**
- * Returns the model proxy factory v.2 for the given element or
- * <code>null</code> if none.
- *
- * @param element element to retrieve adapter for
- * @return model proxy factory or <code>null</code>
- */
- public static IModelProxyFactory2 getModelProxyFactory2(Object element) {
- return (IModelProxyFactory2)getAdapter(element, IModelProxyFactory2.class);
- }
-
- /**
- * Returns the memento provider for the given element or
- * <code>null</code> if none.
- *
- * @param element element to retrieve adapter for
- * @return memento provider or <code>null</code>
- */
- public static IElementMementoProvider getMementoProvider(Object element) {
- return (IElementMementoProvider)getAdapter(element, IElementMementoProvider.class);
- }
-
- /**
- * Returns the element editor for the given element or <code>null</code>.
- *
- * @param element element to retrieve adapter for
- * @return element editor or <code>null</code>
- */
- public static IElementEditor getElementEditor(Object element) {
- return (IElementEditor)getAdapter(element, IElementEditor.class);
- }
-
- /**
- * Creates and returns the selection policy associated with the given selection
- * or <code>null</code> if none.
- *
- * @param selection or <code>null</code>
- * @param context presentation context
- * @return selection policy or <code>null</code>
- */
- public static IModelSelectionPolicy getSelectionPolicy(ISelection selection, IPresentationContext context) {
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- Object element = ss.getFirstElement();
- IModelSelectionPolicyFactory factory = (IModelSelectionPolicyFactory) getAdapter(element, IModelSelectionPolicyFactory.class);
- if (factory != null) {
- return factory.createModelSelectionPolicyAdapter(element, context);
- }
- }
- return null;
- }
-
- /**
- * Returns the viewer input provider for the given element or
- * <code>null</code> if none.
- *
- * @param element element to retrieve adapter for
- * @return viewer input provider or <code>null</code>
- */
- public static IViewerInputProvider getInputProvider(Object element) {
- return (IViewerInputProvider)getAdapter(element, IViewerInputProvider.class);
- }
-
- /**
- * Returns an adapter of the specified type for the given object or <code>null</code>
- * if none.
- *
- * @param element element to retrieve adapter for
- * @param type adapter type
- * @return adapter or <code>null</code>
- */
- private static Object getAdapter(Object element, Class type) {
- return DebugPlugin.getAdapter(element, type);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java
deleted file mode 100644
index 845ad30d2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.internal.core.commands.Request;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputRequestor;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.ui.progress.WorkbenchJob;
-
-/**
- * Internal implementation of the {@link IViewerInputUpdate} interface. Allows
- * implementors to translate the active debug context into an appropriate viewer
- * input.
- *
- * @since 3.4
- * @see IViewerInputUpdate
- */
-public class ViewerInputUpdate extends Request implements IViewerInputUpdate {
-
- /**
- * Presentation context
- */
- private IPresentationContext fContext;
-
- /**
- * New viewer input
- */
- private Object fSource;
-
- /**
- * Whether this update is done
- */
- private boolean fDone;
-
- /**
- * Viewer input to use
- */
- private Object fInputElement;
-
- /**
- * Viewer input at the time the request was made
- */
- private Object fViewerInput;
-
- /**
- * Client making request
- */
- private IViewerInputRequestor fRequestor;
-
- /**
- * When <code>done()</code> is called, the viewer must be informed that the update is complete in the UI thread.
- */
- protected WorkbenchJob fViewerInputUpdateJob = new WorkbenchJob("Asynchronous viewer input update") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- fRequestor.viewerInputComplete(ViewerInputUpdate.this);
- return Status.OK_STATUS;
- }
- };
-
- /**
- * Constructs a viewer input update request.
- *
- * @param context presentation context
- * @param viewerInput viewer input at the time the request was made
- * @param requestor client making the request
- * @param source source from which to derive a viewer input
- */
- public ViewerInputUpdate(IPresentationContext context, Object viewerInput, IViewerInputRequestor requestor, Object source){
- fContext = context;
- fSource = source;
- fRequestor = requestor;
- fViewerInputUpdateJob.setSystem(true);
- fViewerInput = viewerInput;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate#getPresentationContext()
- */
- public IPresentationContext getPresentationContext() {
- return fContext;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IProgressMonitor#done()
- */
- public final void done() {
- synchronized (this) {
- if (isDone()) {
- return;
- }
- fDone = true;
- }
- fViewerInputUpdateJob.schedule();
- }
-
- /**
- * Returns whether this request is done yet.
- *
- * @return whether this request is done yet
- */
- protected synchronized boolean isDone() {
- return fDone;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate#getElement()
- */
- public Object getElement() {
- return fSource;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElementPath()
- */
- public TreePath getElementPath() {
- return TreePath.EMPTY;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate#setViewerInput(java.lang.Object)
- */
- public void setInputElement(Object element) {
- fInputElement = element;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate#getViewerInput()
- */
- public Object getInputElement() {
- return fInputElement;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getViewerInput()
- */
- public Object getViewerInput() {
- return fViewerInput;
- }
-
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java
deleted file mode 100644
index 9ba15c551..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech (Wind River) - added support for a virtual tree model viewer (Bug 242489)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.debug.internal.core.commands.Request;
-import org.eclipse.debug.internal.ui.viewers.AsynchronousSchedulingRuleFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.ui.progress.WorkbenchJob;
-
-/**
- * @since 3.3
- */
-public abstract class ViewerUpdateMonitor extends Request implements IViewerUpdate {
-
- private ModelContentProvider fContentProvider;
-
- /**
- * Element's tree path
- */
- private TreePath fElementPath;
-
- /**
- * Element
- */
- private Object fElement;
-
- /**
- * Element content provider
- */
- private IElementContentProvider fElementContentProvider;
-
- /**
- * Whether this request's 'done' method has been called.
- */
- private boolean fDone = false;
-
- /**
- * Whether this request has been started
- */
- private boolean fStarted = false;
-
- /**
- * Viewer input at the time the request was made
- */
- private Object fViewerInput = null;
-
- /**
- * Whether this update has been delegated to another content provider
- * @since 3.4
- */
- private boolean fIsDelegated = false;
-
- /**
- * Presentation context
- */
- private IPresentationContext fContext;
-
-
- protected WorkbenchJob fViewerUpdateJob;
-
- /**
- * Constructs an update for the given content provider
- *
- * @param contentProvider content provider
- * @param elementPath path to associated model element - empty for root element
- * @param element associated model element
- */
- public ViewerUpdateMonitor(ModelContentProvider contentProvider, Object viewerInput, TreePath elementPath, Object element, IElementContentProvider elementContentProvider, IPresentationContext context) {
- fContext = context;
- fViewerInput = viewerInput;
- fElementContentProvider = elementContentProvider;
- fContentProvider = contentProvider;
- fElement = element;
- fElementPath = elementPath;
- // serialize updates per viewer
- fViewerUpdateJob = new WorkbenchJob(contentProvider.getViewer().getDisplay(), "Asynchronous viewer update") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- // necessary to check if viewer is disposed
- try {
- if (!isCanceled() && !getContentProvider().isDisposed()) {
- IStatus status = getStatus();
- if (status == null || status.isOK()) {
- performUpdate();
- }
- }
- } finally {
- getContentProvider().updateComplete(ViewerUpdateMonitor.this);
- }
- return Status.OK_STATUS;
- }
- };
- fViewerUpdateJob.setRule(getUpdateSchedulingRule());
- fViewerUpdateJob.setSystem(true);
- }
-
- /**
- * Returns the scheduling rule for viewer update job.
- *
- * @return rule or <code>null</code>
- */
- protected ISchedulingRule getUpdateSchedulingRule() {
- return AsynchronousSchedulingRuleFactory.getDefault().newSerialPerObjectRule(getContentProvider());
- }
-
- /**
- * Returns the model content provider this update is being performed for.
- *
- * @return the model content provider this update is being performed for
- */
- protected ModelContentProvider getContentProvider() {
- return fContentProvider;
- }
-
- /**
- * Returns the element content provider to use for this request
- *
- * @return element content provider
- */
- protected IElementContentProvider getElementContentProvider() {
- return fElementContentProvider;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IProgressMonitor#done()
- */
- public final void done() {
- synchronized (this) {
- if (isDone()) {
- return;
- }
- fDone = true;
- }
- scheduleViewerUpdate();
- }
-
- /**
- * Returns whether this request is done yet.
- *
- * @return
- */
- protected synchronized boolean isDone() {
- return fDone;
- }
-
- protected void scheduleViewerUpdate() {
- if(!isCanceled()) {
- fViewerUpdateJob.schedule();
- } else {
- getContentProvider().updateComplete(this);
- }
- }
-
- /**
- * Notification this update has been completed and should now be applied to
- * this update's viewer. This method is called in the UI thread.
- */
- protected abstract void performUpdate();
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getPresentationContext()
- */
- public IPresentationContext getPresentationContext() {
- return fContext;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElement()
- */
- public Object getElement() {
- return fElement;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElementPath()
- */
- public TreePath getElementPath() {
- return fElementPath;
- }
-
- /**
- * Returns whether this request can coalesce the given request, and performs the
- * coalesce if it can.
- *
- * @param update request to coalesce with this request
- * @return whether it worked
- */
- abstract boolean coalesce(ViewerUpdateMonitor update);
-
- /**
- * Returns whether this update or any coalesced updates is for an
- * element at the given path.
- * @since 3.6
- */
- abstract boolean containsUpdate(TreePath path);
-
- /**
- * Starts this request. Subclasses must override startRequest().
- */
- final void start() {
- synchronized (this) {
- if (fStarted) {
- return;
- }
- fStarted = true;
- }
- getContentProvider().updateStarted(this);
- if (!isCanceled()) {
- startRequest();
- } else {
- done();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getViewerInput()
- */
- public Object getViewerInput() {
- return fViewerInput;
- }
-
- /**
- * Subclasses must override to initiate specific request types.
- */
- abstract void startRequest();
-
- /**
- * Returns the priority of this request. Subclasses must override. The
- * highest priority is 1. Priorities indicate the order that waiting
- * requests should be started in (for example, 'hasChildren' before 'update child count').
- *
- * @return priority
- */
- abstract int getPriority();
-
- /**
- * Returns a path used to schedule this request - i.e. based on this path, this
- * request will be scheduled to run when no requests are running against the
- * same element or a parent of the element denoted by the path.
- *
- * @return path used to schedule request
- */
- abstract TreePath getSchedulingPath();
-
- /**
- * Sets whether this update has been delegated to another content provider
- * @param delegated whether the update has been delegated
- * @since 3.4
- */
- public void setDelegated(boolean delegated) {
- fIsDelegated = delegated;
- }
-
- /**
- * @return whether this update has been delegated to another content provider
- * @since 3.4
- */
- public boolean isDelegated() {
- return fIsDelegated;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
deleted file mode 100644
index 625a26fd6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.viewers.model.InternalTreeModelViewer.VirtualElement;
-import org.eclipse.debug.internal.ui.viewers.model.InternalTreeModelViewer.VirtualModel;
-import org.eclipse.debug.ui.IDebugView;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ContentViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.swt.SWTError;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-
-public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDelegate {
-
- private ContentViewer fViewer;
- private static final String TAB = "\t"; //$NON-NLS-1$
- private static final String SEPARATOR = "line.separator"; //$NON-NLS-1$
-
- /**
- * @see AbstractDebugActionDelegate#initialize(IAction, ISelection)
- */
- protected boolean initialize(IAction action, ISelection selection) {
- if (!isInitialized()) {
- IDebugView adapter= (IDebugView)getView().getAdapter(IDebugView.class);
- if (adapter != null) {
- if (adapter.getViewer() instanceof ContentViewer) {
- setViewer((ContentViewer) adapter.getViewer());
- }
- adapter.setAction(getActionId(), action);
- }
- return super.initialize(action, selection);
- }
- return false;
- }
-
- protected String getActionId() {
- return IDebugView.COPY_ACTION;
- }
-
- /**
- * Appends the representation of the specified element (using the label provider and indent)
- * to the buffer. For elements down to stack frames, children representations
- * are append to the buffer as well.
- */
- protected void append(VirtualElement item, StringBuffer buffer, int indent) {
- for (int i= 0; i < indent; i++) {
- buffer.append(TAB);
- }
- String[] labels = item.getLabel();
- int count = labels.length;
- if(count > 0) {
- for (int i = 0; i < count; i++) {
- String text = labels[i];
- if(text != null && !text.trim().equals(IInternalDebugCoreConstants.EMPTY_STRING)) {
- buffer.append(text+TAB);
- }
- }
- buffer.append(System.getProperty(SEPARATOR));
- }
- }
-
- /**
- * Do the specific action using the current selection.
- */
- public void run(final IAction action) {
- if (fViewer instanceof InternalTreeModelViewer) {
- InternalTreeModelViewer viewer = (InternalTreeModelViewer) fViewer;
- TreeItem[] items = getPrunedSelection();
- TreePath root = null;
- int[] indexes = null;
- if (items.length != 0) {
- TreeItem anItem = items[0];
- TreeItem rootItem = anItem.getParentItem();
- if (rootItem == null) {
- root = TreePath.EMPTY;
- } else {
- root = viewer.getTreePathFromItem(rootItem);
- }
- indexes = new int[items.length];
- for (int i = 0; i < items.length; i++) {
- TreeItem child = items[i];
- if (rootItem == null) {
- indexes[i] = viewer.getTree().indexOf(child);
- } else {
- indexes[i] = rootItem.indexOf(child);
- }
- }
- }
- final VirtualModel model = viewer.buildVirtualModel(root, indexes);
- ProgressMonitorDialog dialog = new ProgressMonitorDialog(fViewer.getControl().getShell());
- final IProgressMonitor monitor = dialog.getProgressMonitor();
- dialog.setCancelable(true);
-
- final String[] columns = viewer.getPresentationContext().getColumns();
- final Object[] result = new Object[1];
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(final IProgressMonitor m) throws InvocationTargetException, InterruptedException {
- result[0] = model.populate(m, DebugUIPlugin.removeAccelerators(getAction().getText()), columns);
- }
- };
- try {
- dialog.run(true, true, runnable);
- } catch (InvocationTargetException e) {
- DebugUIPlugin.log(e);
- return;
- } catch (InterruptedException e) {
- return;
- }
-
- VirtualElement modelRoot = (VirtualElement) result[0];
- if (!monitor.isCanceled()) {
- if (root != null) {
- // walk down to nested root
- int depth = root.getSegmentCount();
- for (int i = 0; i < depth; i++) {
- VirtualElement[] children = modelRoot.getChildren();
- for (int j = 0; j < children.length; j++) {
- VirtualElement ve = children[j];
- if (ve != null) {
- modelRoot = ve;
- break;
- }
- }
- }
- }
- VirtualElement[] children = modelRoot.getChildren();
- if (children != null) {
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < children.length; i++) {
- if (children[i] != null) {
- copy(children[i], buffer, 0);
- }
- }
- TextTransfer plainTextTransfer = TextTransfer.getInstance();
- Clipboard clipboard= new Clipboard(fViewer.getControl().getDisplay());
- try {
- doCopy(clipboard, plainTextTransfer, buffer);
- } finally {
- clipboard.dispose();
- }
- }
- }
-
- }
- }
-
- /**
- * @param item
- * @param buffer
- */
- protected void copy(VirtualElement item, StringBuffer buffer, int indent) {
- if (!item.isFiltered()) {
- append(item, buffer, indent);
- VirtualElement[] children = item.getChildren();
- if (children != null) {
- for (int i = 0; i < children.length; i++) {
- copy(children[i], buffer, indent + 1);
- }
- }
- }
- }
-
- protected void doCopy(Clipboard clipboard, TextTransfer plainTextTransfer, StringBuffer buffer) {
- try {
- clipboard.setContents(
- new String[]{buffer.toString()},
- new Transfer[]{plainTextTransfer});
- } catch (SWTError e){
- if (e.code != DND.ERROR_CANNOT_SET_CLIPBOARD) {
- throw e;
- }
- if (MessageDialog.openQuestion(fViewer.getControl().getShell(), ActionMessages.CopyToClipboardActionDelegate_Problem_Copying_to_Clipboard_1, ActionMessages.CopyToClipboardActionDelegate_There_was_a_problem_when_accessing_the_system_clipboard__Retry__2)) { //
- doCopy(clipboard, plainTextTransfer, buffer);
- }
- }
- }
-
- /**
- * Returns the selected items in the tree, pruning children
- * if from selected parents.
- */
- protected TreeItem[] getPrunedSelection() {
- Control control = fViewer.getControl();
- List items = new ArrayList();
- if (control instanceof Tree) {
- Tree tree = (Tree) control;
- TreeItem[] selection = tree.getSelection();
- if (selection.length == 0) {
- selection = tree.getItems();
- }
-
- for (int i = 0; i < selection.length; i++) {
- TreeItem item = selection[i];
- if (isEnabledFor(item.getData())) {
- if (walkHierarchy(item, items)) {
- items.add(item);
- }
- }
- }
- }
- return (TreeItem[]) items.toArray(new TreeItem[items.size()]);
- }
-
- /**
- * Returns whether the parent of the specified
- * element is already contained in the collection.
- */
- protected boolean walkHierarchy(TreeItem item, List elements) {
- TreeItem parent= item.getParentItem();
- if (parent == null) {
- return true;
- }
- if (elements.contains(parent)) {
- return false;
- }
- return walkHierarchy(parent, elements);
- }
-
- protected ContentViewer getViewer() {
- return fViewer;
- }
-
- protected void setViewer(ContentViewer viewer) {
- fViewer = viewer;
- }
- /**
- * @see AbstractDebugActionDelegate#doAction(Object)
- */
- protected void doAction(Object element) {
- //not used
- }
-
- protected boolean getEnableStateForSelection(IStructuredSelection selection) {
- if (selection.isEmpty()) {
- return true;
- } else {
- return super.getEnableStateForSelection(selection);
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java
deleted file mode 100644
index 5ba5197af..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation
- * Pawel Piech (Wind River) - added a breadcrumb mode to Debug view (Bug 252677)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.viewers.FindElementDialog;
-import org.eclipse.debug.internal.ui.viewers.model.InternalTreeModelViewer.VirtualElement;
-import org.eclipse.debug.internal.ui.viewers.model.InternalTreeModelViewer.VirtualModel;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.graphics.Image;
-
-import org.eclipse.ui.IWorkbenchCommandConstants;
-import org.eclipse.ui.PlatformUI;
-
-import org.eclipse.ui.texteditor.IUpdate;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Action which prompts the user to find/navigate to an element in a virtual tree.
- *
- * @since 3.3
- */
-public class VirtualFindAction extends Action implements IUpdate {
-
- private InternalTreeModelViewer fViewer;
-
- class FindLabelProvider extends LabelProvider {
-
- public FindLabelProvider() {
- }
-
- public Image getImage(Object element) {
- return ((VirtualElement)element).getImage();
- }
-
- public String getText(Object element) {
- return ((VirtualElement)element).getLabel()[0];
- }
-
- }
-
- public VirtualFindAction(InternalTreeModelViewer viewer) {
- setText(ActionMessages.FindAction_0);
- setId(DebugUIPlugin.getUniqueIdentifier() + ".FindElementAction"); //$NON-NLS-1$
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.FIND_ELEMENT_ACTION);
- setActionDefinitionId(IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE);
- fViewer = viewer;
- }
-
- public void run() {
- final VirtualModel model = fViewer.buildVirtualModel(null, null);
- ProgressMonitorDialog dialog = new ProgressMonitorDialog(fViewer.getControl().getShell());
- final IProgressMonitor monitor = dialog.getProgressMonitor();
- dialog.setCancelable(true);
-
- String[] columns = fViewer.getPresentationContext().getColumns();
- String[] temp = null;
- if (columns == null || columns.length == 0) {
- temp = null;
- } else {
- temp = new String[]{columns[0]};
- }
- final String[] IDs = temp;
- final Object[] result = new Object[1];
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(final IProgressMonitor m) throws InvocationTargetException, InterruptedException {
- result[0] = model.populate(m, DebugUIPlugin.removeAccelerators(getText()), IDs);
- }
- };
- try {
- dialog.run(true, true, runnable);
- } catch (InvocationTargetException e) {
- DebugUIPlugin.log(e);
- return;
- } catch (InterruptedException e) {
- return;
- }
-
- VirtualElement root = (VirtualElement) result[0];
- if (!monitor.isCanceled()) {
- List list = new ArrayList();
- collectAllChildren(root, list);
- performFind(list.toArray());
- }
-
- }
-
- /**
- * Adds all children to the given list recursively.
- *
- * @param collect
- */
- private void collectAllChildren(VirtualElement element, List collect) {
- VirtualElement[] children = element.getChildren();
- if (children != null) {
- for (int i = 0; i < children.length; i++) {
- if (!children[i].isFiltered()) {
- collect.add(children[i]);
- collectAllChildren(children[i], collect);
- }
- }
- }
- }
-
- protected void performFind(Object[] items) {
- FindElementDialog dialog = new FindElementDialog(fViewer.getControl().getShell(), new FindLabelProvider(), items);
- dialog.setTitle(ActionMessages.FindDialog_3);
- dialog.setMessage(ActionMessages.FindDialog_1);
- if (dialog.open() == Window.OK) {
- Object[] elements = dialog.getResult();
- if (elements.length == 1) {
- VirtualElement element = (VirtualElement)elements[0];
- TreePath path = element.realize();
- if (path != null) {
- fViewer.setSelection(new TreeSelection(path), true, true);
- } else {
- DebugUIPlugin.errorDialog(fViewer.getControl().getShell(), ActionMessages.VirtualFindAction_0,
- MessageFormat.format(ActionMessages.VirtualFindAction_1, new String[]{element.getLabel()[0]}),
- (IStatus)null);
- }
- }
- }
- }
-
- public void update() {
- setEnabled(fViewer.getInput() != null);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualItem.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualItem.java
deleted file mode 100644
index e5e022e2e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualItem.java
+++ /dev/null
@@ -1,410 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeMap;
-
-import org.eclipse.core.runtime.Assert;
-
-/**
- * Virtual item, which is analogous to the SWT's tree item.
- *
- * @since 3.5
- */
-class VirtualItem {
-
- // Data keys for display attributes of an item.
- static String LABEL_KEY = "LABEL_KEY"; //$NON-NLS-1$
- static String IMAGE_KEY = "IMAGE_KEY"; //$NON-NLS-1$
- static String FONT_KEY = "FONT_KEY"; //$NON-NLS-1$
- static String FOREGROUND_KEY = "FOREGROUND_KEY"; //$NON-NLS-1$
- static String BACKGROUND_KEY = "BACKGROUND_KEY"; //$NON-NLS-1$
-
- static String ELEMENT_DATA_KEY = "element"; //$NON-NLS-1$
-
- /**
- * Index object of a tree item. It allows the indexes to be modified
- * as items are inserted and removed.
- */
- public static class Index implements Comparable {
- private Integer fIndexValue;
-
- public Index(int index) {
- fIndexValue = new Integer(index);
- }
-
- public boolean equals(Object obj) {
- return obj instanceof Index && ((Index)obj).fIndexValue.equals(fIndexValue);
- }
-
- public int hashCode() {
- return fIndexValue.hashCode();
- }
-
- public void increment() {
- fIndexValue = new Integer(fIndexValue.intValue() + 1);
- }
-
- public void decrement() {
- fIndexValue = new Integer(fIndexValue.intValue() - 1);
- }
-
- public int intValue() {
- return fIndexValue.intValue();
- }
-
- public int compareTo(Object obj) {
- return obj instanceof Index ? fIndexValue.compareTo(((Index)obj).fIndexValue) : 0;
- }
-
- public String toString() {
- return fIndexValue.toString();
- }
- }
-
- /**
- * Parent items of this item.
- */
- final private VirtualItem fParent;
-
- /**
- * The index of this item.
- */
- final private Index fIndex;
-
- /**
- * Map of child items. The key to the map is the item's index, which
- * must be the same object instance as the index in the item. The tree map
- * keeps the items sorted while allowing indexes (keys) to be modified as
- * child items are inserted and removed.
- */
- private Map fItems = new TreeMap();
-
- /**
- * Flag indicating whether this item has child items.
- */
- private boolean fHasItems = false;
-
- /**
- * Indicates that this item has been expanded. It should only
- * be set to <code>true</code> if fHasItems is <code>true</code>.
- */
- private boolean fExpanded = false;
-
- /**
- * The cound of child items. <code>-1</code> indicates that the count
- * is not known.
- */
- private int fItemCount = -1;
-
- /**
- * The data held by this item. It includes the element as well as the item
- * display attributes.
- */
- private Map fData = new HashMap(1);
-
- /**
- * Flag indicating that the item needs to have it's label updated.
- */
- private boolean fNeedsLabelUpdate = true;
-
- /**
- * Flag indicating that the item's count needs to be updated.
- */
- private boolean fNeedsCountUpdate = true;
-
- /**
- * Flag indicating that the item's element needs to be updated.
- */
- private boolean fNeedsDataUpdate = true;
-
- /**
- * Indicates that this item has been disposed.
- */
- private boolean fDisposed = false;
-
-
- VirtualItem(VirtualItem parent, Index index) {
- fParent = parent;
- fIndex = index;
- }
-
- void setNeedsCountUpdate() {
- fNeedsCountUpdate = true;
- fItemCount = -1;
- }
-
- void setNeedsLabelUpdate() {
- fNeedsLabelUpdate = true;
- }
-
- void setNeedsDataUpdate() {
- fNeedsDataUpdate = true;
- }
-
- void clear(Index index) {
- VirtualItem item = (VirtualItem)fItems.remove(index);
- if (item != null) {
- item.dispose();
- }
- }
-
- VirtualItem getParent() {
- return fParent;
- }
-
- Index getIndex() {
- return fIndex;
- }
-
- VirtualItem findItem(Object element) {
- for (Iterator itr = fItems.values().iterator(); itr.hasNext();) {
- VirtualItem next = (VirtualItem)itr.next();
- Object nextData = next.getData();
- if ( (element != null && element.equals(nextData)) || (element == null && nextData == null) ) {
- return next;
- }
- }
- return null;
- }
-
- boolean needsDataUpdate() {
- return fNeedsDataUpdate;
- }
-
- void clearNeedsDataUpdate() {
- fNeedsDataUpdate = false;
- }
-
- boolean needsCountUpdate() {
- return fNeedsCountUpdate;
- }
-
- void clearNeedsCountUpdate() {
- fNeedsCountUpdate = false;
- }
-
- boolean needsLabelUpdate() {
- return fNeedsLabelUpdate;
- }
-
- void clearNeedsLabelUpdate() {
- fNeedsLabelUpdate = false;
- }
-
- boolean isDisposed() {
- return fDisposed;
- }
-
- void dispose() {
- fData.clear();
- for (Iterator itr = fItems.values().iterator(); itr.hasNext();) {
- ((VirtualItem)itr.next()).dispose();
- }
- fItems.clear();
-
- fDisposed = true;
- findTree().fireItemDisposed(this);
- }
-
- Object getData (String key) {
- return fData.get(key);
- }
-
- void setData(String key, Object data) {
- fData.put(key, data);
- }
-
- void setData(Object data) {
- fData.put(ELEMENT_DATA_KEY, data);
- }
-
- Object getData () {
- return fData.get(ELEMENT_DATA_KEY);
- }
-
- void setExpanded(boolean expanded) {
- if (fExpanded == expanded) {
- return;
- }
- fExpanded = expanded;
-
- if (fExpanded && getItemCount() == -1) {
- setNeedsCountUpdate();
- }
-
-
- Assert.isTrue(!fExpanded || hasItems());
-
- // If collapsed, make sure that all the children are collapsed as well.
- if (!fExpanded) {
- for (Iterator itr = fItems.values().iterator(); itr.hasNext();) {
- ((VirtualItem)itr.next()).setExpanded(expanded);
- }
- }
- }
-
- boolean getExpanded() {
- return fExpanded;
- }
-
- void setHasItems(boolean hasChildren) {
- fHasItems = hasChildren;
- if (!fHasItems) {
- if (getItemCount() != 0) {
- setItemCount(0);
- }
- } else if (getItemCount() == 0) {
- setItemCount(-1);
- }
- }
-
- boolean hasItems() {
- return fHasItems;
- }
-
- void setItemCount(int count) {
- fItemCount = count;
- for (Iterator itr = fItems.entrySet().iterator(); itr.hasNext();) {
- Map.Entry entry = (Map.Entry)itr.next();
- int index = ((Index)entry.getKey()).intValue();
- if (index >= count) {
- itr.remove();
- VirtualItem item = (VirtualItem)entry.getValue();
- item.dispose();
- }
- }
- if (fItemCount == 0) {
- if (hasItems()) {
- setHasItems(false);
- }
- if (getExpanded()) {
- setExpanded(false);
- }
- } else {
- if (!hasItems()) {
- setHasItems(true);
- }
- }
- }
-
- int getItemCount() {
- return fItemCount;
- }
-
- VirtualItem getItem(Index index) {
- ensureItems();
-
- VirtualItem item = (VirtualItem)fItems.get(index);
- if (item == null) {
- item = new VirtualItem(this, index);
- fItems.put(index, item);
- }
- return item;
- }
-
- boolean childrenNeedDataUpdate() {
- if (getItemCount() == 0) {
- return false;
- }
- if (fItems == null || fItems.size() != fItemCount) {
- return true;
- }
- for (Iterator itr = fItems.values().iterator(); itr.hasNext();) {
- VirtualItem child = (VirtualItem)itr.next();
- if (child.needsDataUpdate()) {
- return true;
- }
- }
- return false;
- }
-
- VirtualItem[] getItems() {
- return (VirtualItem[]) fItems.values().toArray(new VirtualItem[fItems.size()]);
- }
-
- VirtualItem addItem(int position) {
- if (!fHasItems) {
- fHasItems = true;
- }
- if (fItemCount < 0) {
- fItemCount = 0;
- }
-
- // Increment all items with an index higher than the given position.
- fItemCount++;
- ensureItems();
- for (Iterator itr = fItems.keySet().iterator(); itr.hasNext();) {
- Index childIndex = (Index)itr.next();
- if (childIndex.intValue() >= position) {
- childIndex.increment();
- }
- }
-
- // Note: the same index object used to create the item has to
- // be used as the key into the map.
- Index childIndex = new Index(position);
- VirtualItem newChild = new VirtualItem(this, childIndex);
- fItems.put(childIndex, newChild);
- return newChild;
- }
-
- void remove(Index position) {
- fItemCount--;
- if (fItemCount < 0) {
- fHasItems = false;
- }
-
- ensureItems();
-
- VirtualItem removedItem = null;
- for (Iterator itr = fItems.entrySet().iterator(); itr.hasNext();) {
- Map.Entry entry = (Map.Entry)itr.next();
- Index childIndex = (Index)entry.getKey();
- if (childIndex.intValue() > position.intValue()) {
- childIndex.decrement();
- } else if (childIndex.intValue() == position.intValue()) {
- removedItem = (VirtualItem)entry.getValue();
- removedItem.dispose();
- itr.remove();
- }
- }
- }
-
- private void ensureItems() {
- if (fItems == null) {
- fItems = new HashMap( Math.max(1, Math.min(fItemCount, 16)) );
- }
- }
-
- private VirtualTree findTree() {
- VirtualItem item = this;
- while (!(item instanceof VirtualTree)) {
- item = item.fParent;
- }
- return (VirtualTree)item;
- }
-
- public String toString() {
- String[] label = (String[])fData.get(LABEL_KEY);
- if (label != null && label.length != 0) {
- return label[0];
- }
- Object data = fData.get(ELEMENT_DATA_KEY);
- if (data != null) {
- return data.toString();
- }
- return super.toString();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualTree.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualTree.java
deleted file mode 100644
index 89c2f366f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualTree.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.swt.SWT;
-
-
-/**
- * Tree of virtual items that is analogous to SWT's tree control.
- *
- * @since 3.5
- */
-class VirtualTree extends VirtualItem {
-
- /**
- * Lazy virtual tree does not retrieve elements or labels,
- * except for the selected elements.
- */
- private boolean fLazy;
-
- /**
- * The item currently at the top of the "virtual" view-port.
- */
- private VirtualItem fTopItem;
-
- /**
- * Interface for listeners that need to be notified when items
- * are disposed or revealed. It should be implemented by the viewer.
- */
- public static interface IVirtualItemListener {
-
- /**
- * Called when the item has been shown in the virtual viewer's
- * view-port. This indicates to the viewer that it should check
- * the item's status and request needed data.
- *
- * @param item The item that was revealed.
- */
- public void revealed(VirtualItem item);
-
- /**
- * Called when an item is disposed. It tells the viewer to
- * clean up any remaining mappings and cached data of this item.
- *
- * @param item The itam that was disposed.
- */
- public void disposed(VirtualItem item);
- }
-
- /**
- * Set of listeners of the virtual tree.
- */
- private Set fVirtualItemListeners = new HashSet(1);
-
- /**
- * The currently selected items. This array contains only
- * the leaf items which are selected.
- */
- private VirtualItem[] fSelection = new VirtualItem[0];
-
- VirtualTree(int style) {
- super(null, new VirtualItem.Index(0));
- fLazy = (style & SWT.VIRTUAL) != 0;
- clearNeedsLabelUpdate();
- clearNeedsDataUpdate();
- }
-
- void dispose() {
- super.dispose();
- fVirtualItemListeners.clear();
- }
-
- void setNeedsCountUpdate() {
- super.setNeedsCountUpdate();
- clearNeedsLabelUpdate();
- clearNeedsDataUpdate();
- }
-
- void setNeedsLabelUpdate() {
- // no-op
- }
-
- void setData(String key, Object data) {
- super.setData(key, data);
- if (data == null) {
- clearNeedsDataUpdate();
- }
- }
-
- void addItemListener(IVirtualItemListener listener) {
- fVirtualItemListeners.add(listener);
- }
-
- void removeItemListener(IVirtualItemListener listener) {
- fVirtualItemListeners.remove(listener);
- }
-
- VirtualItem[] getSelection() {
- return fSelection;
- }
-
- void setSelection(VirtualItem[] items) {
- fSelection = items;
- }
-
- void showItem(VirtualItem item) {
- setTopItem(item);
- }
-
- void fireItemDisposed(VirtualItem item) {
- for (Iterator itr = fVirtualItemListeners.iterator(); itr.hasNext();) {
- ((IVirtualItemListener)itr.next()).disposed(item);
- }
- }
-
- void fireItemRevealed(VirtualItem item) {
- for (Iterator itr = fVirtualItemListeners.iterator(); itr.hasNext();) {
- ((IVirtualItemListener)itr.next()).revealed(item);
- }
- }
-
- void setData(Object data) {
- super.setData(data);
- // The root item always has children as long as the input is non-null,
- // so that it should be expanded.
- setHasItems(data != null);
- }
-
- void setTopItem(VirtualItem item) {
- fTopItem = item;
- }
-
- VirtualItem getTopItem() {
- return fTopItem;
- }
-
- void setHasItems(boolean hasChildren) {
- super.setHasItems(hasChildren);
- // The root item is always expanded as long as it has children.
- if (hasChildren) {
- setExpanded(true);
- }
- }
-
- boolean isItemVisible(VirtualItem item) {
- if (!fLazy) {
- // If not in lazy mode, all items are visible.
- return true;
- } else {
- // TODO: use top item and visible item count to determine list of
- // visible items. For now only mark the selected items as visible.
- for (int i = 0; i < fSelection.length; i++) {
- VirtualItem selectionItem = fSelection[i];
- while (selectionItem != null) {
- if (item.equals(selectionItem)) {
- return true;
- }
- selectionItem = selectionItem.getParent();
- }
- }
- return false;
- }
- }
-
- /**
- * Validates the entire tree.
- */
- void validate() {
- validate(VirtualTree.this);
- }
-
- /**
- * Validates the item and its children, identifying children which were
- * revealed and need to be updated.
- *
- * @param item The item which to validate.
- */
- void validate(VirtualItem item) {
- if (item.needsDataUpdate()) {
- if (isItemVisible(item)) {
- fireItemRevealed(item);
- }
- } else if (item.getData() != null) {
- if ( item.needsLabelUpdate() || (item.needsCountUpdate() && item.hasItems() && item.getExpanded()) ) {
- if (isItemVisible(item)) {
- fireItemRevealed(item);
- }
- }
-
- if (item.getData() != null && item.getItemCount() > 0 && item.getExpanded()) {
- for (int i = 0; i < item.getItemCount(); i++) {
- validate(item.getItem(new Index(i)));
- }
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckUpdate.java
deleted file mode 100644
index 91d90ef10..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckUpdate.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*****************************************************************
- * Copyright (c) 2009 Texas Instruments and others
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Chuong (Texas Instruments) - Initial API and implementation (Bug 286310)
- *****************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-/**
- * Label update which allows the label provider to set the checked element state.
- * The label provider can use the presentation context to determine whether the
- * viewer is showing item check boxes.
- *
- * @since 3.6
- */
-public interface ICheckUpdate extends ILabelUpdate {
-
- /**
- * Property of the presentation context which indicates that the viewer
- * has the check box style.
- */
- public static final String PROP_CHECK = "org.eclipse.debug.ui.check"; //$NON-NLS-1$
-
- /**
- * Sets the check state of the tree node.
- *
- * @param checked
- * @param grayed
- */
- public void setChecked(boolean checked, boolean grayed);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckboxModelProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckboxModelProxy.java
deleted file mode 100644
index d1f720358..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ICheckboxModelProxy.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*****************************************************************
- * Copyright (c) 2009 Texas Instruments and others
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Chuong (Texas Instruments) - Initial API and implementation (Bug 286310)
- * IBM Corporation - ongoing enhancements
- *****************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-import org.eclipse.jface.viewers.TreePath;
-
-
-/**
- * Optional extension to a model proxy for models that use a check box tree viewer. Provides
- * notification for check state changes in the tree.
- *
- * @since 3.6
- */
-public interface ICheckboxModelProxy extends IModelProxy {
-
- /**
- * Notifies the receiver that the given element has had its
- * checked state modified in the viewer.
- * <p>
- * This method is called in the UI thread. Clients that execute long running operations or
- * communicate with a potentially unreliable or blocking model should run those operations
- * asynchronously.
- * </p>
- *
- * @param context Presentation context in which the element was updated.
- * @param viewerInput The root element of the viewer where the check
- * selection took place.
- * @param path Path of the element that had its checked state changed
- * @param checked The new checked state of the element
- * @return false if the check state should not change
- */
- public boolean setChecked(IPresentationContext context, Object viewerInput, TreePath path, boolean checked);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenCountUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenCountUpdate.java
deleted file mode 100644
index 09cb08993..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenCountUpdate.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-
-
-/**
- * Request monitor used to collect the number of children for an element in a viewer.
- * <p>
- * Clients are not intended to implement this interface.
- * </p>
- * @since 3.3
- */
-public interface IChildrenCountUpdate extends IViewerUpdate {
-
- /**
- * Sets the number of children for this update.
- *
- * @param numChildren number of children
- */
- public void setChildCount(int numChildren);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenUpdate.java
deleted file mode 100644
index 643a8379d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IChildrenUpdate.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-
-/**
- * Context sensitive children update request for a parent and subrange of its
- * children.
- * <p>
- * Clients are not intended to implement this interface.
- * </p>
- * @since 3.3
- */
-public interface IChildrenUpdate extends IViewerUpdate {
-
- /**
- * Returns the offset at which children have been requested for. This is
- * the index of the first child being requested.
- *
- * @return offset at which children have been requested for
- */
- public int getOffset();
-
- /**
- * Returns the number of children requested.
- *
- * @return number of children requested
- */
- public int getLength();
-
- /**
- * Sets the child for this request's parent at the given offset.
- *
- * @param child child
- * @param index child offset
- *
- * TODO: what to do with <code>null</code>
- */
- public void setChild(Object child, int offset);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentation.java
deleted file mode 100644
index acdd43c22..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentation.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * Defines the possible set of columns presented in a view for a model.
- * A column presentation is customizable per presentation context (view) and
- * view input, and is created by an <code>IColumnPresentationFactory</code>.
- *
- * @since 3.2
- */
-public interface IColumnPresentation {
-
- /**
- * Initializes this column presentation to be used in the
- * given context.
- *
- * @param context
- */
- public void init(IPresentationContext context);
-
- /**
- * Disposes this column presentation
- */
- public void dispose();
-
- /**
- * Returns an array of all columns supported by this adapter as
- * column identifiers.
- *
- * @return column identifiers
- */
- public String[] getAvailableColumns();
-
- /**
- * Returns an ordered array of columns that should be displayed initially for
- * this presentation as column IDs.
- *
- * @return initial columns to display
- */
- public String[] getInitialColumns();
-
- /**
- * Returns the column header for the column with the given identifier.
- *
- * @param id a column identifier included in <code>getColumns()</code>
- * @return column header
- */
- public String getHeader(String id);
-
- /**
- * Returns the image for the column with the given identifier, or <code>null</code>
- *
- * @param id column id
- * @return image descriptor or <code>null</code>
- */
- public ImageDescriptor getImageDescriptor(String id);
-
- /**
- * Returns an identifier for this columns presentation.
- * The identifier should be unique per kind of column presentation
- * (for example, the column presentation for Java stack frames
- * in the variables view). Allows visible column information to be
- * persisted by the platform.
- *
- * @return identifier
- */
- public String getId();
-
- /**
- * Returns whether this column presentation is optional. When a column presentation
- * is optional, the user may toggle columns on/off.
- *
- * @return whether this column presentation is optional
- */
- public boolean isOptional();
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentationFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentationFactory.java
deleted file mode 100644
index 49795c6cf..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IColumnPresentationFactory.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-/**
- * An adapter used to create column presentations.
- *
- * @see IColumnPresentation
- * @since 3.2
- */
-public interface IColumnPresentationFactory {
-
- /**
- * Constructs and returns the column presentation for the given presentation
- * context (view) and input element, or <code>null</code> of none.
- *
- * @param context presentation context
- * @param element the input element
- * @return column presentation or <code>null</code>
- */
- public IColumnPresentation createColumnPresentation(IPresentationContext context, Object element);
-
- /**
- * Returns the type of column presentation to be used for the given context and object
- * or <code>null</code> if none. Allows a previous column presentation to be re-used if
- * it has not changed type.
- *
- * @param context presentation context
- * @param element input element
- * @return column presentation id or <code>null</code>
- */
- public String getColumnPresentationId(IPresentationContext context, Object element);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementCompareRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementCompareRequest.java
deleted file mode 100644
index 7f6dfc45b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementCompareRequest.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-
-/**
- * Request to compare an element to a previously created memento.
- * <p>
- * Clients are not intended to implement this interface.
- * </p>
- * @since 3.3
- */
-public interface IElementCompareRequest extends IElementMementoRequest {
-
- /**
- * Sets whether this request's memento represents this requests's element.
- *
- * @param equal whether the memento represents the element
- */
- public void setEqual(boolean equal);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementContentProvider.java
deleted file mode 100644
index b98cdbcc0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementContentProvider.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River - Pawel Piech - Need a clarification on usage of IElement*Provider interfaces with update arrays (Bug 213609)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-
-/**
- * Provides content for an element in a virtual viewer.
- *
- * @since 3.3
- */
-public interface IElementContentProvider {
-
- /**
- * Updates the number of children for the given parent elements in the
- * specified requests.
- *
- * @param updates Each update specifies an element to update and provides
- * a store for the result. The update array is guaranteed to have at least
- * one element, and for all updates to have the same presentation context.
- */
- public void update(IChildrenCountUpdate[] updates);
-
- /**
- * Updates children as requested by the given updates.
- *
- * @param updates Each update specifies children to update and stores results.
- * The update array is guaranteed to have at least one element, and for
- * all updates to have the same presentation context.
- */
- public void update(IChildrenUpdate[] updates);
-
- /**
- * Updates whether elements have children.
- *
- * @param updates Each update specifies an element to update and provides
- * a store for the result. The update array is guaranteed to have at least
- * one element, and for all updates to have the same presentation context.
- */
- public void update(IHasChildrenUpdate[] updates);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementEditor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementEditor.java
deleted file mode 100644
index 9d04de4f8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementEditor.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Creates context specific cell modifiers and editors for elements.
- *
- * @since 3.3
- */
-public interface IElementEditor {
-
- /**
- * Returns a cell editor to use for the specified column and object or <code>null</code>
- * if none.
- *
- * @param context presentation context
- * @param id column id
- * @param element object to be edited
- * @param parent parent control to create the cell editor in
- * @return cell editor or <code>null</code>
- */
- public CellEditor getCellEditor(IPresentationContext context, String columnId, Object element, Composite parent);
-
- /**
- * Returns a cell modifier for the specified element in the given context
- * or <code>null</code> if none.
- *
- * @return cell modifier or <code>null</code>
- */
- public ICellModifier getCellModifier(IPresentationContext context, Object element);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementLabelProvider.java
deleted file mode 100644
index 0aaba8c6b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementLabelProvider.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River - Pawel Piech - Need a clarification on usage of IElement*Provider interfaces with update arrays (Bug 213609)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-/**
- * Provides context sensitive labels. Can be registered as an adapter for an element,
- * or implemented directly.
- *
- * @since 3.3
- */
-public interface IElementLabelProvider {
-
- /**
- * Updates the specified labels.
- *
- * @param updates Each update specifies the element and context for which a label is requested and
- * stores label attributes. The update array is guaranteed to have at least one element, and for
- * all updates to have the same presentation context.
- */
- public void update(ILabelUpdate[] updates);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoProvider.java
deleted file mode 100644
index e4da42cd5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoProvider.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River - Pawel Piech - Need a clarification on usage of IElement*Provider interfaces with update arrays (Bug 213609)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-/**
- * Used to save and restore viewer selection/expansion state. A memento
- * provider adapter should be available from a viewer input element
- * in order to support viewer state save/restore.
- *
- * @since 3.3
- */
-public interface IElementMementoProvider {
-
- /**
- * Creates and stores a mementos for the elements specified in the requests.
- * A request should be cancelled if a memento is not supported for the
- * specified element or context.
- *
- * @param requests Specifies elements and provides memento stores.
- * The requests array is guaranteed to have at least one element, and for
- * all requests to have the same presentation context.
- */
- public void encodeElements(IElementMementoRequest[] requests);
-
- /**
- * Determines whether mementos represent associated elements specified in the requests.
- *
- * @param requests Specifies each element and previously created memento.
- * The requests array is guaranteed to have at least one element, and for
- * all requests to have the same presentation context.
- */
- public void compareElements(IElementCompareRequest[] requests);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoRequest.java
deleted file mode 100644
index 9e664dff2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IElementMementoRequest.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-import org.eclipse.ui.IMemento;
-
-/**
- * Request to store a memento for an element in a specific context.
- * <p>
- * Clients are not intended to implement this interface.
- * </p>
- * @since 3.3
- */
-public interface IElementMementoRequest extends IViewerUpdate {
-
- /**
- * Returns the memento used to persist the element.
- *
- * @return memento
- */
- public IMemento getMemento();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IHasChildrenUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IHasChildrenUpdate.java
deleted file mode 100644
index 6c7fab0ea..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IHasChildrenUpdate.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-
-/**
- * Context sensitive update request for whether an element has children.
- * <p>
- * Clients are not intended to implement this interface.
- * </p>
- * @since 3.3
- */
-public interface IHasChildrenUpdate extends IViewerUpdate {
-
- /**
- * Sets whether there are children for this update.
- *
- * @param hasChildren whether there are children
- */
- public void setHasChilren(boolean hasChildren);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ILabelUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ILabelUpdate.java
deleted file mode 100644
index eebe886ec..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ILabelUpdate.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * Context sensitive label update request for an element.
- * <p>
- * Clients are not intended to implement this interface.
- * </p>
- * @since 3.3
- */
-public interface ILabelUpdate extends IViewerUpdate {
-
- /**
- * Returns the id's of the columns which are to be updated
- * or <code>null</code> if none. Note, these columns may be different
- * than the visible columns in the view which are returned by
- * {@link IPresentationContext#getColumns()}.
- *
- * @return column id's or <code>null</code>
- */
- public String[] getColumnIds();
-
- /**
- * Sets the text of the label of the specified column. Cannot be <code>null</code>.
- *
- * @param text
- * @param columnIndex column index (0 when no columns)
- */
- public void setLabel(String text, int columnIndex);
-
- /**
- * Sets the font of the label.
- *
- * @param fontData
- * @param columnIndex column index (0 when no columns)
- */
- public void setFontData(FontData fontData, int columnIndex);
-
- /**
- * Sets the image of the label.
- *
- * @param image
- * @param columnIndex column index (0 when no columns)
- */
- public void setImageDescriptor(ImageDescriptor image, int columnIndex);
-
- /**
- * Sets the foreground color of the label.
- *
- * @param foreground
- * @param columnIndex column index (0 when no columns)
- */
- public void setForeground(RGB foreground, int columnIndex);
-
- /**
- * Sets the background color of the label.
- *
- * @param background
- * @param columnIndex column index (0 when no columns)
- */
- public void setBackground(RGB background, int columnIndex);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelChangedListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelChangedListener.java
deleted file mode 100644
index f812ee94b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelChangedListener.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-/**
- * A model changed listener is notified of changes in a model. A model
- * is represented by an {@link IModelProxy}.
- *
- * @since 3.2
- * @see IModelProxy
- * @see IModelDeltaNode
- */
-public interface IModelChangedListener {
-
- /**
- * Notification a model has changed as described by the given delta.
- *
- * @param delta model delta
- * @param proxy proxy that created the delta
- */
- public void modelChanged(IModelDelta delta, IModelProxy proxy);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDelta.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDelta.java
deleted file mode 100644
index 18fd862ed..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDelta.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-
-
-/**
- * Describes a change within a model. A delta is a hierarchical description of changes
- * within a model. It consists of a tree of nodes. Each node references an element
- * from a model describing how that element changed. A model proxy fires model deltas
- * as its model changes in order to update views displaying that model.
- * <p>
- * Each node in a model delta describes the following:
- * <ul>
- * <li>the type of change - for example, whether an element was added, removed,
- * or whether its content or state changed</li>
- * <li>action to consider - for example, select or reveal the element</li>
- * </ul>
- * </p>
- * <p>
- * Clients are not intended to implement this interface directly. Instead, clients
- * creating and firing model deltas should create instances of
- * {@link org.eclipse.debug.internal.ui.viewers.update.ModelDelta}.
- * </p>
- * </p>
- * @since 3.2
- */
-public interface IModelDelta {
-
- // types of changes
-
- /**
- * Indicates an element has not changed, but has children that have
- * changed in some way.
- */
- public static int NO_CHANGE = 0;
- /**
- * Indicates an element has been added to the model, as described by
- * its path.
- */
- public static int ADDED = 1;
- /**
- * Indicates an element has been removed from the model, as described by
- * its path.
- */
- public static int REMOVED = 1 << 1;
- /**
- * Indicates an element has been replaced in the model, as described by
- * its path. In this case a replacement element is also specified in the
- * model delta node.
- */
- public static int REPLACED = 1 << 3;
- /**
- * Indicates an element has been inserted into the model, as described
- * by its path and index.
- */
- public static int INSERTED = 1 << 4;
-
- // how an element changed
-
- /**
- * Indicates an elements content has changed (i.e. its children).
- */
- public static int CONTENT = 1 << 10;
- /**
- * Indicates an elements state has changed (i.e. label)
- */
- public static int STATE = 1 << 11;
-
- // Suggested actions
-
- /**
- * Suggests that the element should be expanded, as described by its path.
- */
- public static int EXPAND = 1 << 20;
- /**
- * Suggests that the element should be selected, as described by its path.
- */
- public static int SELECT = 1 << 21;
-
- /**
- * Suggests that the element should be revealed, as described by its path.
- * @since 3.3
- */
- public static int REVEAL = 1 << 24;
-
- /**
- * Indicates a model proxy should be installed for the given element
- * @since 3.3
- */
- public static int INSTALL = 1 << 22;
-
- /**
- * Indicates a model proxy should be uninstalled for the given element
- * @since 3.3
- */
- public static int UNINSTALL = 1 << 23;
-
- /**
- * Suggests that the element should be collapsed, as described by its path.
- * @since 3.3
- */
- public static int COLLAPSE = 1 << 25;
-
- /**
- * Flag indicating that the view layout deltas should override the
- * model selection policy. This flag can be used in conjunction with
- * SELECT and REVEAL flags.
- *
- * @see IModelSelectionPolicy
-= * @since 3.5
- */
- public static int FORCE = 1 << 26;
-
- /**
- * Returns the parent of this node, or <code>null</code> if this is
- * a root node.
- *
- * @return parent node or <code>null</code> if this is a root node
- */
- public IModelDelta getParentDelta();
-
- /**
- * Returns the model element this node describes.
- *
- * @return associated model element
- */
- public Object getElement();
-
- /**
- * Returns flags describing how this element changed. A bit mask of the
- * change type constants described in {@link IModelDelta}.
- *
- * @return change flags
- */
- public int getFlags();
-
- /**
- * Returns nodes describing changed children, possibly an empty collection.
- *
- * @return changed children, possibly empty
- */
- public IModelDelta[] getChildDeltas();
-
- /**
- * When a node indicates the <code>IModelDelta.REPLACED</code> flag, this method
- * returns the replacement element, otherwise <code>null</code>.
- *
- * @return replacement element or <code>null</code>
- */
- public Object getReplacementElement();
-
- /**
- * Returns this node's index in its parents child collection or -1 if unknown.
- * This attribute is required when expanding or selecting an element.
- * <p>
- * When a node indicates the <code>IModelDelta.INSERTED</code> flag, this method
- * returns the index that the new element should be inserted at relative to its
- * parents children, otherwise -1.
- * </p>
- * @return insertion index or -1
- */
- public int getIndex();
-
- /**
- * Returns the total number of children this element has, or -1 if unknown. Note
- * that this number may be greater than the number of child delta nodes for this
- * node, since not all children may be reporting deltas.
- * <p>
- * This attribute is required when expanding or selecting an element.
- * </p>
- *
- * @return total number of child elements this element has
- */
- public int getChildCount();
-
- /**
- * Accepts the given visitor.
- *
- * @param visitor
- * @since 3.3
- */
- public void accept(IModelDeltaVisitor visitor);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDeltaVisitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDeltaVisitor.java
deleted file mode 100644
index 1d4154651..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelDeltaVisitor.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-
-/**
- * An objects that visits model deltas.
- *
- * @since 3.3
- */
-public interface IModelDeltaVisitor {
-
- /**
- * Visits the given model delta.
- *
- * @param delta the delta to visit
- * @param depth depth in the delta where 0 == root node
- * @return <code>true</code> if the model delta's children should
- * be visited; <code>false</code> if they should be skipped.
- */
- public boolean visit(IModelDelta delta, int depth);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxy.java
deleted file mode 100644
index 65613521d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxy.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * A model proxy represents a model for a specific presentation context and
- * fires deltas to notify listeners of changes in the model. A model proxy
- * is created by a model proxy factory.
- * <p>
- * When an element is added to an asynchronous viewer, its associated model proxy
- * factory is queried to create a model proxy for that element. The model proxy
- * is then installed into the viewer and the viewer listens to model deltas
- * in order to update that element. Generally, a model proxy factory creates
- * model proxies for root elements in a model, and then represents all elements
- * within that model for a specific presentation context.
- * </p>
- * <p>
- * Clients may implement this interface. Implementation of this interface
- * must subclass {@link AbstractModelProxy}.
- * </p>
- * @see IModelDelta
- * @see IModelProxyFactory
- * @see IModelChangedListener
- * @see ICheckboxModelProxy
- * @since 3.2
- */
-public interface IModelProxy {
-
- /**
- * Notification this model proxy has been created and is about to be installed
- * in the following context. This is the first method called after a model proxy
- * is created.
- * <p>
- * This method is called by the asynchronous viewer framework and should not
- * be called by clients.
- * </p>
- * @param context presentation context in which the proxy will be installed
- */
- public void init(IPresentationContext context);
-
- /**
- * Notification this model proxy has been installed in the specified
- * viewer. This indicates that the model proxy has been created and registered
- * model change listeners are ready to process deltas.
- * <p>
- * This method is called by the asynchronous viewer framework and should not
- * be called by clients.
- * </p>
- * @param viewer viewer
- * @since 3.3
- */
- public void installed(Viewer viewer);
-
- /**
- * Disposes this model proxy.
- * <p>
- * This method is called by the asynchronous viewer framework and should not
- * be called by clients.
- * </p>
- */
- public void dispose();
-
- /**
- * Registers the given listener for model delta notification.
- *
- * @param listener model delta listener
- */
- public void addModelChangedListener(IModelChangedListener listener);
-
- /**
- * Unregisters the given listener from model delta notification.
- *
- * @param listener model delta listener
- */
- public void removeModelChangedListener(IModelChangedListener listener);
-
- /**
- * Returns whether this proxy has been disposed.
- *
- * @return whether this proxy has been disposed
- * @since 3.3
- */
- public boolean isDisposed();
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory.java
deleted file mode 100644
index e46847fdd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-/**
- * A model proxy factory creates model proxies for elements based on
- * specific presentation contexts. A model proxy factory is provided for
- * a model element by registering a model proxy factory adapter for
- * an element.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see IModelProxy
- * @see IModelDelta
- * @since 3.2
- */
-public interface IModelProxyFactory {
- /**
- * Creates and returns a model proxy for the given element in the specified
- * context or <code>null</code> if none.
- *
- * @param element model element to create a model proxy for
- * @param context presentation context
- * @return model proxy or <code>null</code>
- */
- public IModelProxy createModelProxy(Object element, IPresentationContext context);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory2.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory2.java
deleted file mode 100644
index 2bbd8114e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelProxyFactory2.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Freescale Semiconductor and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Freescale Semiconductor - initial API and implementation � Bug 241336
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-import org.eclipse.jface.viewers.TreePath;
-
-/**
- * A model proxy factory creates model proxies for elements based on
- * specific presentation contexts. A model proxy factory is provided for
- * a model element by registering a model proxy factory adapter for
- * an element.
- * <p>
- * This interface is an alternative to the {@link IModelProxyFactory}
- * interface. Unlike its predecessor <code>IModelProxyFactory2</code> allows
- * the full path to the tree element to be specified when creating an
- * <code>IModelProxy<code> instance. Using the full patch allows models to
- * provide proper model deltas even if the root element of this proxy is at
- * variable or unknown location in the viewer.
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see IModelProxyFactory
- * @see IModelProxy
- * @see IModelDelta
- *
- * @since 3.6
- */
-public interface IModelProxyFactory2 {
- /**
- * Creates and returns a model proxy for the given element in the specified
- * context or <code>null</code> if none.
- *
- * @param input viewer input context
- * @param path to model element to create a model proxy for
- * @param context presentation context
- * @return model proxy or <code>null</code>
- */
- public IModelProxy createTreeModelProxy(Object input, TreePath path, IPresentationContext context);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicy.java
deleted file mode 100644
index c0fec6504..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicy.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-import org.eclipse.jface.viewers.ISelection;
-
-/**
- * Resolves selection conflicts within a model. When
- * a selection exists in a viewer, and a client asks
- * to set another selection, the selection policy for
- * that model is asked to determine whether the new
- * selection should override the previous selection.
- * When a selection is from a different model, the
- * original selection is maintained if its model selection
- * policy specifies the selection to be 'sticky'.
- * <p>
- * A selection policy is obtained by querying for the selection
- * policy factory for a given element. The selection policy factory
- * will then be asked to create a model selection policy adapter.
- * The adapter represents selections from an instance of a model.
- * </p>
- *
- * @see IModelSelectionPolicyFactory
- * @since 3.2
- */
-public interface IModelSelectionPolicy {
-
- /**
- * Returns whether the given selection is contained in
- * this model.
- *
- * @param selection
- * @param context
- * @return
- */
- public boolean contains(ISelection selection, IPresentationContext context);
-
- /**
- * Returns whether the candidate selection overrides the
- * existing selection. The policy is only asked about selections
- * that it contains.
- *
- * @param existing
- * @param candidate
- * @param context
- * @return
- */
- public boolean overrides(ISelection existing, ISelection candidate, IPresentationContext context);
-
- /**
- * Returns whether the given selection should be maintained in the
- * face of a selection attempt from a different model.
- *
- * @param selection
- * @param context
- * @return
- */
- public boolean isSticky(ISelection selection, IPresentationContext context);
-
- /**
- * Replaces an invalid selection.
- * <p>
- * This method is called if a model change picked up by a viewer
- * results in an invalid selection. For instance if an element contained in
- * the selection has been removed from the viewer, the selection policy associated
- * with the invalid selection is free to specify a new selection. The default
- * selection policy returns the <code>newSelection</code> as is (with missing
- * elements removed). Model selection policies may implement a different strategy
- * for picking a new selection when the old selection becomes invalid.
- * </p>
- *
- * @param invalidSelection
- * the selection before the viewer was updated
- * @param newSelection
- * the selection after the update, or <code>null</code> if none
- * @return new selection or <code>null</code> if none
- */
- public ISelection replaceInvalidSelection(ISelection invalidSelection, ISelection newSelection);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicyFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicyFactory.java
deleted file mode 100644
index d318f8e07..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IModelSelectionPolicyFactory.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-
-/**
- * A model selection policy factory creates a model selection policy for an element based on
- * a specific presentation context. A model selection policy factory is provided for
- * a model element by registering a model selection policy factory adapter for
- * an element.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see IModelSelectionPolicy
- * @since 3.2
- */
-public interface IModelSelectionPolicyFactory {
- /**
- * Creates and returns a model selection policy for the given element in the specified
- * context or <code>null</code> if none.
- *
- * @param element model element to create a selection policy for
- * @param context presentation context
- * @return model selection policy or <code>null</code>
- */
- public IModelSelectionPolicy createModelSelectionPolicyAdapter(Object element, IPresentationContext context);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java
deleted file mode 100644
index 780d18a6e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech (Wind River) - added a breadcrumb mode to Debug view (Bug 252677)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-import org.eclipse.jface.util.IPropertyChangeListener;
-
-/**
- * Context in which an asynchronous request has been made.
- * <p>
- * Clients may implement and extend this interface to provide
- * special contexts. Implementations must subclass {@link PresentationContext}.
- * </p>
- * @since 3.2
- */
-public interface IPresentationContext {
-
- /**
- * Property name used for property change notification when the columns
- * in a presentation context change.
- */
- public static final String PROPERTY_COLUMNS = "PROPERTY_COLUMNS"; //$NON-NLS-1$
-
- /**
- * Returns identifiers of the visible columns in the order
- * labels should be provided, or <code>null</code> if columns
- * are not being displayed. Label providers use this
- * information.
- *
- * @return visible column identifiers or <code>null</code>
- * @see IColumnPresentation
- */
- public String[] getColumns();
-
- /**
- * Registers the given listener for property change notification.
- *
- * @param listener property listener
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener);
-
- /**
- * Unregisters the given listener from property change notification.
- *
- * @param listener property listener.
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener);
-
- /**
- * Returns the id of this presentation context. Usually this is the id of
- * the associated part. However, when no part is associated with this context,
- * the id may exist on its own. Allows for a context that is not tied to a part.
- *
- * @return id
- * @since 3.3
- */
- public String getId();
-
- /**
- * Sets the specified property and notifies listeners of changes.
- *
- * @param property property name
- * @param value property value
- */
- public void setProperty(String property, Object value);
-
- /**
- * Returns the property with the specified name or <code>null</code>
- * if none.
- *
- * @param property property name
- * @return property value or <code>null</code>
- */
- public Object getProperty(String property);
-
- /**
- * Disposes this presentation context. Called by the framework
- * when the associated viewer is disposed.
- */
- public void dispose();
-
- /**
- * Returns all keys of properties currently set in this context,
- * possibly an empty collection
- *
- * @return keys of all current properties
- * @since 3.4
- */
- public String[] getProperties();
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStateUpdateListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStateUpdateListener.java
deleted file mode 100644
index d88ae2946..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStateUpdateListener.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-
-/**
- * Listener for viewer state updates.
- *
- * @since 3.6
- */
-public interface IStateUpdateListener {
-
- /**
- * Notification that a sequence of state saving updates are starting.
- */
- public void stateSaveUpdatesBegin(Object input);
-
- /**
- * Notification that viewer updates are complete. Corresponds to
- * a <code>viewerUpdatesBegin()</code> notification.
- */
- public void stateSaveUpdatesComplete(Object input);
-
- /**
- * Notification that a sequence of viewer updates are starting.
- */
- public void stateRestoreUpdatesBegin(Object input);
-
- /**
- * Notification that viewer updates are complete. Corresponds to
- * a <code>viewerUpdatesBegin()</code> notification.
- */
- public void stateRestoreUpdatesComplete(Object input);
-
- /**
- * Notification that a specific update has started within
- * a sequence of updates.
- *
- * @param update update
- */
- public void stateUpdateStarted(Object input, IViewerUpdate update);
-
- /**
- * Notification that a specific update has completed within a
- * sequence of updates.
- *
- * @param update update
- */
- public void stateUpdateComplete(Object input, IViewerUpdate update);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStatusMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStatusMonitor.java
deleted file mode 100644
index 0ba8af669..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IStatusMonitor.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-
-/**
- * A progress monitor that accepts a status. This common base interface is used
- * to make non-blocking requests on models that may reply asynchronously. A request
- * may be cancelled by the caller or by the client fulfilling the request (by
- * calling <code>setCancelled(true)</code> on the request). Failure and error
- * states are reported by setting a status on a monitor. When a request
- * is complete, the client fulfilling the request must call <code>done()</code> on the
- * monitor, whether the update succeeds, fails, or is cancelled.
- * <p>
- * Clients accepting a status monitor are expected to poll the
- * monitor (using <code>isCanceled</code>) periodically and abort at their
- * earliest convenience if a request is cancelled.
- * </p>
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * @since 3.3
- * <p>
- * <strong>EXPERIMENTAL</strong>. This interface has been added as
- * part of a work in progress. There is no guarantee that this API will
- * remain unchanged during the 3.3 release cycle. Please do not use this API
- * without consulting with the Platform/Debug team.
- * </p>
- */
-public interface IStatusMonitor extends IProgressMonitor {
-
- /**
- * Sets the status for a request, possibly <code>null</code>.
- * When a request fails, the status indicates why the request failed.
- * A <code>null</code> status is considered to be successful.
- *
- * @param status request status
- */
- public void setStatus(IStatus status);
-
- /**
- * Returns the status of this request, or <code>null</code>.
- *
- * @return request status - <code>null</code> is equivalent
- * to an OK status
- */
- public IStatus getStatus();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputProvider.java
deleted file mode 100644
index dca273093..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputProvider.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-
-/**
- * A viewer input provider allows a view to translate the active debug
- * context into a viewer input (such that the active debug context does
- * not have to be the input to a viewer). Used in conjunction with a
- * {@link ViewerInputService}.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.4
- * @see IViewerInputUpdate
- * @see ViewerInputService
- */
-public interface IViewerInputProvider {
-
- /**
- * Asynchronously determine the viewer input to the based on the active
- * debug context and presentation context.
- *
- * @param update provides details about the request and stores the newly
- * computed viewer input
- */
- public void update(IViewerInputUpdate update);
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputRequestor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputRequestor.java
deleted file mode 100644
index 1ac26036e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputRequestor.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-/**
- * Clients using a {@link ViewerInputService} implement this interface to be notified of
- * the computed viewer input.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see ViewerInputService
- * @since 3.4
- */
-public interface IViewerInputRequestor {
-
- /**
- * Notification that a viewer input update request is complete. The given update
- * contains the result of the request, which may have been canceled.
- *
- * @param update viewer input update request
- */
- public void viewerInputComplete(IViewerInputUpdate update);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputUpdate.java
deleted file mode 100644
index d56225ef3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerInputUpdate.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-
-/**
- * A request to provide a viewer input for a given element and presentation context.
- * Allows a view to translate the active debug context into an appropriate viewer
- * input element.
- * <p>
- * Clients requesting a viewer input update may implement this interface.
- * </p>
- * @since 3.4
- *
- */
-public interface IViewerInputUpdate extends IViewerUpdate {
-
- /**
- * Sets the input to use for this request's presentation context, or <code>null</code>
- * if none (empty viewer). The source used to derive the viewer input is available
- * from this request's <code>getElement()</code> method.
- *
- * @param element viewer input for this request's presentation context, possibly <code>null</code>
- */
- public void setInputElement(Object element);
-
- /**
- * Returns the computed viewer input or <code>null</code> if none. The return value of this method
- * only contains valid data if this request is complete (i.e. <code>done()</code> has been called).
- *
- * @return viewer input or <code>null</code>
- */
- public Object getInputElement();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdate.java
deleted file mode 100644
index f2a5be0a3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdate.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-import org.eclipse.debug.core.IRequest;
-import org.eclipse.jface.viewers.TreePath;
-
-/**
- * A context sensitive viewer update request.
- * <p>
- * Clients are not intended to implement this interface.
- * </p>
- * @since 3.3
- */
-public interface IViewerUpdate extends IRequest {
-
- /**
- * Returns the context this update was requested in.
- *
- * @return context this update was requested in
- */
- public IPresentationContext getPresentationContext();
-
- /**
- * Returns the model element associated with this request.
- *
- * @return associated model element
- */
- public Object getElement();
-
- /**
- * Returns the viewer tree path to the model element associated with this
- * request. An empty path indicates a root element.
- *
- * @return tree path, possibly empty
- */
- public TreePath getElementPath();
-
- /**
- * Returns the element that was the viewer input at the time the
- * request was made, possibly <code>null</code>.
- *
- * @return viewer input element, possibly <code>null</code>
- * @since 3.4
- */
- public Object getViewerInput();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdateListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdateListener.java
deleted file mode 100644
index c8b9d923e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IViewerUpdateListener.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-
-/**
- * Notified of viewer updates.
- *
- * @since 3.3
- */
-public interface IViewerUpdateListener {
-
- /**
- * Notification that a sequence of viewer updates are starting.
- */
- public void viewerUpdatesBegin();
-
- /**
- * Notification that viewer updates are complete. Corresponds to
- * a <code>viewerUpdatesBegin()</code> notification.
- */
- public void viewerUpdatesComplete();
-
- /**
- * Notification that a specific update has started within
- * a sequence of updates.
- *
- * @param update update
- */
- public void updateStarted(IViewerUpdate update);
-
- /**
- * Notification that a specific update has completed within a
- * sequence of updates.
- *
- * @param update update
- */
- public void updateComplete(IViewerUpdate update);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java
deleted file mode 100644
index 0f900c3d1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - Fix for viewer state save/restore [188704]
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-
-
-
-/**
- * A model delta. Used to create model deltas.
- * <p>
- * Clients may instantiate this class; not intended to be subclassed.
- * </p>
- * @see org.eclipse.debug.internal.ui.viewers.IModelDelta
- * @since 3.2
- */
-public class ModelDelta implements IModelDelta {
-
- private IModelDelta fParent;
- private Object fElement;
- private int fFlags;
- private ModelDelta[] fNodes = EMPTY_NODES;
- private Object fReplacement;
- private int fIndex = -1;
- private int fChildCount = -1;
- private static final ModelDelta[] EMPTY_NODES = new ModelDelta[0];
-
- /**
- * Constructs a new delta for the given element.
- *
- * @param element model element
- * @param flags change flags
- */
- public ModelDelta(Object element, int flags) {
- fElement = element;
- fFlags = flags;
- }
-
- /**
- * Constructs a new delta for the given element to be replaced
- * with the specified replacement element.
- *
- * @param element model element
- * @param replacement replacement element
- * @param flags change flags
- */
- public ModelDelta(Object element, Object replacement, int flags) {
- fElement = element;
- fReplacement = replacement;
- fFlags = flags;
- }
-
- /**
- * Constructs a new delta for the given element to be inserted at
- * the specified index.
- *
- * @param element model element
- * @param index insertion position
- * @param flags change flags
- */
- public ModelDelta(Object element, int index, int flags) {
- fElement = element;
- fIndex = index;
- fFlags = flags;
- }
-
- /**
- * Constructs a new delta for the given element at the specified index
- * relative to its parent with the given number of children.
- *
- * @param element model element
- * @param index insertion position
- * @param flags change flags
- * @param childCount number of children this node has
- */
- public ModelDelta(Object element, int index, int flags, int childCount) {
- fElement = element;
- fIndex = index;
- fFlags = flags;
- fChildCount = childCount;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getElement()
- */
- public Object getElement() {
- return fElement;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getFlags()
- */
- public int getFlags() {
- return fFlags;
- }
-
- /**
- * Adds a child node to this delta with the given element and change flags,
- * and returns the child delta.
- *
- * @param element child element to add
- * @param flags change flags for child
- * @return newly created child delta
- */
- public ModelDelta addNode(Object element, int flags) {
- ModelDelta node = new ModelDelta(element, flags);
- node.setParent(this);
- addDelta(node);
- return node;
- }
-
- /**
- * Returns the child delta for the given element, or <code>null</code> if none.
- *
- * @param element child element
- * @return corresponding delta node, or <code>null</code>
- */
- public ModelDelta getChildDelta(Object element) {
- if (fNodes != null) {
- for (int i = 0; i < fNodes.length; i++) {
- ModelDelta delta = fNodes[i];
- if (element.equals(delta.getElement())) {
- return delta;
- }
- }
- }
- return null;
- }
-
- /**
- * Adds a child node to this delta to replace the given element with the
- * specified replacement element and change flags, and returns the
- * newly created child delta.
- *
- * @param element child element to add to this delta
- * @param replacement replacement element for the child element
- * @param flags change flags
- * @return newly created child delta
- */
- public ModelDelta addNode(Object element, Object replacement, int flags) {
- ModelDelta node = new ModelDelta(element, replacement, flags);
- node.setParent(this);
- addDelta(node);
- return node;
- }
-
- /**
- * Adds a child delta to this delta to insert the specified element at
- * the given index, and returns the newly created child delta.
- *
- * @param element child element in insert
- * @param index index of insertion
- * @param flags change flags
- * @return newly created child delta
- */
- public ModelDelta addNode(Object element, int index, int flags) {
- ModelDelta node = new ModelDelta(element, index, flags);
- node.setParent(this);
- addDelta(node);
- return node;
- }
-
- /**
- * Adds a child delta to this delta at the specified index with the
- * given number of children, and returns the newly created child delta.
- *
- * @param element child element in insert
- * @param index index of the element relative to parent
- * @param flags change flags
- * @param numChildren the number of children the element has
- * @return newly created child delta
- */
- public ModelDelta addNode(Object element, int index, int flags, int numChildren) {
- ModelDelta node = new ModelDelta(element, index, flags, numChildren);
- node.setParent(this);
- addDelta(node);
- return node;
- }
-
- /**
- * Sets the parent delta of this delta
- *
- * @param node parent delta
- */
- void setParent(ModelDelta node) {
- fParent = node;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getParent()
- */
- public IModelDelta getParentDelta() {
- return fParent;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getReplacementElement()
- */
- public Object getReplacementElement() {
- return fReplacement;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getIndex()
- */
- public int getIndex() {
- return fIndex;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getNodes()
- */
- public IModelDelta[] getChildDeltas() {
- return fNodes;
- }
-
- private void addDelta(ModelDelta delta) {
- if (fNodes.length == 0) {
- fNodes = new ModelDelta[]{delta};
- } else {
- ModelDelta[] nodes = new ModelDelta[fNodes.length + 1];
- System.arraycopy(fNodes, 0, nodes, 0, fNodes.length);
- nodes[fNodes.length] = delta;
- fNodes = nodes;
- }
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append("Model Delta Start\n"); //$NON-NLS-1$
- appendDetail(" ", buf, this); //$NON-NLS-1$
- buf.append("Model Delta End\n"); //$NON-NLS-1$
- return buf.toString();
- }
-
- private void appendDetail(String indent, StringBuffer buf, IModelDelta delta) {
- buf.append(indent);
- buf.append("Element: "); //$NON-NLS-1$
- buf.append(delta.getElement());
- buf.append('\n');
- buf.append(indent);
- buf.append(" Flags: "); //$NON-NLS-1$
- int flags = delta.getFlags();
- if (flags == 0) {
- buf.append("NO_CHANGE"); //$NON-NLS-1$
- } else {
- if ((flags & IModelDelta.ADDED) > 0) {
- buf.append("ADDED | "); //$NON-NLS-1$
- }
- if ((flags & IModelDelta.CONTENT) > 0) {
- buf.append("CONTENT | "); //$NON-NLS-1$
- }
- if ((flags & IModelDelta.COLLAPSE) > 0) {
- buf.append("COLLAPSE | "); //$NON-NLS-1$
- }
- if ((flags & IModelDelta.EXPAND) > 0) {
- buf.append("EXPAND | "); //$NON-NLS-1$
- }
- if ((flags & IModelDelta.INSERTED) > 0) {
- buf.append("INSERTED | "); //$NON-NLS-1$
- }
- if ((flags & IModelDelta.REMOVED) > 0) {
- buf.append("REMOVED | "); //$NON-NLS-1$
- }
- if ((flags & IModelDelta.REPLACED) > 0) {
- buf.append("REPLACED | "); //$NON-NLS-1$
- }
- if ((flags & IModelDelta.SELECT) > 0) {
- buf.append("SELECT | "); //$NON-NLS-1$
- }
- if ((flags & IModelDelta.STATE) > 0) {
- buf.append("STATE | "); //$NON-NLS-1$
- }
- if ((flags & IModelDelta.INSTALL) > 0) {
- buf.append("INSTALL | "); //$NON-NLS-1$
- }
- if ((flags & IModelDelta.UNINSTALL) > 0) {
- buf.append("UNINSTALL | "); //$NON-NLS-1$
- }
- if ((flags & IModelDelta.REVEAL) > 0) {
- buf.append("REVEAL | "); //$NON-NLS-1$
- }
- if ((flags & IModelDelta.FORCE) > 0) {
- buf.append("FORCE | "); //$NON-NLS-1$
- }
-
- }
- buf.append('\n');
- buf.append(indent);
- buf.append(" Index: "); //$NON-NLS-1$
- buf.append(delta.getIndex());
- buf.append(" Child Count: "); //$NON-NLS-1$
- buf.append(delta.getChildCount());
- buf.append('\n');
- IModelDelta[] nodes = delta.getChildDeltas();
- for (int i = 0; i < nodes.length; i++) {
- appendDetail(indent + " ", buf, nodes[i]); //$NON-NLS-1$
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta#getChildCount()
- */
- public int getChildCount() {
- return fChildCount;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta#accept(org.eclipse.debug.internal.ui.viewers.provisional.IModelDeltaVisitor)
- */
- public void accept(IModelDeltaVisitor visitor) {
- doAccept(visitor, 0);
- }
-
- protected void doAccept(IModelDeltaVisitor visitor, int depth) {
- if (visitor.visit(this, depth)) {
- IModelDelta[] childDeltas = getChildDeltas();
- for (int i = 0; i < childDeltas.length; i++) {
- ((ModelDelta)childDeltas[i]).doAccept(visitor, depth+1);
- }
- }
- }
-
- /**
- * Sets this delta's element
- *
- * @param element
- */
- public void setElement(Object element) {
- fElement = element;
- }
-
- /**
- * Sets this delta's flags.
- *
- * @param flags
- */
- public void setFlags(int flags) {
- fFlags = flags;
- }
-
- /**
- * Sets this delta's child count.
- *
- * @param count
- */
- public void setChildCount(int count) {
- fChildCount = count;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java
deleted file mode 100644
index 22c752441..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - added saving and restoring properties
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.ui.IElementFactory;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Presentation context.
- * <p>
- * Clients may instantiate and subclass this class.
- * </p>
- * @since 3.2
- */
-public class PresentationContext implements IPresentationContext {
-
- private static final String PRESENTATION_CONTEXT_PROPERTIES = "PRESENTATION_CONTEXT_PROPERTIES"; //$NON-NLS-1$
- private static final String BOOLEAN = "BOOLEAN"; //$NON-NLS-1$
- private static final String STRING = "STRING"; //$NON-NLS-1$
- private static final String INTEGER = "INTEGER"; //$NON-NLS-1$
- private static final String PERSISTABLE = "PERSISTABLE"; //$NON-NLS-1$
-
- private String fId;
- private ListenerList fListeners = new ListenerList();
- private Map fProperties = new HashMap();
-
- /**
- * Constructs a presentation context for the given id.
- *
- * @param id presentation context id
- */
- public PresentationContext(String id) {
- fId = id;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext#getColumns()
- */
- public String[] getColumns() {
- return (String[]) getProperty(IPresentationContext.PROPERTY_COLUMNS);
- }
-
- /**
- * Fires a property change event to all registered listeners
- *
- * @param property property name
- * @param oldValue old value or <code>null</code>
- * @param newValue new value or <code>null</code>
- */
- protected void firePropertyChange(String property, Object oldValue, Object newValue) {
- if (!fListeners.isEmpty()) {
- final PropertyChangeEvent event = new PropertyChangeEvent(this, property, oldValue, newValue);
- Object[] listeners = fListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final IPropertyChangeListener listener = (IPropertyChangeListener) listeners[i];
- SafeRunner.run(new SafeRunnable() {
- public void run() throws Exception {
- listener.propertyChange(event);
- }
- });
- }
- }
- }
-
- /**
- * Sets the visible column ids.
- *
- * @param ids column identifiers
- */
- public void setColumns(String[] ids) {
- setProperty(IPresentationContext.PROPERTY_COLUMNS, ids);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext#dispose()
- */
- public void dispose() {
- fListeners.clear();
- fProperties.clear();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener) {
- fListeners.add(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener) {
- fListeners.remove(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext#getId()
- */
- public String getId() {
- return fId;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext#getProperty(java.lang.String)
- */
- public Object getProperty(String property) {
- synchronized (fProperties) {
- return fProperties.get(property);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext#setProperty(java.lang.String, java.lang.Object)
- */
- public void setProperty(String property, Object value) {
- synchronized (fProperties) {
- Object oldValue = fProperties.get(property);
- if (!isEqual(oldValue, value)) {
- fProperties.put(property, value);
- firePropertyChange(property, oldValue, value);
- }
- }
- }
-
- /**
- * Restores the presentation context properties from the given memento.
- * @param memento Memento to restore from.
- */
- public void initProperties(IMemento memento) {
- IMemento presentationMemento = null;
-
- IMemento[] mementos = memento.getChildren(PRESENTATION_CONTEXT_PROPERTIES);
- for (int i = 0; i < mementos.length; i++) {
- if (getId().equals(mementos[i].getID())) {
- presentationMemento = mementos[i];
- break;
- }
- }
-
- if (presentationMemento != null) {
- IMemento[] stringProperties = presentationMemento.getChildren(STRING);
- for (int i = 0; i < stringProperties.length; i++) {
- fProperties.put(stringProperties[i].getID(), stringProperties[i].getString(STRING));
- }
-
- IMemento[] integerMementos = presentationMemento.getChildren(INTEGER);
- for (int i = 0; i < integerMementos.length; i++) {
- fProperties.put(integerMementos[i].getID(), integerMementos[i].getInteger(INTEGER));
- }
-
- IMemento[] booleanMementos = presentationMemento.getChildren(BOOLEAN);
- for (int i = 0; i < booleanMementos.length; i++) {
- fProperties.put(booleanMementos[i].getID(), booleanMementos[i].getBoolean(BOOLEAN));
- }
-
- IMemento[] persistableMementos = presentationMemento.getChildren(PERSISTABLE);
- for (int i = 0; i < persistableMementos.length; i++) {
- String factoryID = persistableMementos[i].getString(PERSISTABLE);
- if (factoryID != null) {
- IElementFactory factory = PlatformUI.getWorkbench().getElementFactory(factoryID);
- if (factory != null) {
- Object element = factory.createElement(persistableMementos[i]);
- if (element != null) {
- fProperties.put(persistableMementos[i].getID(), element);
- }
- }
- }
- }
- }
- }
-
- /**
- * Saves the current presentation context properties to the given memento.
- * @param memento Memento to save to.
- */
- public void saveProperites(IMemento memento) {
- if (fProperties.size() == 0) {
- return;
- }
-
- IMemento properties = memento.createChild(PRESENTATION_CONTEXT_PROPERTIES, getId());
- Iterator iterator = fProperties.entrySet().iterator();
- while (iterator.hasNext()) {
- Map.Entry entry = (Entry) iterator.next();
- if (entry.getValue() instanceof String) {
- IMemento value = properties.createChild(STRING, (String)entry.getKey());
- value.putString(STRING, (String)entry.getValue());
- } else if (entry.getValue() instanceof Integer) {
- IMemento value = properties.createChild(INTEGER, (String)entry.getKey());
- value.putInteger(INTEGER, ((Integer)entry.getValue()).intValue());
- } else if (entry.getValue() instanceof Boolean) {
- IMemento value = properties.createChild(BOOLEAN, (String)entry.getKey());
- value.putBoolean(BOOLEAN, ((Boolean)entry.getValue()).booleanValue());
- } else if (entry.getValue() instanceof IPersistableElement) {
- IPersistableElement persistable = (IPersistableElement)entry.getValue();
- IMemento value = properties.createChild(PERSISTABLE, (String)entry.getKey());
- value.putString(PERSISTABLE, persistable.getFactoryId());
- persistable.saveState(value);
- }
- }
- }
-
- private boolean isEqual(Object a, Object b) {
- if (a == null) {
- return b == null;
- }
- return a.equals(b);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext#getProperties()
- */
- public String[] getProperties() {
- synchronized (fProperties) {
- Set keys = fProperties.keySet();
- return (String[]) keys.toArray(new String[keys.size()]);
- }
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewer.java
deleted file mode 100644
index 3de2a9760..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewer.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech (Wind River) - added a breadcrumb mode to Debug view (Bug 252677)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-import org.eclipse.debug.internal.ui.viewers.model.InternalTreeModelViewer;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.ViewerLabel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IMemento;
-
-/**
- * A tree viewer for a model.
- * <p>
- * Style flags supported by this viewer are the same as for {@link TreeViewer},
- * except:
- * <ul>
- * <li>SWT.VIRTUAL - Indicates that the viewer should be in lazy mode. This
- * flag is required when creating this viewer.
- * <li>SWT.POP_UP - Indicates that the viewer is used in a popup window, and it
- * should ignore requests from the model to select, expand, or collapse tree
- * elements.</li>
- * </ul>
- * </p>
- * @since 3.3
- * @noextend Clients may instantiate this class. Clients may not subclass this class.
- */
-public class TreeModelViewer extends InternalTreeModelViewer {
-
- public TreeModelViewer(Composite parent, int style, IPresentationContext context) {
- super(parent, style, context);
- }
-
- /**
- * Returns this viewer's presentation context.
- *
- * @return presentation context
- */
- public IPresentationContext getPresentationContext() {
- return super.getPresentationContext();
- }
-
- /**
- * Registers the given listener for model delta notification.
- *
- * @param listener model delta listener
- */
- public void addModelChangedListener(IModelChangedListener listener) {
- super.addModelChangedListener(listener);
- }
-
- /**
- * Unregisters the given listener from model delta notification.
- *
- * @param listener model delta listener
- */
- public void removeModelChangedListener(IModelChangedListener listener) {
- super.removeModelChangedListener(listener);
- }
-
- /**
- * Registers the specified listener for view update notifications.
- *
- * @param listener listener
- */
- public void addViewerUpdateListener(IViewerUpdateListener listener) {
- super.addViewerUpdateListener(listener);
- }
-
- /**
- * Removes the specified listener from update notifications.
- *
- * @param listener listener
- */
- public void removeViewerUpdateListener(IViewerUpdateListener listener) {
- super.removeViewerUpdateListener(listener);
- }
-
- /**
- * Returns whether columns can be toggled on/off for this viewer's current
- * input element.
- *
- * @return whether columns can be toggled on/off
- */
- public boolean canToggleColumns() {
- return super.canToggleColumns();
- }
-
- /**
- * Returns the current column presentation for this viewer, or <code>null</code>
- * if none.
- *
- * @return column presentation or <code>null</code>
- */
- public IColumnPresentation getColumnPresentation() {
- return super.getColumnPresentation();
- }
-
- /**
- * Returns identifiers of the visible columns in this viewer, or <code>null</code>
- * if there are currently no columns.
- *
- * @return visible columns identifiers or <code>null</code>
- */
- public String[] getVisibleColumns() {
- return super.getVisibleColumns();
- }
-
- /**
- * Initializes viewer state from the memento
- *
- * @param memento
- */
- public void initState(IMemento memento) {
- super.initState(memento);
- }
-
- /**
- * Save viewer state into the given memento.
- *
- * @param memento
- */
- public void saveState(IMemento memento) {
- super.saveState(memento);
- }
-
- /**
- * Returns whether columns are being displayed currently.
- *
- * @return
- */
- public boolean isShowColumns() {
- return super.isShowColumns();
- }
-
- /**
- * Resets any persisted column size for the given columns
- *
- * @param columnIds array of column identifiers
- */
- public void resetColumnSizes(String[] columnIds) {
- super.resetColumnSizes(columnIds);
- }
-
- /**
- * Toggles columns on/off for the current column presentation, if any.
- *
- * @param show whether to show columns if the current input supports
- * columns
- */
- public void setShowColumns(boolean show) {
- super.setShowColumns(show);
- }
-
- /**
- * Sets the visible columns for this viewer. Id's correspond to
- * column identifiers from a column presentation. Use <code>null</code>
- * or an empty collection to display default columns for the current
- * column presentation. Only effects the current column presentation.
- *
- * @param ids column identifiers or <code>null</code>
- */
- public void setVisibleColumns(String[] ids) {
- super.setVisibleColumns(ids);
- }
-
- public ViewerLabel getElementLabel(TreePath path, String columnId) {
- return super.getElementLabel(path, columnId);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java
deleted file mode 100644
index 4da98b87c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River - Pawel Piech - NPE when closing the Variables view (Bug 213719)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-import org.eclipse.debug.internal.ui.viewers.model.ViewerAdapterService;
-import org.eclipse.debug.internal.ui.viewers.model.ViewerInputUpdate;
-
-/**
- * Service to compute a viewer input from a source object
- * for a given presentation context.
- * <p>
- * This class may be instantiated. Not intended to be subclassed.
- * </p>
- * @since 3.4
- */
-public class ViewerInputService {
-
- // previous update request, cancelled when a new request comes in
- private IViewerInputUpdate fPendingUpdate = null;
-
- private IViewerInputRequestor fRequestor = null;
-
- private TreeModelViewer fViewer;
-
- private IViewerInputRequestor fProxyRequest = new IViewerInputRequestor() {
- public void viewerInputComplete(final IViewerInputUpdate update) {
- synchronized (ViewerInputService.this) {
- fPendingUpdate = null;
- }
- fRequestor.viewerInputComplete(update);
- }
- };
-
- /**
- * Constructs a viewer input service for the given requester and presentation context.
- *
- * @param requestor client requesting viewer inputs
- * @param context context for which inputs are required
- */
- public ViewerInputService(TreeModelViewer viewer, IViewerInputRequestor requestor) {
- fRequestor = requestor;
- fViewer = viewer;
- }
-
- /**
- * Resolves a viewer input derived from the given source object.
- * Reports the result to the given this service's requester. A requester may be called back
- * in the same or thread, or asynchronously in a different thread. Cancels any previous
- * incomplete request from this service's requester.
- *
- * @param source source from which to derive a viewer input
- */
- public void resolveViewerInput(Object source) {
- IViewerInputProvider provdier = ViewerAdapterService.getInputProvider(source);
- synchronized (this) {
- // cancel any pending update
- if (fPendingUpdate != null) {
- fPendingUpdate.cancel();
- }
- fPendingUpdate = new ViewerInputUpdate(fViewer.getPresentationContext(), fViewer.getInput(), fProxyRequest, source);
- }
- if (provdier == null) {
- fPendingUpdate.setInputElement(source);
- fRequestor.viewerInputComplete(fPendingUpdate);
- } else {
- provdier.update(fPendingUpdate);
- }
- }
-
- /**
- * Disposes this viewer input service, canceling any pending jobs.
- */
- public synchronized void dispose() {
- if (fPendingUpdate != null) {
- fPendingUpdate.cancel();
- fPendingUpdate = null;
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTreeModelViewer.java
deleted file mode 100644
index 3134ab2ac..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTreeModelViewer.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.model.provisional;
-
-import org.eclipse.debug.internal.ui.viewers.model.InternalVirtualTreeModelViewer;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.ViewerLabel;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IMemento;
-
-/**
- * A virtual tree model viewer. This viewer does not have a user
- * interface. Instead, clients configure and access the viewer's data through
- * its public methods.
- * <p>
- * Style flags supported by this viewer are:
- * <ul>
- * <li>SWT.VIRTUAL - Indicates that the viewer should be in lazy mode:
- * retrieving only elements that are requested.</li>
- * <li>SWT.POP_UP - Indicates that the viewer should ignore requests from the
- * model to select, expand, or collapse tree elements.</li>
- * </ul>
- * </p>
- * @since 3.5
- * @noextend
- */
-public class VirtualTreeModelViewer extends InternalVirtualTreeModelViewer {
-
-
- public VirtualTreeModelViewer(Display display, int style, IPresentationContext context) {
- super(display, style, context);
- }
-
-
- /**
- * Returns this viewer's presentation context.
- *
- * @return presentation context
- */
- public IPresentationContext getPresentationContext() {
- return super.getPresentationContext();
- }
-
- /**
- * Registers the given listener for model delta notification.
- *
- * @param listener model delta listener
- */
- public void addModelChangedListener(IModelChangedListener listener) {
- super.addModelChangedListener(listener);
- }
-
- /**
- * Unregisters the given listener from model delta notification.
- *
- * @param listener model delta listener
- */
- public void removeModelChangedListener(IModelChangedListener listener) {
- super.removeModelChangedListener(listener);
- }
-
- /**
- * Registers the specified listener for view update notifications.
- *
- * @param listener listener
- */
- public void addViewerUpdateListener(IViewerUpdateListener listener) {
- super.addViewerUpdateListener(listener);
- }
-
- /**
- * Removes the specified listener from update notifications.
- *
- * @param listener listener
- */
- public void removeViewerUpdateListener(IViewerUpdateListener listener) {
- super.removeViewerUpdateListener(listener);
- }
-
- /**
- * Returns whether columns can be toggled on/off for this viewer's current
- * input element.
- *
- * @return whether columns can be toggled on/off
- */
- public boolean canToggleColumns() {
- return super.canToggleColumns();
- }
-
- /**
- * Returns the current column presentation for this viewer, or <code>null</code>
- * if none.
- *
- * @return column presentation or <code>null</code>
- */
- public IColumnPresentation getColumnPresentation() {
- return super.getColumnPresentation();
- }
-
- /**
- * Returns identifiers of the visible columns in this viewer, or <code>null</code>
- * if there are currently no columns.
- *
- * @return visible columns identifiers or <code>null</code>
- */
- public String[] getVisibleColumns() {
- return super.getVisibleColumns();
- }
-
- /**
- * Initializes viewer state from the memento
- *
- * @param memento
- */
- public void initState(IMemento memento) {
- super.initState(memento);
- }
-
- /**
- * Save viewer state into the given memento.
- *
- * @param memento
- */
- public void saveState(IMemento memento) {
- super.saveState(memento);
- }
-
- /**
- * Returns whether columns are being displayed currently.
- *
- * @return
- */
- public boolean isShowColumns() {
- return super.isShowColumns();
- }
-
- /**
- * Toggles columns on/off for the current column presentation, if any.
- *
- * @param show whether to show columns if the current input supports
- * columns
- */
- public void setShowColumns(boolean show) {
- super.setShowColumns(show);
- }
-
- /**
- * Sets the visible columns for this viewer. Id's correspond to
- * column identifiers from a column presentation. Use <code>null</code>
- * or an empty collection to display default columns for the current
- * column presentation. Only effects the current column presentation.
- *
- * @param ids column identifiers or <code>null</code>
- */
- public void setVisibleColumns(String[] ids) {
- super.setVisibleColumns(ids);
- }
-
- public void updateViewer(IModelDelta delta) {
- super.updateViewer(delta);
- }
-
- public ViewerLabel getElementLabel(TreePath path, String columnId) {
- return super.getElementLabel(path, columnId);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractColumnPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractColumnPresentation.java
deleted file mode 100644
index 1467375d0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractColumnPresentation.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.provisional;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * Common function for a column presentation.
- * <p>
- * Clients implementing <code>IColumnPresentation</code> must subclass this class.
- * </p>
- * @since 3.2
- */
-public abstract class AbstractColumnPresentation implements IColumnPresentation {
-
- private IPresentationContext fContext;
-
- /**
- * Empty array of strings
- */
- protected static final String[] EMPTY = new String[0];
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#init(org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- public void init(IPresentationContext context) {
- fContext = context;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#dispose()
- */
- public void dispose() {
- fContext = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#getImageDescriptor(java.lang.String)
- */
- public ImageDescriptor getImageDescriptor(String id) {
- return null;
- }
-
- /**
- * Returns the context this column presentation is installed in.
- *
- * @return presentation context
- */
- protected IPresentationContext getPresentationContext() {
- return fContext;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractModelProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractModelProxy.java
deleted file mode 100644
index c43a11d6d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractModelProxy.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.provisional;
-
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Common function for a model proxy.
- * <p>
- * Clients may subclass this class.
- * </p>
- * @since 3.2
- */
-public abstract class AbstractModelProxy implements IModelProxy {
-
- private IPresentationContext fContext;
- private Viewer fViewer;
- private boolean fDisposed = false;
-
- private ListenerList fListeners = new ListenerList();
-
- // debug flags
- public static boolean DEBUG_DELTAS = false;
-
- static {
- DEBUG_DELTAS = DebugUIPlugin.DEBUG && "true".equals( //$NON-NLS-1$
- Platform.getDebugOption("org.eclipse.debug.ui/debug/viewers/deltas")); //$NON-NLS-1$
- }
-
- protected Object[] getListeners() {
- synchronized (fListeners) {
- return fListeners.getListeners();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.IModelProxy#addModelChangedListener(org.eclipse.debug.internal.ui.viewers.IModelChangedListener)
- */
- public void addModelChangedListener(IModelChangedListener listener) {
- synchronized (fListeners) {
- fListeners.add(listener);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.IModelProxy#removeModelChangedListener(org.eclipse.debug.internal.ui.viewers.IModelChangedListener)
- */
- public void removeModelChangedListener(IModelChangedListener listener) {
- synchronized (fListeners) {
- fListeners.remove(listener);
- }
- }
-
- /**
- * Notifies registered listeners of the given delta.
- *
- * @param delta model delta to broadcast
- */
- public void fireModelChanged(IModelDelta delta) {
- final IModelDelta root = getRootDelta(delta);
- Object[] listeners = getListeners();
- if (DEBUG_DELTAS) {
- DebugUIPlugin.debug("FIRE DELTA: " + delta.toString()); //$NON-NLS-1$
- }
- for (int i = 0; i < listeners.length; i++) {
- final IModelChangedListener listener = (IModelChangedListener) listeners[i];
- ISafeRunnable safeRunnable = new ISafeRunnable() {
- public void handleException(Throwable exception) {
- DebugUIPlugin.log(exception);
- }
-
- public void run() throws Exception {
- listener.modelChanged(root, AbstractModelProxy.this);
- }
-
- };
- SafeRunner.run(safeRunnable);
- }
- }
-
- /**
- * Returns the root node of the given delta.
- *
- * @param delta delta node
- * @return returns the root of the given delta
- */
- protected IModelDelta getRootDelta(IModelDelta delta) {
- IModelDelta parent = delta.getParentDelta();
- while (parent != null) {
- delta = parent;
- parent = delta.getParentDelta();
- }
- return delta;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.IModelProxy#dispose()
- */
- public synchronized void dispose() {
- fDisposed = true;
- fContext = null;
- fViewer = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.IModelProxy#init(org.eclipse.debug.internal.ui.viewers.IPresentationContext)
- */
- public void init(IPresentationContext context) {
- fContext = context;
- }
-
- /**
- * Returns the context this model proxy is installed in.
- *
- * @return presentation context, or <code>null</code> if this
- * model proxy has been disposed
- */
- public IPresentationContext getPresentationContext() {
- return fContext;
- }
-
- /* (non-Javadoc)
- *
- * Subclasses should override as required.
- *
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IModelProxy#installed(org.eclipse.jface.viewers.Viewer)
- */
- public void installed(Viewer viewer) {
- fViewer = viewer;
- }
-
- /**
- * Returns the viewer this proxy is installed in.
- *
- * @return viewer or <code>null</code> if not installed
- */
- protected Viewer getViewer() {
- return fViewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy#isDisposed()
- */
- public synchronized boolean isDisposed() {
- return fDisposed;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousContentAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousContentAdapter.java
deleted file mode 100644
index 01635d16e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousContentAdapter.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.viewers.provisional;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.internal.ui.viewers.AsynchronousSchedulingRuleFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-
-/**
- * Abstract implementation of an asynchronous content adapter.
- * <p>
- * Clients may subclass this class.
- * </p>
- * @since 3.2
- */
-public abstract class AsynchronousContentAdapter implements IAsynchronousContentAdapter {
-
- protected static final Object[] EMPTY = new Object[0];
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousContentAdapter#retrieveChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.provisional.IChildrenRequestMonitor)
- */
- public void retrieveChildren(final Object parent, final IPresentationContext context, final IChildrenRequestMonitor result) {
- Job job = new Job("Retrieving Children") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- if (!monitor.isCanceled()) {
- computeChildren(parent, context, result);
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(getRetrieveChildrenRule(parent, context));
- job.schedule();
- }
-
- /**
- * Returns the scheduling rule for jobs retrieving children.
- *
- * @param parent
- * @param context
- * @return scheduling rule or <code>null</code>
- */
- protected ISchedulingRule getRetrieveChildrenRule(Object parent, IPresentationContext context) {
- return AsynchronousSchedulingRuleFactory.getDefault().newSerialPerObjectRule(context);
- }
-
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousContentAdapter#isContainer(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.provisional.IContainerRequestMonitor)
- */
- public void isContainer(final Object element, final IPresentationContext context, final IContainerRequestMonitor result) {
- Job job = new Job("Computing hasChildren") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- if (!monitor.isCanceled()) {
- computeIsContainer(element, context, result);
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.setRule(getIsContainerRule(element, context));
- job.schedule();
- }
-
- /**
- * Returns the scheduling rule for jobs determining if an element is a container.
- *
- * @param parent
- * @param context
- * @return scheduling rule or <code>null</code>
- */
- protected ISchedulingRule getIsContainerRule(Object parent, IPresentationContext context) {
- return AsynchronousSchedulingRuleFactory.getDefault().newSerialPerObjectRule(context);
- }
-
- /**
- * Computes the children for the given parent in the specified context.
- *
- * @param parent parent to retrieve children for
- * @param context presentation context
- * @param monitor result to report to
- */
- protected void computeChildren(Object parent, IPresentationContext context, IChildrenRequestMonitor monitor) {
- if (!monitor.isCanceled()) {
- IStatus status = Status.OK_STATUS;
- try {
- if (supportsContext(context)) {
- monitor.addChildren(getChildren(parent, context));
- }
- } catch (CoreException e) {
- status = e.getStatus();
- }
- monitor.setStatus(status);
- monitor.done();
- }
- }
-
- /**
- * Computes whether the given element is a container.
- *
- * @param parent potential parent
- * @param context presentation context
- * @param monitor result to report to
- */
- protected void computeIsContainer(Object parent, IPresentationContext context, IContainerRequestMonitor monitor) {
- if (!monitor.isCanceled()) {
- IStatus status = Status.OK_STATUS;
- try {
- monitor.setIsContainer(hasChildren(parent, context));
- } catch (CoreException e) {
- status = e.getStatus();
- }
- monitor.setStatus(status);
- monitor.done();
- }
- }
-
- /**
- * Returns the children for the given parent in the specified context.
- *
- * @param parent element to retrieve children for
- * @param context context children will be presented in
- * @return children
- * @throws CoreException if an exception occurs retrieving children
- */
- protected abstract Object[] getChildren(Object parent, IPresentationContext context) throws CoreException;
-
- /**
- * Returns whether the given element has children in the specified context.
- *
- * @param element element that may have children
- * @param context context element will be presented in
- * @return whether the given element has children in the specified context
- * @throws CoreException if an exception occurs determining whether the
- * element has children
- */
- protected abstract boolean hasChildren(Object element, IPresentationContext context) throws CoreException;
-
- /**
- * Returns whether this adapter supports the given context.
- *
- * @param context
- * @return whether this adapter supports the given context
- */
- protected boolean supportsContext(IPresentationContext context) {
- return supportsPartId(context.getId());
- }
-
- /**
- * Returns whether this adapter provides content in the specified part.
- *
- * @param id part id
- * @return whether this adapter provides content in the specified part
- */
- protected abstract boolean supportsPartId(String id);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousLabelAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousLabelAdapter.java
deleted file mode 100644
index c2377e093..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousLabelAdapter.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.viewers.provisional;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.internal.ui.viewers.AsynchronousSchedulingRuleFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.views.launch.DebugElementHelper;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * Abstract implementation of an asynchronous label adapter
- * <p>
- * Clients may subclass this class.
- * </p>
- * @since 3.2
- */
-public abstract class AsynchronousLabelAdapter implements IAsynchronousLabelAdapter {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.viewers.IAsynchronousLabelAdapter#retrieveLabel(java.lang.Object, org.eclipse.debug.ui.viewers.IPresentationContext, org.eclipse.debug.ui.viewers.ILabelRequestMonitor)
- */
- public void retrieveLabel(final Object element, final IPresentationContext context, final ILabelRequestMonitor result) {
- Job job = null;
- if (requiresUIJob(element)) {
- job = new UIJob("Retrieving labels") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- computeLabels(element, context, result);
- return Status.OK_STATUS;
- }
- };
- } else {
- job = new Job("Retrieving labels") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- computeLabels(element, context, result);
- return Status.OK_STATUS;
- }
- };
- }
- job.setSystem(true);
- job.setRule(getLabelRule(element, context));
- job.schedule();
- }
-
- /**
- * Returns the scheduling rule for label jobs.
- *
- * @param element
- * @param context
- * @return scheduling rule or <code>null</code>
- */
- protected ISchedulingRule getLabelRule(Object element, IPresentationContext context) {
- return AsynchronousSchedulingRuleFactory.getDefault().newSerialPerObjectRule(context);
- }
-
- /**
- * Returns whether this label adapter requires to be run in the UI thread.
- * By default, label jobs are not run in the UI thread. Subclasses should
- * override if required.
- *
- * @return whether this label adapter requires to be run in the UI thread.
- */
- protected boolean requiresUIJob(Object object) {
- return !DebugElementHelper.requiresUIThread(object);
- }
-
- /**
- * Computes label attributes for the given element in the specified context.
- *
- * @param element element to compute label for
- * @param context presentation context
- * @param result monitor to report results to
- */
- protected void computeLabels(Object element, IPresentationContext context, ILabelRequestMonitor monitor) {
- if (!monitor.isCanceled()) {
- IStatus status = Status.OK_STATUS;
- try {
- monitor.setLabels(getLabels(element, context));
- if (!monitor.isCanceled()) {
- monitor.setImageDescriptors(getImageDescriptors(element, context));
- }
- if (!monitor.isCanceled()) {
- monitor.setFontDatas(getFontDatas(element, context));
- }
- if (!monitor.isCanceled()) {
- monitor.setBackgrounds(getBackgrounds(element, context));
- }
- if (!monitor.isCanceled()) {
- monitor.setForegrounds(getForegrounds(element, context));
- }
- } catch (CoreException e) {
- status = e.getStatus();
- }
- if (!monitor.isCanceled()) {
- monitor.setStatus(status);
- monitor.done();
- }
- }
- }
-
- /**
- * Returns a label for the give element in the specified context.
- *
- * @param element element to compute label for
- * @param context presentation context
- * @return label
- * @exception CoreException if an exception occurs computing label
- */
- protected abstract String[] getLabels(Object element, IPresentationContext context) throws CoreException;
-
- /**
- * Returns an image descriptor for the given element in the specified context
- * or <code>null</code>.
- *
- * @param element element to compute image descriptor for
- * @param context presentation context
- * @return image descriptor or <code>null</code>
- * @throws CoreException if an exception occurs computing image descriptor
- */
- protected abstract ImageDescriptor[] getImageDescriptors(Object element, IPresentationContext context) throws CoreException;
-
- /**
- * Returns font data for the given element in the specified context or <code>null</code>
- * to use the default font.
- *
- * @param element element to compute font data for
- * @param context presentation context
- * @return font data or <code>null</code>
- * @throws CoreException if an exception occurs computing font data
- */
- protected abstract FontData[] getFontDatas(Object element, IPresentationContext context) throws CoreException;
-
- /**
- * Returns a foreground color for the given element in the specified context or <code>null</code>
- * to use the default color.
- *
- * @param element element to compute color for
- * @param context presentation context
- * @return color or <code>null</code>
- * @throws CoreException if an exception occurs computing color
- */
- protected abstract RGB[] getForegrounds(Object element, IPresentationContext context) throws CoreException;
-
- /**
- * Returns a background color for the given element in the specified context or <code>null</code>
- * to use the default color.
- *
- * @param element element to compute color for
- * @param context presentation context
- * @return color or <code>null</code>
- * @throws CoreException if an exception occurs computing color
- */
- protected abstract RGB[] getBackgrounds(Object element, IPresentationContext context) throws CoreException;
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IAsynchronousContentAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IAsynchronousContentAdapter.java
deleted file mode 100644
index faf3f89b9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IAsynchronousContentAdapter.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.provisional;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-
-/**
- * Provides content for elements in an asynchronous viewer. Note that implementations
- * must provide content asynchronously.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.2
- */
-public interface IAsynchronousContentAdapter {
-
- /**
- * Asynchronously retrieves the children of the given parent reporting to the
- * given monitor. If unable to retrieve children, an exception should be reported
- * to the monitor with an appropriate status.
- *
- * @param parent the element to retrieve children for
- * @param context the context in which children have been requested
- * @param monitor request monitor to report children to
- */
- public void retrieveChildren(Object parent, IPresentationContext context, IChildrenRequestMonitor result);
-
- /**
- * Asynchronously determines whether the given element contains children in the specified
- * context reporting the result to the given monitor. If unable to determine
- * whether the element has children, an exception should be reported to the monitor
- * with an appropriate status.
- *
- * @param element the element on which children may exist
- * @param context the context in which children may exist
- * @param monitor request monitor to report the result to
- */
- public void isContainer(Object element, IPresentationContext context, IContainerRequestMonitor result);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IAsynchronousLabelAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IAsynchronousLabelAdapter.java
deleted file mode 100644
index d17025d38..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IAsynchronousLabelAdapter.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.provisional;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-
-/**
- * Provides labels for elements. Note that implementations
- * are must provide labels asynchronously.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.2
- */
-public interface IAsynchronousLabelAdapter {
-
- /**
- * Asynchronously retrieves the label of the given object reporting to
- * the given monitor. If unable to retrieve label information, an exception should be
- * reported to the monitor with an appropriate status.
- *
- * @param object the element for which a label is requested
- * @param context the context in which the label has been requested
- * @param monitor request monitor to report the result to
- */
- public void retrieveLabel(Object object, IPresentationContext context, ILabelRequestMonitor result);
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IChildrenRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IChildrenRequestMonitor.java
deleted file mode 100644
index 7b41a6ca4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IChildrenRequestMonitor.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.provisional;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IStatusMonitor;
-
-/**
- * A request monitor that collects children from an asynchronous tree content adapter.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * @since 3.2
- */
-public interface IChildrenRequestMonitor extends IStatusMonitor {
-
- /**
- * Adds the given child to this request.
- *
- * @param child child to add
- */
- public void addChild(Object child);
-
- /**
- * Adds the given children to this request.
- *
- * @param children children to add
- */
- public void addChildren(Object[] children);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IContainerRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IContainerRequestMonitor.java
deleted file mode 100644
index a73b6bfa2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/IContainerRequestMonitor.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.provisional;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IStatusMonitor;
-
-/**
- * A request monitor that collects whether an element contains
- * children.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * @since 3.2
- */
-public interface IContainerRequestMonitor extends IStatusMonitor {
-
- /**
- * Sets whether an element contains children.
- *
- * @param container whether an element contains children
- */
- public void setIsContainer(boolean container);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/ILabelRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/ILabelRequestMonitor.java
deleted file mode 100644
index eb8a93f51..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/ILabelRequestMonitor.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.provisional;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IStatusMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * A request monitor that collects attributes of a element's
- * label.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- * @since 3.2
- */
-public interface ILabelRequestMonitor extends IStatusMonitor {
-
- /**
- * Sets the text of the label. Cannot be <code>null</code>.
- *
- * @param text
- */
- public void setLabels(String[] text);
-
- /**
- * Sets the font of the label.
- *
- * @param fontData
- */
- public void setFontDatas(FontData[] fontData);
-
- /**
- * Sets the image of the label.
- *
- * @param image
- */
- public void setImageDescriptors(ImageDescriptor[] image);
-
- /**
- * Sets the foreground color of the label.
- *
- * @param foreground
- */
- public void setForegrounds(RGB[] foreground);
-
- /**
- * Sets the background color of the label.
- *
- * @param background
- */
- public void setBackgrounds(RGB[] background);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugEventHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugEventHandler.java
deleted file mode 100644
index cd8d568ba..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugEventHandler.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
-
-/**
- * Handles debug events for an event update policy in a viewer.
- *
- * @since 3.2
- */
-public abstract class DebugEventHandler {
-
- private AbstractModelProxy fModelProxy;
-
- /**
- * Constructs an event handler for the given model proxy.
- *
- * @param policy
- */
- public DebugEventHandler(AbstractModelProxy proxy) {
- fModelProxy = proxy;
- }
-
- /**
- * Disposes this event handler
- */
- public synchronized void dispose() {
- fModelProxy = null;
- }
-
- /**
- * Returns the model proxy this event handler working for,
- * or <code>null</code> if disposed.
- *
- * @return
- */
- protected synchronized AbstractModelProxy getModelProxy() {
- return fModelProxy;
- }
-
- /**
- * Returns whether this event handler handles the given event
- *
- * @param event event to handle
- * @return whether this event handler handles the given event
- */
- protected abstract boolean handlesEvent(DebugEvent event);
-
- /**
- * Handles a create event.
- *
- * @param event
- */
- protected void handleCreate(DebugEvent event) {
- refreshRoot(event);
- }
-
- /**
- * Handles a terminate event.
- *
- * @param event
- */
- protected void handleTerminate(DebugEvent event) {
- refreshRoot(event);
- }
-
- /**
- * Handles a suspend event.
- *
- * @param event
- */
- protected void handleSuspend(DebugEvent event) {
- refreshRoot(event);
- }
-
- /**
- * Handles a resume event for which a suspend is expected shortly (<500ms).
- *
- * @param event
- */
- protected void handleResumeExpectingSuspend(DebugEvent event) {
- // do nothing unless the suspend times out
- }
-
- /**
- * Handles a resume event that is not expecting an immediate suspend event
- *
- * @param event
- */
- protected void handleResume(DebugEvent event) {
- refreshRoot(event);
- }
-
- /**
- * Handles a change event.
- *
- * @param event
- */
- protected void handleChange(DebugEvent event) {
- refreshRoot(event);
- }
-
- /**
- * Handles an unknown event.
- *
- * @param event
- */
- protected void handleOther(DebugEvent event) {
- refreshRoot(event);
- }
-
- /**
- * Notification that a pending suspend event was not received for the given
- * resume event within the timeout period.
- *
- * @param resume resume event with missing suspend event
- */
- protected void handleSuspendTimeout(DebugEvent event) {
- refreshRoot(event);
- }
-
- /**
- * Handles the given suspend event which caused a timeout. It is
- * parired with its original resume event.
- *
- * @param suspend suspend event
- * @param resume resume event
- */
- protected void handleLateSuspend(DebugEvent suspend, DebugEvent resume) {
- refreshRoot(suspend);
- }
-
- /**
- * Fires a model delta to indicate that the launch manager should be refreshed.
- * Subclasses should override individual handle events to provide deltas that
- * better reflect the actual change in the model.
- */
- protected void refreshRoot(DebugEvent event) {
- ModelDelta delta = new ModelDelta(DebugPlugin.getDefault().getLaunchManager(), IModelDelta.CONTENT);
- fireDelta(delta);
- }
-
- /**
- * Fires the given delta, unless this handler has been disposed.
- *
- * @param delta
- */
- protected void fireDelta(IModelDelta delta) {
- AbstractModelProxy modelProxy = getModelProxy();
- if (modelProxy != null) {
- modelProxy.fireModelChanged(delta);
- }
- }
-
- /**
- * Returns whether this handler has been disposed.
- *
- * @return whether this handler has been disposed
- */
- protected synchronized boolean isDisposed() {
- return fModelProxy == null;
- }
-
- protected int indexOf(Object[] list, Object element) {
- for (int i = 0; i < list.length; i++) {
- if (element.equals(list[i])) {
- return i;
- }
- }
- return -1;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetEventHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetEventHandler.java
deleted file mode 100644
index de9cca250..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetEventHandler.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
-
-
-/**
- * @since 3.2
- */
-public class DebugTargetEventHandler extends DebugEventHandler {
-
- /**
- * Constructs an event handler for a debug target on the given viewer.
- *
- * @param viewer
- */
- public DebugTargetEventHandler(AbstractModelProxy proxy) {
- super(proxy);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler#handlesEvent(org.eclipse.debug.core.DebugEvent)
- */
- protected boolean handlesEvent(DebugEvent event) {
- return event.getSource() instanceof IDebugTarget;
- }
-
- protected void handleChange(DebugEvent event) {
- int flags = IModelDelta.STATE;
- if (event.getDetail() == DebugEvent.CONTENT) {
- flags = flags | IModelDelta.CONTENT;
- }
- fireDelta((IDebugTarget) event.getSource(), flags);
- }
-
- protected void handleCreate(DebugEvent event) {
- fireDelta((IDebugTarget) event.getSource(), IModelDelta.EXPAND);
- }
-
- protected void handleResume(DebugEvent event) {
- fireDelta((IDebugTarget) event.getSource(), IModelDelta.CONTENT | IModelDelta.STATE | IModelDelta.SELECT);
- }
-
- protected void handleSuspend(DebugEvent event) {
- fireDelta((IDebugTarget) event.getSource(), IModelDelta.CONTENT | IModelDelta.STATE);
- }
-
- protected void handleTerminate(DebugEvent event) {
- fireDelta((IDebugTarget) event.getSource(), IModelDelta.CONTENT | IModelDelta.STATE | IModelDelta.UNINSTALL);
- }
-
- private void fireDelta(IDebugTarget target, int flags) {
- ModelDelta root = new ModelDelta(DebugPlugin.getDefault().getLaunchManager(), IModelDelta.NO_CHANGE);
- ModelDelta delta = root.addNode(target.getLaunch(), IModelDelta.NO_CHANGE);
- delta.addNode(target, flags);
- fireDelta(root);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetProxy.java
deleted file mode 100644
index 88c643fee..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetProxy.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Default model proxy for a debug target.
- *
- * @since 3.2
- */
-public class DebugTargetProxy extends EventHandlerModelProxy {
-
- private IDebugTarget fDebugTarget;
-
- public DebugTargetProxy(IDebugTarget target) {
- fDebugTarget = target;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#dispose()
- */
- public synchronized void dispose() {
- super.dispose();
- fDebugTarget = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#containsEvent(org.eclipse.debug.core.DebugEvent)
- */
- protected boolean containsEvent(DebugEvent event) {
- Object source = event.getSource();
- if (source instanceof IDebugElement) {
- IDebugTarget debugTarget = ((IDebugElement) source).getDebugTarget();
- // an expression can return null for debug target
- if (debugTarget != null) {
- return debugTarget.equals(fDebugTarget);
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#createEventHandlers()
- */
- protected DebugEventHandler[] createEventHandlers() {
- ThreadEventHandler threadEventHandler = new ThreadEventHandler(this);
- return new DebugEventHandler[] { new DebugTargetEventHandler(this), threadEventHandler,
- new StackFrameEventHandler(this, threadEventHandler) };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IModelProxy#installed(org.eclipse.jface.viewers.Viewer)
- */
- public void installed(Viewer viewer) {
- // select any thread that is already suspended after installation
- IDebugTarget target = fDebugTarget;
- if (target != null) {
- ModelDelta delta = getNextSuspendedThreadDelta(null, false);
- if (delta == null) {
- try {
- ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
- ILaunch launch = target.getLaunch();
- int launchIndex = indexOf(manager.getLaunches(), target.getLaunch());
- int targetIndex = indexOf(target.getLaunch().getChildren(), target);
- delta = new ModelDelta(manager, IModelDelta.NO_CHANGE);
- ModelDelta node = delta.addNode(launch, launchIndex, IModelDelta.NO_CHANGE, target.getLaunch().getChildren().length);
- node = node.addNode(target, targetIndex, IModelDelta.EXPAND | IModelDelta.SELECT, target.getThreads().length);
- } catch (DebugException e) {
- // In case of exception do not fire delta
- return;
- }
- }
- // expand the target if no suspended thread
- fireModelChanged(delta);
- }
- }
-
- protected ModelDelta getNextSuspendedThreadDelta(IThread currentThread, boolean reverse) {
- IDebugTarget target = fDebugTarget;
- if (target != null) {
- try {
- IThread[] threads = target.getThreads();
- ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
- ILaunch launch = target.getLaunch();
- int launchIndex = indexOf(manager.getLaunches(), target.getLaunch());
- int targetIndex = indexOf(target.getLaunch().getChildren(), target);
- IThread chosen = null;
- int threadIndex = -1;
- // select the first thread with a breakpoint, or the first suspended thread
- // if none have breakpoints
- boolean takeNext = currentThread == null;
- int startIdx = reverse ? threads.length - 1 : 0;
- int endIdx = reverse ? -1 : threads.length;
- int increment = reverse ? -1 : 1;
- for (int i = startIdx; i != endIdx; i = i + increment) {
- IThread thread = threads[i];
- if (takeNext && thread.isSuspended()) {
- IBreakpoint[] bps = thread.getBreakpoints();
- if (bps != null && bps.length > 0) {
- chosen = thread;
- threadIndex = i;
- break;
- } else {
- if (chosen == null) {
- chosen = thread;
- threadIndex = i;
- }
- }
- }
- takeNext = takeNext || thread.equals(currentThread);
- }
- if (chosen != null) {
- IStackFrame frame = chosen.getTopStackFrame();
- if (frame != null) {
- ModelDelta delta = new ModelDelta(manager, IModelDelta.NO_CHANGE);
- ModelDelta node = delta.addNode(launch, launchIndex, IModelDelta.NO_CHANGE, target.getLaunch().getChildren().length);
- node = node.addNode(target, targetIndex, IModelDelta.NO_CHANGE, threads.length);
- node = node.addNode(chosen, threadIndex, IModelDelta.NO_CHANGE | IModelDelta.EXPAND, chosen.getStackFrames().length);
- node = node.addNode(frame, 0, IModelDelta.NO_CHANGE | IModelDelta.SELECT, 0);
- return delta;
- }
- }
- } catch (DebugException e) {
- }
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultExpressionModelProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultExpressionModelProxy.java
deleted file mode 100644
index 8c7105a3f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultExpressionModelProxy.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.core.model.IVariable;
-
-/**
- * @since 3.2
- *
- */
-public class DefaultExpressionModelProxy extends EventHandlerModelProxy {
-
- private IExpression fExpression;
-
- public DefaultExpressionModelProxy(IExpression expression) {
- fExpression = expression;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#dispose()
- */
- public synchronized void dispose() {
- super.dispose();
- fExpression = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#createEventHandlers()
- */
- protected DebugEventHandler[] createEventHandlers() {
- return new DebugEventHandler[]{new ExpressionEventHandler(this)};
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#containsEvent(org.eclipse.debug.core.DebugEvent)
- */
- protected boolean containsEvent(DebugEvent event) {
- // handles change events from expressions and debug targets
- if (event.getSource().equals(fExpression) || event.getSource().equals(fExpression.getDebugTarget())) {
- return true;
- }
- // have to consider change events on variables
- return event.getKind() == DebugEvent.CHANGE && event.getSource() instanceof IVariable;
- }
-
- /**
- * Returns this model's expression, or <code>null</code> if disposed.
- *
- * @return expression or <code>null</code>
- */
- protected IExpression getExpression() {
- return fExpression;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelProxyFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelProxyFactory.java
deleted file mode 100644
index 7892f6641..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelProxyFactory.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import org.eclipse.debug.core.IExpressionManager;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IWatchExpression;
-import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
-import org.eclipse.debug.internal.ui.memory.provisional.MemoryViewPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-public class DefaultModelProxyFactory implements IModelProxyFactory {
-
- public IModelProxy createModelProxy(Object element, IPresentationContext context) {
- String id = context.getId();
- if (IDebugUIConstants.ID_DEBUG_VIEW.equals(id)) {
- if (element instanceof IDebugTarget) {
- return new DebugTargetProxy((IDebugTarget)element);
- }
- if (element instanceof ILaunchManager) {
- return new LaunchManagerProxy();
- }
- if (element instanceof ILaunch) {
- return new LaunchProxy((ILaunch) element);
- }
- if (element instanceof IProcess) {
- return new ProcessProxy((IProcess)element);
- }
- }
- if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(id)) {
- if (element instanceof IStackFrame) {
- return new DefaultVariableViewModelProxy((IStackFrame)element);
- }
- }
- if (IDebugUIConstants.ID_EXPRESSION_VIEW.equals(id)) {
- if (element instanceof IExpressionManager) {
- return new ExpressionManagerModelProxy();
- }
- if (element instanceof IWatchExpression) {
- return new DefaultWatchExpressionModelProxy((IWatchExpression)element);
- }
- if (element instanceof IExpression) {
- return new DefaultExpressionModelProxy((IExpression)element);
- }
- }
- if (IDebugUIConstants.ID_REGISTER_VIEW.equals(id)) {
- if (element instanceof IStackFrame) {
- return new DefaultVariableViewModelProxy((IStackFrame)element);
- }
- }
- if (IDebugUIConstants.ID_MEMORY_VIEW.equals(id)) {
- if (element instanceof IMemoryBlockRetrieval)
- return new MemoryRetrievalProxy((IMemoryBlockRetrieval)element);
- }
-
- if (context instanceof MemoryViewPresentationContext)
- {
- if (((MemoryViewPresentationContext)context).getRendering() instanceof AbstractAsyncTableRendering)
- {
- if (element instanceof IMemoryBlock)
- return new MemoryBlockProxy((IMemoryBlock)element);
- }
- }
-
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelSelectionPolicyFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelSelectionPolicyFactory.java
deleted file mode 100644
index 6d87308e3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelSelectionPolicyFactory.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelSelectionPolicy;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelSelectionPolicyFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Default factory for selection policies.
- *
- * @since 3.2
- */
-public class DefaultModelSelectionPolicyFactory implements IModelSelectionPolicyFactory {
-
- public IModelSelectionPolicy createModelSelectionPolicyAdapter(Object element, IPresentationContext context) {
- if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) {
- if (element instanceof IDebugElement) {
- return new DefaultSelectionPolicy((IDebugElement)element);
- }
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultSelectionPolicy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultSelectionPolicy.java
deleted file mode 100644
index a19cf97d2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultSelectionPolicy.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech (Wind River) - added a breadcrumb mode to Debug view (Bug 252677)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelSelectionPolicy;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.ui.IDebugUIConstants;
-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.jface.viewers.TreeSelection;
-
-/**
- * Default selection policy for the debug view.
- *
- * @since 3.2
- */
-public class DefaultSelectionPolicy implements IModelSelectionPolicy {
-
- private IDebugElement fDebugElement;
-
- /**
- * Constructs a new selection policy for the given debug
- * element.
- *
- * @param element
- */
- public DefaultSelectionPolicy(IDebugElement element) {
- fDebugElement = element;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.viewers.IModelSelectionPolicy#contains(org.eclipse.jface.viewers.ISelection, org.eclipse.debug.ui.viewers.IPresentationContext)
- */
- public boolean contains(ISelection selection, IPresentationContext context) {
- if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) {
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- Object element = ss.getFirstElement();
- if (element instanceof IDebugElement) {
- IDebugElement debugElement = (IDebugElement) element;
- return fDebugElement.getDebugTarget().equals(debugElement.getDebugTarget());
- }
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.viewers.IModelSelectionPolicy#overrides(org.eclipse.jface.viewers.ISelection, org.eclipse.jface.viewers.ISelection, org.eclipse.debug.ui.viewers.IPresentationContext)
- */
- public boolean overrides(ISelection existing, ISelection candidate, IPresentationContext context) {
- if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) {
- if (existing instanceof IStructuredSelection && candidate instanceof IStructuredSelection) {
- IStructuredSelection ssExisting = (IStructuredSelection) existing;
- IStructuredSelection ssCandidate = (IStructuredSelection) candidate;
- return overrides(ssExisting.getFirstElement(), ssCandidate.getFirstElement());
- }
- }
- return true;
- }
-
- protected boolean overrides(Object existing, Object candidate) {
- if (existing == null) {
- return true;
- }
- if (existing.equals(candidate)) {
- return true;
- }
- if (existing instanceof IStackFrame && candidate instanceof IStackFrame) {
- IStackFrame curr = (IStackFrame) existing;
- IStackFrame next = (IStackFrame) candidate;
- return curr.getThread().equals(next.getThread()) || !isSticky(existing);
- }
- return !isSticky(existing);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.viewers.IModelSelectionPolicy#isSticky(org.eclipse.jface.viewers.ISelection, org.eclipse.debug.ui.viewers.IPresentationContext)
- */
- public boolean isSticky(ISelection selection, IPresentationContext context) {
- if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) {
- if (selection instanceof IStructuredSelection) {
- return isSticky(((IStructuredSelection)selection).getFirstElement());
- }
- }
- return false;
- }
-
- protected boolean isSticky(Object element) {
- if (element instanceof IStackFrame) {
- IStackFrame frame = (IStackFrame) element;
- return frame.isSuspended();
- }
- return false;
- }
-
- /**
- * If an attempt is made to select an invalid element, it usually indicates that the
- * currently selected element was removed from the model. Instead of leaving the
- * selection empty, attempt to select the parent element instead.
- *
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IModelSelectionPolicy#handleInvalidSelection(org.eclipse.jface.viewers.ISelection, org.eclipse.jface.viewers.ISelection)
- */
- public ISelection replaceInvalidSelection(ISelection selection, ISelection newSelection) {
- if (selection instanceof ITreeSelection) {
- TreePath[] paths = ((ITreeSelection)selection).getPaths();
- if (paths.length > 0 && paths[0].getSegmentCount() > 1) {
- return new TreeSelection(paths[0].getParentPath());
- }
- }
- return newSelection;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultVariableViewModelProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultVariableViewModelProxy.java
deleted file mode 100644
index dbab964af..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultVariableViewModelProxy.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IStackFrame;
-
-/**
- * Default update for variables view.
- *
- * @since 3.2
- */
-public class DefaultVariableViewModelProxy extends EventHandlerModelProxy {
-
- /**
- * Root model element for this update policy
- */
- private IStackFrame fFrame;
-
- /**
- * Constructs an update policy on the given target.
- *
- * @param target
- */
- public DefaultVariableViewModelProxy(IStackFrame frame) {
- super();
- fFrame = frame;
- }
-
- public void dispose() {
- super.dispose();
- fFrame = null;
- }
-
- protected DebugEventHandler[] createEventHandlers() {
- return new DebugEventHandler[] { new VariablesViewEventHandler(this, fFrame) };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#containsEvent(org.eclipse.debug.core.DebugEvent)
- */
- protected synchronized boolean containsEvent(DebugEvent event) {
- if (!isDisposed()) {
- Object source = event.getSource();
- if (source instanceof IDebugElement) {
- IDebugTarget debugTarget = ((IDebugElement) source).getDebugTarget();
- if (debugTarget != null) {
- // a debug target can be null for an IExpression
- return debugTarget.equals(fFrame.getDebugTarget());
- }
- }
- }
- return false;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultWatchExpressionModelProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultWatchExpressionModelProxy.java
deleted file mode 100644
index 63fe474ee..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultWatchExpressionModelProxy.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech - Bug 210023: Another NPE in DefaultWatchExpressionModelProxy
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IWatchExpression;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextService;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * Model proxy for the expressions view
- *
- * @see org.eclipse.debug.internal.ui.views.expression.ExpressionView
- * @see org.eclipse.debug.internal.ui.model.elements.ExpressionContentProvider
- * @see org.eclipse.debug.internal.ui.model.elements.ExpressionsViewMementoProvider
- *
- * @since 3.2
- */
-public class DefaultWatchExpressionModelProxy extends DefaultExpressionModelProxy implements IDebugContextListener {
-
- private IWorkbenchWindow fWindow;
-
- public DefaultWatchExpressionModelProxy(IWatchExpression expression) {
- super(expression);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy#installed(org.eclipse.jface.viewers.Viewer)
- */
- public void installed(final Viewer viewer) {
- super.installed(viewer);
- UIJob job = new UIJob("install watch expression model proxy") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if (!isDisposed()) {
- IWorkbenchWindow[] workbenchWindows = PlatformUI.getWorkbench().getWorkbenchWindows();
- for (int i = 0; i < workbenchWindows.length; i++) {
- IWorkbenchWindow window = workbenchWindows[i];
- if (viewer.getControl().getShell().equals(window.getShell())) {
- fWindow = window;
- break;
- }
- }
- if (fWindow == null) {
- fWindow = DebugUIPlugin.getActiveWorkbenchWindow();
- }
- IDebugContextService contextService = DebugUITools.getDebugContextManager().getContextService(fWindow);
- contextService.addDebugContextListener(DefaultWatchExpressionModelProxy.this);
- ISelection activeContext = contextService.getActiveContext();
- if (activeContext != null) {
- contextActivated(activeContext);
- }
- }
- return Status.OK_STATUS;
- }
-
- };
- job.setSystem(true);
- job.schedule();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.update.DefaultExpressionModelProxy#dispose()
- */
- public synchronized void dispose() {
- super.dispose();
- if (fWindow != null) {
- DebugUITools.getDebugContextManager().getContextService(fWindow).removeDebugContextListener(this);
- fWindow = null;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#createEventHandlers()
- */
- protected DebugEventHandler[] createEventHandlers() {
- return new DebugEventHandler[]{new ExpressionEventHandler(this)};
- }
-
- /**
- * Handles the activation of the specified debug context (i.e. the selection)
- * @param selection the specified context to 'activate'
- */
- protected void contextActivated(ISelection selection) {
- if (fWindow != null) {
- if (selection instanceof IStructuredSelection) {
- IDebugElement context = null;
- IStructuredSelection ss = (IStructuredSelection)selection;
- if (ss.size() < 2) {
- Object object = ss.getFirstElement();
- if (object instanceof IDebugElement) {
- context= (IDebugElement) object;
- } else if (object instanceof ILaunch) {
- context= ((ILaunch) object).getDebugTarget();
- }
- }
- IWatchExpression expression = (IWatchExpression)getExpression();
- if (expression != null){
- expression.setExpressionContext(context);
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.IDebugContextListener#debugContextChanged(org.eclipse.debug.ui.contexts.DebugContextEvent)
- */
- public void debugContextChanged(DebugContextEvent event) {
- if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
- contextActivated(event.getContext());
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/EventHandlerModelProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/EventHandlerModelProxy.java
deleted file mode 100644
index d2ec1d9af..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/EventHandlerModelProxy.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
-
-/**
- * @since 3.2
- */
-public abstract class EventHandlerModelProxy extends AbstractModelProxy implements IDebugEventSetListener {
-
- /**
- * Map of elements to timer tasks
- */
- private Map fTimerTasks = new HashMap();
-
- /**
- * Timer for timer tasks
- */
- private Timer fTimer = new Timer(true);
-
- /**
- * Map of event source to resume events with a pending suspend that timed
- * out.
- */
- private Map fPendingSuspends = new HashMap();
-
- /**
- * Event handlers for specific elements
- */
- private DebugEventHandler[] fHandlers = new DebugEventHandler[0];
-
- /**
- * Task used to update an element that resumed for a step or evaluation that
- * took too long to suspend.
- */
- private class PendingSuspendTask extends TimerTask {
-
- private DebugEvent fEvent;
-
- private DebugEventHandler fHandler;
-
- /**
- * Resume event for which there is a pending suspend.
- *
- * @param resume
- * event
- */
- public PendingSuspendTask(DebugEventHandler handler, DebugEvent resume) {
- fHandler = handler;
- fEvent = resume;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.util.TimerTask#run()
- */
- public void run() {
- synchronized (fPendingSuspends) {
- fPendingSuspends.put(fEvent.getSource(), fEvent);
- }
- dispatchSuspendTimeout(fHandler, fEvent);
- }
-
- }
-
- /**
- * Adds the given handler to this event update policy.
- *
- * @param handler
- */
- protected abstract DebugEventHandler[] createEventHandlers();
-
- public synchronized void dispose() {
- super.dispose();
- fTimer.cancel();
- fTimerTasks.clear();
- DebugPlugin.getDefault().removeDebugEventListener(this);
- for (int i = 0; i < fHandlers.length; i++) {
- DebugEventHandler handler = fHandlers[i];
- handler.dispose();
- }
- }
-
- public void init(IPresentationContext context) {
- super.init(context);
- DebugPlugin.getDefault().addDebugEventListener(this);
- fHandlers = createEventHandlers();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
- */
- public final void handleDebugEvents(DebugEvent[] events) {
- if (isDisposed()) {
- return;
- }
- for (int i = 0; i < events.length; i++) {
- DebugEvent event = events[i];
- if (containsEvent(event)) {
- for (int j = 0; j < fHandlers.length; j++) {
- DebugEventHandler handler = fHandlers[j];
- if (isDisposed()) {
- return;
- }
- if (handler.handlesEvent(event)) {
- switch (event.getKind()) {
- case DebugEvent.CREATE:
- dispatchCreate(handler, event);
- break;
- case DebugEvent.TERMINATE:
- dispatchTerminate(handler, event);
- break;
- case DebugEvent.SUSPEND:
- dispatchSuspend(handler, event);
- break;
- case DebugEvent.RESUME:
- dispatchResume(handler, event);
- break;
- case DebugEvent.CHANGE:
- dispatchChange(handler, event);
- break;
- default:
- dispatchOther(handler, event);
- break;
- }
- }
- }
- }
- }
- }
-
- protected boolean containsEvent(DebugEvent event) {
- return true;
- }
-
- /**
- * Dispatches a create event.
- *
- * @param event
- */
- protected void dispatchCreate(DebugEventHandler handler, DebugEvent event) {
- handler.handleCreate(event);
- }
-
- /**
- * Dispatches a terminate event.
- *
- * @param event
- */
- protected void dispatchTerminate(DebugEventHandler handler, DebugEvent event) {
- handler.handleTerminate(event);
- }
-
- /**
- * Dispatches a suspend event. Subclasses may override.
- *
- * @param event
- */
- protected void dispatchSuspend(DebugEventHandler handler, DebugEvent event) {
- // stop timer, if any
- synchronized (this) {
- TimerTask task = (TimerTask) fTimerTasks.remove(event.getSource());
- if (task != null) {
- task.cancel();
- }
- }
- DebugEvent resume = null;
- synchronized (this) {
- resume = (DebugEvent) fPendingSuspends.remove(event.getSource());
- }
- if (resume == null) {
- handler.handleSuspend(event);
- } else {
- handler.handleLateSuspend(event, resume);
- }
- }
-
- /**
- * Dispatches a resume event. By default, if the resume is for an evaluation
- * or a step, a timer is started to update the event source if the step or
- * evaluation takes more than 500ms. Otherwise the source is refreshed.
- * Subclasses may override.
- *
- * @param event
- */
- protected void dispatchResume(DebugEventHandler handler, DebugEvent event) {
- if (event.isEvaluation() || event.isStepStart()) {
- // start a timer to update if the corresponding suspend does not
- // come quickly
- synchronized (this) {
- if (!isDisposed()) {
- PendingSuspendTask task = new PendingSuspendTask(handler, event);
- fTimerTasks.put(event.getSource(), task);
- fTimer.schedule(task, 500);
- }
- }
- if (!isDisposed()) {
- handler.handleResumeExpectingSuspend(event);
- }
- } else {
- handler.handleResume(event);
- }
- }
-
- /**
- * Dispatches a change event.
- *
- * @param event
- */
- protected void dispatchChange(DebugEventHandler handler, DebugEvent event) {
- handler.handleChange(event);
- }
-
- /**
- * Dispatches an unknown event.
- *
- * @param event
- */
- protected void dispatchOther(DebugEventHandler handler, DebugEvent event) {
- handler.handleOther(event);
- }
-
- /**
- * Notification that a pending suspend event was not received for the given
- * resume event and handler within the timeout period.
- *
- * @param resume
- * resume event with missing suspend event
- */
- protected void dispatchSuspendTimeout(DebugEventHandler handler, DebugEvent resume) {
- handler.handleSuspendTimeout(resume);
- }
-
- /**
- * Returns the index of the given element in the list or -1 if
- * not present.
- *
- * @param list
- * @param element
- * @return index or -1 if not present
- */
- protected int indexOf(Object[] list, Object element) {
- for (int i = 0; i < list.length; i++) {
- if (element.equals(list[i])) {
- return i;
- }
- }
- return -1;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionEventHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionEventHandler.java
deleted file mode 100644
index bf4753243..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionEventHandler.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
-
-/**
- * Event handler for an expression.
- *
- * @since 3.2
- *
- */
-public class ExpressionEventHandler extends DebugEventHandler {
-
- public ExpressionEventHandler(AbstractModelProxy proxy) {
- super(proxy);
- }
-
- protected boolean handlesEvent(DebugEvent event) {
- return event.getKind() == DebugEvent.CHANGE;
- }
-
- protected void handleChange(DebugEvent event) {
- ModelDelta delta = new ModelDelta(DebugPlugin.getDefault().getExpressionManager(), IModelDelta.NO_CHANGE);
- IExpression expression = null;
- if (event.getSource() instanceof IExpression) {
- expression = (IExpression) event.getSource();
- int flags = IModelDelta.NO_CHANGE;
- if ((event.getDetail() & DebugEvent.STATE) != 0) {
- flags = flags | IModelDelta.STATE;
- }
- if ((event.getDetail() & DebugEvent.CONTENT) != 0) {
- flags = flags | IModelDelta.CONTENT;
- }
- delta.addNode(expression, flags);
- fireDelta(delta);
- }
- }
-
- protected void refreshRoot(DebugEvent event) {
- ModelDelta delta = new ModelDelta(DebugPlugin.getDefault().getExpressionManager(), IModelDelta.CONTENT);
- fireDelta(delta);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionManagerModelProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionManagerModelProxy.java
deleted file mode 100644
index 686cd0d2f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionManagerModelProxy.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IExpressionManager;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.internal.core.IExpressionsListener2;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
-import org.eclipse.jface.viewers.Viewer;
-
-
-/**
- * Model proxy that fires model delta updates for the ExpressionManager.
- *
- * @see org.eclipse.debug.internal.core.ExpressionManager
- */
-public class ExpressionManagerModelProxy extends AbstractModelProxy implements IExpressionsListener2 {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#init(org.eclipse.debug.internal.ui.viewers.IPresentationContext)
- */
- public void init(IPresentationContext context) {
- super.init(context);
- getExpressionManager().addExpressionListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy#installed(org.eclipse.jface.viewers.Viewer)
- */
- public void installed(Viewer viewer) {
- updateExpressions(getExpressionManager().getExpressions(), IModelDelta.INSTALL);
- }
-
- /**
- * @return the default expression manager from the debug plugin
- */
- protected IExpressionManager getExpressionManager() {
- return DebugPlugin.getDefault().getExpressionManager();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#dispose()
- */
- public synchronized void dispose() {
- super.dispose();
- getExpressionManager().removeExpressionListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.IExpressionsListener2#expressionsMoved(org.eclipse.debug.core.model.IExpression[], int)
- */
- public void expressionsMoved(IExpression[] expressions, int index){
- ModelDelta delta = new ModelDelta(getExpressionManager(), IModelDelta.NO_CHANGE);
- for (int i = 0; i < expressions.length; i++) {
- IExpression expression = expressions[i];
- delta.addNode(expression, IModelDelta.REMOVED);
- }
- for (int i = 0; i < expressions.length; i++) {
- IExpression expression = expressions[i];
- delta.addNode(expression, index+i, IModelDelta.INSERTED);
- }
- fireModelChanged(delta);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.IExpressionsListener2#expressionsInserted(org.eclipse.debug.core.model.IExpression[], int)
- */
- public void expressionsInserted(IExpression[] expressions, int index){
- ModelDelta delta = new ModelDelta(getExpressionManager(), IModelDelta.NO_CHANGE);
- for (int i = 0; i < expressions.length; i++) {
- IExpression expression = expressions[i];
- delta.addNode(expression, index+i, IModelDelta.INSERTED | IModelDelta.INSTALL);
- }
- fireModelChanged(delta);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IExpressionsListener#expressionsAdded(org.eclipse.debug.core.model.IExpression[])
- */
- public void expressionsAdded(IExpression[] expressions) {
- updateExpressions(expressions, IModelDelta.ADDED | IModelDelta.INSTALL);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IExpressionsListener#expressionsRemoved(org.eclipse.debug.core.model.IExpression[])
- */
- public void expressionsRemoved(IExpression[] expressions) {
- updateExpressions(expressions, IModelDelta.REMOVED | IModelDelta.UNINSTALL);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IExpressionsListener#expressionsChanged(org.eclipse.debug.core.model.IExpression[])
- */
- public void expressionsChanged(IExpression[] expressions) {
- updateExpressions(expressions, IModelDelta.CONTENT | IModelDelta.STATE);
- }
-
- private void updateExpressions(IExpression[] expressions, int flags) {
- ModelDelta delta = new ModelDelta(getExpressionManager(), IModelDelta.NO_CHANGE);
- for (int i = 0; i < expressions.length; i++) {
- IExpression expression = expressions[i];
- delta.addNode(expression, flags);
- }
- fireModelChanged(delta);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchManagerProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchManagerProxy.java
deleted file mode 100644
index fa014b865..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchManagerProxy.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.ILaunchesListener2;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Model proxy for launch manager.
- */
-public class LaunchManagerProxy extends AbstractModelProxy implements ILaunchesListener2 {
-
- private ILaunchManager fLaunchManager;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.AbstractModelProxy#init(org.eclipse.debug.internal.ui.viewers.IPresentationContext)
- */
- public synchronized void init(IPresentationContext context) {
- super.init(context);
- fLaunchManager = DebugPlugin.getDefault().getLaunchManager();
- fLaunchManager.addLaunchListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy#installed(org.eclipse.jface.viewers.Viewer)
- */
- public void installed(Viewer viewer) {
- // expand existing launches
- ILaunch[] launches = fLaunchManager.getLaunches();
- if (launches.length > 0) {
- launchesAdded(launches);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.AbstractModelProxy#dispose()
- */
- public synchronized void dispose() {
- super.dispose();
- if (fLaunchManager != null) {
- fLaunchManager.removeLaunchListener(this);
- fLaunchManager = null;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesTerminated(ILaunch[] launches) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesRemoved(ILaunch[] launches) {
- fireDelta(launches, IModelDelta.REMOVED);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesAdded(ILaunch[] launches) {
- fireDelta(launches, IModelDelta.ADDED | IModelDelta.INSTALL);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesChanged(ILaunch[] launches) {
- }
-
- /**
- * Convenience method for firing a delta
- * @param launches the launches to set in the delta
- * @param launchFlags the flags for the delta
- */
- protected void fireDelta(ILaunch[] launches, int launchFlags) {
- ModelDelta delta = new ModelDelta(fLaunchManager, IModelDelta.NO_CHANGE);
- for (int i = 0; i < launches.length; i++) {
- delta.addNode(launches[i], launchFlags);
- }
- fireModelChanged(delta);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java
deleted file mode 100644
index 5db6cbb17..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.ILaunchesListener2;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Model proxy for launch object.
- *
- * @since 3.3
- */
-public class LaunchProxy extends AbstractModelProxy implements ILaunchesListener2 {
-
- private ILaunch fLaunch;
-
- /**
- * Set of launch's previous children. When a child is added,
- * its model proxy is installed.
- */
- private Set fPrevChildren = new HashSet();
-
- /**
- * Constructs a new model proxy for the given launch.
- *
- * @param launch
- */
- public LaunchProxy(ILaunch launch) {
- fLaunch = launch;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.AbstractModelProxy#init(org.eclipse.debug.internal.ui.viewers.IPresentationContext)
- */
- public void init(IPresentationContext context) {
- super.init(context);
- DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy#installed(org.eclipse.jface.viewers.Viewer)
- */
- public void installed(Viewer viewer) {
- // install model proxies for existing children
- installModelProxies();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.AbstractModelProxy#dispose()
- */
- public void dispose() {
- super.dispose();
- DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
- fPrevChildren.clear();
- fLaunch = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesTerminated(ILaunch[] launches) {
- for (int i = 0; i < launches.length; i++) {
- if (launches[i] == fLaunch) {
- fireDelta(IModelDelta.STATE | IModelDelta.CONTENT | IModelDelta.UNINSTALL);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesRemoved(ILaunch[] launches) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesAdded(ILaunch[] launches) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesChanged(ILaunch[] launches) {
- for (int i = 0; i < launches.length; i++) {
- if (launches[i] == fLaunch) {
- fireDelta(IModelDelta.STATE | IModelDelta.CONTENT);
- installModelProxies();
- }
- }
- }
-
- /**
- * Installs model proxies for any new children in the given launch.
- *
- * @param launch
- */
- protected void installModelProxies() {
- boolean changes = false;
- ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
- ILaunch[] allLaunches = manager.getLaunches();
- ModelDelta root = new ModelDelta(manager, 0, IModelDelta.NO_CHANGE, allLaunches.length);
- Object[] children = fLaunch.getChildren();
- ModelDelta launchDelta = root.addNode(fLaunch, indexOf(fLaunch, allLaunches), IModelDelta.EXPAND, children.length);
- for (int j = 0; j < children.length; j++) {
- Object child = children[j];
- if (fPrevChildren.add(child)) {
- changes = true;
- launchDelta.addNode(child, indexOf(child, children), IModelDelta.INSTALL, -1);
- }
- }
- List childrenList = Arrays.asList(children);
- for (Iterator itr = fPrevChildren.iterator(); itr.hasNext();) {
- Object child = itr.next();
- if (!childrenList.contains(child)) {
- itr.remove();
- changes = true;
- launchDelta.addNode(child, IModelDelta.UNINSTALL);
- }
- }
- if (changes) {
- fireModelChanged(root);
- }
- }
-
- /**
- * Finds the index of the selected element in the given list
- * @param element the element to get the index for
- * @param list the list to search for the index
- * @return the index of the specified element in the given array or -1 if not found
- */
- protected int indexOf(Object element, Object[] list) {
- for (int i = 0; i < list.length; i++) {
- if (element == list[i]) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Convenience method to fire a delta
- * @param flags the flags to set on the delta
- */
- protected void fireDelta(int flags) {
- ModelDelta delta = new ModelDelta(DebugPlugin.getDefault().getLaunchManager(), IModelDelta.NO_CHANGE);
- delta.addNode(fLaunch, flags);
- fireModelChanged(delta);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryBlockProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryBlockProxy.java
deleted file mode 100644
index 95c1c56d7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryBlockProxy.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-
-public class MemoryBlockProxy extends EventHandlerModelProxy {
-
- private IMemoryBlock fMemoryBlock;
- private DebugEventHandler fDebugEventHandler = new DebugEventHandler(this) {
-
- protected boolean handlesEvent(DebugEvent event) {
- if (event.getKind() == DebugEvent.CHANGE && event.getSource() == fMemoryBlock)
- return true;
-
- Object src = event.getSource();
- if (src instanceof IDebugElement)
- {
- if (event.getKind() == DebugEvent.SUSPEND && ((IDebugElement)src).getDebugTarget() == fMemoryBlock.getDebugTarget())
- return true;
- }
- return false;
- }
-
- protected void handleChange(DebugEvent event) {
- if (event.getDetail() == DebugEvent.STATE)
- {
- ModelDelta delta = new ModelDelta(fMemoryBlock, IModelDelta.STATE);
- fireModelChanged(delta);
- }
- else
- {
- ModelDelta delta = new ModelDelta(fMemoryBlock, IModelDelta.CONTENT);
- fireModelChanged(delta);
- }
- }
-
- protected void handleSuspend(DebugEvent event) {
- ModelDelta delta = new ModelDelta(fMemoryBlock, IModelDelta.CONTENT);
- fireModelChanged(delta);
- }
-
- public synchronized void dispose() {
- super.dispose();
- }};
-
- public MemoryBlockProxy(IMemoryBlock mb)
- {
- fMemoryBlock = mb;
- }
-
-
- protected DebugEventHandler[] createEventHandlers() {
- return new DebugEventHandler[]{fDebugEventHandler};
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java
deleted file mode 100644
index c6dba1f6c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * WindRiver - Bug 192028 [Memory View] Memory view does not
- * display memory blocks that do not reference IDebugTarget
- *
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IMemoryBlockListener;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
-import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.ui.progress.UIJob;
-
-public class MemoryRetrievalProxy extends AbstractModelProxy implements IMemoryBlockListener {
- private IMemoryBlockRetrieval fRetrieval;
-
- public MemoryRetrievalProxy(IMemoryBlockRetrieval retrieval)
- {
- fRetrieval = retrieval;
-
- }
-
- public void memoryBlocksAdded(IMemoryBlock[] memory) {
- IMemoryBlock[] allMB = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(fRetrieval);
- int lastIndex = allMB.length - memory.length;
- ModelDelta delta = new ModelDelta(fRetrieval, 0, IModelDelta.NO_CHANGE, allMB.length);
-
- for (int i=0; i<memory.length; i++){
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(memory[i]);
-
- if (retrieval != null)
- {
- if (retrieval == fRetrieval)
- {
- // select the newly added memory block
- delta.addNode(memory[i], lastIndex+i, IModelDelta.ADDED | IModelDelta.SELECT, 0);
- }
- }
- }
-
- fireModelChanged(delta);
- }
-
- public void memoryBlocksRemoved(final IMemoryBlock[] memory) {
-
- UIJob job = new UIJob("memory blocks removed"){ //$NON-NLS-1$
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- ModelDelta delta = new ModelDelta(fRetrieval, IModelDelta.NO_CHANGE);
-
- // find a memory block to select
-
- for (int i=0; i<memory.length; i++){
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(memory[i]);
-
- if (retrieval != null)
- {
- if (retrieval == fRetrieval)
- {
- // do not change selection if the memory block removed is not
- // currently selected
- // #getCurrentSelection must be run on the UI thread
- if (isMemoryBlockSelected(getCurrentSelection(), memory[i]))
- addSelectDeltaNode(delta);
- delta.addNode(memory[i], IModelDelta.REMOVED);
- }
- }
- }
-
- fireModelChanged(delta);
- return Status.OK_STATUS;
- }};
- job.setSystem(true);
- job.schedule();
- }
-
- public void init(IPresentationContext context) {
- super.init(context);
- DebugPlugin.getDefault().getMemoryBlockManager().addListener(this);
- }
-
- public void installed(Viewer viewer) {
- super.installed(viewer);
-
- // Set the initial selection when the proxy is installed
- // Otherwise, rendering pane cannot be populated.
- setInitialSelection();
- }
-
- /**
- * Set the initial memory block selection when the proxy is installed.
- * This is done to ensure that when the memory view is opened, there is an initial
- * selection. Otherwise, the Rendering Pane will show up as blank.
- * @since 3.4
- */
- protected void setInitialSelection() {
- IMemoryBlock[] allMB = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(fRetrieval);
- if (allMB.length > 0)
- {
- ModelDelta delta = new ModelDelta(fRetrieval, 0, IModelDelta.NO_CHANGE, allMB.length);
- delta.addNode(allMB[0], 0, IModelDelta.SELECT, 0);
- fireModelChanged(delta);
- }
- }
-
- public synchronized void dispose() {
- super.dispose();
- DebugPlugin.getDefault().getMemoryBlockManager().removeListener(this);
- }
-
- private void addSelectDeltaNode(ModelDelta delta)
- {
- IMemoryBlock[] memoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(fRetrieval);
- if (memoryBlocks != null && memoryBlocks.length > 0)
- {
- delta.addNode(memoryBlocks[0], IModelDelta.SELECT);
- }
- }
-
- private IStructuredSelection getCurrentSelection() {
- Viewer viewer = getViewer();
- if (viewer instanceof StructuredViewer) {
- StructuredViewer sv = (StructuredViewer) viewer;
- ISelection selection = sv.getSelection();
- if (selection instanceof IStructuredSelection)
- return (IStructuredSelection)selection;
- }
- return StructuredSelection.EMPTY;
- }
-
- private boolean isMemoryBlockSelected(IStructuredSelection selection, IMemoryBlock memoryBlock)
- {
- if (!selection.isEmpty())
- {
- Iterator iter = selection.iterator();
- while (iter.hasNext())
- {
- Object sel = iter.next();
- if (sel == memoryBlock)
- return true;
-
- if (sel instanceof IMemoryRendering)
- {
- if (((IMemoryRendering)sel).getMemoryBlock() == memoryBlock)
- return true;
- }
- }
- }
- return false;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ProcessProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ProcessProxy.java
deleted file mode 100644
index 14cfce57e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ProcessProxy.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.jface.viewers.Viewer;
-
-public class ProcessProxy extends EventHandlerModelProxy {
-
- private IProcess fProcess;
-
- private DebugEventHandler fProcessEventHandler = new DebugEventHandler(this) {
- protected boolean handlesEvent(DebugEvent event) {
- return event.getSource().equals(fProcess);
- }
-
- protected void handleChange(DebugEvent event) {
- fireProcessDelta(IModelDelta.STATE);
- }
-
- protected void handleCreate(DebugEvent event) {
- // do nothing - Launch change notification handles this
- }
-
- protected void handleTerminate(DebugEvent event) {
- fireProcessDelta(IModelDelta.STATE | IModelDelta.UNINSTALL);
- }
-
-
- };
-
- private void fireProcessDelta(int flags) {
- ModelDelta delta = null;
- synchronized (ProcessProxy.this) {
- if (!isDisposed()) {
- delta = new ModelDelta(DebugPlugin.getDefault().getLaunchManager(), IModelDelta.NO_CHANGE);
- ModelDelta node = delta;
- node = node.addNode(fProcess.getLaunch(), IModelDelta.NO_CHANGE);
- node.addNode(fProcess, flags);
- }
- }
- if (delta != null && !isDisposed()) {
- fireModelChanged(delta);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#dispose()
- */
- public synchronized void dispose() {
- super.dispose();
- fProcess = null;
- }
-
- public ProcessProxy(IProcess process) {
- fProcess = process;
- }
-
- protected synchronized boolean containsEvent(DebugEvent event) {
- return event.getSource().equals(fProcess);
- }
-
- protected DebugEventHandler[] createEventHandlers() {
- return new DebugEventHandler[] {fProcessEventHandler};
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.AbstractModelProxy#installed()
- */
- public void installed(Viewer viewer) {
- super.installed(viewer);
- // select process if in run mode
- IProcess process = fProcess;
- if (process != null) {
- if (process.isTerminated()) {
- fireProcessDelta(IModelDelta.UNINSTALL);
- } else {
- ILaunch launch = process.getLaunch();
- if (launch != null && ILaunchManager.RUN_MODE.equals(launch.getLaunchMode())) {
- // select the process
- ModelDelta delta = new ModelDelta(DebugPlugin.getDefault().getLaunchManager(), IModelDelta.NO_CHANGE);
- ModelDelta node = delta.addNode(process.getLaunch(), IModelDelta.NO_CHANGE);
- node = node.addNode(process, IModelDelta.SELECT);
- fireModelChanged(delta);
- }
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/StackFrameEventHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/StackFrameEventHandler.java
deleted file mode 100644
index 39d5c95f3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/StackFrameEventHandler.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
-
-/**
- * Default stack frame event handler for the debug view.
- *
- * @since 3.3
- */
-public class StackFrameEventHandler extends DebugEventHandler {
-
- ThreadEventHandler fThreadHandler = null;
-
- /**
- * Constructs a new stack frame event handler
- */
- public StackFrameEventHandler(AbstractModelProxy proxy, ThreadEventHandler threadHandler) {
- super(proxy);
- fThreadHandler = threadHandler;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler#handlesEvent(org.eclipse.debug.core.DebugEvent)
- */
- protected boolean handlesEvent(DebugEvent event) {
- return event.getSource() instanceof IStackFrame;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler#handleChange(org.eclipse.debug.core.DebugEvent)
- */
- protected void handleChange(DebugEvent event) {
- IStackFrame frame = (IStackFrame) event.getSource();
- ModelDelta root = fThreadHandler.buildRootDelta();
- ModelDelta delta = fThreadHandler.addPathToThread(root, frame.getThread());
- delta = delta.addNode(frame.getThread(), IModelDelta.NO_CHANGE);
- int flags = IModelDelta.NO_CHANGE;
- if (event.getDetail() == DebugEvent.CONTENT) {
- flags = flags | IModelDelta.CONTENT;
- } else if (event.getDetail() == DebugEvent.STATE) {
- flags = flags | IModelDelta.STATE;
- }
- delta = delta.addNode(frame, flags);
- fireDelta(root);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java
deleted file mode 100644
index 7ca9f481f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java
+++ /dev/null
@@ -1,357 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
-
-/**
- * @since 3.2
- */
-public class ThreadEventHandler extends DebugEventHandler {
-
- /**
- * Queue of suspended threads to choose from when needing
- * to select a thread when another is resumed. Threads
- * are added in the order they suspend.
- */
- private Set fThreadQueue = new LinkedHashSet();
-
- /**
- * Map of previous TOS per thread
- */
- private Map fLastTopFrame = new HashMap();
- /**
- * Constructs and event handler for a threads in the given viewer.
- *
- * @param viewer
- */
- public ThreadEventHandler(AbstractModelProxy proxy) {
- super(proxy);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler#dispose()
- */
- public synchronized void dispose() {
- fLastTopFrame.clear();
- fThreadQueue.clear();
- super.dispose();
- }
-
- protected void handleSuspend(DebugEvent event) {
- IThread thread = (IThread) event.getSource();
- if (event.isEvaluation()) {
- ModelDelta delta = buildRootDelta();
- ModelDelta node = addPathToThread(delta, thread);
- node = node.addNode(thread, IModelDelta.NO_CHANGE);
- try {
- IStackFrame frame = thread.getTopStackFrame();
- if (frame != null) {
- int flag = IModelDelta.NO_CHANGE;
- if (event.getDetail() == DebugEvent.EVALUATION) {
- // explicit evaluations can change content
- flag = flag | IModelDelta.CONTENT;
- } else if (event.getDetail() == DebugEvent.EVALUATION_IMPLICIT) {
- // implicit evaluations can change state
- flag = flag | IModelDelta.STATE;
- }
- node.addNode(frame, flag);
- fireDelta(delta);
- }
- } catch (DebugException e) {
- }
- } else {
- queueSuspendedThread(event);
- int extras = IModelDelta.STATE;
- switch (event.getDetail()) {
- case DebugEvent.BREAKPOINT:
- // on breakpoint also position thread to be top element
- extras = IModelDelta.EXPAND | IModelDelta.REVEAL;
- break;
- case DebugEvent.CLIENT_REQUEST:
- extras = IModelDelta.EXPAND;
- break;
- }
- fireDeltaUpdatingSelectedFrame(thread, IModelDelta.NO_CHANGE | extras, event);
- }
- }
-
- private boolean isEqual(Object o1, Object o2) {
- if (o1 == o2) {
- return true;
- }
- if (o1 == null) {
- return false;
- }
- return o1.equals(o2);
- }
-
- protected void handleResume(DebugEvent event) {
- IThread thread = removeSuspendedThread(event);
- fireDeltaAndClearTopFrame(thread, IModelDelta.STATE | IModelDelta.CONTENT | IModelDelta.SELECT);
- thread = getNextSuspendedThread();
- if (thread != null) {
- fireDeltaUpdatingSelectedFrame(thread, IModelDelta.NO_CHANGE | IModelDelta.REVEAL, event);
- }
- }
-
- protected void handleCreate(DebugEvent event) {
- fireDeltaAndClearTopFrame((IThread) event.getSource(), IModelDelta.ADDED | IModelDelta.STATE);
- }
-
- protected void handleTerminate(DebugEvent event) {
- IThread thread = (IThread) event.getSource();
- IDebugTarget target = thread.getDebugTarget();
- // ignore thread termination if target is terminated/disconnected
- if (!(target.isTerminated() || target.isDisconnected())) {
- fireDeltaAndClearTopFrame(thread, IModelDelta.REMOVED);
- }
- }
-
- protected void handleChange(DebugEvent event) {
- if (event.getDetail() == DebugEvent.STATE) {
- fireDeltaUpdatingThread((IThread) event.getSource(), IModelDelta.STATE);
- } else {
- fireDeltaUpdatingThread((IThread) event.getSource(), IModelDelta.CONTENT);
- }
- }
-
- protected void handleLateSuspend(DebugEvent suspend, DebugEvent resume) {
- IThread thread = queueSuspendedThread(suspend);
- if (suspend.isEvaluation() && suspend.getDetail() == DebugEvent.EVALUATION_IMPLICIT) {
- // late implicit evaluation - update thread and frame
- ModelDelta delta = buildRootDelta();
- ModelDelta node = addPathToThread(delta, thread);
- node = node.addNode(thread, IModelDelta.STATE);
- try {
- IStackFrame frame = thread.getTopStackFrame();
- if (frame != null) {
- node.addNode(frame, IModelDelta.STATE);
- fireDelta(delta);
- }
- } catch (DebugException e) {
- }
- } else {
- fireDeltaUpdatingSelectedFrame(thread, IModelDelta.STATE | IModelDelta.EXPAND, suspend);
- }
- }
-
- protected void handleSuspendTimeout(DebugEvent event) {
- IThread thread = removeSuspendedThread(event);
- // don't collapse thread when waiting for long step or evaluation to complete
- fireDeltaUpdatingThread(thread, IModelDelta.STATE);
- }
-
- protected ModelDelta buildRootDelta() {
- return new ModelDelta(getLaunchManager(), IModelDelta.NO_CHANGE);
- }
-
- /**
- * Returns the launch manager.
- *
- * @return the launch manager
- */
- protected ILaunchManager getLaunchManager() {
- return DebugPlugin.getDefault().getLaunchManager();
- }
-
- /**
- * Adds nodes into the delta up to but not including the given thread.
- *
- * @param delta root delta for the view (includes viewer input)
- * @param thread thread for which path is requested
- * @return
- */
- protected ModelDelta addPathToThread(ModelDelta delta, IThread thread) {
- ILaunch launch = thread.getLaunch();
- Object[] children = launch.getChildren();
- delta = delta.addNode(launch, indexOf(getLaunchManager().getLaunches(), launch), IModelDelta.NO_CHANGE, children.length);
- IDebugTarget debugTarget = thread.getDebugTarget();
- int numThreads = -1;
- try {
- numThreads = debugTarget.getThreads().length;
- } catch (DebugException e) {
- }
- return delta.addNode(debugTarget, indexOf(children, debugTarget), IModelDelta.NO_CHANGE, numThreads);
- }
-
- private void fireDeltaAndClearTopFrame(IThread thread, int flags) {
- ModelDelta delta = buildRootDelta();
- ModelDelta node = addPathToThread(delta, thread);
- node.addNode(thread, indexOf(thread), flags);
- synchronized (this) {
- fLastTopFrame.remove(thread);
- }
- fireDelta(delta);
- }
-
- private void fireDeltaUpdatingSelectedFrame(IThread thread, int flags, DebugEvent event) {
- ModelDelta delta = buildRootDelta();
- ModelDelta node = addPathToThread(delta, thread);
- IStackFrame prev = null;
- synchronized (this) {
- prev = (IStackFrame) fLastTopFrame.get(thread);
- }
- IStackFrame frame = null;
- try {
- Object frameToSelect = event.getData();
- if (frameToSelect == null || !(frameToSelect instanceof IStackFrame)) {
- frame = thread.getTopStackFrame();
- } else {
- frame = (IStackFrame)frameToSelect;
- }
- } catch (DebugException e) {
- }
- int threadIndex = indexOf(thread);
- int childCount = childCount(thread);
- if (isEqual(frame, prev)) {
- if (frame == null) {
- if (thread.isSuspended()) {
- // no frames, but suspended - update & select
- node = node.addNode(thread, threadIndex, flags | IModelDelta.STATE | IModelDelta.SELECT, childCount);
- }
- } else {
- node = node.addNode(thread, threadIndex, flags, childCount);
- }
- } else {
- if (event.getDetail() == DebugEvent.STEP_END) {
- if (prev == null) {
- // see bug 166602 - expand the thread if this is a step end with no previous top frame
- flags = flags | IModelDelta.EXPAND;
- } else if (frame == null) {
- // there was a previous frame and current is null on a step: transient state
- return;
- }
- }
- node = node.addNode(thread, threadIndex, flags | IModelDelta.CONTENT, childCount);
- }
- if (frame != null) {
- node.addNode(frame, indexOf(frame), IModelDelta.STATE | IModelDelta.SELECT, childCount(frame));
- }
- synchronized (this) {
- if (!isDisposed()) {
- fLastTopFrame.put(thread, frame);
- }
- }
- fireDelta(delta);
- }
-
- /**
- * Returns the index of the given thread, relative to its parent in the view.
- *
- * @param thread thread
- * @return index of the thread, relative to its parent
- */
- protected int indexOf(IThread thread) {
- try {
- return indexOf(thread.getDebugTarget().getThreads(), thread);
- } catch (DebugException e) {
- }
- return -1;
- }
-
- /**
- * Returns the index of the given frame, relative to its parent in the view.
- *
- * @param frame stack frame
- * @return index of the frame, relative to its thread
- */
- protected int indexOf(IStackFrame frame) {
- try {
- return indexOf(frame.getThread().getStackFrames(), frame);
- } catch (DebugException e) {
- return -1;
- }
- }
-
- /**
- * Returns the number of children the given thread has in the view.
- *
- * @param thread thread
- * @return number of children
- */
- protected int childCount(IThread thread) {
- try {
- return thread.getStackFrames().length;
- } catch (DebugException e) {
- }
- return -1;
- }
-
- /**
- * Returns the number of children the given frame has in the view.
- *
- * @param frame frame
- * @return child count
- */
- protected int childCount(IStackFrame frame) {
- return 0;
- }
-
- private void fireDeltaUpdatingThread(IThread thread, int flags) {
- ModelDelta delta = buildRootDelta();
- ModelDelta node = addPathToThread(delta, thread);
- node = node.addNode(thread, flags);
- fireDelta(delta);
- }
-
- protected boolean handlesEvent(DebugEvent event) {
- return event.getSource() instanceof IThread;
- }
-
- protected synchronized IThread queueSuspendedThread(DebugEvent event) {
- IThread thread = (IThread) event.getSource();
- if (!isDisposed()) {
- fThreadQueue.add(thread);
- }
- return thread;
- }
-
- protected synchronized IThread removeSuspendedThread(DebugEvent event) {
- IThread thread = (IThread)event.getSource();
- fThreadQueue.remove(thread);
- return thread;
- }
-
- protected synchronized IThread queueSuspendedThread(IThread thread) {
- if (!isDisposed()) {
- fThreadQueue.add(thread);
- }
- return thread;
- }
-
- protected synchronized void removeQueuedThread(IThread thread) {
- fThreadQueue.remove(thread);
- }
-
- protected synchronized IThread getNextSuspendedThread() {
- if (!fThreadQueue.isEmpty()) {
- return (IThread) fThreadQueue.iterator().next();
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/VariablesViewEventHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/VariablesViewEventHandler.java
deleted file mode 100644
index f72a8516b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/VariablesViewEventHandler.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.viewers.update;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.ISuspendResume;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy;
-
-/**
- *
- * @since 3.2
- */
-public class VariablesViewEventHandler extends DebugEventHandler {
-
- private IStackFrame fFrame;
-
- public VariablesViewEventHandler(AbstractModelProxy proxy, IStackFrame frame) {
- super(proxy);
- fFrame = frame;
- }
-
- protected boolean handlesEvent(DebugEvent event) {
- return true;
- }
-
- protected void refreshRoot(DebugEvent event) {
- if (event.getDetail() != DebugEvent.EVALUATION_IMPLICIT) {
- // Don't refresh everytime an implicit evaluation finishes
- if (event.getSource() instanceof ISuspendResume) {
- if (!((ISuspendResume)event.getSource()).isSuspended()) {
- // no longer suspended
- return;
- }
- }
-
- ModelDelta delta = new ModelDelta(fFrame, IModelDelta.CONTENT);
- fireDelta(delta);
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugModelPresentationContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugModelPresentationContext.java
deleted file mode 100644
index 5b4f63d85..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugModelPresentationContext.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views;
-
-import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-
-/**
- * A presentation context that has a debug model presentation.
- *
- * @since 3.3
- */
-public class DebugModelPresentationContext extends PresentationContext {
-
- private IDebugModelPresentation fPresentation;
-
- /**
- * Constructs a presentation context for the given id using the
- * specified model presentation.
- *
- * @param id context id
- * @param presentation debug model presentation
- */
- public DebugModelPresentationContext(String id, IDebugModelPresentation presentation) {
- super(id);
- fPresentation = presentation;
- }
-
- public IDebugModelPresentation getModelPresentation() {
- return fPresentation;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.java
deleted file mode 100644
index 5de6573a6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views;
-
-import org.eclipse.osgi.util.NLS;
-
-public class DebugUIViewsMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.views.DebugUIViewsMessages";//$NON-NLS-1$
-
- public static String LaunchView_Error_1;
- public static String LaunchView_Exception_occurred_opening_editor_for_debugger__2;
- public static String LaunchView_Terminate_and_Remove_1;
- public static String LaunchView_Terminate_and_remove_selected__2;
- public static String LaunchView_Exceptions_occurred_attempting_to_terminate_and_remove_3;
- public static String LaunchView_Terminate_and_Remove_4;
- public static String LaunchView_Terminate_and_remove_failed_5;
-
- public static String SourceNotFoundEditorInput_Source_Not_Found_1;
- public static String SourceNotFoundEditorInput_Source_not_found_for__0__2;
-
- public static String BreakpointsView_6;
- public static String BreakpointsView_7;
- public static String BreakpointsView_8;
- public static String BreakpointsView_9;
- public static String BreakpointsView_0;
- public static String BreakpointsView_10;
- public static String BreakpointsView_11;
- public static String BreakpointsView_1;
- public static String BreakpointWorkingSetPage_0;
- public static String BreakpointWorkingSetPage_1;
- public static String BreakpointWorkingSetPage_2;
- public static String BreakpointWorkingSetPage_3;
- public static String BreakpointWorkingSetPage_4;
- public static String BreakpointWorkingSetPage_5;
- public static String BreakpointWorkingSetPage_6;
- public static String BreakpointWorkingSetPage_selectAll_label;
- public static String BreakpointWorkingSetPage_selectAll_toolTip;
- public static String BreakpointWorkingSetPage_deselectAll_label;
- public static String BreakpointWorkingSetPage_deselectAll_toolTip;
- public static String OtherBreakpointOrganizer_0;
- public static String WorkingSetCategory_0;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, DebugUIViewsMessages.class);
- }
-
- public static String InspectPopupDialog_0;
-
- public static String InspectPopupDialog_1;
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.properties
deleted file mode 100644
index dfbf22b8d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/DebugUIViewsMessages.properties
+++ /dev/null
@@ -1,45 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2006 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-LaunchView_Error_1=Error
-LaunchView_Exception_occurred_opening_editor_for_debugger__2=Exception occurred opening editor for debugger.
-LaunchView_Terminate_and_Remove_1=Terminate and Remove
-LaunchView_Terminate_and_remove_selected__2=Terminate and remove selected?
-LaunchView_Exceptions_occurred_attempting_to_terminate_and_remove_3=Exceptions occurred attempting to terminate and remove
-LaunchView_Terminate_and_Remove_4=Terminate and Remove
-LaunchView_Terminate_and_remove_failed_5=Terminate and remove failed
-
-SourceNotFoundEditorInput_Source_Not_Found_1=Source Not Found
-SourceNotFoundEditorInput_Source_not_found_for__0__2=Source not found for {0}
-
-BreakpointsView_6=Enabling
-BreakpointsView_7=Disabling
-BreakpointsView_8=enable
-BreakpointsView_9=disable
-BreakpointsView_0=Enable Breakpoint
-BreakpointsView_10=Error {0} Breakpoint
-BreakpointsView_11=An exception occurred while attempting to {0} the breakpoint.
-BreakpointsView_1=Disable Breakpoint
-BreakpointWorkingSetPage_0=Breakpoint Working Set
-BreakpointWorkingSetPage_1=Enter a working set name and select breakpoints.
-BreakpointWorkingSetPage_2=&Working set name:
-BreakpointWorkingSetPage_3=Brea&kpoints:
-BreakpointWorkingSetPage_4=The name must not have leading or trailing whitespace
-BreakpointWorkingSetPage_5=The name must not be empty
-BreakpointWorkingSetPage_6=A working set with that name already exists
-BreakpointWorkingSetPage_selectAll_label=Select &All
-BreakpointWorkingSetPage_selectAll_toolTip=Select all of the breakpoints for this working set.
-BreakpointWorkingSetPage_deselectAll_label=Dese&lect All
-BreakpointWorkingSetPage_deselectAll_toolTip=Deselect all of the breakpoints for this working set.
-OtherBreakpointOrganizer_0=Others
-WorkingSetCategory_0=\ (default)
-InspectPopupDialog_0=Move to Expressions View
-InspectPopupDialog_1=Press {0} to {1}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/IDebugExceptionHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/IDebugExceptionHandler.java
deleted file mode 100644
index 4bc7087b0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/IDebugExceptionHandler.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views;
-
-
-import org.eclipse.debug.core.DebugException;
-
-/**
- * A plugable exception handler.
- */
-public interface IDebugExceptionHandler {
-
- /**
- * Handles the given debug exception.
- *
- * @param e debug exception
- */
- public abstract void handleException(DebugException e);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextManager.java
deleted file mode 100644
index 06d46048e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextManager.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River - Pawel Piech - Fixed debug context service usage (Bug 258189)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.ui.IWindowListener;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Manages the view context services for each window.
- *
- * @since 3.2
- */
-public class ViewContextManager implements IWindowListener {
-
- /**
- * Map of services
- */
- private Map fWindowToService = new HashMap();
-
- // singleton manager
- private static ViewContextManager fgManager;
-
- /**
- * Returns the singleton view context manager.
- *
- * @return view manager
- */
- public static ViewContextManager getDefault() {
- if (fgManager == null) {
- fgManager = new ViewContextManager();
- }
- return fgManager;
- }
-
-
- private ViewContextManager() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow[] workbenchWindows = workbench.getWorkbenchWindows();
- for (int i = 0; i < workbenchWindows.length; i++) {
- IWorkbenchWindow window = workbenchWindows[i];
- windowOpened(window);
- }
- workbench.addWindowListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowActivated(IWorkbenchWindow window) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowDeactivated(IWorkbenchWindow window) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowClosed(IWorkbenchWindow window) {
- ViewContextService service = (ViewContextService) fWindowToService.get(window);
- if (service != null) {
- service.dispose();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow)
- */
- public void windowOpened(IWorkbenchWindow window) {
- ViewContextService service = (ViewContextService) fWindowToService.get(window);
- if (service == null) {
- service = new ViewContextService(window);
- fWindowToService.put(window, service);
- }
- }
-
- /**
- * Returns the service for the given window, or <code>null</code> if none.
- *
- * @param window
- * @return view context service or <code>null</code>
- */
- public ViewContextService getService(IWorkbenchWindow window) {
- return (ViewContextService) fWindowToService.get(window);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java
deleted file mode 100644
index ce6e77d89..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java
+++ /dev/null
@@ -1,1122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.Map.Entry;
-
-import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.core.commands.contexts.Context;
-import org.eclipse.core.commands.contexts.ContextManagerEvent;
-import org.eclipse.core.commands.contexts.IContextManagerListener;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
-import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
-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.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.contexts.DebugModelContextBindingManager;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextService;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IPerspectiveListener4;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IViewReference;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPartReference;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.console.IConsoleConstants;
-import org.eclipse.ui.contexts.IContextService;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Performs view management for a window.
- *
- * @since 3.2
- */
-public class ViewContextService implements IDebugContextListener, IPerspectiveListener4, IPropertyChangeListener, IContextManagerListener {
-
- /**
- * Maps the perspectives in this window to its last activated workbench context
- */
- private Map fPerspectiveToActiveContext = new HashMap();
-
- /**
- * Map of the perspectives to all workbench contexts activated in that perspective
- */
- private Map fPerspectiveToActivatedContexts = new HashMap();
-
- /**
- * Map of context id's to context view bindings
- */
- private Map fContextIdsToBindings;
-
- /**
- * List of perspectives that debugging is allowed in
- */
- private Set fEnabledPerspectives = new HashSet();
-
- /**
- * Whether to ignore perspective change call backs (set to
- * true when this class is modifying views).
- */
- private boolean fIgnoreChanges = false;
-
- /**
- * The window this service is working for
- */
- private IWorkbenchWindow fWindow;
-
- private IContextService fContextService;
-
- private IDebugContextService fDebugContextService;
-
- // base debug context
- public static final String DEBUG_CONTEXT= "org.eclipse.debug.ui.debugging"; //$NON-NLS-1$
-
- // extension points
- private static final String ID_CONTEXT_VIEW_BINDINGS= "contextViewBindings"; //$NON-NLS-1$
-
- // extension elements
- private static final String ELEM_CONTEXT_VIEW_BINDING= "contextViewBinding"; //$NON-NLS-1$
- private static final String ELEM_PERSPECTIVE= "perspective"; //$NON-NLS-1$
-
- // extension attributes
- private static final String ATTR_CONTEXT_ID= "contextId"; //$NON-NLS-1$
- private static final String ATTR_VIEW_ID= "viewId"; //$NON-NLS-1$
- private static final String ATTR_AUTO_OPEN= "autoOpen"; //$NON-NLS-1$
- private static final String ATTR_AUTO_CLOSE= "autoClose"; //$NON-NLS-1$
- private static final String ATTR_PERSPECTIVE_ID= "perspectiveId"; //$NON-NLS-1$
-
- // XML tags
- private static final String XML_ELEMENT_VIEW_BINDINGS ="viewBindings"; //$NON-NLS-1$
- private static final String XML_ELEMENT_PERSPECTIVE ="perspective"; //$NON-NLS-1$
- private static final String XML_ELEMENT_VIEW = "view"; //$NON-NLS-1$
- private static final String XML_ATTR_ID = "id"; //$NON-NLS-1$
- private static final String XML_ATTR_USER_ACTION = "userAction"; //$NON-NLS-1$
- private static final String XML_VALUE_OPENED = "opened"; //$NON-NLS-1$
- private static final String XML_VALUE_CLOSED = "closed"; //$NON-NLS-1$
-
- // ids of base debug views in debug perspective that should not be auto-closed
- private static Set fgBaseDebugViewIds = null;
-
- static {
- fgBaseDebugViewIds = new HashSet();
- fgBaseDebugViewIds.add(IDebugUIConstants.ID_DEBUG_VIEW);
- fgBaseDebugViewIds.add(IDebugUIConstants.ID_VARIABLE_VIEW);
- fgBaseDebugViewIds.add(IDebugUIConstants.ID_BREAKPOINT_VIEW);
- fgBaseDebugViewIds.add(IConsoleConstants.ID_CONSOLE_VIEW);
- }
-
- private static String[] EMPTY_IDS = new String[0];
-
- /**
- * View bindings for a debug context
- */
- private class DebugContextViewBindings {
-
- // context id
- private String fId;
-
- // list of view bindings id's specific to this context
- private String[] fViewBindingIds = EMPTY_IDS;
-
- // all bindings including inherited bindings, top down in activation order
- private String[] fAllViewBindingIds = null;
- // associated binding to activate
- private Map fAllViewIdToBindings = new HashMap();
- // all context id's in this context hierarchy (top down order)
- private String[] fAllConetxtIds = null;
-
- // id of parent context
- private String fParentId;
-
- /**
- * Constructs an empty view binding for the given context.
- *
- * @param id context id
- */
- public DebugContextViewBindings(String id) {
- fId = id;
- }
-
- /**
- * Returns the context id for these view bindings
- *
- * @return context id
- */
- public String getId() {
- return fId;
- }
-
- /**
- * Adds the given view binding to this context
- *
- * @param binding view binding to add
- */
- public void addBinding(ViewBinding binding) {
- String[] newBindings = new String[fViewBindingIds.length + 1];
- System.arraycopy(fViewBindingIds, 0, newBindings, 0, fViewBindingIds.length);
- newBindings[fViewBindingIds.length] = binding.getViewId();
- fAllViewIdToBindings.put(binding.getViewId(), binding);
- fViewBindingIds = newBindings;
- }
-
- /**
- * Sets the parent id of this view bindings
- *
- * @param id parent context id
- */
- protected void setParentId(String id) {
- fParentId = id;
- }
-
- /**
- * Returns the id of parent context
- *
- * @return parent context id
- */
- public DebugContextViewBindings getParentContext() {
- if (fParentId == null) {
- return null;
- }
- return (DebugContextViewBindings) fContextIdsToBindings.get(fParentId);
- }
-
- /**
- * Activates the views in this context hierarchy. Views are activated top down, allowing
- * sub-contexts to override settings in a parent context.
- */
- public void activateChain(IWorkbenchPage page) {
- initializeChain();
- doActivation(page, fAllViewBindingIds, fAllConetxtIds);
- }
-
- /**
- * Activates the view bindings for the specified views and the
- * specified contexts in the given page.
- *
- * @param page page to activate views in
- * @param viewIds id's of views to activate
- * @param contextIds associated contexts that are activated
- */
- private void doActivation(IWorkbenchPage page, String[] viewIds, String[] contextIds) {
- // note activation of all the relevant contexts
- for (int i = 0; i < contextIds.length; i++) {
- addActivated(contextIds[i]);
- }
- // set the active context to be this
- setActive(page.getPerspective(), getId());
- // activate the view bindings
- for (int i = 0; i < viewIds.length; i++) {
- String viewId = viewIds[i];
- ViewBinding binding = (ViewBinding) fAllViewIdToBindings.get(viewId);
- binding.activated(page);
- }
- // bring most relevant views to top
- for (int i = 0; i < viewIds.length; i++) {
- String viewId = viewIds[i];
- ViewBinding binding = (ViewBinding) fAllViewIdToBindings.get(viewId);
- binding.checkZOrder(page, fAllViewBindingIds);
- }
- }
-
- /**
- * Builds the top down ordered list of bindings for this context allowing sub-contexts
- * to override parent settings.
- */
- private synchronized void initializeChain() {
- if (fAllViewBindingIds == null) {
- List orderedIds = new ArrayList();
- List contexts = new ArrayList();
- DebugContextViewBindings context = this;
- while (context != null) {
- contexts.add(0, context);
- context = context.getParentContext();
- }
- Iterator iterator = contexts.iterator();
- fAllConetxtIds = new String[contexts.size()];
- int pos = 0;
- while (iterator.hasNext()) {
- DebugContextViewBindings bindings = (DebugContextViewBindings) iterator.next();
- fAllConetxtIds[pos] = bindings.getId();
- pos++;
- for (int i = 0; i < bindings.fViewBindingIds.length; i++) {
- String viewId = bindings.fViewBindingIds[i];
- if (bindings == this) {
- orderedIds.add(viewId);
- }
- if (!fAllViewIdToBindings.containsKey(viewId)) {
- orderedIds.add(viewId);
- fAllViewIdToBindings.put(viewId, bindings.fAllViewIdToBindings.get(viewId));
- }
- }
- }
- fAllViewBindingIds = (String[]) orderedIds.toArray(new String[orderedIds.size()]);
- }
- }
-
- /**
- * Deactivates this context only (not parents)
- *
- * @param page workbench page
- */
- public void deactivate(IWorkbenchPage page) {
- removeActivated(getId());
- if (isActiveContext(getId())) {
- setActive(page.getPerspective(), null);
- }
- for (int i = 0; i < fViewBindingIds.length; i++) {
- String viewId = fViewBindingIds[i];
- ViewBinding binding = (ViewBinding) fAllViewIdToBindings.get(viewId);
- binding.deactivated(page);
- }
- }
-
- /**
- * Notes when a view is opened/closed manually.
- *
- * @param opened opened or closed
- * @param viewId
- */
- public void setViewOpened(boolean opened, String viewId) {
- initializeChain();
- ViewBinding binding = (ViewBinding)fAllViewIdToBindings.get(viewId);
- if (binding != null) {
- if (opened) {
- binding.userOpened();
- } else {
- binding.userClosed();
- }
- }
- }
-
- public void applyUserSettings(String viewId, Element viewElement) {
- initializeChain();
- ViewBinding binding = (ViewBinding) fAllViewIdToBindings.get(viewId);
- if (binding != null) {
- binding.applyUserSettings(viewElement);
- }
- }
-
- /**
- * Save view binding settings into XML document.
- *
- * @param document
- * @param root
- * @param alreadyDone views already done
- */
- public void saveBindings(Document document, Element root, Set alreadyDone) {
- for (int i = 0; i < fViewBindingIds.length; i++) {
- String viewId = fViewBindingIds[i];
- if (!alreadyDone.contains(viewId)) {
- alreadyDone.add(viewId);
- ViewBinding binding = (ViewBinding) fAllViewIdToBindings.get(viewId);
- binding.saveBindings(document, root);
- }
- }
- }
- }
-
- /**
- * Information for a view
- */
- private class ViewBinding {
- private IConfigurationElement fElement;
- /**
- * Set of perspectives this view was opened in by the user
- */
- private Set fUserOpened = new HashSet();
- /**
- * Set of perspectives this view was closed in by the user
- */
- private Set fUserClosed = new HashSet();
-
- public ViewBinding(IConfigurationElement element) {
- fElement = element;
- }
-
- /**
- * Returns the id of the view this binding pertains to.
- *
- * @return
- */
- public String getViewId() {
- return fElement.getAttribute(ATTR_VIEW_ID);
- }
-
- /**
- * Returns whether this view binding is set for auto-open.
- *
- * @return
- */
- public boolean isAutoOpen() {
- String autoopen = fElement.getAttribute(ATTR_AUTO_OPEN);
- return autoopen == null || "true".equals(autoopen); //$NON-NLS-1$
- }
-
- /**
- * Returns whether this view binding is set for auto-close.
- *
- * @return
- */
- public boolean isAutoClose() {
- String autoclose = fElement.getAttribute(ATTR_AUTO_CLOSE);
- return autoclose == null || "true".equals(autoclose); //$NON-NLS-1$
- }
-
- /**
- * Returns whether this view was opened by the user in the active perspective.
- * @return
- */
- public boolean isUserOpened() {
- return fUserOpened.contains(getActivePerspective().getId());
- }
-
- /**
- * Returns whether this view was closed by the user in the active perspective
- * @return
- */
- public boolean isUserClosed() {
- return fUserClosed.contains(getActivePerspective().getId());
- }
-
- /**
- * Returns whether this view is part of the active perspective by default
- *
- * TODO: we really need an API to determine which views are
- * in a perspective by default, but it does not seem to exist.
- *
- * @return
- */
- public boolean isDefault() {
- String id = getActivePerspective().getId();
- if (IDebugUIConstants.ID_DEBUG_PERSPECTIVE.equals(id)) {
- return fgBaseDebugViewIds.contains(getViewId());
- }
- return false;
- }
-
- protected void userOpened() {
- if (isTrackingViews()) {
- String id = getActivePerspective().getId();
- fUserOpened.add(id);
- fUserClosed.remove(id);
- saveViewBindings();
- }
- }
-
- protected void userClosed() {
- if (isTrackingViews()) {
- String id = getActivePerspective().getId();
- fUserClosed.add(id);
- fUserOpened.remove(id);
- saveViewBindings();
- }
- }
-
- /**
- * Returns whether the preference is set to track user view open/close.
- *
- * @return
- */
- protected boolean isTrackingViews() {
- return DebugUITools.getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_TRACK_VIEWS);
- }
-
- /**
- * Context has been activated, open/show as required.
- *
- * @param page
- */
- public void activated(IWorkbenchPage page) {
- if (!isUserClosed()) {
- if (isAutoOpen()) {
- try {
- fIgnoreChanges = true;
- page.showView(getViewId(), null, IWorkbenchPage.VIEW_CREATE);
- } catch (PartInitException e) {
- DebugUIPlugin.log(e);
- } finally {
- fIgnoreChanges = false;
- }
- }
- }
- }
-
- /**
- * Context has been activated. Check the view stack to see if this view
- * should be made visible.
- *
- * @param page
- */
- public void checkZOrder(IWorkbenchPage page, String[] relevantViews) {
- // see if view is open already
- IViewPart part = page.findView(getViewId());
- if (part != null) {
- IViewPart[] viewStack = page.getViewStack(part);
- if (viewStack != null && viewStack.length > 0) {
- String top = viewStack[0].getSite().getId();
- for (int i = 0; i < relevantViews.length; i++) {
- if (relevantViews[i].equals(top)) {
- // a relevant view is visible
- return;
- }
- }
- // an irrelevant view is visible
- try {
- fIgnoreChanges = true;
- page.bringToTop(part);
- } finally {
- fIgnoreChanges = false;
- }
- }
- }
- }
-
- /**
- * Context has been deactivated, close as required.
- *
- * @param page
- */
- public void deactivated(IWorkbenchPage page) {
- if (!isUserOpened()) {
- if (isAutoClose() && !isDefault()) {
- IViewReference reference = page.findViewReference(getViewId());
- if (reference != null) {
- try {
- fIgnoreChanges = true;
- page.hideView(reference);
- } finally {
- fIgnoreChanges = false;
- }
- }
- }
- }
- }
-
- /**
- * Save view binding settings into XML document.
- *
- * @param document
- * @param root
- */
- public void saveBindings(Document document, Element root) {
- Element viewElement = document.createElement(XML_ELEMENT_VIEW);
- viewElement.setAttribute(XML_ATTR_ID, getViewId());
- appendPerspectives(document, viewElement, fUserOpened, XML_VALUE_OPENED);
- appendPerspectives(document, viewElement, fUserClosed, XML_VALUE_CLOSED);
- if (viewElement.hasChildNodes()) {
- root.appendChild(viewElement);
- }
- }
-
- private void appendPerspectives(Document document, Element parent, Set perpectives, String xmlValue) {
- String[] ids = (String[]) perpectives.toArray(new String[perpectives.size()]);
- for (int i = 0; i < ids.length; i++) {
- String id = ids[i];
- Element element = document.createElement(XML_ELEMENT_PERSPECTIVE);
- element.setAttribute(XML_ATTR_ID, id);
- element.setAttribute(XML_ATTR_USER_ACTION, xmlValue);
- parent.appendChild(element);
- }
- }
-
- public void applyUserSettings(Element viewElement) {
- NodeList list = viewElement.getChildNodes();
- int length = list.getLength();
- for (int i = 0; i < length; ++i) {
- Node node = list.item(i);
- short type = node.getNodeType();
- if (type == Node.ELEMENT_NODE) {
- Element entry = (Element) node;
- if(entry.getNodeName().equalsIgnoreCase(XML_ELEMENT_PERSPECTIVE)){
- String id = entry.getAttribute(XML_ATTR_ID);
- String setting = entry.getAttribute(XML_ATTR_USER_ACTION);
- if (id != null) {
- if (XML_VALUE_CLOSED.equals(setting)) {
- fUserClosed.add(id);
- } else if (XML_VALUE_OPENED.equals(setting)) {
- fUserOpened.add(id);
- }
- }
- }
- }
- }
- }
- }
-
- private IDebugContextService getDebugContextService() {
- return fDebugContextService;
- }
-
- /**
- * Creates a service for the given window
- *
- * @param window
- */
- ViewContextService(IWorkbenchWindow window) {
- fWindow = window;
- fContextService = (IContextService) PlatformUI.getWorkbench().getAdapter(IContextService.class);
- fDebugContextService = DebugUITools.getDebugContextManager().getContextService(fWindow);
- loadContextToViewExtensions();
- applyUserViewBindings();
- loadPerspectives();
- window.addPerspectiveListener(this);
- getDebugContextService().addDebugContextListener(this);
- DebugUIPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(this);
- fContextService.addContextManagerListener(this);
- }
-
- public void dispose() {
- fWindow.removePerspectiveListener(this);
- getDebugContextService().removeDebugContextListener(this);
- DebugUIPlugin.getDefault().getPluginPreferences().removePropertyChangeListener(this);
- fContextService.removeContextManagerListener(this);
- }
-
- /**
- * Loads extensions which map context id's to view bindings.
- */
- private void loadContextToViewExtensions() {
- fContextIdsToBindings = new HashMap();
- IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), ID_CONTEXT_VIEW_BINDINGS);
- IConfigurationElement[] configurationElements = extensionPoint.getConfigurationElements();
- for (int i = 0; i < configurationElements.length; i++) {
- IConfigurationElement element = configurationElements[i];
- if ( ELEM_CONTEXT_VIEW_BINDING.equals(element.getName()) ) {
- String viewId = element.getAttribute(ATTR_VIEW_ID);
- String contextId = element.getAttribute(ATTR_CONTEXT_ID);
- if (contextId == null || viewId == null) {
- continue;
- }
- ViewBinding info = new ViewBinding(element);
- DebugContextViewBindings bindings = (DebugContextViewBindings) fContextIdsToBindings.get(contextId);
- if (bindings == null) {
- bindings = new DebugContextViewBindings(contextId);
- fContextIdsToBindings.put(contextId, bindings);
- }
- bindings.addBinding(info);
- }
- }
- linkParentContexts();
- }
-
- /**
- * Applies user settings that modify view binding extensions.
- */
- private void applyUserViewBindings() {
- String xml = DebugUITools.getPreferenceStore().getString(IInternalDebugUIConstants.PREF_USER_VIEW_BINDINGS);
- if (xml.length() > 0) {
- try {
- Element root = DebugPlugin.parseDocument(xml);
- NodeList list = root.getChildNodes();
- int length = list.getLength();
- for (int i = 0; i < length; ++i) {
- Node node = list.item(i);
- short type = node.getNodeType();
- if (type == Node.ELEMENT_NODE) {
- Element entry = (Element) node;
- if(entry.getNodeName().equalsIgnoreCase(XML_ELEMENT_VIEW)){
- String id = entry.getAttribute(XML_ATTR_ID);
- Iterator bindings = fContextIdsToBindings.values().iterator();
- while (bindings.hasNext()) {
- DebugContextViewBindings binding = (DebugContextViewBindings) bindings.next();
- binding.applyUserSettings(id, entry);
- }
- }
- }
- }
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- }
-
- /**
- * Load the collection of perspectives in which view management will occur from the preference store.
- */
- private void loadPerspectives() {
- String preference = DebugUIPlugin.getDefault().getPreferenceStore().getString(
- IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES);
- if (IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES_DEFAULT.equals(preference)) {
- fEnabledPerspectives = getDefaultEnabledPerspectives();
- } else {
- fEnabledPerspectives = parseList(preference);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.Preferences.IPropertyChangeListener#propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if (!fIgnoreChanges) {
- if (IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES.equals(event.getProperty())) {
- loadPerspectives();
- } else if (IInternalDebugUIConstants.PREF_USER_VIEW_BINDINGS.equals(event.getProperty())) {
- loadContextToViewExtensions();
- applyUserViewBindings();
- // clear activations to re-enable activation based on new settings
- fPerspectiveToActivatedContexts.clear();
- ISelection selection = getDebugContextService().getActiveContext();
- contextActivated(selection);
- }
- }
- }
-
- /**
- * Returns whether this service's window's active perspective supports view management.
- *
- * @return whether this service's window's active perspective supports view management
- */
- private boolean isEnabledPerspective() {
- IPerspectiveDescriptor perspective = getActivePerspective();
- if (perspective != null) {
- return fEnabledPerspectives.contains(perspective.getId());
- }
- return false;
- }
-
- /**
- * Returns the active perspective in this service's window, or <code>null</code>
- *
- * @return active perspective or <code>null</code>
- */
- private IPerspectiveDescriptor getActivePerspective() {
- IWorkbenchPage activePage = fWindow.getActivePage();
- if (activePage != null) {
- return activePage.getPerspective();
- }
- return null;
- }
-
- /**
- * Parses the comma separated string into a list of strings
- *
- * @return list
- */
- public static Set parseList(String listString) {
- Set list = new HashSet(10);
- StringTokenizer tokenizer = new StringTokenizer(listString, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String token = tokenizer.nextToken();
- list.add(token);
- }
- return list;
- }
-
- /**
- * Calculates the default set of perspectives enabled for view management
- * based on the contextViewBindings extension point.
- *
- * @return set of enabled perspectives.
- *
- * @since 3.5
- */
- public static Set getDefaultEnabledPerspectives() {
- Set perspectives = new HashSet(4);
-
- IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), ID_CONTEXT_VIEW_BINDINGS);
- IConfigurationElement[] configurationElements = extensionPoint.getConfigurationElements();
- for (int i = 0; i < configurationElements.length; i++) {
- IConfigurationElement element = configurationElements[i];
- if ( ELEM_PERSPECTIVE.equals(element.getName()) ) {
- String perspectiveId = element.getAttribute(ATTR_PERSPECTIVE_ID);
- if (perspectiveId != null) {
- perspectives.add(perspectiveId);
- }
- }
- }
-
- return perspectives;
- }
-
- public void contextActivated(ISelection selection) {
- if (isEnabledPerspective()) {
- if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- Iterator iterator = ss.iterator();
- while (iterator.hasNext()) {
- Object target = iterator.next();
- ILaunch launch = DebugModelContextBindingManager.getLaunch(target);
- if (launch != null) {
- ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration();
- if (launchConfiguration != null) {
- try {
- ILaunchConfigurationType type = launchConfiguration.getType();
- // check if this perspective is enabled for the launch type
- // Include the word '.internal.' so the context is filtered from the key binding pref page (Bug 144019) also see PerspectiveManager.handleBreakpointHit()
- if (fContextService.getActiveContextIds().contains(type.getIdentifier() + ".internal." + getActivePerspective().getId())) { //$NON-NLS-1$
- // get the leaf contexts to be activated
- List workbenchContexts = DebugModelContextBindingManager.getDefault().getWorkbenchContextsForDebugContext(target);
- // TODO: do we need to check if contexts are actually enabled in workbench first?
- if (!workbenchContexts.isEmpty()) {
- // if all contexts already activate and last context is already active context == done
- Iterator contexts = workbenchContexts.iterator();
- while (contexts.hasNext()) {
- String contextId = (String)contexts.next();
- if (!isActivated(contextId)) {
- activateChain(contextId);
- }
- // ensure last context gets top priority
- if (!contexts.hasNext()) {
- if (!isActiveContext(contextId)) {
- activateChain(contextId);
- }
- }
- }
- }
-
- }
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- }
- }
- }
- }
- }
-
- /**
- * Returns whether the given context is the active context in the active perspective.
- *
- * @param contextId
- * @return
- */
- private boolean isActiveContext(String contextId) {
- IPerspectiveDescriptor activePerspective = getActivePerspective();
- if (activePerspective != null) {
- String activeId = (String) fPerspectiveToActiveContext.get(activePerspective);
- return contextId.equals(activeId);
- }
- return false;
- }
-
- /**
- * Returns whether the given context is activated in the active perspective.
- *
- * @param contextId
- * @return
- */
- private boolean isActivated(String contextId) {
- IPerspectiveDescriptor activePerspective = getActivePerspective();
- if (activePerspective != null) {
- Set contexts = (Set) fPerspectiveToActivatedContexts.get(activePerspective);
- if (contexts != null) {
- return contexts.contains(contextId);
- }
- }
- return false;
- }
-
- private void addActivated(String contextId) {
- IPerspectiveDescriptor activePerspective = getActivePerspective();
- if (activePerspective != null) {
- Set contexts = (Set) fPerspectiveToActivatedContexts.get(activePerspective);
- if (contexts == null) {
- contexts = new HashSet();
- fPerspectiveToActivatedContexts.put(activePerspective, contexts);
- }
- contexts.add(contextId);
- }
- }
-
- private void removeActivated(String contextId) {
- IPerspectiveDescriptor activePerspective = getActivePerspective();
- if (activePerspective != null) {
- Set contexts = (Set) fPerspectiveToActivatedContexts.get(activePerspective);
- if (contexts != null) {
- contexts.remove(contextId);
- }
- }
- }
-
- public void debugContextChanged(DebugContextEvent event) {
- if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
- contextActivated(event.getContext());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveListener3#perspectiveOpened(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor)
- */
- public void perspectiveOpened(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveListener3#perspectiveClosed(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor)
- */
- public void perspectiveClosed(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveListener3#perspectiveDeactivated(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor)
- */
- public void perspectiveDeactivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
- }
-
- /**
- * Closes all auto-opened views.
- *
- * @param page
- * @param perspective
- */
- private void clean(IPerspectiveDescriptor perspective) {
- Set contexts = (Set) fPerspectiveToActivatedContexts.remove(perspective);
- fPerspectiveToActiveContext.remove(perspective);
- if (contexts != null) {
- Iterator iterator = contexts.iterator();
- while (iterator.hasNext()) {
- String id = (String) iterator.next();
- deactivate(id);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveListener3#perspectiveSavedAs(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor, org.eclipse.ui.IPerspectiveDescriptor)
- */
- public void perspectiveSavedAs(IWorkbenchPage page, IPerspectiveDescriptor oldPerspective, IPerspectiveDescriptor newPerspective) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveListener2#perspectiveChanged(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor, org.eclipse.ui.IWorkbenchPartReference, java.lang.String)
- */
- public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, IWorkbenchPartReference partRef, String changeId) {
- if (!fIgnoreChanges && page.getWorkbenchWindow().equals(fWindow)) {
- if(partRef != null) {
- if (IWorkbenchPage.CHANGE_VIEW_SHOW == changeId || IWorkbenchPage.CHANGE_VIEW_HIDE == changeId) {
- Iterator iterator = fContextIdsToBindings.values().iterator();
- while (iterator.hasNext()) {
- DebugContextViewBindings bindings = (DebugContextViewBindings) iterator.next();
- bindings.setViewOpened(IWorkbenchPage.CHANGE_VIEW_SHOW == changeId, partRef.getId());
- }
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveListener#perspectiveActivated(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor)
- */
- public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
- if (page.getWorkbenchWindow().equals(fWindow)) {
- ISelection activeContext = getDebugContextService().getActiveContext();
- if (activeContext != null) {
- contextActivated(activeContext);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveListener#perspectiveChanged(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor, java.lang.String)
- */
- public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) {
- }
-
- /**
- * Activates all parent contexts of the given context, top down.
- *
- * @param contextId
- */
- private void activateChain(String contextId) {
- IWorkbenchPage page = fWindow.getActivePage();
- if (page != null) {
- DebugContextViewBindings bindings= (DebugContextViewBindings) fContextIdsToBindings.get(contextId);
- if (bindings != null) {
- bindings.activateChain(page);
- }
- }
- }
-
- /**
- * Links each debug context view bindings with its parent context bindings
- */
- private void linkParentContexts() {
- Iterator iterator = fContextIdsToBindings.entrySet().iterator();
- while (iterator.hasNext()) {
- Entry entry = (Entry)iterator.next();
- String contextId = (String) entry.getKey();
- DebugContextViewBindings bindings = (DebugContextViewBindings) entry.getValue();
- if (!bindings.getId().equals(DEBUG_CONTEXT)) {
- Context context = fContextService.getContext(contextId);
- try {
- bindings.setParentId(context.getParentId());
- } catch (NotDefinedException e) {
- DebugUIPlugin.log(e);
- }
- }
- }
- }
-
- /**
- * Sets the active context in the given perspective, or removes
- * when <code>null</code>.
- *
- * @param perspective
- * @param contextId
- */
- private void setActive(IPerspectiveDescriptor perspective, String contextId) {
- if (contextId == null) {
- fPerspectiveToActiveContext.remove(perspective);
- } else {
- fPerspectiveToActiveContext.put(perspective, contextId);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.contexts.IContextManagerListener#contextManagerChanged(org.eclipse.core.commands.contexts.ContextManagerEvent)
- */
- public void contextManagerChanged(ContextManagerEvent event) {
- if (event.isActiveContextsChanged()) {
- Set disabledContexts = getDisabledContexts(event);
- if (!disabledContexts.isEmpty()) {
- Iterator contexts = disabledContexts.iterator();
- while (contexts.hasNext()) {
- String contextId = (String)contexts.next();
- if (isViewConetxt(contextId)) {
- if (isActivated(contextId)) {
- deactivate(contextId);
- }
- }
- }
- }
- }
- }
-
- private void deactivate(String contextId) {
- IWorkbenchPage page = fWindow.getActivePage();
- if (page != null) {
- DebugContextViewBindings bindings = (DebugContextViewBindings) fContextIdsToBindings.get(contextId);
- if (bindings != null) {
- bindings.deactivate(page);
- }
- }
- }
-
- /**
- * Returns a set of contexts disabled in the given event, possibly empty.
- *
- * @param event
- * @return disabled context id's
- */
- private Set getDisabledContexts(ContextManagerEvent event) {
- Set prev = new HashSet(event.getPreviouslyActiveContextIds());
- Set activeContextIds = event.getContextManager().getActiveContextIds();
- if (activeContextIds != null) {
- prev.removeAll(activeContextIds);
- }
- return prev;
- }
-
- /**
- * Returns whether the given context has view bindings.
- *
- * @param id
- * @return whether the given context has view bindings
- */
- private boolean isViewConetxt(String id) {
- return fContextIdsToBindings.containsKey(id);
- }
-
- /**
- * Save view binding settings that differ from extension settings
- */
- private void saveViewBindings() {
- try {
- Document document = DebugPlugin.newDocument();
- Element root = document.createElement(XML_ELEMENT_VIEW_BINDINGS);
- document.appendChild(root);
- Set done = new HashSet();
- Iterator bindings = fContextIdsToBindings.values().iterator();
- while (bindings.hasNext()) {
- DebugContextViewBindings binding = (DebugContextViewBindings) bindings.next();
- binding.saveBindings(document, root, done);
- }
- String prefValue = IInternalDebugCoreConstants.EMPTY_STRING;
- if (root.hasChildNodes()) {
- prefValue = DebugPlugin.serializeDocument(document);
- }
- fIgnoreChanges = true;
- DebugUITools.getPreferenceStore().setValue(IInternalDebugUIConstants.PREF_USER_VIEW_BINDINGS, prefValue);
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- } finally {
- fIgnoreChanges = false;
- }
-
- }
-
- /**
- * Returns the perspectives in which debugging is enabled.
- *
- * @return
- */
- public String[] getEnabledPerspectives() {
- return (String[]) fEnabledPerspectives.toArray(new String[fEnabledPerspectives.size()]);
- }
-
- /**
- * Show the view without effecting user preferences
- *
- * @param viewId
- */
- public void showViewQuiet(String viewId) {
- IWorkbenchPage page = fWindow.getActivePage();
- if (page != null) {
- try {
- fIgnoreChanges = true;
- IViewPart part = page.showView(viewId, null, IWorkbenchPage.VIEW_VISIBLE);
- if (!page.isPartVisible(part)) {
- page.bringToTop(part);
- }
- } catch (PartInitException e) {
- DebugUIPlugin.log(e);
- } finally {
- fIgnoreChanges = false;
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveListener4#perspectivePreDeactivate(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor)
- */
- public void perspectivePreDeactivate(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
- if (page.getWorkbenchWindow().equals(fWindow)) {
- clean(perspective);
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java
deleted file mode 100644
index 9e20fb5ce..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.debug.core.model.IBreakpoint;
-
-/**
- * A container of breakpoints, based on a category.
- */
-public class BreakpointContainer extends PlatformObject {
-
- private IAdaptable fCategory;
- private IBreakpointOrganizer fOrganizer;
- private List fBreakpoints;
- private Map fCategoriesToContainers;
- private IBreakpointOrganizer[] fNesting;
-
- /**
- * Constructs a container of breakpoints for the given category,
- * created by the given organizer.
- *
- * @param category breakpoint category
- * @param organizer breakpoint organizer
- * @param nesting nested organizers or <code>null</code> if none
- */
- public BreakpointContainer(IAdaptable category, IBreakpointOrganizer organizer, IBreakpointOrganizer[] nesting) {
- fCategory = category;
- fOrganizer = organizer;
- fBreakpoints = new ArrayList();
- fNesting = nesting;
- fCategoriesToContainers = new HashMap();
- // seed with all nested categories
- if (nesting != null && nesting.length > 0) {
- IAdaptable[] emptyCategories = nesting[0].getCategories();
- if (emptyCategories != null) {
- for (int i = 0; i < emptyCategories.length; i++) {
- IAdaptable empty = emptyCategories[i];
- BreakpointContainer container = (BreakpointContainer) fCategoriesToContainers.get(empty);
- if (container == null) {
- IBreakpointOrganizer[] siblings = new IBreakpointOrganizer[nesting.length - 1];
- System.arraycopy(nesting, 1, siblings, 0, siblings.length);
- container = new BreakpointContainer(empty, nesting[0], siblings);
- fCategoriesToContainers.put(empty, container);
- }
- }
- }
- }
- }
-
- /**
- * Adds a breakpoint to this container and its nested containers.
- *
- * @param breakpoint breakpoint to add
- */
- public void addBreakpoint(IBreakpoint breakpoint) {
- fBreakpoints.add(breakpoint);
- if (fNesting != null && fNesting.length > 0) {
- IBreakpointOrganizer organizer = fNesting[0];
- IAdaptable[] categories = organizer.getCategories(breakpoint);
- if (categories== null || categories.length == 0) {
- categories = OtherBreakpointCategory.getCategories(organizer);
- }
- for (int i = 0; i < categories.length; i++) {
- IAdaptable category = categories[i];
- BreakpointContainer container = (BreakpointContainer) fCategoriesToContainers.get(category);
- if (container == null) {
- IBreakpointOrganizer[] nesting = null;
- if (fNesting.length > 1) {
- nesting = new IBreakpointOrganizer[fNesting.length - 1];
- System.arraycopy(fNesting, 1, nesting, 0, nesting.length);
- }
- container = new BreakpointContainer(category, organizer, nesting);
- fCategoriesToContainers.put(category, container);
- }
- container.addBreakpoint(breakpoint);
- }
- }
- }
-
- /**
- * Returns the breakpoints in this container
- *
- * @return the breakpoints in this container
- */
- public IBreakpoint[] getBreakpoints() {
- return (IBreakpoint[]) fBreakpoints.toArray(new IBreakpoint[fBreakpoints.size()]);
- }
-
- /**
- * Returns this container's category.
- *
- * @return container category
- */
- public IAdaptable getCategory() {
- return fCategory;
- }
-
- /**
- * Returns children as breakpoints or nested containers.
- *
- * @return children as breakpoints or nested containers
- */
- public Object[] getChildren() {
- if (fCategoriesToContainers.isEmpty()) {
- return getBreakpoints();
- }
- return getContainers();
- }
-
- /**
- * Returns the containers nested in this container, possibly empty.
- *
- * @return the containers nested in this container, possibly empty
- */
- public BreakpointContainer[] getContainers() {
- Collection collection = fCategoriesToContainers.values();
- return (BreakpointContainer[]) collection.toArray(new BreakpointContainer[collection.size()]);
- }
-
- /**
- * Returns this container's organizer.
- *
- * @return this container's organizer
- */
- public IBreakpointOrganizer getOrganizer() {
- return fOrganizer;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if (obj instanceof BreakpointContainer) {
- BreakpointContainer container = (BreakpointContainer) obj;
- return getCategory().equals(container.getCategory());
- }
- return super.equals(obj);
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return getCategory().hashCode();
- }
-
- /**
- * Returns whether this container contains the given breakpoint.
- *
- * @param breakpoint
- * @return whether this container contains the given breakpoint
- */
- public boolean contains(IBreakpoint breakpoint) {
- return fBreakpoints.contains(breakpoint);
- }
-
- /**
- * Returns the leaf containers the given breakpoint is contained in, or <code>null</code>
- * if none.
- *
- * @param breakpoint
- * @return leaf containers the given breakpoint is contained in, or <code>null</code>
- * if none
- */
- public BreakpointContainer[] getContainers(IBreakpoint breakpoint) {
- if (contains(breakpoint)) {
- BreakpointContainer[] containers = getContainers();
- if (containers.length == 0) {
- return new BreakpointContainer[]{this};
- }
- List list = new ArrayList();
- for (int i = 0; i < containers.length; i++) {
- BreakpointContainer container = containers[i];
- BreakpointContainer[] subcontainers = container.getContainers(breakpoint);
- if (subcontainers != null) {
- for (int j = 0; j < subcontainers.length; j++) {
- list.add(subcontainers[j]);
- }
- }
- }
- return (BreakpointContainer[]) list.toArray(new BreakpointContainer[list.size()]);
- }
- return null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java
deleted file mode 100644
index 2c009db99..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.ui.model.IWorkbenchAdapter2;
-
-/**
- * BreakpointContainerWorkbenchAdapter
- */
-public class BreakpointContainerWorkbenchAdapter implements IWorkbenchAdapter, IWorkbenchAdapter2{
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
- */
- public Object[] getChildren(Object o) {
- // not used
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- if (object instanceof BreakpointContainer) {
- BreakpointContainer container = (BreakpointContainer) object;
- IAdaptable category = container.getCategory();
- IWorkbenchAdapter adapter = (IWorkbenchAdapter) category.getAdapter(IWorkbenchAdapter.class);
- if (adapter != null) {
- return adapter.getImageDescriptor(category);
- }
- return container.getOrganizer().getImageDescriptor();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
- */
- public String getLabel(Object object) {
- if (object instanceof BreakpointContainer) {
- BreakpointContainer container = (BreakpointContainer) object;
- IAdaptable category = container.getCategory();
- IWorkbenchAdapter adapter = (IWorkbenchAdapter) category.getAdapter(IWorkbenchAdapter.class);
- if (adapter != null) {
- return adapter.getLabel(category);
- }
- return container.getOrganizer().getLabel();
- }
- return IInternalDebugCoreConstants.EMPTY_STRING;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
- */
- public Object getParent(Object o) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter2#getForeground(java.lang.Object)
- */
- public RGB getForeground(Object object) {
- if (object instanceof BreakpointContainer) {
- BreakpointContainer container = (BreakpointContainer) object;
- IAdaptable category = container.getCategory();
- IWorkbenchAdapter2 adapter = (IWorkbenchAdapter2) category.getAdapter(IWorkbenchAdapter2.class);
- if (adapter != null) {
- return adapter.getForeground(category);
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter2#getBackground(java.lang.Object)
- */
- public RGB getBackground(Object object) {
- if (object instanceof BreakpointContainer) {
- BreakpointContainer container = (BreakpointContainer) object;
- IAdaptable category = container.getCategory();
- IWorkbenchAdapter2 adapter = (IWorkbenchAdapter2) category.getAdapter(IWorkbenchAdapter2.class);
- if (adapter != null) {
- return adapter.getBackground(category);
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter2#getFont(java.lang.Object)
- */
- public FontData getFont(Object object) {
- if (object instanceof BreakpointContainer) {
- BreakpointContainer container = (BreakpointContainer) object;
- IAdaptable category = container.getCategory();
- IWorkbenchAdapter2 adapter = (IWorkbenchAdapter2) category.getAdapter(IWorkbenchAdapter2.class);
- if (adapter != null) {
- return adapter.getFont(category);
- }
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFactory.java
deleted file mode 100644
index 221587fd2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFactory.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.ui.IElementFactory;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Factory to restore breakpoints from mementos for breakpoint working sets.
- */
-public class BreakpointFactory implements IElementFactory {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IElementFactory#createElement(org.eclipse.ui.IMemento)
- */
- public IAdaptable createElement(IMemento memento) {
- String longString = memento.getString(BreakpointPersistableElementAdapter.TAG_MARKER_ID);
- String factoryId = memento.getString(BreakpointPersistableElementAdapter.TAG_RESOURCE_FACTORY_ID);
- if (factoryId != null && longString != null) {
- IElementFactory elementFactory = PlatformUI.getWorkbench().getElementFactory(factoryId);
- if (elementFactory != null) {
- IAdaptable adaptable = elementFactory.createElement(memento);
- if (adaptable instanceof IResource) {
- IResource resource = (IResource) adaptable;
- try {
- long id = Long.parseLong(longString);
- IMarker marker = resource.findMarker(id);
- if (marker != null) {
- return DebugPlugin.getDefault().getBreakpointManager().getBreakpoint(marker);
- }
- } catch (NumberFormatException e) {
- } catch (CoreException e) {
- }
- }
- }
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java
deleted file mode 100644
index 3108687a3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.views.DebugUIViewsMessages;
-import org.eclipse.debug.ui.IBreakpointOrganizerDelegate;
-import org.eclipse.debug.ui.IBreakpointOrganizerDelegateExtension;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.IPropertyChangeListener;
-
-/**
- * A contributed breakpoint organizer.
- */
-public class BreakpointOrganizerExtension implements IBreakpointOrganizer, IBreakpointOrganizerDelegateExtension {
-
- private IConfigurationElement fElement;
- private IBreakpointOrganizerDelegate fDelegate;
- private ImageDescriptor fDescriptor;
-
- // attributes
- public static final String ATTR_LABEL = "label"; //$NON-NLS-1$
- public static final String ATTR_CLASS = "class"; //$NON-NLS-1$
- public static final String ATTR_ID = "id"; //$NON-NLS-1$
- public static final String ATTR_ICON = "icon"; //$NON-NLS-1$
- public static final String ATTR_OTHERS_LABEL = "othersLabel"; //$NON-NLS-1$
-
- public BreakpointOrganizerExtension(IConfigurationElement element) {
- fElement = element;
- }
-
- /**
- * Returns the image descriptor for this organizer.
- *
- * @return image descriptor
- */
- public ImageDescriptor getImageDescriptor() {
- if (fDescriptor == null) {
- fDescriptor = DebugUIPlugin.getImageDescriptor(fElement, ATTR_ICON);
- if (fDescriptor == null) {
- fDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
- }
- return fDescriptor;
- }
-
- /**
- * Returns this organizer's label.
- *
- * @return this organizer's label
- */
- public String getLabel() {
- return fElement.getAttribute(ATTR_LABEL);
- }
-
- /**
- * Returns this organizer's identifier.
- *
- * @return this organizer's identifier
- */
- public String getIdentifier() {
- return fElement.getAttribute(ATTR_ID);
- }
-
- /**
- * Returns this organizer's delegate, instantiating it if required.
- *
- * @return this organizer's delegate
- */
- protected IBreakpointOrganizerDelegate getOrganizer() {
- if (fDelegate == null) {
- try {
- fDelegate = (IBreakpointOrganizerDelegate) fElement.createExecutableExtension(ATTR_CLASS);
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- return fDelegate;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories(org.eclipse.debug.core.model.IBreakpoint)
- */
- public IAdaptable[] getCategories(IBreakpoint breakpoint) {
- return getOrganizer().getCategories(breakpoint);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener) {
- getOrganizer().addPropertyChangeListener(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener) {
- getOrganizer().removePropertyChangeListener(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#addBreakpoint(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
- */
- public void addBreakpoint(IBreakpoint breakpoint, IAdaptable category) {
- getOrganizer().addBreakpoint(breakpoint, category);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#removeBreakpoint(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
- */
- public void removeBreakpoint(IBreakpoint breakpoint, IAdaptable category) {
- getOrganizer().removeBreakpoint(breakpoint, category);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#canAdd(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
- */
- public boolean canAdd(IBreakpoint breakpoint, IAdaptable category) {
- return getOrganizer().canAdd(breakpoint, category);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#canRemove(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
- */
- public boolean canRemove(IBreakpoint breakpoint, IAdaptable category) {
- return getOrganizer().canRemove(breakpoint, category);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#dispose()
- */
- public void dispose() {
- // don't instantiate the delegate if it has not been used
- if (fDelegate != null) {
- fDelegate.dispose();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.breakpoints.IBreakpointOrganizer#getOthersLabel()
- */
- public String getOthersLabel() {
- String attribute = fElement.getAttribute(ATTR_OTHERS_LABEL);
- if (attribute == null) {
- return DebugUIViewsMessages.OtherBreakpointOrganizer_0;
- }
- return attribute;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories()
- */
- public IAdaptable[] getCategories() {
- return getOrganizer().getCategories();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegateExtension#addBreakpoints(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.runtime.IAdaptable)
- */
- public void addBreakpoints(IBreakpoint[] breakpoints, IAdaptable category) {
- IBreakpointOrganizerDelegate organizer = getOrganizer();
- if (organizer instanceof IBreakpointOrganizerDelegateExtension) {
- ((IBreakpointOrganizerDelegateExtension)organizer).addBreakpoints(breakpoints, category);
- } else {
- for (int i = 0; i < breakpoints.length; i++) {
- addBreakpoint(breakpoints[i], category);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegateExtension#removeBreakpoints(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.runtime.IAdaptable)
- */
- public void removeBreakpoints(IBreakpoint[] breakpoints, IAdaptable category) {
- IBreakpointOrganizerDelegate organizer = getOrganizer();
- if (organizer instanceof IBreakpointOrganizerDelegateExtension) {
- ((IBreakpointOrganizerDelegateExtension)organizer).removeBreakpoints(breakpoints, category);
- } else {
- for (int i = 0; i < breakpoints.length; i++) {
- removeBreakpoint(breakpoints[i], category);
- }
- }
-
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java
deleted file mode 100644
index 617ff70c3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-
-/**
- * Manager which provides access to the breakpoint organizers
- * contributed via the org.eclipse.debug.ui.breakpointOrganizers
- * extension point.
- * <p>
- * Manages the default breakpoint working set and places newly
- * create breakpoints in to that set.
- * </p>
- * @since 3.1
- */
-public class BreakpointOrganizerManager {
-
- private static BreakpointOrganizerManager fgManager;
-
- // map for lookup by id
- private Map fOrganizers = new HashMap();
- // cached sorted list by label
- private List fSorted = null;
-
- /**
- * Returns the singleton instance of the breakpoint container
- * factory manager.
- */
- public static BreakpointOrganizerManager getDefault() {
- if (fgManager == null) {
- fgManager= new BreakpointOrganizerManager();
- }
- return fgManager;
- }
-
- /**
- * Creates and initializes a new breakpoint container factory.
- */
- private BreakpointOrganizerManager() {
- loadOrganizers();
- // force the working set organizers to initialize their listeners
- start("org.eclipse.debug.ui.workingSetOrganizer"); //$NON-NLS-1$
- start("org.eclipse.debug.ui.breakpointWorkingSetOrganizer"); //$NON-NLS-1$
- }
-
- /**
- * Forces instantiation of orgranizer delegate.
- *
- * @param organizerId organizer to start
- */
- private void start(String organizerId) {
- IBreakpointOrganizer organizer = getOrganizer(organizerId);
- IPropertyChangeListener listener = new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- }
- };
- organizer.addPropertyChangeListener(listener);
- organizer.removePropertyChangeListener(listener);
- }
-
- /**
- * Loads all contributed breakpoint organizers.
- */
- private void loadOrganizers() {
- IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_BREAKPOINT_ORGANIZERS);
- IConfigurationElement[] configurationElements = extensionPoint.getConfigurationElements();
- for (int i = 0; i < configurationElements.length; i++) {
- IConfigurationElement element= configurationElements[i];
- IBreakpointOrganizer organizer = new BreakpointOrganizerExtension(element);
- if (validateOrganizer(organizer)) {
- fOrganizers.put(organizer.getIdentifier(), organizer);
- }
- }
- }
-
- /**
- * Validates the given organizer. Checks that certain required attributes
- * are available.
- * @param extension the organizer to validate
- * @return whether the given organizer is valid
- */
- protected static boolean validateOrganizer(IBreakpointOrganizer organizer) {
- String id = organizer.getIdentifier();
- String label = organizer.getLabel();
- return id != null && id.length() > 0 && label != null && label.length() > 0;
- }
-
- /**
- * Returns all contributed breakpoint organizers.
- *
- * @return all contributed breakpoint organizers
- */
- public IBreakpointOrganizer[] getOrganizers() {
- if (fSorted == null) {
- Collection collection = fOrganizers.values();
- fSorted = new ArrayList();
- fSorted.addAll(collection);
- Collections.sort(fSorted, new Comparator() {
- public int compare(Object o1, Object o2) {
- IBreakpointOrganizer b1 = (IBreakpointOrganizer)o1;
- IBreakpointOrganizer b2 = (IBreakpointOrganizer)o2;
- return b1.getLabel().compareTo(b2.getLabel());
- }
-
- public boolean equals(Object obj) {
- return this == obj;
- }
- });
- }
- return (IBreakpointOrganizer[]) fSorted.toArray(new IBreakpointOrganizer[fSorted.size()]);
- }
-
- /**
- * Returns the specified breakpoint organizer or <code>null</code>
- * @param id organizer identifier
- * @return breakpoint organizer or <code>null</code>
- */
- public IBreakpointOrganizer getOrganizer(String id) {
- return (IBreakpointOrganizer) fOrganizers.get(id);
- }
-
- /**
- * Shuts down the organizer manager, disposing organizers.
- */
- public void shutdown() {
- IBreakpointOrganizer[] organizers = getOrganizers();
- for (int i = 0; i < organizers.length; i++) {
- IBreakpointOrganizer organizer = organizers[i];
- organizer.dispose();
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java
deleted file mode 100644
index d0c83615e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IPersistableElement;
-
-/**
- * Adapter to save and restore breakpoints for a working set.
- */
-public class BreakpointPersistableElementAdapter implements IPersistableElement {
-
- private IBreakpoint fBreakpoint;
-
- public static final String TAG_MARKER_ID = "TAG_MARKER_ID"; //$NON-NLS-1$
- public static final String TAG_RESOURCE_FACTORY_ID = "TAG_RESOURCE_FACTORY_ID"; //$NON-NLS-1$
-
- /**
- * Constructs a new persitable element adapter for the given breakpoint.
- *
- * @param breakpoint
- */
- public BreakpointPersistableElementAdapter(IBreakpoint breakpoint) {
- fBreakpoint = breakpoint;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPersistableElement#getFactoryId()
- */
- public String getFactoryId() {
- return "org.eclipse.debug.ui.elementFactory.breakpoints"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPersistableElement#saveState(org.eclipse.ui.IMemento)
- */
- public void saveState(IMemento memento) {
- IMarker marker = fBreakpoint.getMarker();
- if (marker != null) {
- IResource resource = marker.getResource();
- IPersistableElement pe = (IPersistableElement) resource.getAdapter(IPersistableElement.class);
- if (pe != null) {
- long id = marker.getId();
- String longString = Long.toString(id);
- memento.putString(TAG_MARKER_ID, longString);
- memento.putString(TAG_RESOURCE_FACTORY_ID, pe.getFactoryId());
- pe.saveState(memento);
- }
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java
deleted file mode 100644
index ef4a7c265..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java
+++ /dev/null
@@ -1,456 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IMarkerDelta;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.IBreakpointsListener;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.importexport.breakpoints.IImportExportConstants;
-import org.eclipse.debug.ui.AbstractBreakpointOrganizerDelegate;
-import org.eclipse.debug.ui.IBreakpointOrganizerDelegateExtension;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Breakpoint organizers for breakpoint working sets.
- *
- * @since 3.1
- */
-public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate implements IBreakpointOrganizerDelegateExtension, IPropertyChangeListener, IBreakpointsListener {
-
- private IWorkingSetManager fWorkingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
-
- /**
- * A cache for mapping markers to the working set they belong to
- * @since 3.2
- */
- private BreakpointWorkingSetCache fCache = null;
-
- // Cache of the default working set, so we can know when it changes name
- private static IWorkingSet fDefaultWorkingSet = null;
-
-
- /**
- * Constructs a working set breakpoint organizer. Listens for changes in
- * working sets and fires property change notification.
- */
- public BreakpointSetOrganizer() {
- fWorkingSetManager.addPropertyChangeListener(this);
- fCache = new BreakpointWorkingSetCache();
- DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
- DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
- fDefaultWorkingSet = getDefaultWorkingSet();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories(org.eclipse.debug.core.model.IBreakpoint)
- */
- public IAdaptable[] getCategories(IBreakpoint breakpoint) {
- List result = new ArrayList();
- IWorkingSet[] workingSets = fWorkingSetManager.getWorkingSets();
- for (int i = 0; i < workingSets.length; i++) {
- IWorkingSet set = workingSets[i];
- if (IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(set.getId())) {
- IAdaptable[] elements = set.getElements();
- for (int j = 0; j < elements.length; j++) {
- IAdaptable adaptable = elements[j];
- if (adaptable.equals(breakpoint)) {
- result.add(new WorkingSetCategory(set));
- break;
- }
- }
- }
- }
- return (IAdaptable[]) result.toArray(new IAdaptable[result.size()]);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#dispose()
- */
- public void dispose() {
- fWorkingSetManager.removePropertyChangeListener(this);
- fWorkingSetManager = null;
- DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
- DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
- super.dispose();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- IWorkingSet set = null;
- Object newValue = event.getNewValue();
- if (newValue instanceof IWorkingSet) {
- set = (IWorkingSet) newValue;
- }
- else if (event.getOldValue() instanceof IWorkingSet) {
- set = (IWorkingSet) event.getOldValue();
- }
- if(set == null) {
- return;
- }
- String property = event.getProperty();
- //fix for bug 103731
- if (property.equals(IWorkingSetManager.CHANGE_WORKING_SET_NAME_CHANGE)) {
- if (newValue.equals(fDefaultWorkingSet)) {
- setDefaultWorkingSet((IWorkingSet) newValue);
- }
- }
- if (property.equals(IWorkingSetManager.CHANGE_WORKING_SET_REMOVE)) {
- if (event.getOldValue().equals(fDefaultWorkingSet)) {
- setDefaultWorkingSet(null);
- }
- }
- if(property.equals(IWorkingSetManager.CHANGE_WORKING_SET_ADD)) {
- IAdaptable[] breakpoints = set.getElements();
- for (int i = 0; i < breakpoints.length; i++) {
- if (breakpoints[i] instanceof IBreakpoint) {
- IMarker marker = ((IBreakpoint)breakpoints[i]).getMarker();
- fCache.addEntry(marker, set.getName());
- fCache.flushMarkerCache(marker);
- }
- }
- }
- if (set != null && IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(set.getId())) {
- fireCategoryChanged(new WorkingSetCategory(set));
- }
- if (property.equals(IInternalDebugUIConstants.MEMENTO_BREAKPOINT_WORKING_SET_NAME)) {
- IWorkingSet defaultWorkingSet = getDefaultWorkingSet();
- if (defaultWorkingSet != null) {
- fireCategoryChanged(new WorkingSetCategory(defaultWorkingSet));
- } else {
- fireCategoryChanged(null);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.IBreakpointsListener#breakpointsAdded(org.eclipse.debug.core.model.IBreakpoint[])
- */
- public void breakpointsAdded(IBreakpoint[] breakpoints) {
- Map setToBreakpoints = new HashMap();
- for (int i = 0; i < breakpoints.length; i++) {
- IMarker marker = breakpoints[i].getMarker();
- String[] names = getWorkingsetAttributeFromMarker(marker, IInternalDebugUIConstants.WORKING_SET_NAME);
- //add it to the default set if the listing is empty
- if (names.length == 0) {
- queueToSet(breakpoints[i], getDefaultWorkingSet(), setToBreakpoints);
- } else {
- for (int j = 1; j < names.length; j++) {
- IWorkingSet set = PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(names[j]);
- // if we cannot find the one we want, try to get the default
- if (set == null) {
- set = getDefaultWorkingSet();
- }
- queueToSet(breakpoints[i], set, setToBreakpoints);
- }
- }
- }
- Iterator iterator = setToBreakpoints.entrySet().iterator();
- while (iterator.hasNext()) {
- Entry entry = (Entry) iterator.next();
- IWorkingSet set = (IWorkingSet) entry.getKey();
- List list = (List) entry.getValue();
- addBreakpointsToSet((IBreakpoint[]) list.toArray(new IBreakpoint[list.size()]), set);
- }
- }
-
- private void queueToSet(IBreakpoint breakpoint, IWorkingSet set, Map queue) {
- List list = (List) queue.get(set);
- if (list == null) {
- list = new ArrayList();
- queue.put(set, list);
- }
- list.add(breakpoint);
- }
-
- /**
- * Adds a breakpoint to a working set
- * @param breakpoint the breakpoint to add
- * @param set the set to add it to or <code>null</code> if none
- *
- * @since 3.2
- */
- private void addBreakpointsToSet(IBreakpoint[] breakpoints, IWorkingSet set) {
- if (set != null) {
- IAdaptable[] elements = set.getElements();
- Set collection = new HashSet(elements.length);
- List list = new ArrayList(elements.length + breakpoints.length);
- for(int i = 0; i < elements.length; i++) {
- collection.add(elements[i]);
- list.add(elements[i]);
- }
- for (int i = 0; i < breakpoints.length; i++) {
- IBreakpoint breakpoint = breakpoints[i];
- if (!collection.contains(breakpoint)) {
- list.add(breakpoint);
- fCache.addEntry(breakpoint.getMarker(), set.getName()); //fix for bug 103731
- fCache.flushMarkerCache(breakpoint.getMarker());
- }
- }
- set.setElements((IAdaptable[]) list.toArray(new IAdaptable[list.size()]));
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.IBreakpointsListener#breakpointsRemoved(org.eclipse.debug.core.model.IBreakpoint[],
- * org.eclipse.core.resources.IMarkerDelta[])
- */
- public void breakpointsRemoved(IBreakpoint[] breakpoints,
- IMarkerDelta[] deltas) {
- IWorkingSet[] workingSets = fWorkingSetManager.getWorkingSets();
- IWorkingSet set = null;
- for (int i = 0; i < workingSets.length; i++) {
- set = workingSets[i];
- if (IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(set.getId())) {
- clean(set);
- }
- }
- }
-
- /**
- * Removes deleted breakpoints from the given working set.
- *
- * @param workingSet
- * breakpoint working set
- */
- private void clean(IWorkingSet workingSet) {
- IAdaptable[] elements = workingSet.getElements();
- IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
- boolean update = false;
- for (int i = 0; i < elements.length; i++) {
- IAdaptable adaptable = elements[i];
- if (adaptable instanceof IBreakpoint) {
- IBreakpoint breakpoint = (IBreakpoint) adaptable;
- if (!manager.isRegistered(breakpoint)) {
- update = true;
- elements[i] = null;
- }
- }
- }
- if (update) {
- List newElements = new ArrayList(elements.length);
- for (int i = 0; i < elements.length; i++) {
- IAdaptable adaptable = elements[i];
- if (adaptable != null) {
- newElements.add(adaptable);
- }
- }
- workingSet.setElements((IAdaptable[]) newElements.toArray(new IAdaptable[newElements.size()]));
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.IBreakpointsListener#breakpointsChanged(org.eclipse.debug.core.model.IBreakpoint[],
- * org.eclipse.core.resources.IMarkerDelta[])
- */
- public void breakpointsChanged(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
- }
-
- /**
- * Returns the active default breakpoint working set, or <code>null</code>
- * if none.
- *
- * @return the active default breakpoint working set, or <code>null</code>
- */
- public static IWorkingSet getDefaultWorkingSet() {
- IPreferenceStore preferenceStore = DebugUIPlugin.getDefault().getPreferenceStore();
- String name = preferenceStore.getString(IInternalDebugUIConstants.MEMENTO_BREAKPOINT_WORKING_SET_NAME);
- if (name != null) {
- return PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(name);
- }
- return null;
- }
-
- /**
- * Sets the active default breakpoint working set, or <code>null</code> if
- * none.
- *
- * @param set
- * default working set or <code>null</code>
- */
- public static void setDefaultWorkingSet(IWorkingSet set) {
- String name = IInternalDebugCoreConstants.EMPTY_STRING;
- if (set != null) {
- // only consider breakpoint working sets
- if (IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(set.getId())) {
- name = set.getName();
- }
- }
- fDefaultWorkingSet = set;
- DebugUIPlugin.getDefault().getPluginPreferences().setValue(IInternalDebugUIConstants.MEMENTO_BREAKPOINT_WORKING_SET_NAME, name);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#canRemove(org.eclipse.debug.core.model.IBreakpoint,
- * org.eclipse.core.runtime.IAdaptable)
- */
- public boolean canRemove(IBreakpoint breakpoint, IAdaptable category) {
- if (category instanceof WorkingSetCategory) {
- WorkingSetCategory wsc = (WorkingSetCategory) category;
- return IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(wsc.getWorkingSet().getId());
- }
- return super.canRemove(breakpoint, category);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#canAdd(org.eclipse.debug.core.model.IBreakpoint,
- * org.eclipse.core.runtime.IAdaptable)
- */
- public boolean canAdd(IBreakpoint breakpoint, IAdaptable category) {
- if (category instanceof WorkingSetCategory) {
- WorkingSetCategory wsc = (WorkingSetCategory) category;
- return IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(wsc.getWorkingSet().getId());
- }
- return super.canAdd(breakpoint, category);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#addBreakpoint(org.eclipse.debug.core.model.IBreakpoint,
- * org.eclipse.core.runtime.IAdaptable)
- */
- public void addBreakpoint(IBreakpoint breakpoint, IAdaptable category) {
- addBreakpoints(new IBreakpoint[]{breakpoint}, category);
- }
-
- /**
- * Gets the working set names from the marker
- *
- * @param marker
- * them marker to get the names from
- * @return the listing of markers or an empty String array, never null
- *
- * @since 3.2
- */
- private String[] getWorkingsetAttributeFromMarker(IMarker marker, String type) {
- try {
- String name = (String) marker.getAttribute(type);
- if (name != null) {
- return name.split("\\" + IImportExportConstants.DELIMITER); //$NON-NLS-1$
- }
- }
- catch (CoreException e) {DebugPlugin.log(e);}
- return new String[] {};
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#removeBreakpoint(org.eclipse.debug.core.model.IBreakpoint,
- * org.eclipse.core.runtime.IAdaptable)
- */
- public void removeBreakpoint(IBreakpoint breakpoint, IAdaptable category) {
- if (category instanceof WorkingSetCategory) {
- IWorkingSet set = ((WorkingSetCategory) category).getWorkingSet();
- IAdaptable[] elements = set.getElements();
- List list = new ArrayList();
- for (int i = 0; i < elements.length; i++) {
- IAdaptable adaptable = elements[i];
- if (!adaptable.equals(breakpoint)) {
- list.add(adaptable);
- }
- }
- fCache.removeMappedEntry(breakpoint.getMarker(), set.getName());
- fCache.flushMarkerCache(breakpoint.getMarker());
- set.setElements((IAdaptable[]) list.toArray(new IAdaptable[list.size()]));
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories()
- */
- public IAdaptable[] getCategories() {
- IWorkingSet[] workingSets = fWorkingSetManager.getWorkingSets();
- List all = new ArrayList();
- for (int i = 0; i < workingSets.length; i++) {
- IWorkingSet set = workingSets[i];
- if (IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(set
- .getId())) {
- all.add(new WorkingSetCategory(set));
- }
- }
- return (IAdaptable[]) all.toArray(new IAdaptable[all.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegateExtension#addBreakpoints(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.runtime.IAdaptable)
- */
- public void addBreakpoints(IBreakpoint[] breakpoints, IAdaptable category) {
- if (category instanceof WorkingSetCategory) {
- IWorkingSet set = ((WorkingSetCategory) category).getWorkingSet();
- addBreakpointsToSet(breakpoints, set);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegateExtension#removeBreakpoints(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.runtime.IAdaptable)
- */
- public void removeBreakpoints(IBreakpoint[] breakpoints, IAdaptable category) {
- if (category instanceof WorkingSetCategory) {
- IWorkingSet set = ((WorkingSetCategory) category).getWorkingSet();
- IAdaptable[] elements = set.getElements();
- List list = new ArrayList(elements.length);
- for (int i = 0; i < elements.length; i++) {
- list.add(elements[i]);
- }
- for (int i = 0; i < breakpoints.length; i++) {
- IBreakpoint breakpoint = breakpoints[i];
- fCache.removeMappedEntry(breakpoint.getMarker(), set.getName());
- fCache.flushMarkerCache(breakpoint.getMarker());
- list.remove(breakpoint);
- }
- set.setElements((IAdaptable[]) list.toArray(new IAdaptable[list.size()]));
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java
deleted file mode 100644
index 613072513..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.ui.AbstractBreakpointOrganizerDelegate;
-import org.eclipse.debug.ui.BreakpointTypeCategory;
-import org.eclipse.debug.ui.IBreakpointTypeCategory;
-
-/**
- * Breakpoint organizers for breakpoint types.
- *
- * @since 3.1
- */
-public class BreakpointTypeOrganizer extends AbstractBreakpointOrganizerDelegate {
-
- private Map fTypes = new HashMap();
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories(org.eclipse.debug.core.model.IBreakpoint)
- */
- public IAdaptable[] getCategories(IBreakpoint breakpoint) {
- IBreakpointTypeCategory category = (IBreakpointTypeCategory) breakpoint.getAdapter(IBreakpointTypeCategory.class);
- if (category != null) {
- return new IAdaptable[]{category};
- }
- String name = DebugPlugin.getDefault().getBreakpointManager().getTypeName(breakpoint);
- if (name != null) {
- IAdaptable[] categories = (IAdaptable[]) fTypes.get(name);
- if (categories == null) {
- categories = new IAdaptable[]{new BreakpointTypeCategory(name)};
- fTypes.put(name, categories);
- }
- return categories;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#dispose()
- */
- public void dispose() {
- fTypes.clear();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetCache.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetCache.java
deleted file mode 100644
index 85682f4ed..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetCache.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import java.util.HashMap;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.importexport.breakpoints.IImportExportConstants;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Class to cache the breakpoint to workingset information in its underlying
- * marker as breakpoints are moved between breakpoint working sets.
- * It resolves the need for constant attribute lookup and parsing to
- * fix bug 103731
- *
- * @since 3.2
- */
-public class BreakpointWorkingSetCache {
-
- /**
- * the entire cache
- * key: marker
- * value: vector of workingsets the marker belongs to
- */
- HashMap fCache = null;
-
- /**
- * Default constructor
- * @param organizer the oprganizer that owns this cache
- */
- public BreakpointWorkingSetCache() {
- fCache = new HashMap(15);
- }
-
- /**
- * Adds an entry into the cache
- * @param marker the marker to add the workingset information about
- * @param entry the entry to add to the cache
- */
- public void addEntry(IMarker marker, Object entry) {
- Vector list = (Vector)fCache.get(marker);
- if (list == null) {
- list = new Vector();
- list.addElement(entry);
- fCache.put(marker, list);
- }
- else {
- if(!list.contains(entry)) {
- list.addElement(entry);
- }
- }
- }
-
- /**
- * Removes an item from the list contained under the marker key, not the marker entry
- * @param marker the marker key to remove the item from
- * @param entry the entry to remove
- */
- public void removeMappedEntry(IMarker marker, Object entry) {
- Vector list = (Vector)fCache.get(marker);
- if(list != null) {
- list.remove(entry);
- }
- }
-
- /**
- * Flushes the cache of only the specified marker
- * @param marker the marker whose cache is to be flushed
- */
- public void flushMarkerCache(IMarker marker) {
- IWorkingSetManager manager = PlatformUI.getWorkbench().getWorkingSetManager();
- Vector list = (Vector)fCache.get(marker);
- if(list != null) {
- String names = IImportExportConstants.DELIMITER;
- String ids = IImportExportConstants.DELIMITER;
- for(int i = 0; i < list.size(); i++) {
- String name = (String)list.elementAt(i);
- IWorkingSet ws = manager.getWorkingSet(name);
- if(ws != null) {
- names += name+IImportExportConstants.DELIMITER;
- ids += ws.getId()+IImportExportConstants.DELIMITER;
- }
- }
- try {
- marker.setAttribute(IInternalDebugUIConstants.WORKING_SET_NAME, names);
- marker.setAttribute(IInternalDebugUIConstants.WORKING_SET_ID, ids);
- }
- catch(CoreException e) {DebugPlugin.log(e);}
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetElementAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetElementAdapter.java
deleted file mode 100644
index bc7e5fbc0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetElementAdapter.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetElementAdapter;
-
-/**
- * Consulted by workbench pull down actions that add/remove selected elements to/from
- * working sets. Allows breakpoint working sets to select which elements are applicable
- * for adding/removing.
- *
- * @since 3.3
- */
-public class BreakpointWorkingSetElementAdapter implements IWorkingSetElementAdapter {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkingSetElementAdapter#adaptElements(org.eclipse.ui.IWorkingSet, org.eclipse.core.runtime.IAdaptable[])
- */
- public IAdaptable[] adaptElements(IWorkingSet ws, IAdaptable[] elements) {
- for (int i = 0; i < elements.length; i++) {
- IAdaptable adaptable = elements[i];
- if (!(adaptable instanceof IBreakpoint)) {
- return selectBreakpoints(elements);
- }
- }
- return elements;
- }
-
- private IAdaptable[] selectBreakpoints(IAdaptable[] elements) {
- List breakpoints = new ArrayList(elements.length);
- for (int i = 0; i < elements.length; i++) {
- IAdaptable adaptable = elements[i];
- if (adaptable instanceof IBreakpoint) {
- breakpoints.add(adaptable);
- }
- }
- return (IAdaptable[]) breakpoints.toArray(new IAdaptable[breakpoints.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkingSetElementAdapter#dispose()
- */
- public void dispose() {
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java
deleted file mode 100644
index aa8f8a789..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.importexport.breakpoints.EmbeddedBreakpointsViewer;
-import org.eclipse.debug.internal.ui.views.DebugUIViewsMessages;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.IWorkingSetPage;
-
-/**
- * The Breakpoint working set page allows the user to create
- * and edit a Breakpoint working set.
- *
- * @since 3.1
- */
-public class BreakpointWorkingSetPage extends WizardPage implements IWorkingSetPage {
-
- final private static String PAGE_TITLE= DebugUIViewsMessages.BreakpointWorkingSetPage_0;
- final private static String PAGE_ID= "breakpointWorkingSetPage"; //$NON-NLS-1$
-
- private Text fWorkingSetName;
- private EmbeddedBreakpointsViewer fTViewer;
- private boolean fFirstCheck;
- private IWorkingSet fWorkingSet;
-
- /**
- * Default constructor.
- */
- public BreakpointWorkingSetPage() {
- super(PAGE_ID, PAGE_TITLE, DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_WIZBAN_DEBUG));
- setDescription(DebugUIViewsMessages.BreakpointWorkingSetPage_1);
- fFirstCheck= true;
- }
-
- /*
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- initializeDialogUnits(parent);
- Composite composite= new Composite(parent, SWT.NONE);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- setControl(composite);
- Label label= new Label(composite, SWT.WRAP);
- label.setText(DebugUIViewsMessages.BreakpointWorkingSetPage_2);
- GridData gd= new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
- label.setLayoutData(gd);
- fWorkingSetName= new Text(composite, SWT.SINGLE | SWT.BORDER);
- fWorkingSetName.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
- fWorkingSetName.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validateInput();
- }
- }
- );
- fWorkingSetName.setFocus();
- label= new Label(composite, SWT.WRAP);
- label.setText(DebugUIViewsMessages.BreakpointWorkingSetPage_3);
- gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
- label.setLayoutData(gd);
- IViewPart viewpart = DebugUIPlugin.getActiveWorkbenchWindow().getActivePage().findView(IDebugUIConstants.ID_BREAKPOINT_VIEW);
- IStructuredSelection selection;
- if (viewpart == null) {
- selection = new StructuredSelection();
- } else {
- selection = (IStructuredSelection)viewpart.getViewSite().getSelectionProvider().getSelection();
- }
- fTViewer = new EmbeddedBreakpointsViewer(composite, DebugPlugin.getDefault().getBreakpointManager(), selection);
- // Add select / deselect all buttons for bug 46669
- Composite buttonComposite = new Composite(composite, SWT.NONE);
- buttonComposite.setLayout(new GridLayout(2, false));
- buttonComposite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- Button selectAllButton = SWTFactory.createPushButton(buttonComposite, DebugUIViewsMessages.BreakpointWorkingSetPage_selectAll_label, null);
- selectAllButton.setToolTipText(DebugUIViewsMessages.BreakpointWorkingSetPage_selectAll_toolTip);
- selectAllButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent selectionEvent) {
- BreakpointsViewer viewer = fTViewer.getViewer();
- viewer.getTree().selectAll();
- viewer.setCheckedElements(((IStructuredSelection)viewer.getSelection()).toArray());
- viewer.setGrayedElements(new Object[] {});
- viewer.getTree().deselectAll();
- validateInput();
- }
- });
- Button deselectAllButton = SWTFactory.createPushButton(buttonComposite, DebugUIViewsMessages.BreakpointWorkingSetPage_deselectAll_label, null);
- deselectAllButton.setToolTipText(DebugUIViewsMessages.BreakpointWorkingSetPage_deselectAll_toolTip);
- deselectAllButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent selectionEvent) {
- BreakpointsViewer viewer = fTViewer.getViewer();
- viewer.setCheckedElements(new Object[] {});
- validateInput();
- }
- });
- if (fWorkingSet != null)
- fWorkingSetName.setText(fWorkingSet.getName());
- validateInput();
- Dialog.applyDialogFont(composite);
- }
-
- /*
- * Implements method from IWorkingSetPage
- */
- public IWorkingSet getSelection() {
- return fWorkingSet;
- }
-
- /*
- * Implements method from IWorkingSetPage
- */
- public void setSelection(IWorkingSet workingSet) {
- Assert.isNotNull(workingSet, "Working set must not be null"); //$NON-NLS-1$
- fWorkingSet= workingSet;
- if (getContainer() != null && getShell() != null && fWorkingSetName != null) {
- fFirstCheck= false;
- fWorkingSetName.setText(fWorkingSet.getName());
- validateInput();
- }
- }
-
- /*
- * Implements method from IWorkingSetPage
- */
- public void finish() {
- String workingSetName = fWorkingSetName.getText();
- Object[] adaptable = fTViewer.getCheckedElements().toArray();
- ArrayList elements = new ArrayList();
- //weed out non-breakpoint elements since 3.2
- for(int i = 0; i < adaptable.length; i++) {
- if(adaptable[i] instanceof IBreakpoint) {
- elements.add(adaptable[i]);
- }//end if
- }//end for
- if (fWorkingSet == null) {
- IWorkingSetManager workingSetManager= PlatformUI.getWorkbench().getWorkingSetManager();
- fWorkingSet = workingSetManager.createWorkingSet(workingSetName, (IAdaptable[])elements.toArray(new IAdaptable[elements.size()]));
- } else {
- fWorkingSet.setName(workingSetName);
- fWorkingSet.setElements((IAdaptable[])elements.toArray(new IAdaptable[elements.size()]));
- }
- }
-
- /**
- * validates the current input of the page to determine if the finish button can be enabled
- */
- private void validateInput() {
- String errorMessage= null;
- String newText= fWorkingSetName.getText();
-
- if (newText.equals(newText.trim()) == false)
- errorMessage = DebugUIViewsMessages.BreakpointWorkingSetPage_4;
- if (newText.equals(IInternalDebugCoreConstants.EMPTY_STRING)) {
- if (fFirstCheck) {
- setPageComplete(false);
- fFirstCheck= false;
- return;
- }
- errorMessage= DebugUIViewsMessages.BreakpointWorkingSetPage_5;
- }
- fFirstCheck= false;
- if (errorMessage == null && (fWorkingSet == null || newText.equals(fWorkingSet.getName()) == false)) {
- IWorkingSet[] workingSets= PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSets();
- for (int i= 0; i < workingSets.length; i++) {
- if (newText.equals(workingSets[i].getName())) {
- errorMessage= DebugUIViewsMessages.BreakpointWorkingSetPage_6;
- }
- }
- }
- setErrorMessage(errorMessage);
- setPageComplete(errorMessage == null);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsComparator.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsComparator.java
deleted file mode 100644
index 96f5741ef..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsComparator.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.ILineBreakpoint;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.viewers.IBasicPropertyConstants;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-/**
- * @since 3.3
- */
-public class BreakpointsComparator extends ViewerComparator {
- /**
- * @see ViewerSorter#isSorterProperty(Object, String)
- */
- public boolean isSorterProperty(Object element,String propertyId) {
- return propertyId.equals(IBasicPropertyConstants.P_TEXT);
- }
-
- /**
- * Returns a negative, zero, or positive number depending on whether
- * the first element is less than, equal to, or greater than
- * the second element.
- * <p>
- * Group breakpoints by debug model
- * within debug model, group breakpoints by type
- * within type groups, sort by line number (if applicable) and then
- * alphabetically by label
- *
- * @param viewer the viewer
- * @param e1 the first element
- * @param e2 the second element
- * @return a negative number if the first element is less than the
- * second element; the value <code>0</code> if the first element is
- * equal to the second element; and a positive number if the first
- * element is greater than the second element
- */
- public int compare(Viewer viewer, Object e1, Object e2) {
- if (!(e1 instanceof IBreakpoint)) {
- return super.compare(viewer, e1, e2);
- }
-
- IBreakpoint b1= (IBreakpoint)e1;
- IBreakpoint b2= (IBreakpoint)e2;
- String modelId1= b1.getModelIdentifier();
- String modelId2= b2.getModelIdentifier();
- int result= modelId1.compareTo(modelId2);
- if (result != 0) {
- return result;
- }
- String type1= IInternalDebugCoreConstants.EMPTY_STRING;
- String type2= IInternalDebugCoreConstants.EMPTY_STRING;
- IMarker marker1= b1.getMarker();
- if (!marker1.exists()) {
- return 0;
- }
- try {
- type1= marker1.getType();
- } catch (CoreException ce) {
- DebugUIPlugin.log(ce);
- }
- try {
- IMarker marker2= b2.getMarker();
- if (!marker2.exists()) {
- return 0;
- }
- type2= marker2.getType();
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
-
- result= type1.compareTo(type2);
- if (result != 0) {
- return result;
- }
- // model and type are the same
-
- ILabelProvider lprov = (ILabelProvider) ((StructuredViewer)viewer).getLabelProvider();
- String name1= lprov.getText(e1);
- String name2= lprov.getText(e2);
-
- boolean lineBreakpoint= false;
- try {
- lineBreakpoint= marker1.isSubtypeOf(IBreakpoint.LINE_BREAKPOINT_MARKER);
- } catch (CoreException ce) {
- }
- if (lineBreakpoint) {
- return compareLineBreakpoints(b1, b2, name1,name2);
- }
-
- return name1.compareTo(name2);
- }
-
- protected int compareLineBreakpoints(IBreakpoint b1, IBreakpoint b2, String name1, String name2) {
- int colon1= name1.indexOf(':');
- if (colon1 != -1) {
- int colon2= name2.indexOf(':');
- if (colon2 != -1) {
- String upToColon1= name1.substring(0, colon1);
- if (name2.startsWith(upToColon1)) {
- int l1= 0;
- int l2= 0;
- try {
- l1= ((ILineBreakpoint)b1).getLineNumber();
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- try {
- l2= ((ILineBreakpoint)b2).getLineNumber();
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- return l1 - l2;
- }
- }
- }
- return name1.compareTo(name2);
- }
- }
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsContentProvider.java
deleted file mode 100644
index 88644a7a7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsContentProvider.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.ui.IBreakpointOrganizerDelegate;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Content provider for the breakpoints view
- */
-public class BreakpointsContentProvider implements ITreeContentProvider, IPropertyChangeListener {
-
- private IBreakpointOrganizer[] fOrganizers = null;
- private BreakpointsViewer fViewer;
- private Object[] fElements;
- private boolean fDisposed = false;
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- */
- public Object[] getChildren(Object parentElement) {
- if (parentElement.equals(DebugPlugin.getDefault().getBreakpointManager())) {
- return fElements;
- } else if (parentElement instanceof BreakpointContainer) {
- return ((BreakpointContainer)parentElement).getChildren();
- }
- return new Object[0];
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- */
- public Object getParent(Object element) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- */
- public boolean hasChildren(Object element) {
- return getChildren(element).length > 0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
- fDisposed = true;
- fElements = null;
- setOrganizers(null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- fViewer = (BreakpointsViewer)viewer;
- if (newInput != null) {
- reorganize();
- }
- }
-
- /**
- * Sets the nested order of breakpoint organizers, or <code>null</code>
- * if none.
- *
- * @param organizers the nested order of breakpoint organizers, or <code>null</code>
- * if none
- */
- public void setOrganizers(IBreakpointOrganizer[] organizers) {
- if (organizers != null && organizers.length == 0) {
- organizers = null;
- }
- // remove previous listeners
- if (fOrganizers != null) {
- for (int i = 0; i < fOrganizers.length; i++) {
- fOrganizers[i].removePropertyChangeListener(this);
- }
- }
- fOrganizers = organizers;
- // add listeners
- if (fOrganizers != null) {
- for (int i = 0; i < fOrganizers.length; i++) {
- fOrganizers[i].addPropertyChangeListener(this);
- }
- }
- if (!fDisposed) {
- fViewer.getControl().setRedraw(false);
- // maintain expansion based on visible breakpoints
- IBreakpoint[] breakpoints = null;
- if (isShowingGroups()) {
- breakpoints = fViewer.getVisibleBreakpoints();
- }
- reorganize();
- if (isShowingGroups()) {
- // restore expansion
- for (int i = 0; i < fElements.length; i++) {
- BreakpointContainer container = (BreakpointContainer) fElements[i];
- for (int j = 0; j < breakpoints.length; j++) {
- if (container.contains(breakpoints[j])) {
- fViewer.expandToLevel(container, AbstractTreeViewer.ALL_LEVELS);
- fViewer.updateCheckedState(container);
- break;
- }
- }
-
- }
- }
- fViewer.getControl().setRedraw(true);
- }
- }
-
- /**
- * Returns the root containers containing the given breakpoint, or <code>null</code>
- * if none
- *
- * @param breakpoint
- * @return root containers containing the given breakpoint or <code>null</code>
- */
- public BreakpointContainer[] getRoots(IBreakpoint breakpoint) {
- if (isShowingGroups()) {
- List list = new ArrayList();
- for (int i = 0; i < fElements.length; i++) {
- BreakpointContainer container = (BreakpointContainer) fElements[i];
- if (container.contains(breakpoint)) {
- list.add(container);
- }
- }
- return (BreakpointContainer[]) list.toArray(new BreakpointContainer[list.size()]);
- }
- return null;
- }
-
- /**
- * Returns the nested order of breakpoint organizers being used, or <code>null</code>
- * if none.
- *
- * @return the nested order of breakpoint organizers being used, or <code>null</code>
- * if none
- */
- IBreakpointOrganizer[] getOrganizers() {
- return fOrganizers;
- }
-
- /**
- * Organizes the breakpoints based on nested categories, if any.
- */
- protected void reorganize() {
- IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints();
- if (fOrganizers == null) {
- fElements = breakpoints;
- } else {
- IBreakpointOrganizer organizer = fOrganizers[0];
- Map categoriesToContainers = new HashMap();
- for (int i = 0; i < breakpoints.length; i++) {
- IBreakpoint breakpoint = breakpoints[i];
- IAdaptable[] categories = organizer.getCategories(breakpoint);
- if (categories == null || categories.length == 0) {
- categories = OtherBreakpointCategory.getCategories(organizer);
- }
- for (int j = 0; j < categories.length; j++) {
- IAdaptable category = categories[j];
- BreakpointContainer container = (BreakpointContainer) categoriesToContainers.get(category);
- if (container == null) {
- IBreakpointOrganizer[] nesting = null;
- if (fOrganizers.length > 1) {
- nesting = new IBreakpointOrganizer[fOrganizers.length - 1];
- System.arraycopy(fOrganizers, 1, nesting, 0, nesting.length);
- }
- container = new BreakpointContainer(category, organizer, nesting);
- categoriesToContainers.put(category, container);
- }
- container.addBreakpoint(breakpoint);
- }
- }
- // add empty categories
- IAdaptable[] emptyCategories = organizer.getCategories();
- if (emptyCategories != null) {
- for (int i = 0; i < emptyCategories.length; i++) {
- IAdaptable category = emptyCategories[i];
- BreakpointContainer container = (BreakpointContainer) categoriesToContainers.get(category);
- if (container == null) {
- container = new BreakpointContainer(category, organizer, null);
- categoriesToContainers.put(category, container);
- }
- }
- }
- fElements = categoriesToContainers.values().toArray();
- }
- fViewer.getControl().setRedraw(false);
- fViewer.refresh();
- fViewer.getControl().setRedraw(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(IBreakpointOrganizerDelegate.P_CATEGORY_CHANGED)) {
- // TODO: only re-organize if showing the changed category
- reorganize();
- }
- }
-
- /**
- * Returns the existing containers the given breakpoint is contained in, or <code>null</code>.
- *
- * @param breakpoint
- * @return the existing containers the given breakpoint is contained in, or <code>null</code>
- */
- protected BreakpointContainer[] getContainers(IBreakpoint breakpoint) {
- if (isShowingGroups()) {
- IAdaptable[] categories = fOrganizers[0].getCategories(breakpoint);
- if (categories == null || categories.length == 0) {
- categories = OtherBreakpointCategory.getCategories(fOrganizers[0]);
- }
- BreakpointContainer[] containers = new BreakpointContainer[categories.length];
- int index = 0;
- for (int i = 0; i < fElements.length; i++) {
- BreakpointContainer container = (BreakpointContainer)fElements[i];
- for (int j = 0; j < categories.length; j++) {
- IAdaptable category = categories[j];
- if (container.getCategory().equals(category)) {
- containers[index] = container;
- index++;
- }
- }
- }
- return containers;
- }
- return null;
- }
-
- /**
- * Returns whether content is grouped by categories.
- *
- * @return whether content is grouped by categories
- */
- protected boolean isShowingGroups() {
- return fOrganizers != null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDragAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDragAdapter.java
deleted file mode 100644
index 8b547e7ee..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDragAdapter.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.util.TransferDragSourceListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DragSourceAdapter;
-import org.eclipse.swt.dnd.DragSourceEvent;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
-
-/**
- * A drag adapter for the breakpoints viewer
- */
-public class BreakpointsDragAdapter extends DragSourceAdapter implements TransferDragSourceListener {
-
- /**
- * the associated viewer for the adapter
- */
- private BreakpointsViewer fViewer;
- private Item[] fItems = null;
-
- /**
- * Constructor
- * @param view the associated view, which acts as the selection provider and therefore <b>must</b> implement <code>ISelectionProvider</code>
- */
- public BreakpointsDragAdapter(BreakpointsViewer viewer) {
- Assert.isNotNull(viewer);
- fViewer = viewer;
- }
-
- /**
- * @see TransferDragSourceListener#getTransfer
- */
- public Transfer getTransfer() {
- return LocalSelectionTransfer.getInstance();
- }
-
- /* non Java-doc
- * @see org.eclipse.swt.dnd.DragSourceListener#dragStart
- */
- public void dragStart(DragSourceEvent event) {
- ISelection selection = fViewer.getSelection();
- LocalSelectionTransfer.getInstance().setSelection(selection);
- LocalSelectionTransfer.getInstance().setSelectionSetTime(event.time & 0xFFFFFFFFL);
- event.doit = fViewer.canDrag(fViewer.getSelectedItems());
- fItems = fViewer.getSelectedItems();
- }
-
- /* non Java-doc
- * @see org.eclipse.swt.dnd.DragSourceListener#dragSetData
- */
- public void dragSetData(DragSourceEvent event) {
- // For consistency set the data to the selection even though
- // the selection is provided by the LocalSelectionTransfer
- // to the drop target adapter.
- event.data = LocalSelectionTransfer.getInstance().getSelection();
- }
-
- /* non Java-doc
- * @see org.eclipse.swt.dnd.DragSourceListener#dragFinished
- */
- public void dragFinished(DragSourceEvent event) {
- if (event.detail == DND.DROP_MOVE) {
- // remove from source on move operation
- fViewer.performDrag(fItems);
- }
- fItems = null;
- LocalSelectionTransfer.getInstance().setSelection(null);
- LocalSelectionTransfer.getInstance().setSelectionSetTime(0);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDropAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDropAdapter.java
deleted file mode 100644
index cd4096d9e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDropAdapter.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ViewerDropAdapter;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
-
-/**
- * BreakpointsDropAdapter
- */
-public class BreakpointsDropAdapter extends ViewerDropAdapter {
-
- private Item fTarget = null;
-
- /**
- * @param viewer
- */
- protected BreakpointsDropAdapter(BreakpointsViewer viewer) {
- super(viewer);
- setFeedbackEnabled(false);
- }
-
- /**
- * @see org.eclipse.jface.viewers.ViewerDropAdapter#performDrop(java.lang.Object)
- */
- public boolean performDrop(Object data) {
- return ((BreakpointsViewer)getViewer()).performDrop(fTarget, (IStructuredSelection) LocalSelectionTransfer.getInstance().getSelection());
- }
-
- /**
- * @see org.eclipse.jface.viewers.ViewerDropAdapter#determineTarget(org.eclipse.swt.dnd.DropTargetEvent)
- */
- protected Object determineTarget(DropTargetEvent event) {
- fTarget = (Item) event.item;
- return fTarget;
- }
-
- /**
- * @see org.eclipse.jface.viewers.ViewerDropAdapter#validateDrop(java.lang.Object, int, org.eclipse.swt.dnd.TransferData)
- */
- public boolean validateDrop(Object target, int operation, TransferData transferType) {
- return ((BreakpointsViewer)getViewer()).canDrop(fTarget, (IStructuredSelection) LocalSelectionTransfer.getInstance().getSelection());
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsLabelProvider.java
deleted file mode 100644
index 65ba74cd8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsLabelProvider.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.CompositeDebugImageDescriptor;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.jface.viewers.IFontProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-/**
- * Label provider for the breakpoints view
- */
-public class BreakpointsLabelProvider extends LabelProvider implements IFontProvider {
-
- private WorkbenchLabelProvider fWorkbenchLabelProvider;
- private IDebugModelPresentation fPresentation;
-
- /**
- * Constructs a new label provide for the breakpoints view.
- */
- public BreakpointsLabelProvider() {
- fWorkbenchLabelProvider = new WorkbenchLabelProvider();
- fPresentation = DebugUITools.newDebugModelPresentation();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- */
- public void dispose() {
- fWorkbenchLabelProvider.dispose();
- fPresentation.dispose();
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- public Image getImage(Object element) {
- if (element instanceof IBreakpoint) {
- return fPresentation.getImage(element);
- }
- Image image = fWorkbenchLabelProvider.getImage(element);
- if (image != null) {
- int flags= computeAdornmentFlags();
- if (flags > 0) {
- CompositeDebugImageDescriptor descriptor= new CompositeDebugImageDescriptor(image, flags);
- return DebugUIPlugin.getImageDescriptorRegistry().get(descriptor);
- }
- }
- return image;
- }
-
- /**
- * Computes and return common adornment flags for the given category.
- *
- * @param element breakpoint category
- * @return adornment flags defined in CompositeDebugImageDescriptor
- */
- private int computeAdornmentFlags() {
- if (!DebugPlugin.getDefault().getBreakpointManager().isEnabled()) {
- return CompositeDebugImageDescriptor.SKIP_BREAKPOINT;
- }
- return 0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object element) {
- if (element instanceof IBreakpoint) {
- return fPresentation.getText(element);
- }
- return fWorkbenchLabelProvider.getText(element);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IFontProvider#getFont(java.lang.Object)
- */
- public Font getFont(Object element) {
- if (element instanceof IBreakpoint) {
- return null;
- }
- return fWorkbenchLabelProvider.getFont(element);
- }
-
- /**
- * Returns the debug model presentation used by this label provider.
- *
- * @return the debug model presentation used by this label provider
- */
- public IDebugModelPresentation getPresentation() {
- return fPresentation;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java
deleted file mode 100644
index 17e8cf0b8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java
+++ /dev/null
@@ -1,791 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Brock Janiczak - bug 78494
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import com.ibm.icu.text.MessageFormat;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.ITreeViewerListener;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.TreeExpansionEvent;
-import org.eclipse.jface.viewers.Viewer;
-
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IPerspectiveListener2;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IViewReference;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchCommandConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartReference;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.XMLMemento;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.actions.SelectionListenerAction;
-import org.eclipse.ui.contexts.IContextActivation;
-import org.eclipse.ui.contexts.IContextService;
-import org.eclipse.ui.progress.IProgressService;
-import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManagerListener;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.LazyModelPresentation;
-import org.eclipse.debug.internal.ui.actions.breakpointGroups.CopyBreakpointsAction;
-import org.eclipse.debug.internal.ui.actions.breakpointGroups.PasteBreakpointsAction;
-import org.eclipse.debug.internal.ui.actions.breakpointGroups.RemoveFromWorkingSetAction;
-import org.eclipse.debug.internal.ui.actions.breakpoints.OpenBreakpointMarkerAction;
-import org.eclipse.debug.internal.ui.actions.breakpoints.ShowSupportedBreakpointsAction;
-import org.eclipse.debug.internal.ui.actions.breakpoints.SkipAllBreakpointsAction;
-import org.eclipse.debug.internal.ui.views.DebugUIViewsMessages;
-
-import org.eclipse.debug.ui.AbstractDebugView;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * This view shows the breakpoints registered with the breakpoint manager
- */
-public class BreakpointsView extends AbstractDebugView implements ISelectionListener, IBreakpointManagerListener, IPerspectiveListener2 {
-
- private BreakpointsViewEventHandler fEventHandler;
- private ICheckStateListener fCheckListener= new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- Object source = event.getElement();
- if (source instanceof BreakpointContainer) {
- handleContainerChecked(event, (BreakpointContainer) source);
- } else if (source instanceof IBreakpoint) {
- handleBreakpointChecked(event, (IBreakpoint) source);
- }
- }
- };
- private boolean fIsTrackingSelection= false;
- // Persistence constants
- private static String KEY_IS_TRACKING_SELECTION= "isTrackingSelection"; //$NON-NLS-1$
- private static String KEY_VALUE="value"; //$NON-NLS-1$
- private static final String ACTION_REMOVE_FROM_GROUP = "RemoveFromGroup"; //$NON-NLS-1$
- private BreakpointsContentProvider fContentProvider;
- private Clipboard fClipboard;
- private IContextActivation fActivatedContext;
-
- /**
- * This memento allows the Breakpoints view to save and restore state
- * when it is closed and opened within a session. A different
- * memento is supplied by the platform for persistence at
- * workbench shutdown.
- */
- private static IMemento fgMemento;
-
- /**
- * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
- */
- public void createPartControl(Composite parent) {
- super.createPartControl(parent);
- DebugPlugin.getDefault().getBreakpointManager().addBreakpointManagerListener(this);
- getSite().getWorkbenchWindow().addPerspectiveListener(this);
- }
-
- /**
- * @see AbstractDebugView#createViewer(Composite)
- */
- protected Viewer createViewer(Composite parent) {
- fContentProvider= new BreakpointsContentProvider();
- CheckboxTreeViewer viewer = new BreakpointsViewer(new Tree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CHECK));
- setViewer(viewer);
- viewer.setUseHashlookup(true);
- viewer.setContentProvider(fContentProvider);
- viewer.setComparator(new BreakpointsComparator());
- viewer.setInput(DebugPlugin.getDefault().getBreakpointManager());
- viewer.addCheckStateListener(fCheckListener);
- viewer.addTreeListener(new ITreeViewerListener() {
- public void treeExpanded(TreeExpansionEvent event) {
- ((BreakpointsViewer)getViewer()).updateCheckedState(event.getElement());
- }
- public void treeCollapsed(TreeExpansionEvent event) {
- }
- });
- viewer.setLabelProvider(new BreakpointsLabelProvider());
- // Necessary so that the PropertySheetView hears about selections in this view
- getSite().setSelectionProvider(viewer);
- initIsTrackingSelection();
- initBreakpointOrganizers();
- setEventHandler(new BreakpointsViewEventHandler(this));
- initDragAndDrop();
- return viewer;
- }
-
- /**
- * Initializes drag and drop for the breakpoints viewer
- */
- private void initDragAndDrop() {
- BreakpointsViewer viewer = (BreakpointsViewer) getViewer();
- int ops = DND.DROP_MOVE | DND.DROP_COPY;
- // drop
- viewer.addDropSupport(ops, new Transfer[] {LocalSelectionTransfer.getInstance()}, new BreakpointsDropAdapter(viewer));
- // Drag
- viewer.addDragSupport(ops, new Transfer[] {LocalSelectionTransfer.getInstance()}, new BreakpointsDragAdapter(viewer));
- }
-
- /**
- * Initializes whether this view tracks selection in the
- * debug view from the persisted state.
- */
- private void initIsTrackingSelection() {
- IMemento memento= getMemento();
- if (memento != null) {
- IMemento node= memento.getChild(KEY_IS_TRACKING_SELECTION);
- if (node != null) {
- setTrackSelection(Boolean.valueOf(node.getString(KEY_VALUE)).booleanValue());
- return;
- }
- }
- setTrackSelection(false);
- }
-
- /**
- * Initializes the persisted breakpoints organizers
- */
- private void initBreakpointOrganizers() {
- IMemento memento = getMemento();
- if (memento != null) {
- IMemento node = memento.getChild(IDebugUIConstants.EXTENSION_POINT_BREAKPOINT_ORGANIZERS);
- if (node == null) {
- fContentProvider.setOrganizers(null);
- } else {
- String value = node.getString(KEY_VALUE);
- if (value != null) {
- String[] ids = value.split(","); //$NON-NLS-1$
- BreakpointOrganizerManager manager = BreakpointOrganizerManager.getDefault();
- List organziers= new ArrayList();
- for (int i = 0; i < ids.length; i++) {
- IBreakpointOrganizer organizer = manager.getOrganizer(ids[i]);
- if (organizer != null) {
- organziers.add(organizer);
- }
- }
- fContentProvider.setOrganizers((IBreakpointOrganizer[]) organziers.toArray(new IBreakpointOrganizer[organziers.size()]));
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#getMemento()
- */
- protected IMemento getMemento() {
- if (fgMemento != null) {
- return fgMemento;
- }
- return super.getMemento();
- }
-
- /**
- * Update the checked state up the given element and all of its children.
- *
- * @param element
- */
- public void updateCheckedState(Object element) {
- ((BreakpointsViewer)getViewer()).updateCheckedState(element);
- }
-
- /**
- * Returns this view's viewer as a checkbox tree viewer.
- * @return this view's viewer as a checkbox tree viewer
- */
- public CheckboxTreeViewer getCheckboxViewer() {
- return (CheckboxTreeViewer) getViewer();
- }
-
- /**
- * Returns this view's content provider as a tree content provider.
- * @return this view's content provider as a tree content provider
- */
- public ITreeContentProvider getTreeContentProvider() {
- return fContentProvider;
- }
-
- /**
- * A breakpoint has been checked/unchecked. Update the group
- * element's checked/grayed state as appropriate.
- */
- private void handleBreakpointChecked(final CheckStateChangedEvent event, final IBreakpoint breakpoint) {
- final boolean enable= event.getChecked();
- String jobName = enable ? DebugUIViewsMessages.BreakpointsView_0 : DebugUIViewsMessages.BreakpointsView_1; //
- new Job(jobName) {
- protected IStatus run(IProgressMonitor monitor) {
- try {
- breakpoint.setEnabled(enable);
- return Status.OK_STATUS;
- } catch (final CoreException e) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- String titleState= enable ? DebugUIViewsMessages.BreakpointsView_6 : DebugUIViewsMessages.BreakpointsView_7; //
- String messageState= enable ? DebugUIViewsMessages.BreakpointsView_8 : DebugUIViewsMessages.BreakpointsView_9; //
- DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), MessageFormat.format(DebugUIViewsMessages.BreakpointsView_10, new String[] { titleState }), MessageFormat.format(DebugUIViewsMessages.BreakpointsView_11, new String[] { messageState }), e); //
- // If the breakpoint fails to update, reset its check state.
- getCheckboxViewer().removeCheckStateListener(fCheckListener);
- event.getCheckable().setChecked(breakpoint, !event.getChecked());
- getCheckboxViewer().addCheckStateListener(fCheckListener);
- }
- });
- }
- return Status.CANCEL_STATUS;
- }
- }.schedule();
- }
-
- /**
- * A group has been checked or unchecked. Enable/disable all of the
- * breakpoints in that group to match.
- */
- private void handleContainerChecked(CheckStateChangedEvent event, BreakpointContainer container) {
- final IBreakpoint[] breakpoints = container.getBreakpoints();
- final boolean enable= event.getChecked();
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) {
- try {
- for (int i = 0; i < breakpoints.length; i++) {
- IBreakpoint breakpoint = breakpoints[i];
- breakpoint.setEnabled(enable);
- }
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- };
- // TODO: should use scheduling rule
- IProgressService progressService = PlatformUI.getWorkbench().getProgressService();
- try {
- progressService.busyCursorWhile(runnable);
- }
- catch (InvocationTargetException e) {}
- catch (InterruptedException e) {}
- }
-
- /**
- * @see AbstractDebugView#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.BREAKPOINT_VIEW;
- }
-
- /**
- * @see IWorkbenchPart#dispose()
- */
- public void dispose() {
- disposeAction(IWorkbenchCommandConstants.EDIT_COPY);
- disposeAction(IWorkbenchCommandConstants.EDIT_PASTE);
- disposeAction(ACTION_REMOVE_FROM_GROUP);
-
- if (getCheckboxViewer() != null) {
- getCheckboxViewer().removeCheckStateListener(fCheckListener);
- }
- IAction action= getAction("ShowBreakpointsForModel"); //$NON-NLS-1$
- if (action != null) {
- ((ShowSupportedBreakpointsAction)action).dispose();
- }
- getSite().getPage().removeSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, this);
- DebugPlugin.getDefault().getBreakpointManager().removeBreakpointManagerListener(this);
- super.dispose();
-
- if (getEventHandler() != null) {
- getEventHandler().dispose();
- }
-
- if (fClipboard != null) {
- fClipboard.dispose();
- }
-
- getSite().getWorkbenchWindow().removePerspectiveListener(this);
- }
-
- /**
- * @see AbstractDebugView#createActions()
- */
- protected void createActions() {
- IAction action = new OpenBreakpointMarkerAction(getViewer());
- setAction("GotoMarker", action); //$NON-NLS-1$
- setAction(DOUBLE_CLICK_ACTION, action);
- setAction("ShowBreakpointsForModel", new ShowSupportedBreakpointsAction(getStructuredViewer(),this)); //$NON-NLS-1$
- setAction("SkipBreakpoints", new SkipAllBreakpointsAction(this)); //$NON-NLS-1$
-
- fClipboard= new Clipboard(getSite().getShell().getDisplay());
-
- PasteBreakpointsAction paste = new PasteBreakpointsAction(this);
- configure(paste, ActionFactory.PASTE.getCommandId(), ActionFactory.PASTE.getId(), ISharedImages.IMG_TOOL_PASTE);
- SelectionListenerAction copy = new CopyBreakpointsAction(this, fClipboard, paste);
- configure(copy, ActionFactory.COPY.getCommandId(), ActionFactory.COPY.getId(), ISharedImages.IMG_TOOL_COPY);
-
- SelectionListenerAction remove = new RemoveFromWorkingSetAction(this);
- setAction(ACTION_REMOVE_FROM_GROUP, remove);
- getViewer().addSelectionChangedListener(remove);
- }
-
- /**
- * Configures the action to override the global action, registers
- * the action for selection change notification, and registers
- * the action with this view.
- *
- * @param sla action
- * @param defId action definition id
- * @param globalId global action id
- * @param imgId image identifier
- */
- private void configure(SelectionListenerAction action, String defId, String globalId, String imgId) {
- setAction(defId, action);
- action.setActionDefinitionId(defId);
- getViewSite().getActionBars().setGlobalActionHandler(globalId, action);
- getViewer().addSelectionChangedListener(action);
- action.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(imgId));
- }
-
- /**
- * Cleans up selection listener action
- *
- * @param id action id
- */
- private void disposeAction(String id) {
- IAction action = getAction(id);
- if (action instanceof SelectionListenerAction) {
- SelectionListenerAction sla = (SelectionListenerAction) action;
- if (getViewer() != null) {
- getViewer().removeSelectionChangedListener(sla);
- }
- }
- }
-
- /**
- * Adds items to the context menu.
- *
- * @param menu The menu to contribute to
- */
- protected void fillContextMenu(IMenuManager menu) {
- updateObjects();
- menu.add(new Separator(IDebugUIConstants.EMPTY_NAVIGATION_GROUP));
- menu.add(new Separator(IDebugUIConstants.NAVIGATION_GROUP));
- menu.add(getAction("GotoMarker")); //$NON-NLS-1$
- menu.add(new Separator(IDebugUIConstants.EMPTY_BREAKPOINT_GROUP));
- menu.add(new Separator(IDebugUIConstants.BREAKPOINT_GROUP));
- menu.add(getAction(IWorkbenchCommandConstants.EDIT_COPY));
- menu.add(getAction(IWorkbenchCommandConstants.EDIT_PASTE));
- IAction action = getAction(ACTION_REMOVE_FROM_GROUP);
- if (action.isEnabled()) {
- menu.add(action);
- }
- menu.add(new Separator(IDebugUIConstants.EMPTY_RENDER_GROUP));
- menu.add(new Separator(IDebugUIConstants.BREAKPOINT_GROUP_GROUP));
-
- menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
-
- /**
- * @see AbstractDebugView#configureToolBar(IToolBarManager)
- */
- protected void configureToolBar(IToolBarManager tbm) {
- tbm.add(new Separator(IDebugUIConstants.BREAKPOINT_GROUP));
- tbm.add(getAction("ShowBreakpointsForModel")); //$NON-NLS-1$
- tbm.add(getAction("GotoMarker")); //$NON-NLS-1$
- tbm.add(getAction("SkipBreakpoints")); //$NON-NLS-1$
- tbm.add(new Separator(IDebugUIConstants.RENDER_GROUP));
- }
-
- /**
- * Returns this view's event handler
- *
- * @return a breakpoint view event handler
- */
- protected BreakpointsViewEventHandler getEventHandler() {
- return fEventHandler;
- }
-
- /**
- * Sets this view's event handler.
- *
- * @param eventHandler a breakpoint view event handler
- */
- private void setEventHandler(BreakpointsViewEventHandler eventHandler) {
- fEventHandler = eventHandler;
- }
- /**
- * @see org.eclipse.debug.ui.AbstractDebugView#becomesVisible()
- */
- protected void becomesVisible() {
- super.becomesVisible();
- CheckboxTreeViewer viewer = getCheckboxViewer();
- ISelection selection = viewer.getSelection();
- viewer.getControl().setRedraw(false);
- ((BreakpointsContentProvider)viewer.getContentProvider()).reorganize();
- viewer.setSelection(new StructuredSelection(selection));
- viewer.getControl().setRedraw(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IWorkbenchPart part, ISelection sel) {
- if (sel.isEmpty() || !isTrackingSelection()) {
- return;
- }
- IStructuredSelection selection= (IStructuredSelection) sel;
- Iterator iter= selection.iterator();
- Object firstElement= iter.next();
- if (firstElement == null || iter.hasNext()) {
- return;
- }
- IThread thread= null;
- if (firstElement instanceof IStackFrame) {
- thread= ((IStackFrame) firstElement).getThread();
- } else if (firstElement instanceof IThread) {
- thread= (IThread) firstElement;
- } else {
- return;
- }
- IBreakpoint[] breakpoints= thread.getBreakpoints();
- getViewer().setSelection(new StructuredSelection(breakpoints), true);
- }
-
- /**
- * Returns whether this view is currently tracking the
- * selection from the debug view.
- *
- * @return whether this view is currently tracking the
- * debug view's selection
- */
- public boolean isTrackingSelection() {
- return fIsTrackingSelection;
- }
-
- /**
- * Sets whether this view should track the selection from
- * the debug view.
- *
- * @param trackSelection whether or not this view should
- * track the debug view's selection.
- */
- public void setTrackSelection(boolean trackSelection) {
- fIsTrackingSelection= trackSelection;
- if (trackSelection) {
- getSite().getPage().addSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, this);
- } else {
- getSite().getPage().removeSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, this);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewPart#saveState(org.eclipse.ui.IMemento)
- */
- public void saveState(IMemento memento) {
- super.saveState(memento);
- IMemento node= memento.createChild(KEY_IS_TRACKING_SELECTION);
- node.putString(KEY_VALUE, String.valueOf(fIsTrackingSelection));
-
- StringBuffer buffer= new StringBuffer();
- IBreakpointOrganizer[] organizers = fContentProvider.getOrganizers();
- if (organizers != null) {
- for (int i = 0; i < organizers.length; i++) {
- IBreakpointOrganizer organizer = organizers[i];
- buffer.append(organizer.getIdentifier());
- if (i < (organizers.length - 1)) {
- buffer.append(',');
- }
- }
- node = memento.createChild(IDebugUIConstants.EXTENSION_POINT_BREAKPOINT_ORGANIZERS);
- node.putString(KEY_VALUE, buffer.toString());
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IBreakpointManagerListener#breakpointManagerEnablementChanged(boolean)
- */
- public void breakpointManagerEnablementChanged(boolean enabled) {
- DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
- IAction action = getAction("SkipBreakpoints"); //$NON-NLS-1$
- if (action != null) {
- ((SkipAllBreakpointsAction) action).updateActionCheckedState();
- }
- }
- });
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
- */
- public void doubleClick(DoubleClickEvent event) {
- IStructuredSelection selection= (IStructuredSelection) event.getSelection();
- if (selection.size() == 1) {
- Object element = selection.getFirstElement();
- if (element instanceof BreakpointContainer) {
- getCheckboxViewer().setExpandedState(element, !getCheckboxViewer().getExpandedState(element));
- return;
- }
- }
- super.doubleClick(event);
- }
-
- /**
- * @param selectedContainers
- */
- public void setBreakpointOrganizers(IBreakpointOrganizer[] organizers) {
- Viewer viewer = getViewer();
- ISelection selection = viewer.getSelection();
- fContentProvider.setOrganizers(organizers);
- viewer.setSelection(selection);
- }
-
- /**
- * returns the complete listing of breakpoints organizers
- * @return the complete listing of breakpoint organizers
- */
- public IBreakpointOrganizer[] getBreakpointOrganizers() {
- return fContentProvider.getOrganizers();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveListener2#perspectiveChanged(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor, org.eclipse.ui.IWorkbenchPartReference, java.lang.String)
- */
- public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, IWorkbenchPartReference partRef, String changeId) {
- if (partRef instanceof IViewReference && changeId.equals(IWorkbenchPage.CHANGE_VIEW_HIDE)) {
- String id = ((IViewReference) partRef).getId();
- if (id.equals(getViewSite().getId())) {
- // BreakpointsView closed. Persist settings.
- fgMemento= XMLMemento.createWriteRoot("BreakpointsViewMemento"); //$NON-NLS-1$
- saveState(fgMemento);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveListener#perspectiveActivated(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor)
- */
- public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveListener#perspectiveChanged(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor, java.lang.String)
- */
- public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDebugView#getPresentation(java.lang.String)
- */
- public IDebugModelPresentation getPresentation(String id) {
- if (getViewer() instanceof StructuredViewer) {
- IBaseLabelProvider lp = ((StructuredViewer)getViewer()).getLabelProvider();
- if (lp instanceof BreakpointsLabelProvider) {
- BreakpointsLabelProvider blp = (BreakpointsLabelProvider) lp;
- lp = blp.getPresentation();
- }
- if (lp instanceof DelegatingModelPresentation) {
- return ((DelegatingModelPresentation)lp).getPresentation(id);
- }
- if (lp instanceof LazyModelPresentation) {
- if (((LazyModelPresentation)lp).getDebugModelIdentifier().equals(id)) {
- return (IDebugModelPresentation)lp;
- }
- }
- }
- return null;
- }
-
- /**
- * This method is used solely to preserve the selection state of the viewer in the event that the current selection is to be removed
- * @param selection the selection to be removed
- *
- * @since 3.3
- */
- public void preserveSelection(IStructuredSelection selection) {
- if(selection != null && !selection.isEmpty()) {
- TreeItem item = (TreeItem) ((BreakpointsViewer)getCheckboxViewer()).searchItem(selection.getFirstElement());
- Object toselect = null;
- if(item != null) {
- TreeItem parent = item.getParentItem();
- if(parent != null) {
- int idx = 0;
- if(parent.getItemCount() == 1) {
- toselect = parent.getData();
- }
- idx = parent.indexOf(item);
- if(idx == 0) {
- if(parent.getItemCount() > 1) {
- toselect = parent.getItem(1).getData();
- }
- else {
- toselect = parent.getItem(0).getData();
- }
- }
- if(idx > 0) {
- toselect = parent.getItem(idx-1).getData();
- }
- }
- else {
- Tree tree = item.getParent();
- TreeItem[] items = tree.getItems();
- if (items.length > 1){
- for(int i = 0; i < items.length; i++) {
- if(item.equals(items[i])) {
- if(i+1 >= items.length){
- toselect = items[i-1].getData();
- break;
- } else {
- toselect = items[i+1].getData();
- break;
- }
-
- }
- }
- }
- }
- }
- if(toselect != null) {
- getViewer().setSelection(new StructuredSelection(toselect), true);
- }
- }
- }
-
- /**
- * Returns whether the given selection can be pasted into the given target.
- * <p>
- * Scheme:
- * <ul>
- * <li>Breakpoints can only be pasted into allowable containers (i..e. like workings sets)</li>
- * <li>Breakpoints can only be pasted into containers that they do not already reside in</li>
- * <li>Breakpoints can only be pasted into containers, not other breakpoints</li>
- * </ul>
- * </p>
- *
- * @param target target of the paste
- * @param selection the selection to paste
- * @return whether the given selection can be pasted into the given target
- *
- * TODO Remove in favour of using <code>TreeItem</code>s and <code>TreePath</code>s to determine paste targets
- */
- public boolean canPaste(Object target, ISelection selection) {
- if(!(target instanceof BreakpointContainer)) {
- return false;
- }
- if(selection.isEmpty()) {
- return false;
- }
- IStructuredSelection ss = (IStructuredSelection) selection;
- BreakpointContainer container = (BreakpointContainer) target;
- IBreakpoint breakpoint = null;
- Object element = null;
- for(Iterator iter = ss.iterator(); iter.hasNext();) {
- element = iter.next();
- if(!(element instanceof IBreakpoint)) {
- return false;
- }
- breakpoint = (IBreakpoint) element;
- if (container.contains(breakpoint) || !container.getOrganizer().canAdd(breakpoint, container.getCategory())) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Pastes the selection into the given target
- *
- * @param target target of the paste, either a BreakpointContainer,
- * or a Breakpoint within a BreakpointContainer
- * @param selection breakpoints
- * @return whether successful
- *
- * TODO remove in favour of using <code>TreeItem</code> as paste target
- */
- public boolean performPaste(Object target, ISelection selection) {
- if (target instanceof BreakpointContainer && selection instanceof IStructuredSelection) {
- BreakpointContainer container = (BreakpointContainer) target;
- Object[] objects = ((IStructuredSelection)selection).toArray();
- for (int i = 0; i < objects.length; i++) {
- container.getOrganizer().addBreakpoint((IBreakpoint)objects[i], container.getCategory());
- }
- return true;
- }
- return false;
- }
-
- /**
- * Returns if the breakpoints view is currently showing groups or not
- * @return true of the breakpoints view showing groups, false otherwise
- */
- public boolean isShowingGroups() {
- return fContentProvider.isShowingGroups();
- }
-
- /**
- * @see org.eclipse.ui.part.PageBookView#partActivated(org.eclipse.ui.IWorkbenchPart)
- */
- public void partActivated(IWorkbenchPart part) {
- if (part.equals(this)) {
- IContextService contextService = (IContextService)getSite().getService(IContextService.class);
- fActivatedContext = contextService.activateContext(IDebugUIConstants.ID_BREAKPOINT_VIEW);
- }
- super.partActivated(part);
- }
-
- /**
- * @see org.eclipse.ui.part.PageBookView#partDeactivated(org.eclipse.ui.IWorkbenchPart)
- */
- public void partDeactivated(IWorkbenchPart part) {
- if (part.equals(this)) {
- IContextService contextService = (IContextService)getSite().getService(IContextService.class);
- contextService.deactivateContext(fActivatedContext);
- }
- super.partDeactivated(part);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewEventHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewEventHandler.java
deleted file mode 100644
index 300bc1a55..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewEventHandler.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Brock Janiczak - bug 57999
- * Michael Fraenkel - bug 84385
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.resources.IMarkerDelta;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.IBreakpointManagerListener;
-import org.eclipse.debug.core.IBreakpointsListener;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.activities.ActivityManagerEvent;
-import org.eclipse.ui.activities.IActivityManagerListener;
-import org.eclipse.ui.activities.IWorkbenchActivitySupport;
-
-/**
- * Handles breakpoint events and activity manager events (which can affect grouping),
- * updating the breakpoints view and viewer.
- */
-public class BreakpointsViewEventHandler implements IBreakpointsListener, IActivityManagerListener, IBreakpointManagerListener {
-
- private BreakpointsView fView;
-
- /**
- * Constructs an event handler for the breakpoints view.
- */
- public BreakpointsViewEventHandler(BreakpointsView view) {
- fView= view;
- IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
- breakpointManager.addBreakpointListener(this);
- breakpointManager.addBreakpointManagerListener(this);
- IWorkbenchActivitySupport activitySupport = PlatformUI.getWorkbench().getActivitySupport();
- if (activitySupport != null) {
- activitySupport.getActivityManager().addActivityManagerListener(this);
- }
- }
-
- /**
- * When this event handler is disposed, remove it as a listener.
- */
- public void dispose() {
- IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
- breakpointManager.removeBreakpointListener(this);
- breakpointManager.removeBreakpointManagerListener(this);
- IWorkbenchActivitySupport activitySupport = PlatformUI.getWorkbench().getActivitySupport();
- if (activitySupport != null) {
- activitySupport.getActivityManager().removeActivityManagerListener(this);
- }
- }
-
- /**
- * @see IBreakpointsListener#breakpointsAdded(IBreakpoint[])
- */
- public void breakpointsAdded(final IBreakpoint[] breakpoints) {
- if (fView.isAvailable() && fView.isVisible()) {
- fView.asyncExec(new Runnable() {
- public void run() {
- if (fView.isAvailable()) {
- CheckboxTreeViewer viewer = fView.getCheckboxViewer();
- viewer.getControl().setRedraw(false);
- BreakpointsContentProvider provider = (BreakpointsContentProvider)viewer.getContentProvider();
- provider.reorganize();
-
- // This code is left in as a test case for platform bug 77075
- //for (int i = 0; i < breakpoints.length; i++) {
- //viewer.expandToLevel(breakpoints[i], AbstractTreeViewer.ALL_LEVELS);
- //}
- // expand as required
- for (int i = 0; i < breakpoints.length; i++) {
- IBreakpoint breakpoint = breakpoints[i];
- BreakpointContainer[] roots = provider.getRoots(breakpoint);
- if (roots != null) {
- for (int j = 0; j < roots.length; j++) {
- viewer.expandToLevel(roots[j], AbstractTreeViewer.ALL_LEVELS);
- }
- }
- }
- fView.getViewer().refresh();
- viewer.setSelection(new StructuredSelection(breakpoints));
- viewer.getControl().setRedraw(true);
- fView.updateObjects();
- }
- }
- });
- }
- }
-
- /**
- * @see IBreakpointsListener#breakpointsRemoved(IBreakpoint[], IMarkerDelta[])
- */
- public void breakpointsRemoved(final IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
- if (fView.isAvailable() && fView.isVisible()) {
- fView.asyncExec(new Runnable() {
- public void run() {
- if (fView.isAvailable()) {
- CheckboxTreeViewer viewer= (CheckboxTreeViewer)fView.getViewer();
- viewer.getControl().setRedraw(false);
- ((BreakpointsContentProvider)viewer.getContentProvider()).reorganize();
- viewer.getControl().setRedraw(true);
- fView.updateObjects();
- }
- }
- });
- }
- }
-
- /**
- * @see IBreakpointsListener#breakpointsChanged(IBreakpoint[], IMarkerDelta[])
- */
- public void breakpointsChanged(final IBreakpoint[] breakpoints, final IMarkerDelta[] deltas) {
- if (fView.isAvailable() & fView.isVisible()) {
- fView.asyncExec(new Runnable() {
- public void run() {
- if (fView.isAvailable()) {
- CheckboxTreeViewer viewer = (CheckboxTreeViewer)fView.getViewer();
- viewer.getControl().setRedraw(false);
- BreakpointsContentProvider provider = (BreakpointsContentProvider) viewer.getContentProvider();
- Set updates = new HashSet();
- for (int i = 0; i < breakpoints.length; i++) {
- IBreakpoint breakpoint = breakpoints[i];
- viewer.update(breakpoint, null);
- BreakpointContainer[] containers = provider.getContainers(breakpoint);
- if (containers != null) {
- for (int j = 0; j < containers.length; j++ ) {
- updates.add(containers[j]);
- }
- } else {
- updates.add(breakpoint);
- }
- }
- Object[] objects = updates.toArray();
- for (int i = 0; i < objects.length; i++) {
- fView.updateCheckedState(objects[i]);
- }
- viewer.getControl().setRedraw(true);
- fView.updateObjects();
- }
- }
- });
- }
- }
-
- /**
- * When new activities are added or enabled, refresh the view contents to add/remove
- * breakpoints related to the affected activities.
- */
- public void activityManagerChanged(final ActivityManagerEvent activityManagerEvent) {
- if (fView.isAvailable() & fView.isVisible() && activityManagerEvent.haveEnabledActivityIdsChanged()) {
- fView.asyncExec(new Runnable() {
- public void run() {
- fView.getViewer().refresh();
- }
- });
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IBreakpointManagerListener#breakpointManagerEnablementChanged(boolean)
- */
- public void breakpointManagerEnablementChanged(boolean enabled) {
- if (fView.isAvailable() & fView.isVisible()) {
- fView.asyncExec(new Runnable() {
- public void run() {
- fView.getViewer().refresh();
- }
- });
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewer.java
deleted file mode 100644
index 97604e2d2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewer.java
+++ /dev/null
@@ -1,447 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IBreakpointOrganizerDelegateExtension;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.swt.widgets.Item;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.swt.widgets.Widget;
-
-/**
- * Breakpoints viewer.
- */
-public class BreakpointsViewer extends CheckboxTreeViewer {
-
- /**
- * Constructs a new breakpoints viewer with the given tree.
- *
- * @param tree
- */
- public BreakpointsViewer(Tree tree) {
- super(tree);
- }
-
- /**
- * Returns the selected items.
- *
- * @return selected items
- */
- public Item[] getSelectedItems() {
- return getSelection(getControl());
- }
-
- /**
- * Returns the item associated with the given element, or <code>null</code>.
- *
- * @param element element in breakpoints view
- * @return item associated with the given element, or <code>null</code>
- */
- public Widget searchItem(Object element) {
- return findItem(element);
- }
-
- /**
- * Refreshes the given item in the tree.
- *
- * @param item item to refresh
- */
- public void refreshItem(TreeItem item) {
- updateItem(item, item.getData());
- }
-
- /**
- * Returns a collection of currently visible breakpoints.
- *
- * @return collection of currently visible breakpoints
- */
- public IBreakpoint[] getVisibleBreakpoints() {
- IBreakpointManager manager= DebugPlugin.getDefault().getBreakpointManager();
- Object[] elements= ((ITreeContentProvider)getContentProvider()).getElements(manager);
- List list = new ArrayList();
- for (int i = 0; i < elements.length; i++) {
- TreeItem item = (TreeItem) searchItem(elements[i]);
- if (item != null) {
- collectExpandedBreakpoints(item, list);
- }
- }
- return (IBreakpoint[]) list.toArray(new IBreakpoint[list.size()]);
- }
-
- /**
- * Adds expanded breakpoints to the list. Traverses children of the given
- * tree item if any.
- *
- * @param item
- * @param list collection of visible breakpoints
- */
- private void collectExpandedBreakpoints(TreeItem item, List list) {
- Object data = item.getData();
- if (data instanceof IBreakpoint) {
- list.add(data);
- return;
- }
- if (item.getExpanded()) {
- TreeItem[] items = item.getItems();
- for (int i = 0; i < items.length; i++) {
- collectExpandedBreakpoints(items[i], list);
- }
- }
- }
-
- /**
- * Sets the selection to a specific tree item
- *
- * @param item
- */
- protected void setSelection(TreeItem item) {
- getTree().setSelection(new TreeItem[]{item});
- updateSelection(getSelection());
- }
-
- /**
- * Returns the container from within the specified path that is the container the breakpoint can be removed from
- * @param breakpoint the breakpoint to get the container for
- * @return the first found container that includes the breakpoint that allows removal, or <code>null</code> if none found
- * @since 3.3
- */
- public BreakpointContainer getRemovableContainer(Item item) {
- if(item == null) {
- return null;
- }
- if(item.getData() instanceof IBreakpoint) {
- TreePath path = getTreePathFromItem(item);
- if(path != null) {
- IBreakpoint breakpoint = (IBreakpoint) path.getLastSegment();
- BreakpointContainer container = null;
- for(int i = path.getSegmentCount()-2; i > -1; i--) {
- container = (BreakpointContainer) path.getSegment(i);
- if(container.contains(breakpoint) && container.getOrganizer().canRemove(breakpoint, container.getCategory())) {
- return container;
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the addable breakpoint container of the specified breakpoint
- * @param breakpoint the breakpoint to get the container for
- * @return the first found addable container for the specified breakpoint or <code>null</code> if none found
- * @since 3.3
- */
- public BreakpointContainer getAddableContainer(Item item) {
- TreePath path = getTreePathFromItem(item);
- if(path != null) {
- Object element = path.getLastSegment();
- if(element instanceof IBreakpoint) {
- BreakpointContainer container = null;
- IBreakpoint breakpoint = (IBreakpoint) element;
- for(int i = path.getSegmentCount()-2; i > -1; i--) {
- container = (BreakpointContainer) path.getSegment(i);
- if(container.contains(breakpoint) && container.getOrganizer().canAdd(breakpoint, container.getCategory())) {
- return container;
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Returns if the selected item in the tree can be dragged
- * <p>
- * Scheme:
- * <ul>
- * <li>breakpoint containers cannot be dragged</li>
- * <li>breakpoints can be dragged iff the container they reside in supports the removal of breakpoints</li>
- * </ul>
- * </p>
- * @param element the element to test if it can be dragged
- * @return true if the selected element can be dragged, false otherwise
- * @since 3.3
- */
- public boolean canDrag(Item[] items) {
- if(items == null) {
- return false;
- }
- if(items.length == 0) {
- return false;
- }
- for(int i = 0; i < items.length; i++) {
- if(getRemovableContainer(items[i]) == null) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Performs the actual removal of breakpoints from their respective (removable) containers on a successful drag operation
- * @param selection the selection of breakpoints involved in the drag
- * @since 3.3
- */
- public void performDrag(Item[] items) {
- if(items == null) {
- return;
- }
- Map containersToBreakpoints = new HashMap();
- BreakpointContainer container = null;
- IBreakpoint breakpoint = null;
- for(int i = 0; i < items.length; i++) {
- if(!items[i].isDisposed()) {
- breakpoint = (IBreakpoint)items[i].getData();
- container = getRemovableContainer(items[i]);
- if(container != null) {
- List list = (List) containersToBreakpoints.get(container);
- if (list == null) {
- list = new ArrayList();
- containersToBreakpoints.put(container, list);
- }
- list.add(breakpoint);
- }
- }
- }
- Iterator iterator = containersToBreakpoints.entrySet().iterator();
- while (iterator.hasNext()) {
- Entry entry = (Entry) iterator.next();
- container = (BreakpointContainer) entry.getKey();
- List list = (List) entry.getValue();
- IBreakpointOrganizer organizer = container.getOrganizer();
- IBreakpoint[] breakpoints = (IBreakpoint[]) list.toArray(new IBreakpoint[list.size()]);
- if (organizer instanceof IBreakpointOrganizerDelegateExtension) {
- IBreakpointOrganizerDelegateExtension extension = (IBreakpointOrganizerDelegateExtension) organizer;
- extension.removeBreakpoints(breakpoints, container.getCategory());
- } else {
- for (int i = 0; i < breakpoints.length; i++) {
- organizer.removeBreakpoint(breakpoints[i], container.getCategory());
- }
- }
- }
- }
-
- /**
- * Determines if the specified element can be dropped into the specified target
- * <p>
- * Scheme:
- * <ul>
- * <li>Breakpoints can be dropped into working sets</li>
- * <li>Breakpoints can be dropped into breakpoints, provided there is a droppable parent of the target breakpoint</li>
- * </ul>
- * </p>
- * @param target the target for the drop
- * @param element the element we want to drop
- * @return true if the specified element can be dropped into the specified target, false otherwise
- * @since 3.3
- */
- public boolean canDrop(Item target, IStructuredSelection selection) {
- if(selection == null || target == null) {
- return false;
- }
- for(Iterator iter = selection.iterator(); iter.hasNext();) {
- Object currentObject = iter.next();
- if (!(currentObject instanceof IBreakpoint) || !checkAddableParentContainers(target, (IBreakpoint)currentObject)){
- return false;
- }
- }
- return true;
- }
-
- /**
- * This method is used to determine if there is an addable parent container available for the specified drop target.
- * <p>
- * A drop target can be either a <code>BreakpointContainer</code> or an <code>IBreakpoint</code>. This method always checks the entire heirarchy
- * of the tree path for the specified target in the event one of the parent element does not support dropping.
- * </p>
- * @param target
- * @param breakpoint
- * @return
- */
- private boolean checkAddableParentContainers(Item target, IBreakpoint breakpoint) {
- BreakpointContainer container = null;
- TreePath path = getTreePathFromItem(target);
- if(path != null) {
- Object element = null;
- for(int i = path.getSegmentCount()-1; i > -1; i--) {
- element = path.getSegment(i);
- if(element instanceof BreakpointContainer) {
- container = (BreakpointContainer) element;
- if(container.contains(breakpoint) || !container.getOrganizer().canAdd(breakpoint, container.getCategory())) {
- return false;
- }
- }
- }
- }
- return true;
- }
-
- /**
- * Performs the actual addition of the selected breakpoints to the specified target
- * @param target the target to add the selection of breakpoints to
- * @param selection the selection of breakpoints
- * @return true if the drop occurred, false otherwise
- * @since 3.3
- */
- public boolean performDrop(Item target, IStructuredSelection selection) {
- if(target == null || selection == null) {
- return false;
- }
- IBreakpoint breakpoint = null;
- Object element = target.getData();
- BreakpointContainer container = (element instanceof BreakpointContainer ? (BreakpointContainer)element : getAddableContainer(target));
- if(container == null) {
- return false;
- }
- IBreakpointOrganizer organizer = container.getOrganizer();
- if (organizer instanceof IBreakpointOrganizerDelegateExtension) {
- IBreakpointOrganizerDelegateExtension extension = (IBreakpointOrganizerDelegateExtension) organizer;
- Object[] array = selection.toArray();
- IBreakpoint[] breakpoints = new IBreakpoint[array.length];
- System.arraycopy(array, 0, breakpoints, 0, array.length);
- extension.addBreakpoints(breakpoints, container.getCategory());
- } else {
- for(Iterator iter = selection.iterator(); iter.hasNext();) {
- breakpoint = (IBreakpoint) iter.next();
- organizer.addBreakpoint(breakpoint, container.getCategory());
- }
- }
- expandToLevel(target.getData(), ALL_LEVELS);
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.Viewer#refresh()
- */
- public void refresh() {
- super.refresh();
- initializeCheckedState();
- }
-
- /**
- * Sets the initial checked state of the items in the viewer.
- */
- private void initializeCheckedState() {
- TreeItem[] items = getTree().getItems();
- for (int i = 0; i < items.length; i++) {
- updateCheckedState(items[i]);
- }
- }
-
- /**
- * Update the checked state up the given element and all of its children.
- *
- * @param element
- */
- public void updateCheckedState(Object element) {
- Widget[] widgets = searchItems(element);
- for (int i = 0; i < widgets.length; i++) {
- Widget widget = widgets[i];
- if (widget != null) {
- updateCheckedState((TreeItem)widget);
- }
- }
- }
-
- /**
- * finds all occurrences of a widget to update
- * @param element the element to search for when finding occurrences
- * @return a list of widget occurrences to update or an empty list
- */
- private Widget[] searchItems(Object element) {
- ArrayList list = new ArrayList();
- TreeItem[] items = getTree().getItems();
- for (int i = 0; i < items.length; i++) {
- findAllOccurrences(items[i], element, list);
- }
- return (Widget[]) list.toArray(new Widget[0]);
- }
-
- /**
- * performs the actual search for items in the tree
- * @param list the list to add matches to
- * @param item the item in the tree
- * @param element the element to compare
- */
- private void findAllOccurrences(TreeItem item, Object element, ArrayList list) {
- if (element.equals(item.getData())) {
- list.add(item);
- }
- TreeItem[] items = item.getItems();
- for (int i = 0; i < items.length; i++) {
- findAllOccurrences(items[i], element, list);
- }
- }
-
- /**
- * Update the checked state up the given element and all of its children.
- *
- * @param element
- */
- public void updateCheckedState(TreeItem item) {
- Object element = item.getData();
- if (element instanceof IBreakpoint) {
- try {
- item.setChecked(((IBreakpoint) element).isEnabled());
- refreshItem(item);
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- } else if (element instanceof BreakpointContainer) {
- IBreakpoint[] breakpoints = ((BreakpointContainer) element).getBreakpoints();
- int enabledChildren= 0;
- for (int i = 0; i < breakpoints.length; i++) {
- IBreakpoint breakpoint = breakpoints[i];
- try {
- if (breakpoint.isEnabled()) {
- enabledChildren++;
- }
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- if (enabledChildren == 0) {
- // Uncheck the container node if no children are enabled
- item.setGrayed(false);
- item.setChecked(false);
- } else if (enabledChildren == breakpoints.length) {
- // Check the container if all children are enabled
- item.setGrayed(false);
- item.setChecked(true);
- } else {
- // If some but not all children are enabled, gray the container node
- item.setGrayed(true);
- item.setChecked(true);
- }
- // Update any children (breakpoints and containers)
- TreeItem[] items = item.getItems();
- for (int i = 0; i < items.length; i++) {
- updateCheckedState(items[i]);
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/FileBreakpointOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/FileBreakpointOrganizer.java
deleted file mode 100644
index bf2a4b316..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/FileBreakpointOrganizer.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.ui.AbstractBreakpointOrganizerDelegate;
-
-/**
- * Breakpoint organizers for files.
- *
- * @since 3.1
- */
-public class FileBreakpointOrganizer extends AbstractBreakpointOrganizerDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories(org.eclipse.debug.core.model.IBreakpoint)
- */
- public IAdaptable[] getCategories(IBreakpoint breakpoint) {
- IMarker marker = breakpoint.getMarker();
- if (marker != null) {
- IResource resource = marker.getResource();
- if (resource.getType() == IResource.FILE) {
- return new IAdaptable[]{(IFile)resource};
- }
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/IBreakpointOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/IBreakpointOrganizer.java
deleted file mode 100644
index eefe1f7f5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/IBreakpointOrganizer.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import org.eclipse.debug.ui.IBreakpointOrganizerDelegate;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * A breakpoint organizer is used to categorize breakpoints and provides
- * change notification when categorization has changed. Breakpoint organizers
- * are contributed via the <code>breakpointOrganizers</code> extension point.
- * <p>
- * This interface is not intended to be implemented. Clients contributing a breakpoint
- * organizer are intended to implement <code>IBreakpointOrganizerDelegate</code>.
- * </p>
- * @since 3.1
- */
-public interface IBreakpointOrganizer extends IBreakpointOrganizerDelegate {
-
- /**
- * Returns a label for this breakpoint organizer.
- *
- * @return a label for this breakpoint organizer
- */
- public String getLabel();
-
- /**
- * Returns an image descriptor for this breakpoint organizer or <code>null</code>.
- *
- * @return an image descriptor for this breakpoint organizer or <code>null</code>
- */
- public ImageDescriptor getImageDescriptor();
-
- /**
- * Returns a unique identifier for this breakpoint organizer.
- *
- * @return a unique identifier for this breakpoint organizer
- */
- public String getIdentifier();
-
- /**
- * Returns the label for breakpoints that do not fall into a category
- * for this organizer.
- *
- * @return label for breakpoints that do not fall into a category
- * for this organizer
- */
- public String getOthersLabel();
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/OtherBreakpointCategory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/OtherBreakpointCategory.java
deleted file mode 100644
index 388bb547c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/OtherBreakpointCategory.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-/**
- * Category for breakpoints in "other" categories.
- */
-public class OtherBreakpointCategory extends PlatformObject implements IWorkbenchAdapter {
-
- private static Map fOthers = new HashMap();
- private IBreakpointOrganizer fOrganizer;
-
-
- public static IAdaptable[] getCategories(IBreakpointOrganizer organizer) {
- IAdaptable[] others = (IAdaptable[]) fOthers.get(organizer);
- if (others == null) {
- others = new IAdaptable[]{new OtherBreakpointCategory(organizer)};
- fOthers.put(organizer, others);
- }
- return others;
- }
-
- /**
- * Constructs an 'other' category for the given organizer.
- *
- * @param organizer breakpoint organizer
- */
- private OtherBreakpointCategory(IBreakpointOrganizer organizer) {
- fOrganizer = organizer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
- */
- public Object[] getChildren(Object o) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- return DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_VIEW_BREAKPOINTS);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
- */
- public String getLabel(Object o) {
- return fOrganizer.getOthersLabel();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
- */
- public Object getParent(Object o) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if (obj instanceof OtherBreakpointCategory) {
- OtherBreakpointCategory category = (OtherBreakpointCategory) obj;
- return fOrganizer.equals(category.fOrganizer);
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return fOrganizer.hashCode();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ProjectBreakpointOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ProjectBreakpointOrganizer.java
deleted file mode 100644
index 03d8ebdda..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ProjectBreakpointOrganizer.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.ui.AbstractBreakpointOrganizerDelegate;
-
-/**
- * Breakpoint organizers for projects.
- *
- * @since 3.1
- */
-public class ProjectBreakpointOrganizer extends AbstractBreakpointOrganizerDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories(org.eclipse.debug.core.model.IBreakpoint)
- */
- public IAdaptable[] getCategories(IBreakpoint breakpoint) {
- IMarker marker = breakpoint.getMarker();
- if (marker != null) {
- IProject project = marker.getResource().getProject();
- if (project != null) {
- return new IAdaptable[]{project};
- }
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java
deleted file mode 100644
index 14125fcd2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.ui.AbstractBreakpointOrganizerDelegate;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Breakpoint organizers for resource working sets.
- *
- * @since 3.1
- */
-public class WorkingSetBreakpointOrganizer extends AbstractBreakpointOrganizerDelegate implements IPropertyChangeListener {
-
- IWorkingSetManager fWorkingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
-
- /**
- * Constructs a working set breakpoint organizer. Listens for changes in
- * working sets and fires property change notification.
- */
- public WorkingSetBreakpointOrganizer() {
- fWorkingSetManager.addPropertyChangeListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories(org.eclipse.debug.core.model.IBreakpoint)
- */
- public IAdaptable[] getCategories(IBreakpoint breakpoint) {
- List result = new ArrayList();
- List parents = new ArrayList();
- IResource res = breakpoint.getMarker().getResource();
- parents.add(res);
- while (res != null) {
- res = res.getParent();
- if (res != null) {
- parents.add(res);
- }
- }
- IWorkingSet[] workingSets = fWorkingSetManager.getWorkingSets();
- for (int i = 0; i < workingSets.length; i++) {
- if (!IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(workingSets[i].getId())) {
- IAdaptable[] elements = workingSets[i].getElements();
- for (int j = 0; j < elements.length; j++) {
- IResource resource = (IResource) elements[j].getAdapter(IResource.class);
- if (resource != null) {
- if (parents.contains(resource)) {
- result.add(new WorkingSetCategory(workingSets[i]));
- break;
- }
- }
- }
- }
- }
- return (IAdaptable[]) result.toArray(new IAdaptable[result.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#dispose()
- */
- public void dispose() {
- fWorkingSetManager.removePropertyChangeListener(this);
- fWorkingSetManager = null;
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- IWorkingSet set = null;
- if (event.getNewValue() instanceof IWorkingSet) {
- set = (IWorkingSet) event.getNewValue();
- } else if (event.getOldValue() instanceof IWorkingSet) {
- set = (IWorkingSet) event.getOldValue();
- }
- if (set != null && !IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(set.getId())) {
- fireCategoryChanged(new WorkingSetCategory(set));
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetCategory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetCategory.java
deleted file mode 100644
index 99293d41f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetCategory.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.breakpoints;
-
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.debug.internal.ui.views.DebugUIViewsMessages;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.ui.model.IWorkbenchAdapter2;
-
-/**
- * Represents a breakpoint category for a specific working set.
- */
-public class WorkingSetCategory extends PlatformObject implements IWorkbenchAdapter, IWorkbenchAdapter2 {
-
- private IWorkingSet fWorkingSet;
-
- /**
- * Constructs a new workings set category for the given working set.
- *
- * @param workingSet
- */
- public WorkingSetCategory(IWorkingSet workingSet) {
- fWorkingSet = workingSet;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
- */
- public Object[] getChildren(Object o) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- return fWorkingSet.getImageDescriptor();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
- */
- public String getLabel(Object o) {
- StringBuffer name = new StringBuffer(fWorkingSet.getName());
- if (isDefault()) {
- name.append(DebugUIViewsMessages.WorkingSetCategory_0);
- }
- return name.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
- */
- public Object getParent(Object o) {
- return null;
- }
-
- /**
- * Returns the working set for this category.
- *
- * @return
- */
- public IWorkingSet getWorkingSet() {
- return fWorkingSet;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if (obj instanceof WorkingSetCategory) {
- WorkingSetCategory category = (WorkingSetCategory) obj;
- return category.getWorkingSet().equals(fWorkingSet);
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return fWorkingSet.hashCode();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter2#getForeground(java.lang.Object)
- */
- public RGB getForeground(Object element) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter2#getBackground(java.lang.Object)
- */
- public RGB getBackground(Object element) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter2#getFont(java.lang.Object)
- */
- public FontData getFont(Object element) {
- if (isDefault()) {
- FontData[] fontData = JFaceResources.getDefaultFont().getFontData();
- if (fontData != null && fontData.length > 0) {
- FontData data = fontData[0];
- data.setStyle(SWT.BOLD);
- return data;
- }
- }
- return null;
- }
-
- /**
- * Whether this is the default breakpoint working set.
- *
- * @return whether this is the default breakpoint working set
- */
- private boolean isDefault() {
- return fWorkingSet.equals(BreakpointSetOrganizer.getDefaultWorkingSet());
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleLineNotifier.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleLineNotifier.java
deleted file mode 100644
index a51c68d14..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleLineNotifier.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.console;
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.console.IConsoleLineTracker;
-import org.eclipse.debug.ui.console.IConsoleLineTrackerExtension;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.ui.console.IConsoleConstants;
-import org.eclipse.ui.console.IPatternMatchListener;
-import org.eclipse.ui.console.PatternMatchEvent;
-import org.eclipse.ui.console.TextConsole;
-
-/**
- * Tracks text appended to the console and notifies listeners in terms of whole
- * lines.
- */
-public class ConsoleLineNotifier implements IPatternMatchListener, IPropertyChangeListener {
- /**
- * Console listeners
- */
- private List fListeners = new ArrayList(2);
-
- /**
- * The console this notifier is tracking
- */
- private ProcessConsole fConsole = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IPatternMatchListenerDelegate#connect(org.eclipse.ui.console.TextConsole)
- */
- public void connect(TextConsole console) {
- if (console instanceof ProcessConsole) {
- fConsole = (ProcessConsole)console;
-
- IConsoleLineTracker[] lineTrackers = DebugUIPlugin.getDefault().getProcessConsoleManager().getLineTrackers(fConsole.getProcess());
- for (int i = 0; i < lineTrackers.length; i++) {
- lineTrackers[i].init(fConsole);
- addConsoleListener(lineTrackers[i]);
- }
-
- fConsole.addPropertyChangeListener(this);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IPatternMatchListener#disconnect()
- */
- public synchronized void disconnect() {
- try {
- IDocument document = fConsole.getDocument();
- if (document != null) {
- int lastLine = document.getNumberOfLines() - 1;
- if (document.getLineDelimiter(lastLine) == null) {
- IRegion lineInformation = document.getLineInformation(lastLine);
- lineAppended(lineInformation);
- }
- }
- } catch (BadLocationException e) {
- }
- }
-
- /**
- * Notification the console's streams have been closed
- */
- public synchronized void consoleClosed() {
- int size = fListeners.size();
- for (int i = 0; i < size; i++) {
- IConsoleLineTracker tracker = (IConsoleLineTracker) fListeners.get(i);
- if (tracker instanceof IConsoleLineTrackerExtension) {
- ((IConsoleLineTrackerExtension) tracker).consoleClosed();
- }
- tracker.dispose();
- }
-
- fConsole = null;
- fListeners = null;
- }
-
- /**
- * Adds the given listener to the list of listeners notified when a line of
- * text is appended to the console.
- *
- * @param listener
- */
- public void addConsoleListener(IConsoleLineTracker listener) {
- if (!fListeners.contains(listener))
- fListeners.add(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IPatternMatchListener#matchFound(org.eclipse.ui.console.PatternMatchEvent)
- */
- public void matchFound(PatternMatchEvent event) {
- try {
- IDocument document = fConsole.getDocument();
- int lineOfOffset = document.getLineOfOffset(event.getOffset());
- String delimiter = document.getLineDelimiter(lineOfOffset);
- int strip = delimiter==null ? 0 : delimiter.length();
- Region region = new Region(event.getOffset(), event.getLength()-strip);
- lineAppended(region);
- } catch (BadLocationException e) {}
- }
-
- public void lineAppended(IRegion region) {
- int size = fListeners.size();
- for (int i=0; i<size; i++) {
- IConsoleLineTracker tracker = (IConsoleLineTracker) fListeners.get(i);
- tracker.lineAppended(region);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if(event.getProperty().equals(IConsoleConstants.P_CONSOLE_OUTPUT_COMPLETE)) {
- fConsole.removePropertyChangeListener(this);
- consoleClosed();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IPatternMatchListener#getPattern()
- */
- public String getPattern() {
- return ".*\\r(\\n?)|.*\\n"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IPatternMatchListener#getCompilerFlags()
- */
- public int getCompilerFlags() {
- return 0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IPatternMatchListener#getLineQualifier()
- */
- public String getLineQualifier() {
- return "\\n|\\r"; //$NON-NLS-1$
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleMessages.java
deleted file mode 100644
index 935439620..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleMessages.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.console;
-
-import org.eclipse.osgi.util.NLS;
-
-public class ConsoleMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.views.console.ConsoleMessages";//$NON-NLS-1$
-
- public static String ConsoleRemoveAllTerminatedAction_0;
- public static String ConsoleRemoveAllTerminatedAction_1;
-
- public static String ConsoleTerminateAction_0;
- public static String ConsoleTerminateAction_1;
-
- public static String ProcessConsole_0;
-
- public static String ProcessConsole_1;
- public static String ProcessConsole_2;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, ConsoleMessages.class);
- }
-
- public static String ConsoleRemoveTerminatedAction_0;
-
- public static String ConsoleRemoveTerminatedAction_1;
-
- public static String ShowStandardErrorAction_0;
-
- public static String ShowStandardOutAction_0;
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleMessages.properties
deleted file mode 100644
index 9c441dc1a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleMessages.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2009 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-ConsoleRemoveAllTerminatedAction_0=&Remove All Terminated
-ConsoleRemoveAllTerminatedAction_1=Remove All Terminated Launches
-ConsoleRemoveTerminatedAction_0=Remove Launch
-ConsoleRemoveTerminatedAction_1=Remove Launch
-
-ConsoleTerminateAction_0=&Terminate
-ConsoleTerminateAction_1=Terminate
-
-ProcessConsole_0=<terminated> {0}
-
-ProcessConsole_1=[Console output redirected to file:{0}]\n
-ProcessConsole_2=[Invalid file specified for console output: {0}]\n
-ShowStandardErrorAction_0=Show Console When Standard Error Changes
-ShowStandardOutAction_0=Show Console When Standard Out Changes
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java
deleted file mode 100644
index 9d3a049bc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.console;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchesListener2;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.RemoveAllTerminatedAction;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.Action;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * ConsoleRemoveAllTerminatedAction
- */
-public class ConsoleRemoveAllTerminatedAction extends Action implements IUpdate, ILaunchesListener2 {
-
- public void dispose() {
- DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
- public void update() {
- ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
- for (int i = 0; i < launches.length; i++) {
- ILaunch launch = launches[i];
- if (launch.isTerminated()) {
- setEnabled(true);
- return;
- }
- }
- setEnabled(false);
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
- RemoveAllTerminatedAction.removeTerminatedLaunches(launches);
- }
-
- public ConsoleRemoveAllTerminatedAction() {
- super(ConsoleMessages.ConsoleRemoveAllTerminatedAction_0);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.CONSOLE_REMOVE_ALL_TERMINATED);
- setToolTipText(ConsoleMessages.ConsoleRemoveAllTerminatedAction_1);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_REMOVE_ALL));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_REMOVE_ALL));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_REMOVE_ALL));
- DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesRemoved(ILaunch[] launches) {
- if (isEnabled()) {
- update();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesAdded(ILaunch[] launches) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesChanged(ILaunch[] launches) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesTerminated(ILaunch[] launches) {
- update();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveLaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveLaunchAction.java
deleted file mode 100644
index dcd6847c0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveLaunchAction.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.console;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.ILaunchesListener2;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.console.ConsolePlugin;
-import org.eclipse.ui.console.IConsole;
-import org.eclipse.ui.console.IConsoleListener;
-import org.eclipse.ui.console.IConsoleView;
-
-/**
- * ConsoleRemoveTerminatedAction
- */
-public class ConsoleRemoveLaunchAction extends Action implements IViewActionDelegate, IConsoleListener, ILaunchesListener2 {
-
- private ILaunch fLaunch;
-
- // only used when a view action delegate
- private IConsoleView fConsoleView;
-
- public ConsoleRemoveLaunchAction() {
- super(ConsoleMessages.ConsoleRemoveTerminatedAction_0);
- setToolTipText(ConsoleMessages.ConsoleRemoveTerminatedAction_1);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.CONSOLE_REMOVE_LAUNCH);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_REMOVE));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_REMOVE));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_REMOVE));
- DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
- ConsolePlugin.getDefault().getConsoleManager().addConsoleListener(this);
- }
-
- public ConsoleRemoveLaunchAction(ILaunch launch) {
- this();
- fLaunch = launch;
- update();
- }
-
- public void dispose() {
- DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
- ConsolePlugin.getDefault().getConsoleManager().removeConsoleListener(this);
- }
-
- public synchronized void update() {
- ILaunch launch = getLaunch();
- if (launch != null) {
- setEnabled(launch.isTerminated());
- } else {
- setEnabled(false);
- }
- }
-
- public synchronized void run() {
- ILaunch launch = getLaunch();
- if (launch != null) {
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- launchManager.removeLaunch(launch);
- }
- }
-
- public void init(IViewPart view) {
- if (view instanceof IConsoleView) {
- fConsoleView = (IConsoleView) view;
- }
- update();
- }
-
- public void run(IAction action) {
- run();
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
- public void consolesAdded(IConsole[] consoles) {
- }
-
- public void consolesRemoved(IConsole[] consoles) {
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesTerminated(ILaunch[] launches) {
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesRemoved(ILaunch[] launches) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesAdded(ILaunch[] launches) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
- */
- public void launchesChanged(ILaunch[] launches) {
- }
-
- protected ILaunch getLaunch() {
- if (fConsoleView == null) {
- return fLaunch;
- }
- // else get dynmically, as this action was created via plug-in XML view contribution
- IConsole console = fConsoleView.getConsole();
- if (console instanceof ProcessConsole) {
- ProcessConsole pconsole = (ProcessConsole) console;
- return pconsole.getProcess().getLaunch();
- }
- return null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleShowPreferencesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleShowPreferencesAction.java
deleted file mode 100644
index 7ff97a24d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleShowPreferencesAction.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.console;
-
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
-/**
- * ConsoleShowPreferencesAction Displays the Console's Preference page
- *
- * @since 3.2
- */
-public class ConsoleShowPreferencesAction extends Action implements IViewActionDelegate {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {}
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- SWTFactory.showPreferencePage("org.eclipse.debug.ui.ConsolePreferencePage"); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
- * org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- // do nothing
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleTerminateAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleTerminateAction.java
deleted file mode 100644
index e562612ce..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleTerminateAction.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.console;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.commands.ITerminateHandler;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.commands.actions.DebugCommandService;
-import org.eclipse.jface.action.Action;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * ConsoleTerminateAction
- */
-public class ConsoleTerminateAction extends Action implements IUpdate {
-
- private ProcessConsole fConsole;
- private IWorkbenchWindow fWindow;
-
- /**
- * Creates a terminate action for the console
- */
- public ConsoleTerminateAction(IWorkbenchWindow window, ProcessConsole console) {
- super(ConsoleMessages.ConsoleTerminateAction_0);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.CONSOLE_TERMINATE_ACTION);
- fConsole = console;
- fWindow = window;
- setToolTipText(ConsoleMessages.ConsoleTerminateAction_1);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_TERMINATE));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TERMINATE));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_TERMINATE));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.CONSOLE_TERMINATE_ACTION);
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
- public void update() {
- IProcess process = fConsole.getProcess();
- setEnabled(process.canTerminate());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- IProcess process = fConsole.getProcess();
- List targets = collectTargets(process);
- targets.add(process);
- DebugCommandService service = DebugCommandService.getService(fWindow);
- service.executeCommand(ITerminateHandler.class, targets.toArray(), null);
- }
-
- /**
- * Collects targets associated with a process.
- *
- * @param process
- * @return associated targets
- */
- private List collectTargets(IProcess process) {
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunch[] launches = launchManager.getLaunches();
- List targets = new ArrayList();
- for (int i = 0; i < launches.length; i++) {
- ILaunch launch = launches[i];
- IProcess[] processes = launch.getProcesses();
- for (int j = 0; j < processes.length; j++) {
- IProcess process2 = processes[j];
- if (process2.equals(process)) {
- IDebugTarget[] debugTargets = launch.getDebugTargets();
- for (int k = 0; k < debugTargets.length; k++) {
- targets.add(debugTargets[k]);
- }
- return targets; // all possible targets have been terminated for the launch.
- }
- }
- }
- return targets;
- }
-
- public void dispose() {
- fConsole = null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java
deleted file mode 100644
index 6e382e940..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java
+++ /dev/null
@@ -1,828 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.console;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.variables.IStringVariableManager;
-import org.eclipse.core.variables.VariablesPlugin;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.IStreamListener;
-import org.eclipse.debug.core.model.IFlushableStreamMonitor;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.IStreamMonitor;
-import org.eclipse.debug.core.model.IStreamsProxy;
-import org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.console.IConsole;
-import org.eclipse.debug.ui.console.IConsoleColorProvider;
-import org.eclipse.debug.ui.console.IConsoleHyperlink;
-import org.eclipse.debug.ui.console.IConsoleLineTracker;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.console.ConsolePlugin;
-import org.eclipse.ui.console.IHyperlink;
-import org.eclipse.ui.console.IOConsole;
-import org.eclipse.ui.console.IOConsoleInputStream;
-import org.eclipse.ui.console.IOConsoleOutputStream;
-import org.eclipse.ui.console.IPatternMatchListener;
-import org.eclipse.ui.console.PatternMatchEvent;
-import org.eclipse.ui.console.TextConsole;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.progress.UIJob;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * A console for a system process with standard I/O streams.
- *
- * @since 3.0
- */
-public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSetListener, IPropertyChangeListener {
- private IProcess fProcess = null;
-
- private List fStreamListeners = new ArrayList();
-
- private IConsoleColorProvider fColorProvider;
-
- private IOConsoleInputStream fInput;
-
- private FileOutputStream fFileOutputStream;
-
- private boolean fAllocateConsole = true;
-
- private boolean fStreamsClosed = false;
-
- /**
- * Proxy to a console document
- */
- public ProcessConsole(IProcess process, IConsoleColorProvider colorProvider) {
- this(process, colorProvider, null);
- }
-
- /**
- * Constructor
- * @param process the process to associate with this console
- * @param colorProvider the colour provider for this console
- * @param encoding the desired encoding for this console
- */
- public ProcessConsole(IProcess process, IConsoleColorProvider colorProvider, String encoding) {
- super(IInternalDebugCoreConstants.EMPTY_STRING, IDebugUIConstants.ID_PROCESS_CONSOLE_TYPE, null, encoding, true);
- fProcess = process;
-
- ILaunchConfiguration configuration = process.getLaunch().getLaunchConfiguration();
- String file = null;
- boolean append = false;
- if (configuration != null) {
- try {
- file = configuration.getAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_FILE, (String) null);
- if (file != null) {
- IStringVariableManager stringVariableManager = VariablesPlugin.getDefault().getStringVariableManager();
- file = stringVariableManager.performStringSubstitution(file);
- append = configuration.getAttribute(IDebugUIConstants.ATTR_APPEND_TO_FILE, false);
- }
- } catch (CoreException e) {
- }
- }
-
- if (file != null) {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IWorkspaceRoot root = workspace.getRoot();
- Path path = new Path(file);
- IFile ifile = root.getFileForLocation(path);
- String message = null;
-
- try {
- String fileLoc = null;
- if (ifile != null) {
- if (append && ifile.exists()) {
- ifile.appendContents(new ByteArrayInputStream(new byte[0]), true, true, new NullProgressMonitor());
- } else {
- if (ifile.exists()) {
- ifile.delete(true, new NullProgressMonitor());
- }
- ifile.create(new ByteArrayInputStream(new byte[0]), true, new NullProgressMonitor());
- }
- }
-
- File outputFile = new File(file);
- fFileOutputStream = new FileOutputStream(outputFile, append);
- fileLoc = outputFile.getAbsolutePath();
-
- message = MessageFormat.format(ConsoleMessages.ProcessConsole_1, new String[] {fileLoc});
- addPatternMatchListener(new ConsoleLogFilePatternMatcher(fileLoc));
- } catch (FileNotFoundException e) {
- message = MessageFormat.format(ConsoleMessages.ProcessConsole_2, new String[] {file});
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- if (message != null) {
- try {
- IOConsoleOutputStream stream = newOutputStream();
- stream.write(message);
- stream.close();
- } catch (IOException e) {
- DebugUIPlugin.log(e);
- }
- }
- try {
- fAllocateConsole = configuration.getAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_CONSOLE, true);
- } catch (CoreException e) {
- }
- }
-
- fColorProvider = colorProvider;
- fInput = getInputStream();
- colorProvider.connect(fProcess, this);
-
- setName(computeName());
-
- Color color = fColorProvider.getColor(IDebugUIConstants.ID_STANDARD_INPUT_STREAM);
- fInput.setColor(color);
-
- IConsoleLineTracker[] lineTrackers = DebugUIPlugin.getDefault().getProcessConsoleManager().getLineTrackers(process);
- if (lineTrackers.length > 0) {
- addPatternMatchListener(new ConsoleLineNotifier());
- }
- }
-
- /**
- * Computes and returns the image descriptor for this console.
- *
- * @return an image descriptor for this console or <code>null</code>
- */
- protected ImageDescriptor computeImageDescriptor() {
- ILaunchConfiguration configuration = getProcess().getLaunch().getLaunchConfiguration();
- if (configuration != null) {
- ILaunchConfigurationType type;
- try {
- type = configuration.getType();
- return DebugPluginImages.getImageDescriptor(type.getIdentifier());
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- return null;
- }
-
- /**
- * Computes and returns the current name of this console.
- *
- * @return a name for this console
- */
- protected String computeName() {
- String label = null;
- IProcess process = getProcess();
- ILaunchConfiguration config = process.getLaunch().getLaunchConfiguration();
-
- label = process.getAttribute(IProcess.ATTR_PROCESS_LABEL);
- if (label == null) {
- if (config == null) {
- label = process.getLabel();
- } else {
- // check if PRIVATE config
- if (DebugUITools.isPrivate(config)) {
- label = process.getLabel();
- } else {
- String type = null;
- try {
- type = config.getType().getName();
- } catch (CoreException e) {
- }
- StringBuffer buffer = new StringBuffer();
- buffer.append(config.getName());
- if (type != null) {
- buffer.append(" ["); //$NON-NLS-1$
- buffer.append(type);
- buffer.append("] "); //$NON-NLS-1$
- }
- buffer.append(process.getLabel());
- label = buffer.toString();
- }
- }
- }
-
- if (process.isTerminated()) {
- return MessageFormat.format(ConsoleMessages.ProcessConsole_0, new String[] { label });
- }
- return label;
- }
-
- /**
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent evt) {
- String property = evt.getProperty();
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- if (property.equals(IDebugPreferenceConstants.CONSOLE_WRAP) || property.equals(IDebugPreferenceConstants.CONSOLE_WIDTH)) {
- boolean fixedWidth = store.getBoolean(IDebugPreferenceConstants.CONSOLE_WRAP);
- if (fixedWidth) {
- int width = store.getInt(IDebugPreferenceConstants.CONSOLE_WIDTH);
- setConsoleWidth(width);
- } else {
- setConsoleWidth(-1);
- }
- } else if (property.equals(IDebugPreferenceConstants.CONSOLE_LIMIT_CONSOLE_OUTPUT) || property.equals(IDebugPreferenceConstants.CONSOLE_HIGH_WATER_MARK) || property.equals(IDebugPreferenceConstants.CONSOLE_LOW_WATER_MARK)) {
- boolean limitBufferSize = store.getBoolean(IDebugPreferenceConstants.CONSOLE_LIMIT_CONSOLE_OUTPUT);
- if (limitBufferSize) {
- int highWater = store.getInt(IDebugPreferenceConstants.CONSOLE_HIGH_WATER_MARK);
- int lowWater = store.getInt(IDebugPreferenceConstants.CONSOLE_LOW_WATER_MARK);
- if (highWater > lowWater) {
- setWaterMarks(lowWater, highWater);
- }
- } else {
- setWaterMarks(-1, -1);
- }
- } else if (property.equals(IDebugPreferenceConstants.CONSOLE_TAB_WIDTH)) {
- int tabWidth = store.getInt(IDebugPreferenceConstants.CONSOLE_TAB_WIDTH);
- setTabWidth(tabWidth);
- } else if (property.equals(IDebugPreferenceConstants.CONSOLE_OPEN_ON_OUT)) {
- boolean activateOnOut = store.getBoolean(IDebugPreferenceConstants.CONSOLE_OPEN_ON_OUT);
- IOConsoleOutputStream stream = getStream(IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM);
- if (stream != null) {
- stream.setActivateOnWrite(activateOnOut);
- }
- } else if (property.equals(IDebugPreferenceConstants.CONSOLE_OPEN_ON_ERR)) {
- boolean activateOnErr = store.getBoolean(IDebugPreferenceConstants.CONSOLE_OPEN_ON_ERR);
- IOConsoleOutputStream stream = getStream(IDebugUIConstants.ID_STANDARD_ERROR_STREAM);
- if (stream != null) {
- stream.setActivateOnWrite(activateOnErr);
- }
- } else if (property.equals(IDebugPreferenceConstants.CONSOLE_SYS_OUT_COLOR)) {
- IOConsoleOutputStream stream = getStream(IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM);
- if (stream != null) {
- stream.setColor(fColorProvider.getColor(IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM));
- }
- } else if (property.equals(IDebugPreferenceConstants.CONSOLE_SYS_ERR_COLOR)) {
- IOConsoleOutputStream stream = getStream(IDebugUIConstants.ID_STANDARD_ERROR_STREAM);
- if (stream != null) {
- stream.setColor(fColorProvider.getColor(IDebugUIConstants.ID_STANDARD_ERROR_STREAM));
- }
- } else if (property.equals(IDebugPreferenceConstants.CONSOLE_SYS_IN_COLOR)) {
- if (fInput != null) {
- fInput.setColor(fColorProvider.getColor(IDebugUIConstants.ID_STANDARD_INPUT_STREAM));
- }
- } else if (property.equals(IDebugUIConstants.PREF_CONSOLE_FONT)) {
- setFont(JFaceResources.getFont(IDebugUIConstants.PREF_CONSOLE_FONT));
- } else if (property.equals(IDebugPreferenceConstants.CONSOLE_BAKGROUND_COLOR)) {
- setBackground(DebugUIPlugin.getPreferenceColor(IDebugPreferenceConstants.CONSOLE_BAKGROUND_COLOR));
- }
- }
-
- /**
- * @see org.eclipse.debug.ui.console.IConsole#getStream(java.lang.String)
- */
- public IOConsoleOutputStream getStream(String streamIdentifier) {
- for (Iterator i = fStreamListeners.iterator(); i.hasNext();) {
- StreamListener listener = (StreamListener) i.next();
- if (listener.fStreamId.equals(streamIdentifier)) {
- return listener.fStream;
- }
- }
- return null;
- }
-
- /**
- * @see org.eclipse.debug.ui.console.IConsole#getProcess()
- */
- public IProcess getProcess() {
- return fProcess;
- }
-
- /**
- * @see org.eclipse.ui.console.IOConsole#dispose()
- */
- protected void dispose() {
- super.dispose();
- fColorProvider.disconnect();
- closeStreams();
- disposeStreams();
- DebugPlugin.getDefault().removeDebugEventListener(this);
- DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
- JFaceResources.getFontRegistry().removeListener(this);
- }
-
- /**
- * cleanup method to clsoe all of the open stream to this console
- */
- private synchronized void closeStreams() {
- if (fStreamsClosed) {
- return;
- }
- for (Iterator i = fStreamListeners.iterator(); i.hasNext();) {
- StreamListener listener = (StreamListener) i.next();
- listener.closeStream();
- }
- if (fFileOutputStream != null) {
- synchronized (fFileOutputStream) {
- try {
- fFileOutputStream.flush();
- fFileOutputStream.close();
- } catch (IOException e) {
- }
- }
- }
- try {
- fInput.close();
- } catch (IOException e) {
- }
- fStreamsClosed = true;
- }
-
- /**
- * disposes ofthe listeners for each of the stream associated with this console
- */
- private synchronized void disposeStreams() {
- for (Iterator i = fStreamListeners.iterator(); i.hasNext();) {
- StreamListener listener = (StreamListener) i.next();
- listener.dispose();
- }
- fFileOutputStream = null;
- fInput = null;
- }
-
- /**
- * @see org.eclipse.ui.console.AbstractConsole#init()
- */
- protected void init() {
- super.init();
- if (fProcess.isTerminated()) {
- closeStreams();
- resetName();
- } else {
- DebugPlugin.getDefault().addDebugEventListener(this);
- }
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- store.addPropertyChangeListener(this);
- JFaceResources.getFontRegistry().addListener(this);
- if (store.getBoolean(IDebugPreferenceConstants.CONSOLE_WRAP)) {
- setConsoleWidth(store.getInt(IDebugPreferenceConstants.CONSOLE_WIDTH));
- }
- setTabWidth(store.getInt(IDebugPreferenceConstants.CONSOLE_TAB_WIDTH));
-
- if (store.getBoolean(IDebugPreferenceConstants.CONSOLE_LIMIT_CONSOLE_OUTPUT)) {
- int highWater = store.getInt(IDebugPreferenceConstants.CONSOLE_HIGH_WATER_MARK);
- int lowWater = store.getInt(IDebugPreferenceConstants.CONSOLE_LOW_WATER_MARK);
- setWaterMarks(lowWater, highWater);
- }
-
- DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
- setFont(JFaceResources.getFont(IDebugUIConstants.PREF_CONSOLE_FONT));
- setBackground(DebugUIPlugin.getPreferenceColor(IDebugPreferenceConstants.CONSOLE_BAKGROUND_COLOR));
- }
- });
- }
-
- /**
- * Notify listeners when name changes.
- *
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
- */
- public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- DebugEvent event = events[i];
- if (event.getSource().equals(getProcess())) {
-
- if (event.getKind() == DebugEvent.TERMINATE) {
- closeStreams();
- DebugPlugin.getDefault().removeDebugEventListener(this);
- }
-
- resetName();
- }
- }
- }
-
- /**
- * resets the name of this console to the original computed name
- */
- private void resetName() {
- final String newName = computeName();
- String name = getName();
- if (!name.equals(newName)) {
- UIJob job = new UIJob("Update console title") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- ProcessConsole.this.setName(newName);
- warnOfContentChange();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
- }
-
- /**
- * send notification of a change of content in this console
- */
- private void warnOfContentChange() {
- ConsolePlugin.getDefault().getConsoleManager().warnOfContentChange(DebugUITools.getConsole(fProcess));
- }
-
- /**
- * @see org.eclipse.debug.ui.console.IConsole#connect(org.eclipse.debug.core.model.IStreamsProxy)
- */
- public void connect(IStreamsProxy streamsProxy) {
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- IStreamMonitor streamMonitor = streamsProxy.getErrorStreamMonitor();
- if (streamMonitor != null) {
- connect(streamMonitor, IDebugUIConstants.ID_STANDARD_ERROR_STREAM,
- store.getBoolean(IDebugPreferenceConstants.CONSOLE_OPEN_ON_ERR));
- }
- streamMonitor = streamsProxy.getOutputStreamMonitor();
- if (streamMonitor != null) {
- connect(streamMonitor, IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM,
- store.getBoolean(IDebugPreferenceConstants.CONSOLE_OPEN_ON_OUT));
- }
- InputReadJob readJob = new InputReadJob(streamsProxy);
- readJob.setSystem(true);
- readJob.schedule();
- }
-
- /**
- * @see org.eclipse.debug.ui.console.IConsole#connect(org.eclipse.debug.core.model.IStreamMonitor, java.lang.String)
- */
- public void connect(IStreamMonitor streamMonitor, String streamIdentifier) {
- connect(streamMonitor, streamIdentifier, false);
- }
-
- /**
- * Connects the given stream monitor to a new output stream with the given identifier.
- *
- * @param streamMonitor stream monitor
- * @param streamIdentifier stream identifier
- * @param activateOnWrite whether the stream should displayed when written to
- */
- private void connect(IStreamMonitor streamMonitor, String streamIdentifier, boolean activateOnWrite) {
- IOConsoleOutputStream stream = null;
- if (fAllocateConsole) {
- stream = newOutputStream();
- Color color = fColorProvider.getColor(streamIdentifier);
- stream.setColor(color);
- stream.setActivateOnWrite(activateOnWrite);
- }
- synchronized (streamMonitor) {
- StreamListener listener = new StreamListener(streamIdentifier, streamMonitor, stream);
- fStreamListeners.add(listener);
- }
- }
-
- /**
- * @see org.eclipse.debug.ui.console.IConsole#addLink(org.eclipse.debug.ui.console.IConsoleHyperlink, int, int)
- */
- public void addLink(IConsoleHyperlink link, int offset, int length) {
- try {
- addHyperlink(link, offset, length);
- } catch (BadLocationException e) {
- DebugUIPlugin.log(e);
- }
- }
-
- /**
- * @see org.eclipse.debug.ui.console.IConsole#addLink(org.eclipse.ui.console.IHyperlink, int, int)
- */
- public void addLink(IHyperlink link, int offset, int length) {
- try {
- addHyperlink(link, offset, length);
- } catch (BadLocationException e) {
- DebugUIPlugin.log(e);
- }
- }
-
- /**
- * @see org.eclipse.debug.ui.console.IConsole#getRegion(org.eclipse.debug.ui.console.IConsoleHyperlink)
- */
- public IRegion getRegion(IConsoleHyperlink link) {
- return super.getRegion(link);
- }
-
- /**
- * This class listens to a specified IO stream
- */
- private class StreamListener implements IStreamListener {
-
- private IOConsoleOutputStream fStream;
-
- private IStreamMonitor fStreamMonitor;
-
- private String fStreamId;
-
- private boolean fFlushed = false;
-
- private boolean fListenerRemoved = false;
-
- public StreamListener(String streamIdentifier, IStreamMonitor monitor, IOConsoleOutputStream stream) {
- this.fStreamId = streamIdentifier;
- this.fStreamMonitor = monitor;
- this.fStream = stream;
- fStreamMonitor.addListener(this);
- //fix to bug 121454. Ensure that output to fast processes is processed.
- streamAppended(null, monitor);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.debug.core.IStreamListener#streamAppended(java.lang.String,
- * org.eclipse.debug.core.model.IStreamMonitor)
- */
- public void streamAppended(String text, IStreamMonitor monitor) {
- String encoding = getEncoding();
- if (fFlushed) {
- try {
- if (fStream != null) {
- if (encoding == null)
- fStream.write(text);
- else
- fStream.write(text.getBytes(encoding));
- }
- if (fFileOutputStream != null) {
- synchronized (fFileOutputStream) {
- if (encoding == null)
- fFileOutputStream.write(text.getBytes());
- else
- fFileOutputStream.write(text.getBytes(encoding));
- }
- }
- } catch (IOException e) {
- DebugUIPlugin.log(e);
- }
- } else {
- String contents = null;
- synchronized (fStreamMonitor) {
- fFlushed = true;
- contents = fStreamMonitor.getContents();
- if (fStreamMonitor instanceof IFlushableStreamMonitor) {
- IFlushableStreamMonitor m = (IFlushableStreamMonitor) fStreamMonitor;
- m.flushContents();
- m.setBuffered(false);
- }
- }
- try {
- if (contents != null && contents.length() > 0) {
- if (fStream != null) {
- fStream.write(contents);
- }
- if (fFileOutputStream != null) {
- synchronized (fFileOutputStream) {
- fFileOutputStream.write(contents.getBytes());
- }
- }
- }
- } catch (IOException e) {
- DebugUIPlugin.log(e);
- }
- }
- }
-
- public void closeStream() {
- if (fStreamMonitor == null) {
- return;
- }
- synchronized (fStreamMonitor) {
- fStreamMonitor.removeListener(this);
- if (!fFlushed) {
- String contents = fStreamMonitor.getContents();
- streamAppended(contents, fStreamMonitor);
- }
- fListenerRemoved = true;
- try {
- if (fStream != null) {
- fStream.close();
- }
- } catch (IOException e) {
- }
- }
- }
-
- public void dispose() {
- if (!fListenerRemoved) {
- closeStream();
- }
- fStream = null;
- fStreamMonitor = null;
- fStreamId = null;
- }
- }
-
- private class InputReadJob extends Job {
-
- private IStreamsProxy streamsProxy;
-
- InputReadJob(IStreamsProxy streamsProxy) {
- super("Process Console Input Job"); //$NON-NLS-1$
- this.streamsProxy = streamsProxy;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected IStatus run(IProgressMonitor monitor) {
- try {
- byte[] b = new byte[1024];
- int read = 0;
- while (fInput != null && read >= 0) {
- read = fInput.read(b);
- if (read > 0) {
- String s = new String(b, 0, read);
- streamsProxy.write(s);
- }
- }
- } catch (IOException e) {
- DebugUIPlugin.log(e);
- }
- return Status.OK_STATUS;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.console.IConsole#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- if (super.getImageDescriptor() == null) {
- setImageDescriptor(computeImageDescriptor());
- }
- return super.getImageDescriptor();
- }
-
- private class ConsoleLogFilePatternMatcher implements IPatternMatchListener {
- String fFilePath;
-
- public ConsoleLogFilePatternMatcher(String filePath) {
- fFilePath = escape(filePath);
- }
-
- private String escape(String path) {
- StringBuffer buffer = new StringBuffer(path);
- int index = buffer.indexOf("\\"); //$NON-NLS-1$
- while (index >= 0) {
- buffer.insert(index, '\\');
- index = buffer.indexOf("\\", index+2); //$NON-NLS-1$
- }
- return buffer.toString();
- }
-
- public String getPattern() {
- return fFilePath;
- }
-
- public void matchFound(PatternMatchEvent event) {
- try {
- addHyperlink(new ConsoleLogFileHyperlink(fFilePath), event.getOffset(), event.getLength());
- removePatternMatchListener(this);
- } catch (BadLocationException e) {
- }
- }
-
- public int getCompilerFlags() {
- return 0;
- }
-
- public String getLineQualifier() {
- return null;
- }
-
- public void connect(TextConsole console) {
- }
-
- public void disconnect() {
- }
- }
-
- private class ConsoleLogFileHyperlink implements IHyperlink {
- String fFilePath;
- ConsoleLogFileHyperlink(String filePath) {
- fFilePath = filePath;
- }
-
- public void linkActivated() {
- IEditorInput input;
- Path path = new Path(fFilePath);
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IFile ifile = root.getFileForLocation(path);
- if (ifile == null) { // The file is not in the workspace
- File file = new File(fFilePath);
- LocalFileStorage lfs = new LocalFileStorage(file);
- input = new StorageEditorInput(lfs, file);
-
- } else {
- input = new FileEditorInput(ifile);
- }
-
- IWorkbenchPage activePage = DebugUIPlugin.getActiveWorkbenchWindow().getActivePage();
- try {
- activePage.openEditor(input, EditorsUI.DEFAULT_TEXT_EDITOR_ID, true);
- } catch (PartInitException e) {
- }
- }
- public void linkEntered() {
- }
- public void linkExited() {
- }
- }
-
- class StorageEditorInput extends PlatformObject implements IStorageEditorInput {
- private File fFile;
- private IStorage fStorage;
-
- public StorageEditorInput(IStorage storage, File file) {
- fStorage = storage;
- fFile = file;
- }
-
- public IStorage getStorage() {
- return fStorage;
- }
-
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
-
- public String getName() {
- return getStorage().getName();
- }
-
- public IPersistableElement getPersistable() {
- return null;
- }
-
- public String getToolTipText() {
- return getStorage().getFullPath().toOSString();
- }
-
- public boolean equals(Object object) {
- return object instanceof StorageEditorInput &&
- getStorage().equals(((StorageEditorInput)object).getStorage());
- }
-
- public int hashCode() {
- return getStorage().hashCode();
- }
-
- public boolean exists() {
- return fFile.exists();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.AbstractConsole#getHelpContextId()
- */
- public String getHelpContextId() {
- return IDebugHelpContextIds.PROCESS_CONSOLE;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsoleManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsoleManager.java
deleted file mode 100644
index df8479fe7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsoleManager.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.console;
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchListener;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.console.ConsoleColorProvider;
-import org.eclipse.debug.ui.console.IConsoleColorProvider;
-import org.eclipse.debug.ui.console.IConsoleLineTracker;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ui.console.ConsolePlugin;
-import org.eclipse.ui.console.IConsole;
-import org.eclipse.ui.console.IConsoleManager;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Creates documents for processes as they are registered with a launch.
- * The singleton manager is accessible from the debug UI plugin.
- */
-public class ProcessConsoleManager implements ILaunchListener {
-
- /**
- * Console document content provider extensions, keyed by extension id
- */
- private Map fColorProviders;
-
- /**
- * The default color provider. Used if no color provider is contributed
- * for the given process type.
- */
- private IConsoleColorProvider fDefaultColorProvider;
-
- /**
- * Console line trackers; keyed by process type to list of trackers (1:N)
- */
- private Map fLineTrackers;
-
- /**
- * Map of processes for a launch to compute removed processes
- */
- private Map fProcesses;
-
-
-
- /**
- * @see ILaunchListener#launchRemoved(ILaunch)
- */
- public void launchRemoved(ILaunch launch) {
- removeLaunch(launch);
- }
-
- protected void removeLaunch(ILaunch launch) {
- IProcess[] processes= launch.getProcesses();
- for (int i= 0; i < processes.length; i++) {
- IProcess iProcess = processes[i];
- removeProcess(iProcess);
- }
- if (fProcesses != null) {
- fProcesses.remove(launch);
- }
- }
-
- /**
- * Removes the console and document associated with the given process.
- *
- * @param iProcess process to clean up
- */
- private void removeProcess(IProcess iProcess) {
- IConsole console = getConsole(iProcess);
-
- if (console != null) {
- IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
- manager.removeConsoles(new IConsole[]{console});
- }
- }
-
- /**
- * Returns the console for the given process, or <code>null</code> if none.
- *
- * @param process
- * @return the console for the given process, or <code>null</code> if none
- */
- public IConsole getConsole(IProcess process) {
- IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
- IConsole[] consoles = manager.getConsoles();
- for (int i = 0; i < consoles.length; i++) {
- IConsole console = consoles[i];
- if (console instanceof ProcessConsole) {
- ProcessConsole pc = (ProcessConsole)console;
- if (pc.getProcess().equals(process)) {
- return pc;
- }
- }
- }
- return null;
- }
-
- /**
- * @see ILaunchListener#launchAdded(ILaunch)
- */
- public void launchAdded(ILaunch launch) {
- launchChanged(launch);
- }
-
- /**
- * @see ILaunchListener#launchChanged(ILaunch)
- */
- public void launchChanged(final ILaunch launch) {
- IProcess[] processes= launch.getProcesses();
- for (int i= 0; i < processes.length; i++) {
- if (getConsoleDocument(processes[i]) == null) {
- IProcess process = processes[i];
- if (process.getStreamsProxy() == null) {
- continue;
- }
-
- //create a new console.
- IConsoleColorProvider colorProvider = getColorProvider(process.getAttribute(IProcess.ATTR_PROCESS_TYPE));
- String encoding = launch.getAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING);
- ProcessConsole pc = new ProcessConsole(process, colorProvider, encoding);
- pc.setAttribute(IDebugUIConstants.ATTR_CONSOLE_PROCESS, process);
-
- //add new console to console manager.
- ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[]{pc});
- }
- }
- List removed = getRemovedProcesses(launch);
- if (removed != null) {
- Iterator iterator = removed.iterator();
- while (iterator.hasNext()) {
- IProcess p = (IProcess) iterator.next();
- removeProcess(p);
- }
- }
- }
-
- /**
- * Returns the document for the process, or <code>null</code>
- * if none.
- */
- public IDocument getConsoleDocument(IProcess process) {
- ProcessConsole console = (ProcessConsole) getConsole(process);
- return (console != null ? console.getDocument() : null);
- }
-
- /**
- * Called by the debug ui plug-in on startup.
- * The console document manager starts listening for
- * launches to be registered and initializes if any launches
- * already exist.
- */
- public void startup() {
- ILaunchManager launchManager= DebugPlugin.getDefault().getLaunchManager();
- launchManager.addLaunchListener(this);
-
- //set up the docs for launches already registered
- ILaunch[] launches= launchManager.getLaunches();
- for (int i = 0; i < launches.length; i++) {
- launchAdded(launches[i]);
- }
- }
-
- /**
- * Called by the debug ui plug-in on shutdown.
- * The console document manager de-registers as a
- * launch listener and kills all existing console documents.
- */
- public void shutdown() {
- ILaunchManager launchManager= DebugPlugin.getDefault().getLaunchManager();
- ILaunch[] launches = launchManager.getLaunches();
- for (int i = 0; i < launches.length; i++) {
- ILaunch launch = launches[i];
- removeLaunch(launch);
- }
- launchManager.removeLaunchListener(this);
- if (fProcesses != null) {
- fProcesses.clear();
- }
- }
-
- /**
- * Returns a new console document color provider extension for the given
- * process type, or <code>null</code> if none.
- *
- * @param type corresponds to <code>IProcess.ATTR_PROCESS_TYPE</code>
- * @return IConsoleColorProvider
- */
- public IConsoleColorProvider getColorProvider(String type) {
- if (fColorProviders == null) {
- fColorProviders = new HashMap();
- IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_CONSOLE_COLOR_PROVIDERS);
- IConfigurationElement[] elements = extensionPoint.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- IConfigurationElement extension = elements[i];
- fColorProviders.put(extension.getAttribute("processType"), extension); //$NON-NLS-1$
- }
- }
- IConfigurationElement extension = (IConfigurationElement)fColorProviders.get(type);
- if (extension != null) {
- try {
- Object colorProvider = extension.createExecutableExtension("class"); //$NON-NLS-1$
- if (colorProvider instanceof IConsoleColorProvider) {
- return (IConsoleColorProvider)colorProvider;
- }
- DebugUIPlugin.logErrorMessage(MessageFormat.format(
- "Extension {0} must specify an instanceof IConsoleColorProvider for class attribute.", //$NON-NLS-1$
- new String[]{extension.getDeclaringExtension().getUniqueIdentifier()}));
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- //no color provider found of specified type, return default color provider.
- if (fDefaultColorProvider == null) {
- fDefaultColorProvider = new ConsoleColorProvider();
- }
- return fDefaultColorProvider;
- }
-
- /**
- * Returns the Line Trackers for a given process type.
- * @param process The process for which line trackers are required.
- * @return An array of line trackers which match the given process type.
- */
- public IConsoleLineTracker[] getLineTrackers(IProcess process) {
- String type = process.getAttribute(IProcess.ATTR_PROCESS_TYPE);
-
- if (fLineTrackers == null) {
- fLineTrackers = new HashMap();
- IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_CONSOLE_LINE_TRACKERS);
- IConfigurationElement[] elements = extensionPoint.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- IConfigurationElement extension = elements[i];
- String processType = extension.getAttribute("processType"); //$NON-NLS-1$
- List list = (List)fLineTrackers.get(processType);
- if (list == null) {
- list = new ArrayList();
- fLineTrackers.put(processType, list);
- }
- list.add(extension);
- }
- }
-
- ArrayList trackers = new ArrayList();
- if (type != null) {
- List lineTrackerExtensions = (List) fLineTrackers.get(type);
- if(lineTrackerExtensions != null) {
- for(Iterator i = lineTrackerExtensions.iterator(); i.hasNext(); ) {
- IConfigurationElement element = (IConfigurationElement) i.next();
- try {
- trackers.add(element.createExecutableExtension("class")); //$NON-NLS-1$
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- }
- }
- return (IConsoleLineTracker[]) trackers.toArray(new IConsoleLineTracker[0]);
- }
-
- /**
- * Returns the processes that have been removed from the given
- * launch, or <code>null</code> if none.
- *
- * @param launch launch that has changed
- * @return removed processes or <code>null</code>
- */
- private List getRemovedProcesses(ILaunch launch) {
- List removed = null;
- if (fProcesses == null) {
- fProcesses = new HashMap();
- }
- IProcess[] old = (IProcess[]) fProcesses.get(launch);
- IProcess[] curr = launch.getProcesses();
- if (old != null) {
- for (int i = 0; i < old.length; i++) {
- IProcess process = old[i];
- if (!contains(curr, process)) {
- if (removed == null) {
- removed = new ArrayList();
- }
- removed.add(process);
- }
- }
- }
- // update cache with current processes
- fProcesses.put(launch, curr);
- return removed;
- }
-
- /**
- * Returns whether the given object is contained in the list.
- *
- * @param list list to search
- * @param object object to search for
- * @return whether the given object is contained in the list
- */
- private boolean contains(Object[] list, Object object) {
- for (int i = 0; i < list.length; i++) {
- Object object2 = list[i];
- if (object2.equals(object)) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java
deleted file mode 100644
index e61655643..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.console;
-
-import java.io.IOException;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.IStreamsProxy;
-import org.eclipse.debug.core.model.IStreamsProxy2;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.console.IConsole;
-import org.eclipse.ui.console.IConsoleConstants;
-import org.eclipse.ui.console.IConsolePageParticipant;
-import org.eclipse.ui.console.IConsoleView;
-import org.eclipse.ui.contexts.IContextActivation;
-import org.eclipse.ui.contexts.IContextService;
-import org.eclipse.ui.handlers.IHandlerActivation;
-import org.eclipse.ui.handlers.IHandlerService;
-import org.eclipse.ui.part.IPageBookViewPage;
-import org.eclipse.ui.part.IPageSite;
-import org.eclipse.ui.part.IShowInSource;
-import org.eclipse.ui.part.IShowInTargetList;
-import org.eclipse.ui.part.ShowInContext;
-
-/**
- * Creates and manages process console specific actions
- *
- * @since 3.1
- */
-public class ProcessConsolePageParticipant implements IConsolePageParticipant, IShowInSource, IShowInTargetList, IDebugEventSetListener, IDebugContextListener {
-
- // actions
- private ConsoleTerminateAction fTerminate;
- private ConsoleRemoveLaunchAction fRemoveTerminated;
- private ConsoleRemoveAllTerminatedAction fRemoveAllTerminated;
- private ShowWhenContentChangesAction fStdOut;
- private ShowWhenContentChangesAction fStdErr;
-
- private ProcessConsole fConsole;
-
- private IPageBookViewPage fPage;
-
- private IConsoleView fView;
-
- private EOFHandler fEOFHandler;
- private String fContextId = "org.eclipse.debug.ui.console"; //$NON-NLS-1$;
- private IContextActivation fActivatedContext;
- private IHandlerActivation fActivatedHandler;
- /**
- * Handler to send EOF
- */
- private class EOFHandler extends AbstractHandler {
- public Object execute(ExecutionEvent event) throws org.eclipse.core.commands.ExecutionException {
- IStreamsProxy proxy = getProcess().getStreamsProxy();
- if (proxy instanceof IStreamsProxy2) {
- IStreamsProxy2 proxy2 = (IStreamsProxy2) proxy;
- try {
- proxy2.closeInputStream();
- } catch (IOException e1) {
- }
- }
- return null;
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsolePageParticipant#init(IPageBookViewPage, IConsole)
- */
- public void init(IPageBookViewPage page, IConsole console) {
- fPage = page;
- fConsole = (ProcessConsole) console;
-
- fRemoveTerminated = new ConsoleRemoveLaunchAction(fConsole.getProcess().getLaunch());
- fRemoveAllTerminated = new ConsoleRemoveAllTerminatedAction();
- fTerminate = new ConsoleTerminateAction(page.getSite().getWorkbenchWindow(), fConsole);
- fStdOut = new ShowStandardOutAction();
- fStdErr = new ShowStandardErrorAction();
-
- fView = (IConsoleView) fPage.getSite().getPage().findView(IConsoleConstants.ID_CONSOLE_VIEW);
-
- DebugPlugin.getDefault().addDebugEventListener(this);
- DebugUITools.getDebugContextManager().getContextService(fPage.getSite().getWorkbenchWindow()).addDebugContextListener(this);
-
- // contribute to toolbar
- IActionBars actionBars = fPage.getSite().getActionBars();
- configureToolBar(actionBars.getToolBarManager());
-
- // create handler and submissions for EOF
- fEOFHandler = new EOFHandler();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsolePageParticipant#dispose()
- */
- public void dispose() {
- DebugUITools.getDebugContextManager().getContextService(fPage.getSite().getWorkbenchWindow()).removeDebugContextListener(this);
- DebugPlugin.getDefault().removeDebugEventListener(this);
- if (fRemoveTerminated != null) {
- fRemoveTerminated.dispose();
- fRemoveTerminated = null;
- }
- if (fRemoveAllTerminated != null) {
- fRemoveAllTerminated.dispose();
- fRemoveAllTerminated = null;
- }
- if (fTerminate != null) {
- fTerminate.dispose();
- fTerminate = null;
- }
- if (fStdOut != null) {
- fStdOut.dispose();
- fStdOut = null;
- }
- if (fStdErr != null) {
- fStdErr.dispose();
- fStdErr = null;
- }
- fConsole = null;
- }
-
- /**
- * Contribute actions to the toolbar
- */
- protected void configureToolBar(IToolBarManager mgr) {
- mgr.appendToGroup(IConsoleConstants.LAUNCH_GROUP, fTerminate);
- mgr.appendToGroup(IConsoleConstants.LAUNCH_GROUP, fRemoveTerminated);
- mgr.appendToGroup(IConsoleConstants.LAUNCH_GROUP, fRemoveAllTerminated);
- mgr.appendToGroup(IConsoleConstants.OUTPUT_GROUP, fStdOut);
- mgr.appendToGroup(IConsoleConstants.OUTPUT_GROUP, fStdErr);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class required) {
- if (IShowInSource.class.equals(required)) {
- return this;
- }
- if (IShowInTargetList.class.equals(required)) {
- return this;
- }
- //CONTEXTLAUNCHING
- if(ILaunchConfiguration.class.equals(required)) {
- ILaunch launch = getProcess().getLaunch();
- if(launch != null) {
- return launch.getLaunchConfiguration();
- }
- return null;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.IShowInSource#getShowInContext()
- */
- public ShowInContext getShowInContext() {
- IProcess process = getProcess();
- if (process == null) {
- return null;
- }
- IDebugTarget target = (IDebugTarget)process.getAdapter(IDebugTarget.class);
- ISelection selection = null;
- if (target == null) {
- selection = new TreeSelection(new TreePath(new Object[]{
- DebugPlugin.getDefault().getLaunchManager(),
- process.getLaunch(),
- process}));
- } else {
- selection = new TreeSelection(new TreePath(new Object[]{
- DebugPlugin.getDefault().getLaunchManager(),
- target.getLaunch(),
- target}));
- }
- return new ShowInContext(null, selection);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.IShowInTargetList#getShowInTargetIds()
- */
- public String[] getShowInTargetIds() {
- return new String[] {IDebugUIConstants.ID_DEBUG_VIEW};
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
- */
- public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- DebugEvent event = events[i];
- if (event.getSource().equals(getProcess())) {
- Runnable r = new Runnable() {
- public void run() {
- if (fTerminate != null) {
- fTerminate.update();
- }
- }
- };
-
- DebugUIPlugin.getStandardDisplay().asyncExec(r);
- }
- }
- }
-
- protected IProcess getProcess() {
- return fConsole != null ? fConsole.getProcess() : null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsolePageParticipant#activated()
- */
- public void activated() {
- // add EOF submissions
- IPageSite site = fPage.getSite();
- IHandlerService handlerService = (IHandlerService)site.getService(IHandlerService.class);
- IContextService contextService = (IContextService)site.getService(IContextService.class);
- fActivatedContext = contextService.activateContext(fContextId);
- fActivatedHandler = handlerService.activateHandler("org.eclipse.debug.ui.commands.eof", fEOFHandler); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.console.IConsolePageParticipant#deactivated()
- */
- public void deactivated() {
- // remove EOF submissions
- IPageSite site = fPage.getSite();
- IHandlerService handlerService = (IHandlerService)site.getService(IHandlerService.class);
- IContextService contextService = (IContextService)site.getService(IContextService.class);
- handlerService.deactivateHandler(fActivatedHandler);
- contextService.deactivateContext(fActivatedContext);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener#contextEvent(org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent)
- */
- public void debugContextChanged(DebugContextEvent event) {
- if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
- if (fView != null && getProcess().equals(DebugUITools.getCurrentProcess())) {
- fView.display(fConsole);
- }
- }
-
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessTypePropertyTester.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessTypePropertyTester.java
deleted file mode 100644
index a525977d0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessTypePropertyTester.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.console;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.ui.console.TextConsole;
-
-/**
- * Tests if a process type matches the expected value.
- *
- * @since 3.1
- */
-public class ProcessTypePropertyTester extends PropertyTester {
-
- /* (non-Javadoc)
- * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
- */
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if (receiver instanceof TextConsole) {
- TextConsole console = (TextConsole) receiver;
- IProcess process = (IProcess) console.getAttribute(IDebugUIConstants.ATTR_CONSOLE_PROCESS);
- if (process != null) {
- String type = process.getAttribute(IProcess.ATTR_PROCESS_TYPE);
- return (type != null && type.equals(expectedValue));
- }//end if
- }//end if
- return false;
- }//end test
-
-}//end class
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardErrorAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardErrorAction.java
deleted file mode 100644
index ff2f6a064..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardErrorAction.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.console;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Toggles preference show the console when output is written
- * to standard error stream.
- *
- * @since 3.3
- */
-public class ShowStandardErrorAction extends ShowWhenContentChangesAction {
-
- /**
- * Constructs an action to toggle console auto activation preferences
- */
- public ShowStandardErrorAction() {
- super(ConsoleMessages.ShowStandardErrorAction_0);
- setId(DebugUIPlugin.getUniqueIdentifier() + ".ShowWhenStderrChangesAction"); //$NON-NLS-1$
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.SHOW_WHEN_STDERR_CHANGES_ACTION);
- setImageDescriptor(DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STANDARD_ERR));
- }
-
- protected String getKey() {
- return IDebugPreferenceConstants.CONSOLE_OPEN_ON_ERR;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardOutAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardOutAction.java
deleted file mode 100644
index 0bd2b96dd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardOutAction.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.console;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Toggles preference show the console when output is written
- * to standard output stream.
- *
- * @since 3.3
- */
-public class ShowStandardOutAction extends ShowWhenContentChangesAction {
-
- /**
- * Constructs an action to toggle console auto activation preferences
- */
- public ShowStandardOutAction() {
- super(ConsoleMessages.ShowStandardOutAction_0);
- setId(DebugUIPlugin.getUniqueIdentifier() + ".ShowWhenStdoutChangesAction"); //$NON-NLS-1$
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.SHOW_WHEN_STDOUT_CHANGES_ACTION);
- setImageDescriptor(DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STANDARD_OUT));
- }
-
- protected String getKey() {
- return IDebugPreferenceConstants.CONSOLE_OPEN_ON_OUT;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowWhenContentChangesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowWhenContentChangesAction.java
deleted file mode 100644
index bfe1825b7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowWhenContentChangesAction.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.console;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-
-/**
- * Abstract action for toggling preference to automatically show
- * the console when a streams content changes.
- *
- * @since 3.3
- */
-public abstract class ShowWhenContentChangesAction extends Action implements IPropertyChangeListener{
-
- /**
- * Constructs an action to toggle console auto activation preferences
- */
- public ShowWhenContentChangesAction(String name) {
- super(name, IAction.AS_CHECK_BOX);
- setToolTipText(name);
- getPreferenceStore().addPropertyChangeListener(this);
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
- if (property.equals(getKey())) {
- update();
- }
- }
-
- protected abstract String getKey();
-
- private void update() {
- IPreferenceStore store = getPreferenceStore();
- if (store.getBoolean(getKey())) {
- // on
- setChecked(true);
- } else {
- // off
- setChecked(false);
- }
- }
-
- /**
- * @return
- */
- private IPreferenceStore getPreferenceStore() {
- return DebugUIPlugin.getDefault().getPreferenceStore();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- IPreferenceStore store = getPreferenceStore();
- boolean show = isChecked();
- store.removePropertyChangeListener(this);
- store.setValue(getKey(), show);
- store.addPropertyChangeListener(this);
- }
-
- /**
- * Must be called to dispose this action.
- */
- public void dispose() {
- getPreferenceStore().removePropertyChangeListener(this);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java
deleted file mode 100644
index cbaced58f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java
+++ /dev/null
@@ -1,511 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - Pawel Piech - Initial Implementation - Drag/Drop to Expressions View (Bug 184057), Integration with non-standard debug models (Bug 209883)
- * IBM Corporation - further implementation and documentation
- * Wind River Systems - integration with non-standard debug models
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.expression;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IExpressionManager;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.core.model.IWatchExpression;
-import org.eclipse.debug.internal.core.ExpressionManager;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
-import org.eclipse.debug.internal.ui.views.variables.IndexedVariablePartition;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.actions.IWatchExpressionFactoryAdapter;
-import org.eclipse.debug.ui.actions.IWatchExpressionFactoryAdapter2;
-import org.eclipse.debug.ui.actions.IWatchExpressionFactoryAdapterExtension;
-import org.eclipse.jface.util.LocalSelectionTransfer;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ViewerDropAdapter;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.TransferData;
-
-/**
- * Drop Adapter allowing expressions, variables and text to be dropped in the Expression View.
- * When IVariables or text is dropped new watch expressions are created at the drop location.
- * When IExpressions are dropped, they are moved to the drop location
- *
- * @see org.eclipse.debug.internal.ui.views.variables.VariablesDragAdapter
- * @see ExpressionManager
- * @since 3.4
- */
-public class ExpressionDropAdapter extends ViewerDropAdapter {
-
- private TransferData fCurrentTransferType = null;
- private boolean fInsertBefore;
- private int fDropType;
-
- private static final int DROP_TYPE_DEFAULT = 0;
- private static final int DROP_TYPE_VARIABLE = 1;
- private static final int DROP_TYPE_EXPRESSION = 2;
- private static final int DROP_TYPE_WATCH_ADAPTABLE_ELEMENT = 3;
-
- /**
- * Constructor takes the viewer this drop adapter applies to.
- * @param viewer the viewer to add drop to
- */
- protected ExpressionDropAdapter(TreeModelViewer viewer) {
- super(viewer);
- setFeedbackEnabled(true);
- setSelectionFeedbackEnabled(false);
- setScrollExpandEnabled(false);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerDropAdapter#dragEnter(org.eclipse.swt.dnd.DropTargetEvent)
- */
- public void dragEnter(DropTargetEvent event) {
- fDropType = DROP_TYPE_DEFAULT;
- event.detail = DND.DROP_NONE;
-
- for (int i = 0; i < event.dataTypes.length; i++) {
- if (LocalSelectionTransfer.getTransfer().isSupportedType(event.dataTypes[i])) {
- if (isExpressionDrop()){
- event.currentDataType = event.dataTypes[i];
- event.detail = DND.DROP_MOVE;
- fDropType = DROP_TYPE_EXPRESSION;
- break;
- } else if (isVariableDrop()){
- event.currentDataType = event.dataTypes[i];
- event.detail = DND.DROP_COPY;
- fDropType = DROP_TYPE_VARIABLE;
- break;
- } else if (isWatchAdaptableElementDrop()){
- event.currentDataType = event.dataTypes[i];
- event.detail = DND.DROP_COPY;
- fDropType = DROP_TYPE_WATCH_ADAPTABLE_ELEMENT;
- break;
- }
- } else if (TextTransfer.getInstance().isSupportedType(event.dataTypes[i])) {
- event.currentDataType = event.dataTypes[i];
- event.detail = DND.DROP_COPY;
- fDropType = DROP_TYPE_DEFAULT;
- break;
- }
- }
-
- super.dragEnter(event);
- }
-
- /**
- * @return whether the selection transfer contains only IExpressions
- */
- private boolean isExpressionDrop() {
- IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection();
- Iterator iterator = selection.iterator();
- while (iterator.hasNext()) {
- Object element = iterator.next();
- if (getTargetExpression(element) == null){
- return false;
- }
- }
- return true;
- }
-
- /**
- * @return whether the selection transfer contains only IVariables
- */
- private boolean isVariableDrop() {
- IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection();
- Iterator iterator = selection.iterator();
- while (iterator.hasNext()) {
- Object element = iterator.next();
- if (!(element instanceof IVariable)){
- return false;
- }
- }
- return true;
- }
-
- /**
- * @return whether the selection transfer contains only objects adaptable
- * to IWatchExpressionFactoryAdapter2
- */
- private boolean isWatchAdaptableElementDrop() {
- IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection();
- Iterator iterator = selection.iterator();
- while (iterator.hasNext()) {
- Object element = iterator.next();
- if (!(element instanceof IAdaptable &&
- ((IAdaptable)element).getAdapter(IWatchExpressionFactoryAdapter2.class) != null))
- {
- return false;
- }
- }
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerDropAdapter#dragOver(org.eclipse.swt.dnd.DropTargetEvent)
- */
- public void dragOver(DropTargetEvent event) {
- super.dragOver(event);
- // Allow scrolling (but not expansion)
- event.feedback |= DND.FEEDBACK_SCROLL;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerDropAdapter#validateDrop(java.lang.Object, int, org.eclipse.swt.dnd.TransferData)
- */
- public boolean validateDrop(Object target, int operation, TransferData transferType) {
- if (LocalSelectionTransfer.getTransfer().isSupportedType(transferType)) {
- if (fDropType == DROP_TYPE_EXPRESSION){
- return validateExpressionDrop(target);
- } else if (fDropType == DROP_TYPE_VARIABLE){
- return validateVariableDrop(target);
- } else if (fDropType == DROP_TYPE_WATCH_ADAPTABLE_ELEMENT){
- return validateWatchAdaptableDrop(target);
- }
- } else if (TextTransfer.getInstance().isSupportedType(transferType)) {
- return validateTextDrop(target);
- }
- return false;
- }
-
- /**
- * Validates if an IExpression drop is valid by checking if the target
- * is an IExpression.
- * @param target target of the drop
- * @return whether the drop is valid
- */
- private boolean validateExpressionDrop(Object target){
- return target instanceof IExpression ||
- ((target instanceof IAdaptable) && ((IAdaptable)target).getAdapter(IExpression.class) != null);
- }
-
- private IExpression getTargetExpression(Object target) {
- if (target instanceof IExpression) {
- return (IExpression)target;
- } else if (target instanceof IAdaptable) {
- return (IExpression)((IAdaptable)target).getAdapter(IExpression.class);
- }
- return null;
- }
-
- /**
- * Validates if the drop is valid by validating the local selection transfer
- * to ensure that a watch expression can be created for each contained IVariable.
- * @param target target of the drop
- * @return whether the drop is valid
- */
- private boolean validateVariableDrop(Object target) {
- // Target must be null or an IExpression, you cannot add a new watch expression inside another
- if (target != null && getTargetExpression(target) == null) {
- return false;
- }
-
- IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection();
- int enabled = 0;
- int size = -1;
- if (selection != null) {
- size = selection.size();
- IExpressionManager manager = DebugPlugin.getDefault().getExpressionManager();
- Iterator iterator = selection.iterator();
- while (iterator.hasNext()) {
- Object element = iterator.next();
- if (element instanceof IVariable){
- IVariable variable = (IVariable) element;
- if (variable instanceof IndexedVariablePartition) {
- break;
- } else if (manager.hasWatchExpressionDelegate(variable.getModelIdentifier()) && isFactoryEnabled(variable)) {
- enabled++;
- } else {
- break;
- }
- }
- }
- }
- return enabled == size;
- }
-
- /**
- * Validates if the drop is valid by validating the local selection transfer
- * to ensure that a watch expression can be created for each contained element.
- * @param target target of the drop
- * @return whether the drop is valid
- */
- private boolean validateWatchAdaptableDrop(Object target) {
- // Target must be null or an IExpression, you cannot add a new watch expression inside another
- if (target != null && getTargetExpression(target) == null) {
- return false;
- }
-
- IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection();
- int enabled = 0;
- int size = -1;
- if (selection != null) {
- size = selection.size();
- Iterator iterator = selection.iterator();
- while (iterator.hasNext()) {
- Object element = iterator.next();
- if (isFactory2Enabled(element)) {
- enabled++;
- } else {
- break;
- }
- }
- }
- return enabled == size;
- }
-
- /**
- * Validates if the drop is valid by validating the drop location.
- * Only valid if the target is <code>null</code> or an <code>IExpression</code>.
- * You cannot add a new watch expression inside another.
- * @param target target of the drop
- * @return whether the drop is valid
- */
- private boolean validateTextDrop(Object target){
- return target == null || getTargetExpression(target) != null;
- }
-
- /**
- * Returns whether the factory adapter for the given variable is currently enabled.
- *
- * @param variable the variable to ask for the adapter
- * @return whether the factory is enabled
- */
- private boolean isFactoryEnabled(IVariable variable) {
- IWatchExpressionFactoryAdapter factory = getFactory(variable);
- if (factory instanceof IWatchExpressionFactoryAdapterExtension) {
- IWatchExpressionFactoryAdapterExtension ext = (IWatchExpressionFactoryAdapterExtension) factory;
- return ext.canCreateWatchExpression(variable);
- }
- return true;
- }
-
- /**
- * Returns whether the factory adapter for the given element is currently enabled.
- *
- * @param element the element to ask for the adapter
- * @return whether the factory is enabled
- */
- private boolean isFactory2Enabled(Object element) {
- IWatchExpressionFactoryAdapter2 factory = getFactory2(element);
- if (factory != null) {
- return factory.canCreateWatchExpression(element);
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerDropAdapter#drop(org.eclipse.swt.dnd.DropTargetEvent)
- */
- public void drop(DropTargetEvent event) {
- fCurrentTransferType = event.currentDataType;
- // Unless insert after is explicitly set, insert before
- fInsertBefore = getCurrentLocation() != LOCATION_AFTER;
- super.drop(event);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerDropAdapter#performDrop(java.lang.Object)
- */
- public boolean performDrop(Object data) {
- if (LocalSelectionTransfer.getTransfer().isSupportedType(fCurrentTransferType)) {
- IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection();
- if (fDropType == DROP_TYPE_EXPRESSION){
- return performExpressionDrop(selection);
- } else if (fDropType == DROP_TYPE_VARIABLE || fDropType == DROP_TYPE_WATCH_ADAPTABLE_ELEMENT){
- return performVariableOrWatchAdaptableDrop(selection);
- }
- } else if (TextTransfer.getInstance().isSupportedType(fCurrentTransferType)) {
- if (data != null) {
- return performTextDrop((String)data);
- }
- }
- return false;
- }
-
- /**
- * Performs the drop when the selection is a collection of IExpressions.
- * Moves the given expressions from their original locations to the
- * location of the current target.
- * @param selection the dragged selection
- * @return whether the drop could be completed
- */
- private boolean performExpressionDrop(IStructuredSelection selection) {
- IExpression targetExpression = getTargetExpression(getCurrentTarget());
- if (targetExpression != null){
- IExpression[] expressions = new IExpression[selection.size()];
- Object[] selectionElements = selection.toArray();
- for (int i = 0; i < selectionElements.length; i++) {
- expressions[i] = getTargetExpression(selectionElements[i]);
- }
-
- IExpressionManager manager = DebugPlugin.getDefault().getExpressionManager();
- if (manager instanceof ExpressionManager){
- ((ExpressionManager)manager).moveExpressions(expressions, targetExpression, fInsertBefore);
- }
- return true;
- }
- return false;
-
- }
-
- /**
- * If the dragged data is a structured selection, get any IVariables in it
- * and create expressions for each of them. Insert the created expressions
- * at the currently selected target or add them to the end of the collection
- * if no target is selected.
- *
- * @param selection Structured selection containing IVariables
- * @return whether the drop was successful
- */
- private boolean performVariableOrWatchAdaptableDrop(IStructuredSelection selection) {
- List expressions = new ArrayList(selection.size());
- for (Iterator itr = selection.iterator(); itr.hasNext(); ) {
- Object element = itr.next();
- String expressionText = createExpressionString(element);
- if (expressionText != null){
- IExpression expression = createExpression(expressionText);
- if (expression != null){
- expressions.add(expression);
- } else {
- DebugUIPlugin.log(new Status(IStatus.ERROR,DebugUIPlugin.getUniqueIdentifier(),"Drop failed. Watch expression could not be created for the text " + expressionText)); //$NON-NLS-1$
- return false;
- }
- } else {
- return false;
- }
- }
- if (expressions.size() == selection.size()){
- IExpressionManager manager = DebugPlugin.getDefault().getExpressionManager();
- if (manager instanceof ExpressionManager){
- IExpression targetExpression = getTargetExpression(getCurrentTarget());
- if (targetExpression != null){
- ((ExpressionManager)manager).insertExpressions((IExpression[])expressions.toArray(new IExpression[expressions.size()]), targetExpression, fInsertBefore);
- } else {
- ((ExpressionManager)manager).addExpressions((IExpression[])expressions.toArray(new IExpression[expressions.size()]));
- }
- return true;
- }
- }
- return false;
- }
-
-
- /**
- * Performs the drop when text was dragged. Creates a new watch expression from
- * the text. Inserts the expression at the currently selected target or adds it
- * to the end of the collection if no target is selected.
- *
- * @param text string to use to create the expression
- * @return whether the drop was successful
- */
- private boolean performTextDrop(String text){
- IExpression expression = createExpression(text);
- if (expression != null){
- IExpressionManager manager = DebugPlugin.getDefault().getExpressionManager();
- if (manager instanceof ExpressionManager){
- IExpression targetExpression = getTargetExpression(getCurrentTarget());
- if (targetExpression != null){
- ((ExpressionManager)manager).insertExpressions(new IExpression[]{expression}, targetExpression, fInsertBefore);
- } else {
- ((ExpressionManager)manager).addExpression(expression);
- }
- return true;
- }
- }
- DebugUIPlugin.log(new Status(IStatus.ERROR,DebugUIPlugin.getUniqueIdentifier(),"Drop failed. Watch expression could not be created for the text " + text)); //$NON-NLS-1$
- return false;
- }
-
- /**
- * Creates a new watch expression from an IVariable using the watch expression factory
- * adapter for that variable.
- *
- * @param variable the variable to use to create the watch expression
- * @return the string to be used to create expression, return <code>null</code>
- * if no expression is to be created
- */
- private String createExpressionString(Object element) {
- try {
- if (element instanceof IVariable) {
- IVariable variable = (IVariable)element;
- IWatchExpressionFactoryAdapter factory = getFactory(variable);
- String exp = variable.getName();
- if (factory != null) {
- //if a factory exists, use it to create expression,
- //otherwise just use variable name
- exp = factory.createWatchExpression(variable);
- }
- return exp;
- } else {
- IWatchExpressionFactoryAdapter2 factory2 = getFactory2(element);
- if (factory2 != null) {
- return factory2.createWatchExpression(element);
- }
- }
- } catch (CoreException e) {
- DebugUIPlugin.log(e.getStatus());
- }
- return null;
- }
-
- /**
- * Creates a new watch expression from a string using the default expression manager.
- *
- * @param exp the string to use to create the expression
- */
- private IExpression createExpression(String exp) {
- IWatchExpression expression = DebugPlugin.getDefault().getExpressionManager().newWatchExpression(exp);
- IAdaptable object = DebugUITools.getDebugContext();
- IDebugElement context = null;
- if (object instanceof IDebugElement) {
- context = (IDebugElement) object;
- } else if (object instanceof ILaunch) {
- context = ((ILaunch) object).getDebugTarget();
- }
- expression.setExpressionContext(context);
- return expression;
- }
-
-
- /**
- * Returns the factory adapter for the given variable or <code>null</code> if none.
- *
- * @param variable
- * @return factory or <code>null</code>
- */
- private IWatchExpressionFactoryAdapter getFactory(IVariable variable) {
- return (IWatchExpressionFactoryAdapter) variable.getAdapter(IWatchExpressionFactoryAdapter.class);
- }
-
- /**
- * Returns the factory adapter for the given element or <code>null</code> if none.
- *
- * @param element
- * @return factory or <code>null</code>
- */
- private IWatchExpressionFactoryAdapter2 getFactory2(Object element) {
- if (element instanceof IAdaptable) {
- return (IWatchExpressionFactoryAdapter2)((IAdaptable)element).getAdapter(IWatchExpressionFactoryAdapter2.class);
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
deleted file mode 100644
index bdd9de2b0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River - Pawel Piech - Drag/Drop to Expressions View (Bug 184057)
- * Wind River - Pawel Piech - Fix viewer input race condition (Bug 234908)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.expression;
-
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IExpressionManager;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IWatchExpression;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.actions.expressions.PasteWatchExpressionsAction;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
-import org.eclipse.debug.internal.ui.views.variables.AvailableLogicalStructuresAction;
-import org.eclipse.debug.internal.ui.views.variables.SelectionDragAdapter;
-import org.eclipse.debug.internal.ui.views.variables.VariablesView;
-import org.eclipse.debug.internal.ui.views.variables.VariablesViewMessages;
-import org.eclipse.debug.internal.ui.views.variables.details.AvailableDetailPanesAction;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.util.LocalSelectionTransfer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
-
-/**
- * Displays expressions and their values with a detail
- * pane.
- */
-public class ExpressionView extends VariablesView {
-
- private PasteWatchExpressionsAction fPasteAction;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.EXPRESSION_VIEW;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#configureToolBar(org.eclipse.jface.action.IToolBarManager)
- */
- protected void configureToolBar(IToolBarManager tbm) {
- super.configureToolBar(tbm);
- tbm.add(new Separator(IDebugUIConstants.EMPTY_EXPRESSION_GROUP));
- tbm.add(new Separator(IDebugUIConstants.EXPRESSION_GROUP));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
- protected void fillContextMenu(IMenuManager menu) {
- menu.add(new Separator(IDebugUIConstants.EMPTY_EXPRESSION_GROUP));
- menu.add(new Separator(IDebugUIConstants.EXPRESSION_GROUP));
- menu.add(getAction(VARIABLES_FIND_ELEMENT_ACTION));
- menu.add(getAction("ChangeVariableValue")); //$NON-NLS-1$
- menu.add(new Separator());
- IAction action = new AvailableLogicalStructuresAction(this);
- if (action.isEnabled()) {
- menu.add(action);
- }
- action = new AvailableDetailPanesAction(this);
- if (isDetailPaneVisible() && action.isEnabled()) {
- menu.add(action);
- }
- menu.add(new Separator(IDebugUIConstants.EMPTY_RENDER_GROUP));
- menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#contextActivated(org.eclipse.jface.viewers.ISelection)
- */
- protected void contextActivated(ISelection selection) {
- if (selection == null || selection.isEmpty()) {
- setViewerInput(DebugPlugin.getDefault().getExpressionManager());
- } else {
- super.contextActivated(selection);
- }
- if (isAvailable() && isVisible()) {
- updateAction("ContentAssist"); //$NON-NLS-1$
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#viewerInputUpdateComplete(IViewerInputUpdate)
- */
- protected void viewerInputUpdateComplete(IViewerInputUpdate update) {
- if (update.getElement() != null) {
- setViewerInput(update.getInputElement());
- } else {
- setViewerInput(DebugPlugin.getDefault().getExpressionManager());
- }
- updateAction(VARIABLES_FIND_ELEMENT_ACTION);
- updateAction(FIND_ACTION);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getDetailPanePreferenceKey()
- */
- protected String getDetailPanePreferenceKey() {
- return IDebugPreferenceConstants.EXPRESSIONS_DETAIL_PANE_ORIENTATION;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getToggleActionLabel()
- */
- protected String getToggleActionLabel() {
- return VariablesViewMessages.ExpressionView_4;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getViewerStyle()
- */
- protected int getViewerStyle() {
- return SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.VIRTUAL;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getPresentationContextId()
- */
- protected String getPresentationContextId() {
- return IDebugUIConstants.ID_EXPRESSION_VIEW;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#initDragAndDrop(org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer)
- */
- protected void initDragAndDrop(TreeModelViewer viewer) {
- viewer.addDragSupport(DND.DROP_MOVE, new Transfer[] {LocalSelectionTransfer.getTransfer()}, new SelectionDragAdapter(viewer));
- viewer.addDropSupport(DND.DROP_MOVE|DND.DROP_COPY, new Transfer[] {LocalSelectionTransfer.getTransfer(), TextTransfer.getInstance()}, new ExpressionDropAdapter(viewer));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#createActions()
- */
- protected void createActions() {
- super.createActions();
- fPasteAction = new PasteWatchExpressionsAction(this);
- configure(fPasteAction, IWorkbenchActionDefinitionIds.PASTE, PASTE_ACTION, ISharedImages.IMG_TOOL_PASTE);
- }
-
- /**
- * Configures the action to override the global action, and registers the
- * action with this view.
- *
- * @param action
- * action
- * @param defId
- * action definition id
- * @param globalId
- * global action id
- * @param imgId
- * image identifier
- */
- private void configure(IAction action, String defId, String globalId,
- String imgId) {
- setAction(defId, action);
- action.setActionDefinitionId(defId);
- getViewSite().getActionBars().setGlobalActionHandler(globalId, action);
- action.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(imgId));
- }
-
- /**
- * Returns whether the given selection can be pasted into the expressions
- * view.
- *
- * @param selection
- * the selection to paste
- * @return whether the given selection can be pasted into the given target
- */
- public boolean canPaste() {
- String clipboardText = getClipboardText();
- if (clipboardText != null && clipboardText.length() > 0) {
- return true;
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#createTreeViewer(org.eclipse.swt.widgets.Composite)
- */
- protected TreeModelViewer createTreeViewer(Composite parent) {
- TreeModelViewer viewer = super.createTreeViewer(parent);
- viewer.getTree().addFocusListener(new FocusListener() {
- public void focusLost(FocusEvent e) {
- if (fPasteAction != null) {
- getViewSite().getActionBars().setGlobalActionHandler(PASTE_ACTION, null);
- }
- }
-
- public void focusGained(FocusEvent e) {
- if (fPasteAction != null) {
- getViewSite().getActionBars().setGlobalActionHandler(PASTE_ACTION, fPasteAction);
- }
- }
- });
- return viewer;
- }
-
- /**
- * Pastes the selection into the given target
- *
- * @param selection
- * breakpoints
- * @return whether successful
- */
- public boolean performPaste() {
- String clipboardText = getClipboardText();
- if (clipboardText != null && clipboardText.length() > 0) {
- IExpressionManager expressionManager = DebugPlugin.getDefault().getExpressionManager();
- IWatchExpression watchExpression = expressionManager
- .newWatchExpression(clipboardText);
- expressionManager.addExpression(watchExpression);
- watchExpression.setExpressionContext(getContext());
- return true;
- }
- return false;
- }
-
- // TODO: duplicate code from WatchExpressionAction
- protected IDebugElement getContext() {
- IAdaptable object = DebugUITools.getDebugContext();
- IDebugElement context = null;
- if (object instanceof IDebugElement) {
- context = (IDebugElement) object;
- } else if (object instanceof ILaunch) {
- context = ((ILaunch) object).getDebugTarget();
- }
- return context;
- }
-
- protected String getClipboardText() {
- Clipboard clipboard = new Clipboard(Display.getDefault());
- try {
- TextTransfer textTransfer = TextTransfer.getInstance();
- return (String) clipboard.getContents(textTransfer);
- } finally {
- clipboard.dispose();
- }
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java
deleted file mode 100644
index 94083c91a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.jface.action.Action;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Action that controls the preference for whether elements should be
- * automatically expanded in the breadcrumb drop down viewers.
- *
- * @since 3.5
- */
-class BreadcrumbDropDownAutoExpandAction extends Action {
-
- private final LaunchView fLaunchView;
-
- /**
- * Creates a new action to set the debug view mode.
- *
- * @param view Reference to the debug view.
- * @param mode The mode to be set by this action.
- * @param parent The view's parent control used to calculate view size
- * in auto mode.
- */
- public BreadcrumbDropDownAutoExpandAction(LaunchView view) {
- super(IInternalDebugCoreConstants.EMPTY_STRING, AS_CHECK_BOX);
- fLaunchView = view;
-
- setText(LaunchViewMessages.BreadcrumbDropDownAutoExpandAction_label);
- setToolTipText(LaunchViewMessages.BreadcrumbDropDownAutoExpandAction_tooltip);
- setDescription(LaunchViewMessages.BreadcrumbDropDownAutoExpandAction_description);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DEBUG_VIEW_DROP_DOWN_AUTOEXPAND_ACTION);
-
- setChecked(fLaunchView.getBreadcrumbDropDownAutoExpand());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- fLaunchView.setBreadcrumbDropDownAutoExpand(isChecked());
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java
deleted file mode 100644
index ca87e7de3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Pawel Piech - Wind River - adapted to use in Debug view
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartSite;
-
-/**
- * Fake part to used to create the breadcrumb page.
- *
- * @since 3.5
- * @see LaunchView#fDefaultPageRec
- */
-class BreadcrumbWorkbenchPart implements IWorkbenchPart {
-
- private IWorkbenchPartSite fSite = null;
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- return (obj instanceof BreadcrumbWorkbenchPart);
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return getClass().hashCode();
- }
-
- /**
- * Constructs a part for the given console that binds to the given
- * site
- */
- public BreadcrumbWorkbenchPart(IWorkbenchPartSite site) {
- fSite = site;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#addPropertyListener(org.eclipse.ui.IPropertyListener)
- */
- public void addPropertyListener(IPropertyListener listener) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
- */
- public void createPartControl(Composite parent) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#dispose()
- */
- public void dispose() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#getSite()
- */
- public IWorkbenchPartSite getSite() {
- return fSite;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#getTitle()
- */
- public String getTitle() {
- return ""; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#getTitleImage()
- */
- public Image getTitleImage() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#getTitleToolTip()
- */
- public String getTitleToolTip() {
- return ""; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#removePropertyListener(org.eclipse.ui.IPropertyListener)
- */
- public void removePropertyListener(IPropertyListener listener) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#setFocus()
- */
- public void setFocus() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- return null;
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java
deleted file mode 100644
index 00620344c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - support for alternative expression view content providers
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.debug.core.IExpressionManager;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.IRegisterGroup;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.internal.ui.elements.adapters.AsynchronousDebugLabelAdapter;
-import org.eclipse.debug.internal.ui.elements.adapters.DefaultViewerInputProvider;
-import org.eclipse.debug.internal.ui.elements.adapters.MemoryBlockContentAdapter;
-import org.eclipse.debug.internal.ui.elements.adapters.MemoryBlockLabelAdapter;
-import org.eclipse.debug.internal.ui.elements.adapters.MemoryRetrievalContentAdapter;
-import org.eclipse.debug.internal.ui.elements.adapters.MemorySegmentLabelAdapter;
-import org.eclipse.debug.internal.ui.elements.adapters.StackFrameSourceDisplayAdapter;
-import org.eclipse.debug.internal.ui.elements.adapters.StackFrameViewerInputProvider;
-import org.eclipse.debug.internal.ui.elements.adapters.VariableColumnFactoryAdapter;
-import org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider;
-import org.eclipse.debug.internal.ui.model.elements.DebugTargetContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.ExpressionContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.ExpressionLabelProvider;
-import org.eclipse.debug.internal.ui.model.elements.ExpressionManagerContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.ExpressionManagerMementoProvider;
-import org.eclipse.debug.internal.ui.model.elements.ExpressionMementoProvider;
-import org.eclipse.debug.internal.ui.model.elements.LaunchContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.LaunchManagerContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.MemoryBlockContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.MemoryBlockLabelProvider;
-import org.eclipse.debug.internal.ui.model.elements.MemoryRetrievalContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.MemoryViewElementMementoProvider;
-import org.eclipse.debug.internal.ui.model.elements.RegisterGroupContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.RegisterGroupLabelProvider;
-import org.eclipse.debug.internal.ui.model.elements.RegisterGroupMementoProvider;
-import org.eclipse.debug.internal.ui.model.elements.StackFrameContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.StackFrameMementoProvider;
-import org.eclipse.debug.internal.ui.model.elements.ThreadContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.VariableContentProvider;
-import org.eclipse.debug.internal.ui.model.elements.VariableEditor;
-import org.eclipse.debug.internal.ui.model.elements.VariableLabelProvider;
-import org.eclipse.debug.internal.ui.model.elements.VariableMementoProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementEditor;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelSelectionPolicyFactory;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputProvider;
-import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousContentAdapter;
-import org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousLabelAdapter;
-import org.eclipse.debug.internal.ui.viewers.update.DefaultModelProxyFactory;
-import org.eclipse.debug.internal.ui.viewers.update.DefaultModelSelectionPolicyFactory;
-import org.eclipse.debug.internal.ui.views.memory.renderings.MemorySegment;
-import org.eclipse.debug.ui.sourcelookup.ISourceDisplay;
-
-/**
- * DebugElementAdapterFactory
- */
-public class DebugElementAdapterFactory implements IAdapterFactory {
-
- private static IModelProxyFactory fgModelProxyFactoryAdapter = new DefaultModelProxyFactory();
- private static ISourceDisplay fgStackFrameSourceDisplayAdapter = new StackFrameSourceDisplayAdapter();
- private static IModelSelectionPolicyFactory fgModelSelectionPolicyFactoryAdapter = new DefaultModelSelectionPolicyFactory();
-
- private static IAsynchronousLabelAdapter fgDebugLabelAdapter = new AsynchronousDebugLabelAdapter();
- private static IAsynchronousLabelAdapter fgMemoryBlockLabelAdapter = new MemoryBlockLabelAdapter();
- private static IAsynchronousLabelAdapter fgTableRenderingLineLabelAdapter = new MemorySegmentLabelAdapter();
-
- private static IElementLabelProvider fgLPDebugElement = new DebugElementLabelProvider();
- private static IElementLabelProvider fgLPVariable = new VariableLabelProvider();
- private static IElementLabelProvider fgLPExpression = new ExpressionLabelProvider();
- private static IElementLabelProvider fgLPRegisterGroup = new RegisterGroupLabelProvider();
- private static IElementLabelProvider fgLPMemoryBlock = new MemoryBlockLabelProvider();
-
- private static IElementEditor fgEEVariable = new VariableEditor();
-
- private static IAsynchronousContentAdapter fgAsyncMemoryRetrieval = new MemoryRetrievalContentAdapter();
- private static IAsynchronousContentAdapter fgAsyncMemoryBlock = new MemoryBlockContentAdapter();
-
- private static IElementContentProvider fgCPLaunchManger = new LaunchManagerContentProvider();
- private static IElementContentProvider fgCPLaunch = new LaunchContentProvider();
- private static IElementContentProvider fgCPTarget = new DebugTargetContentProvider();
- private static IElementContentProvider fgCPThread = new ThreadContentProvider();
- private static IElementContentProvider fgCPFrame = new StackFrameContentProvider();
- private static IElementContentProvider fgCPVariable = new VariableContentProvider();
- private static IElementContentProvider fgCPExpressionManager = new ExpressionManagerContentProvider();
- private static IElementContentProvider fgCPExpression = new ExpressionContentProvider();
- private static IElementContentProvider fgCPRegisterGroup = new RegisterGroupContentProvider();
- private static IElementContentProvider fgCPMemoryRetrieval = new MemoryRetrievalContentProvider();
- private static IElementContentProvider fgCPMemoryBlock = new MemoryBlockContentProvider();
-
- private static IElementMementoProvider fgMPFrame = new StackFrameMementoProvider();
- private static IElementMementoProvider fgMPVariable = new VariableMementoProvider();
- private static IElementMementoProvider fgMPExpression = new ExpressionMementoProvider();
- private static IElementMementoProvider fgMPRegisterGroup = new RegisterGroupMementoProvider();
- private static IElementMementoProvider fgMPExpressionManager = new ExpressionManagerMementoProvider();
- private static IElementMementoProvider fgMPMemory = new MemoryViewElementMementoProvider();
-
- private static IColumnPresentationFactory fgVariableColumnFactory = new VariableColumnFactoryAdapter();
-
- private static IViewerInputProvider fgDefaultViewerInputProvider = new DefaultViewerInputProvider();
- private static IViewerInputProvider fgStackFrameViewerInputProvider = new StackFrameViewerInputProvider();
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (adapterType.isInstance(adaptableObject)) {
- return adaptableObject;
- }
-
- if (adapterType.equals(IAsynchronousContentAdapter.class)) {
- if (adaptableObject instanceof IMemoryBlockRetrieval) {
- return fgAsyncMemoryRetrieval;
- }
- if (adaptableObject instanceof IMemoryBlock) {
- return fgAsyncMemoryBlock;
- }
- }
-
- if (adapterType.equals(IElementContentProvider.class)) {
- if (adaptableObject instanceof ILaunchManager) {
- return fgCPLaunchManger;
- }
- if (adaptableObject instanceof ILaunch) {
- return fgCPLaunch;
- }
- if (adaptableObject instanceof IDebugTarget) {
- return fgCPTarget;
- }
- if (adaptableObject instanceof IMemoryBlockRetrieval)
- {
- return fgCPMemoryRetrieval;
- }
- if (adaptableObject instanceof IThread) {
- return fgCPThread;
- }
- if (adaptableObject instanceof IStackFrame) {
- return fgCPFrame;
- }
- if (adaptableObject instanceof IVariable) {
- return fgCPVariable;
- }
- if (adaptableObject instanceof IExpressionManager) {
- return fgCPExpressionManager;
- }
- if (adaptableObject instanceof IExpression) {
- return fgCPExpression;
- }
- if (adaptableObject instanceof IRegisterGroup) {
- return fgCPRegisterGroup;
- }
- if (adaptableObject instanceof IMemoryBlock) {
- return fgCPMemoryBlock;
- }
- }
-
- if (adapterType.equals(IAsynchronousLabelAdapter.class)) {
- if (adaptableObject instanceof IMemoryBlock) {
- return fgMemoryBlockLabelAdapter;
- }
-
- if (adaptableObject instanceof MemorySegment) {
- return fgTableRenderingLineLabelAdapter;
- }
- return fgDebugLabelAdapter;
- }
-
- if (adapterType.equals(IElementLabelProvider.class)) {
- if (adaptableObject instanceof IVariable) {
- return fgLPVariable;
- }
- if (adaptableObject instanceof IExpression) {
- return fgLPExpression;
- }
- if (adaptableObject instanceof IRegisterGroup) {
- return fgLPRegisterGroup;
- }
- if (adaptableObject instanceof IMemoryBlock) {
- return fgLPMemoryBlock;
- }
- return fgLPDebugElement;
- }
-
- if (adapterType.equals(IModelProxyFactory.class)) {
- if (adaptableObject instanceof ILaunch || adaptableObject instanceof IDebugTarget ||
- adaptableObject instanceof IProcess || adaptableObject instanceof ILaunchManager ||
- adaptableObject instanceof IStackFrame || adaptableObject instanceof IExpressionManager ||
- adaptableObject instanceof IExpression || adaptableObject instanceof IMemoryBlockRetrieval ||
- adaptableObject instanceof IMemoryBlock)
- return fgModelProxyFactoryAdapter;
- }
-
- if (adapterType.equals(ISourceDisplay.class)) {
- if (adaptableObject instanceof IStackFrame) {
- return fgStackFrameSourceDisplayAdapter;
- }
- }
-
- if (adapterType.equals(IModelSelectionPolicyFactory.class)) {
- if (adaptableObject instanceof IDebugElement) {
- return fgModelSelectionPolicyFactoryAdapter;
- }
- }
-
- if (adapterType.equals(IColumnPresentationFactory.class)) {
- if (adaptableObject instanceof IStackFrame) {
- return fgVariableColumnFactory;
- }
- }
-
- if (adapterType.equals(IElementMementoProvider.class)) {
- if (adaptableObject instanceof IStackFrame) {
- return fgMPFrame;
- }
- if (adaptableObject instanceof IVariable) {
- return fgMPVariable;
- }
- if (adaptableObject instanceof IRegisterGroup) {
- return fgMPRegisterGroup;
- }
- if (adaptableObject instanceof IExpression) {
- return fgMPExpression;
- }
- if (adaptableObject instanceof IExpressionManager) {
- return fgMPExpressionManager;
- }
- if (adaptableObject instanceof IMemoryBlockRetrieval) {
- return fgMPMemory;
- }
- }
-
- if (adapterType.equals(IElementEditor.class)) {
- if (adaptableObject instanceof IVariable) {
- return fgEEVariable;
- }
- }
-
- if (adapterType.equals(IViewerInputProvider.class)) {
- if (adaptableObject instanceof IStackFrame) {
- return fgStackFrameViewerInputProvider;
- } else {
- return fgDefaultViewerInputProvider;
- }
- }
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList() {
- return new Class[] {
- IAsynchronousLabelAdapter.class,
- IAsynchronousContentAdapter.class,
- IModelProxyFactory.class,
- ISourceDisplay.class,
- IModelSelectionPolicyFactory.class,
- IColumnPresentationFactory.class,
- IElementContentProvider.class,
- IElementLabelProvider.class,
- IElementMementoProvider.class,
- IElementEditor.class,
- IViewerInputProvider.class};
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementHelper.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementHelper.java
deleted file mode 100644
index efafa7b7c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementHelper.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.jface.viewers.IFontProvider;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * Translates images, colors, and fonts into image descriptors, RGBs, and font
- * datas for workbench adapaters. Also provides labels.
- *
- * @since 3.1
- */
-public class DebugElementHelper {
-
- // a model presentation that can provide images & labels for debug elements
- private static DelegatingModelPresentation fgPresenetation;
-
- // map of images to image descriptors
- private static Map fgImages = new HashMap();
-
- /**
- * Disposes this adapater
- */
- public static void dispose() {
- fgImages.clear();
- if (fgPresenetation != null) {
- fgPresenetation.dispose();
- fgPresenetation = null;
- }
- }
-
- /**
- * Returns an image descriptor for the given debug element.
- *
- * @param object object for which an image descriptor is required
- */
- public static ImageDescriptor getImageDescriptor(Object object) {
- Image image = getPresentation().getImage(object);
- return getImageDescriptor(image);
- }
-
- /**
- * Returns an image descriptor for the given debug element.
- *
- * @param presentation presentation to obtain image from
- * @param object object for which an image descriptor is required
- * @since 3.3
- */
- public static ImageDescriptor getImageDescriptor(Object object, IDebugModelPresentation presentation) {
- Image image = presentation.getImage(object);
- return getImageDescriptor(image);
- }
-
- public static ImageDescriptor getImageDescriptor(Image image)
- {
- if (image != null) {
- ImageDescriptor descriptor = (ImageDescriptor) fgImages.get(image);
- if (descriptor == null) {
- descriptor = new ImageImageDescriptor(image);
- fgImages.put(image, descriptor);
- }
- return descriptor;
- }
- return null;
- }
-
- /**
- * Returns a label for the given debug element.
- *
- * @param o object for which a label is required
- */
- public static String getLabel(Object o) {
- return getPresentation().getText(o);
- }
-
- /**
- * Returns a model presentation to use to retrieve lables & images.
- *
- * @return a model presentation to use to retrieve lables & images
- */
- public static DelegatingModelPresentation getPresentation() {
- if (fgPresenetation == null) {
- fgPresenetation = new DelegatingModelPresentation();
- }
- return fgPresenetation;
- }
-
- /**
- * Returns the RGB of the foreground color for the given element, or
- * <code>null</code> if none.
- *
- * @param element object for which a foreground color is required
- * @return the RGB of the foreground color for the given element, or
- * <code>null</code> if none
- */
- public static RGB getForeground(Object element) {
- Color color = getPresentation().getForeground(element);
- if (color != null) {
- return color.getRGB();
- }
- return null;
- }
-
- /**
- * Returns the RGB of the foreground color for the given element, or
- * <code>null</code> if none.
- *
- * @param element object for which a foreground color is required
- * @param presentation presentation to obtain color from
- * @return the RGB of the foreground color for the given element, or
- * <code>null</code> if none
- * @since 3.3
- */
- public static RGB getForeground(Object element, IDebugModelPresentation presentation) {
- Color color = null;
- if (presentation instanceof IColorProvider) {
- IColorProvider colorProvider = (IColorProvider) presentation;
- color = colorProvider.getForeground(element);
- } else {
- color = getPresentation().getForeground(element);
- }
- if (color != null) {
- return color.getRGB();
- }
- return null;
- }
-
- /**
- * Returns the RGB of the background color for the given element, or
- * <code>null</code> if none.
- *
- * @param element object for which a background color is required
- * @return the RGB of the background color for the given element, or
- * <code>null</code> if none
- */
- public static RGB getBackground(Object element) {
- Color color = getPresentation().getBackground(element);
- if (color != null) {
- return color.getRGB();
- }
- return null;
- }
-
- /**
- * Returns the RGB of the background color for the given element, or
- * <code>null</code> if none.
- *
- * @param element object for which a background color is required
- * @param presentation presentation to use to retrieve color
- * @return the RGB of the background color for the given element, or
- * <code>null</code> if none
- * @since 3.3
- */
- public static RGB getBackground(Object element, IDebugModelPresentation presentation) {
- Color color = null;
- if (presentation instanceof IColorProvider) {
- IColorProvider colorProvider = (IColorProvider) presentation;
- color = colorProvider.getBackground(element);
- } else {
- color = getPresentation().getBackground(element);
- }
- if (color != null) {
- return color.getRGB();
- }
- return null;
- }
-
- /**
- * Returns the font data for the given element, or
- * <code>null</code> if none.
- *
- * @param element object for which font data is required
- * @return the font data for the given element, or
- * <code>null</code> if none
- */
- public static FontData getFont(Object element) {
- Font font = getPresentation().getFont(element);
- if (font != null) {
- return font.getFontData()[0];
- }
- return null;
- }
-
- /**
- * Returns the font data for the given element, or
- * <code>null</code> if none.
- *
- * @param element object for which font data is required
- * @param presentation presentation to obtain font from
- * @return the font data for the given element, or
- * <code>null</code> if none
- * @since 3.3
- */
- public static FontData getFont(Object element, IDebugModelPresentation presentation) {
- Font font = null;
- if (presentation instanceof IFontProvider) {
- IFontProvider provider = (IFontProvider) presentation;
- font = provider.getFont(element);
- } else {
- font = getPresentation().getFont(element);
- }
- if (font != null) {
- return font.getFontData()[0];
- }
- return null;
- }
-
- /**
- * Returns whether the UI thread is required for computing the label for the
- * given object.
- *
- * @param object object a label is being computed for
- * @return whether the UI thread is required
- */
- public static boolean requiresUIThread(Object object) {
- DelegatingModelPresentation presentation = getPresentation();
- return presentation.requiresUIThread(object);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewModeAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewModeAction.java
deleted file mode 100644
index 5a014ddb6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewModeAction.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.jface.action.Action;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Action that controls the view mode for Debug view (auto vs. breadcrumb, vs.
- * tree view).
- *
- * @since 3.5
- */
-class DebugViewModeAction extends Action {
-
- private final LaunchView fLaunchView;
- private final Composite fParent;
- private final String fMode;
-
- /**
- * Creates a new action to set the debug view mode.
- *
- * @param view Reference to the debug view.
- * @param mode The mode to be set by this action.
- * @param parent The view's parent control used to calculate view size
- * in auto mode.
- */
- public DebugViewModeAction(LaunchView view, String mode, Composite parent) {
- super(IInternalDebugCoreConstants.EMPTY_STRING, AS_RADIO_BUTTON);
- fLaunchView = view;
- fParent = parent;
- fMode = mode;
-
- if (mode == IDebugPreferenceConstants.DEBUG_VIEW_MODE_AUTO) {
- setText(LaunchViewMessages.DebugViewModeAction_Auto_label);
- setToolTipText(LaunchViewMessages.DebugViewModeAction_Auto_tooltip);
- setDescription(LaunchViewMessages.DebugViewModeAction_Auto_description);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DEBUG_VIEW_MODE_AUTO_ACTION);
- } else if (mode == IDebugPreferenceConstants.DEBUG_VIEW_MODE_FULL) {
- setText(LaunchViewMessages.DebugViewModeAction_Full_label);
- setToolTipText(LaunchViewMessages.DebugViewModeAction_Full_tooltip);
- setDescription(LaunchViewMessages.DebugViewModeAction_Full_description);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DEBUG_VIEW_MODE_FULL_ACTION);
- } else {
- setText(LaunchViewMessages.DebugViewModeAction_Compact_label);
- setToolTipText(LaunchViewMessages.DebugViewModeAction_Compact_tooltip);
- setDescription(LaunchViewMessages.DebugViewModeAction_Compact_description);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DEBUG_VIEW_MODE_COMPACT_ACTION);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- fLaunchView.setViewMode(fMode, fParent);
- }
-
- /**
- * Returns the view mode set by this action.
- */
- public String getMode() {
- return fMode;
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/Decoration.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/Decoration.java
deleted file mode 100644
index 6f5cc4c71..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/Decoration.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-import org.eclipse.debug.core.model.IThread;
-
-/**
- * A decoration in an editor, created by the debugger.
- */
-public abstract class Decoration {
-
- /**
- * Removes this decoration
- */
- public abstract void remove();
-
- /**
- * Returns the thread this decoration decorates.
- *
- * @return thread associated with this decoration
- */
- public abstract IThread getThread();
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DecorationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DecorationManager.java
deleted file mode 100644
index 49938fd68..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DecorationManager.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IThread;
-
-/**
- * Manages source selections and decorated editors for launch views.
- */
-public class DecorationManager {
-
- // map of targets to lists of active decorations
- private static Map fDecorations = new HashMap(10);
-
- /**
- * Adds the given decoration for the given stack frame.
- *
- * @param decoration
- * @param frame
- */
- public static void addDecoration(Decoration decoration) {
- synchronized (fDecorations) {
- IDebugTarget target = decoration.getThread().getDebugTarget();
- List list = (List) fDecorations.get(target);
- if (list == null) {
- list = new ArrayList();
- fDecorations.put(target, list);
- }
- list.add(decoration);
- }
- }
-
- /**
- * Removes any decorations for the given debug target.
- *
- * @param target
- * to remove editor decorations for
- */
- public static void removeDecorations(IDebugTarget target) {
- doRemoveDecorations(target, null);
- }
-
- /**
- * Removes any decorations for the given thread
- *
- * @param thread
- * thread to remove decorations for
- */
- public static void removeDecorations(IThread thread) {
- doRemoveDecorations(thread.getDebugTarget(), thread);
- }
-
- private static void doRemoveDecorations(IDebugTarget target, IThread thread) {
- ArrayList decorationsToRemove = new ArrayList();
- synchronized (fDecorations) {
- List list = (List) fDecorations.get(target);
- if (list != null) {
- ListIterator iterator = list.listIterator();
- while (iterator.hasNext()) {
- Decoration decoration = (Decoration) iterator.next();
- if (thread == null || thread.equals(decoration.getThread())) {
- decorationsToRemove.add(decoration);
- iterator.remove();
- }
- }
- if (list.isEmpty()) {
- fDecorations.remove(target);
- }
- }
- }
- Iterator iter = decorationsToRemove.iterator();
- while (iter.hasNext())
- {
- Decoration decoration = (Decoration)iter.next();
- decoration.remove();
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/ImageImageDescriptor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/ImageImageDescriptor.java
deleted file mode 100644
index 57f8fb646..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/ImageImageDescriptor.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-
-/**
- * Image descriptor for an image.
- */
-public class ImageImageDescriptor extends ImageDescriptor {
- private Image fImage;
-
- /**
- * Constructor for ImagImageDescriptor.
- */
- public ImageImageDescriptor(Image image) {
- super();
- fImage= image;
- }
-
- /* (non-Javadoc)
- * @see ImageDescriptor#getImageData()
- */
- public ImageData getImageData() {
- return fImage.getImageData();
- }
-
- /* (non-Javadoc)
- * @see Object#equals(Object)
- */
- public boolean equals(Object obj) {
- return (obj != null) && getClass().equals(obj.getClass()) && fImage.equals(((ImageImageDescriptor)obj).fImage);
- }
-
- /* (non-Javadoc)
- * @see Object#hashCode()
- */
- public int hashCode() {
- return fImage.hashCode();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
deleted file mode 100644
index 327dfc817..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
+++ /dev/null
@@ -1,1392 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River - Pawel Piech - Busy status while updates in progress (Bug 206822)
- * Pawel Piech (Wind River) - added a breadcrumb mode to Debug view (Bug 252677)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.commands.IRestartHandler;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.ITerminate;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.actions.AddToFavoritesAction;
-import org.eclipse.debug.internal.ui.actions.EditLaunchConfigurationAction;
-import org.eclipse.debug.internal.ui.commands.actions.DisconnectCommandAction;
-import org.eclipse.debug.internal.ui.commands.actions.DropToFrameCommandAction;
-import org.eclipse.debug.internal.ui.commands.actions.RestartCommandAction;
-import org.eclipse.debug.internal.ui.commands.actions.ResumeCommandAction;
-import org.eclipse.debug.internal.ui.commands.actions.StepIntoCommandAction;
-import org.eclipse.debug.internal.ui.commands.actions.StepOverCommandAction;
-import org.eclipse.debug.internal.ui.commands.actions.StepReturnCommandAction;
-import org.eclipse.debug.internal.ui.commands.actions.SuspendCommandAction;
-import org.eclipse.debug.internal.ui.commands.actions.TerminateAllAction;
-import org.eclipse.debug.internal.ui.commands.actions.TerminateAndRelaunchAction;
-import org.eclipse.debug.internal.ui.commands.actions.TerminateAndRemoveAction;
-import org.eclipse.debug.internal.ui.commands.actions.TerminateCommandAction;
-import org.eclipse.debug.internal.ui.commands.actions.ToggleStepFiltersAction;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.internal.ui.sourcelookup.EditSourceLookupPathAction;
-import org.eclipse.debug.internal.ui.sourcelookup.LookupSourceAction;
-import org.eclipse.debug.internal.ui.viewers.model.InternalTreeModelViewer;
-import org.eclipse.debug.internal.ui.viewers.model.VirtualFindAction;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDeltaVisitor;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
-import org.eclipse.debug.internal.ui.views.DebugModelPresentationContext;
-import org.eclipse.debug.internal.ui.views.DebugUIViewsMessages;
-import org.eclipse.debug.ui.AbstractDebugView;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.actions.DebugCommandAction;
-import org.eclipse.debug.ui.contexts.AbstractDebugContextProvider;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextProvider;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IPageListener;
-import org.eclipse.ui.IPartListener2;
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IPerspectiveListener2;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartReference;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.WorkbenchException;
-import org.eclipse.ui.XMLMemento;
-import org.eclipse.ui.actions.SelectionListenerAction;
-import org.eclipse.ui.dialogs.PropertyDialogAction;
-import org.eclipse.ui.part.IPageBookViewPage;
-import org.eclipse.ui.part.IPageSite;
-import org.eclipse.ui.part.IShowInSource;
-import org.eclipse.ui.part.IShowInTarget;
-import org.eclipse.ui.part.IShowInTargetList;
-import org.eclipse.ui.part.Page;
-import org.eclipse.ui.part.ShowInContext;
-import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
-import org.eclipse.ui.progress.UIJob;
-
-public class LaunchView extends AbstractDebugView implements ISelectionChangedListener, IPerspectiveListener2, IPageListener, IShowInTarget, IShowInSource, IShowInTargetList, IPartListener2, IViewerUpdateListener {
-
- public static final String ID_CONTEXT_ACTIVITY_BINDINGS = "contextActivityBindings"; //$NON-NLS-1$
-
- private static final String TERMINATE = "terminate"; //$NON-NLS-1$
-
- private static final String DISCONNECT = "disconnect"; //$NON-NLS-1$
-
- private static final String SUSPEND = "suspend"; //$NON-NLS-1$
-
- private static final String RESUME = "resume"; //$NON-NLS-1$
-
- private static final String STEP_RETURN = "step_return"; //$NON-NLS-1$
-
- private static final String STEP_OVER = "step_over"; //$NON-NLS-1$
-
- private static final String DROP_TO_FRAME = "drop_to_frame"; //$NON-NLS-1$
-
- private static final String STEP_INTO = "step_into"; //$NON-NLS-1$
-
- private static final String TERMINATE_AND_REMOVE = "terminate_and_remove"; //$NON-NLS-1$
-
- private static final String TERMINATE_ALL = "terminate_all"; //$NON-NLS-1$
-
- private static final String TERMINATE_AND_RELAUNCH = "terminate_relaunch"; //$NON-NLS-1$
-
- private static final String TOGGLE_STEP_FILTERS = "toggle_step_filters"; //$NON-NLS-1$
-
- private static final String RESTART = "restart"; //$NON-NLS-1$
-
- private static final int BREADCRUMB_TRIGGER_RANGE = 5; // pixels
-
- private static final int BREADCRUMB_STICKY_RANGE = 20; // pixels
-
- /**
- * Whether this view is in the active page of a perspective.
- */
- private boolean fIsActive = true;
-
- /**
- * Model presentation or <code>null</code> if none
- */
- private IDebugModelPresentation fPresentation = null;
-
- private EditLaunchConfigurationAction fEditConfigAction = null;
- private AddToFavoritesAction fAddToFavoritesAction = null;
- private EditSourceLookupPathAction fEditSourceAction = null;
- private LookupSourceAction fLookupAction = null;
-
- /**
- * Current view mode (auto vs. breadcrumb, vs. tree view).
- *
- * @since 3.5
- */
- private String fCurrentViewMode = IDebugPreferenceConstants.DEBUG_VIEW_MODE_AUTO;
-
- /**
- * Actions for selecting the view mode (auto vs. breadcrumb, vs. tree view).
- *
- * @since 3.5
- */
- private DebugViewModeAction[] fDebugViewModeActions;
-
- /**
- * Action that controls the breadcrumb drop-down auto-expand behavior.
- *
- * @since 3.5
- */
- private BreadcrumbDropDownAutoExpandAction fBreadcrumbDropDownAutoExpandAction;
-
- /**
- * Preference name for the view's memento.
- *
- * @since 3.5
- */
- private String PREF_STATE_MEMENTO = "pref_state_memento."; //$NON-NLS-1$
-
- /**
- * Key for a view preference for whether the elements in breadcrumb's
- * drop-down viewer should be automatically expanded.
- *
- * @since 3.5
- */
- private static final String BREADCRUMB_DROPDOWN_AUTO_EXPAND = DebugUIPlugin.getUniqueIdentifier() + ".BREADCRUMB_DROPDOWN_AUTO_EXPAND"; //$NON-NLS-1$
-
- /**
- * Preference for whether the elements in breadcrumb's
- * drop-down viewer should be automatically expanded.
- *
- * @since 3.5
- */
- private boolean fBreadcrumbDropDownAutoExpand = false;
-
- /**
- * Page-book page for the breadcrumb viewer. This page is activated in
- * Debug view when the height of the view is reduced to just one line.
- *
- * @since 3.5
- */
- private class BreadcrumbPage extends Page {
-
- LaunchViewBreadcrumb fCrumb;
- Control fControl;
-
- public void createControl(Composite parent) {
- fCrumb = new LaunchViewBreadcrumb(LaunchView.this, (TreeModelViewer)getViewer(), fTreeViewerDebugContextProvider);
- fControl = fCrumb.createContent(parent);
- }
-
- public void init(IPageSite pageSite) {
- super.init(pageSite);
- pageSite.setSelectionProvider(fCrumb.getSelectionProvider());
- }
-
- public Control getControl() {
- return fControl;
- }
-
- public void setFocus() {
- fCrumb.activate();
- }
-
- IDebugContextProvider getContextProvider() {
- return fCrumb.getContextProvider();
- }
-
- int getHeight() {
- return fCrumb.getHeight();
- }
- }
-
- private BreadcrumbPage fBreadcrumbPage;
-
- class TreeViewerContextProvider extends AbstractDebugContextProvider implements IModelChangedListener {
-
- private ISelection fContext = null;
- private TreeModelViewer fViewer = null;
- private Visitor fVisitor = new Visitor();
-
- class Visitor implements IModelDeltaVisitor {
- public boolean visit(IModelDelta delta, int depth) {
- if ((delta.getFlags() & (IModelDelta.STATE | IModelDelta.CONTENT)) > 0) {
- // state and/or content change
- if ((delta.getFlags() & IModelDelta.SELECT) == 0) {
- // no select flag
- if ((delta.getFlags() & IModelDelta.CONTENT) > 0) {
- // content has changed without select >> possible re-activation
- possibleChange(getViewerTreePath(delta), DebugContextEvent.ACTIVATED);
- } else if ((delta.getFlags() & IModelDelta.STATE) > 0) {
- // state has changed without select >> possible state change of active context
- possibleChange(getViewerTreePath(delta), DebugContextEvent.STATE);
- }
- }
- }
- return true;
- }
- }
-
- /**
- * Returns a tree path for the node, *not* including the root element.
- *
- * @param node
- * model delta
- * @return corresponding tree path
- */
- private TreePath getViewerTreePath(IModelDelta node) {
- ArrayList list = new ArrayList();
- IModelDelta parentDelta = node.getParentDelta();
- while (parentDelta != null) {
- list.add(0, node.getElement());
- node = parentDelta;
- parentDelta = node.getParentDelta();
- }
- return new TreePath(list.toArray());
- }
-
- public TreeViewerContextProvider(TreeModelViewer viewer) {
- super(LaunchView.this);
- fViewer = viewer;
- fViewer.addModelChangedListener(this);
- }
-
- protected void dispose() {
- fContext = null;
- fViewer.removeModelChangedListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.contexts.IDebugContextProvider#getActiveContext()
- */
- public synchronized ISelection getActiveContext() {
- return fContext;
- }
-
- protected void activate(ISelection selection) {
- synchronized (this) {
- fContext = selection;
- }
- fire(new DebugContextEvent(this, selection, DebugContextEvent.ACTIVATED));
- }
-
- protected void possibleChange(TreePath element, int type) {
- DebugContextEvent event = null;
- synchronized (this) {
- if (fContext instanceof ITreeSelection) {
- ITreeSelection ss = (ITreeSelection) fContext;
- if (ss.size() == 1) {
- TreePath current = ss.getPaths()[0];
- if (current.startsWith(element, null)) {
- if (current.getSegmentCount() == element.getSegmentCount()) {
- event = new DebugContextEvent(this, fContext, type);
- } else {
- // if parent of the currently selected element
- // changes, issue event to update STATE only
- event = new DebugContextEvent(this, fContext, DebugContextEvent.STATE);
- }
- }
- }
- }
- }
- if (event == null) {
- return;
- }
- if (getControl().getDisplay().getThread() == Thread.currentThread()) {
- fire(event);
- } else {
- final DebugContextEvent finalEvent = event;
- Job job = new UIJob("context change") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- // verify selection is still the same context since job was scheduled
- synchronized (TreeViewerContextProvider.this) {
- if (fContext instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) fContext;
- Object changed = ((IStructuredSelection)finalEvent.getContext()).getFirstElement();
- if (!(ss.size() == 1 && ss.getFirstElement().equals(changed))) {
- return Status.OK_STATUS;
- }
- }
- }
- fire(finalEvent);
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedListener#modelChanged(org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta)
- */
- public void modelChanged(IModelDelta delta, IModelProxy proxy) {
- delta.accept(fVisitor);
- }
-
- }
-
- /**
- * Context provider
- */
- private TreeViewerContextProvider fTreeViewerDebugContextProvider;
-
- /**
- * The PageBookView, which is a base class of this class does not make it
- * easy to control which page is currently active. It is intended that the
- * page book pages are associated with workbench parts, and the parts are
- * in turn associated with PageRec records.
- * <p>
- * PageRec is needed in order to properly active a page book page, by
- * calling showPageRec(), so in this class we need to add some hooks in
- * order to obtain the page record for the tree viewer page and the
- * breadcrumb page.</p><p>
- * For the default page, we override the showPageRec()
- * to determine if the default page is being shown and if it is, we save
- * its record for later use. showPageRec() is always called for the default
- * page after it is created. For the breadcrumb page, we use the page book
- * view mechanism to create the page based on a workbench part, but we have
- * to create a dummy part in order for this to work.
- * </p>
- * <p>
- * See bug 262845 and 262870.
- * </p>
- *
- * @see #createPartControl(Composite)
- * @see BreadcrumbWorkbenchPart
- * @eee #doCreatePage(IWorkbenchPart)
- * @see #isImportant(IWorkbenchPart)
- * @see #autoSelectViewPage(Composite)
- * @see #showTreeViewerPage()
- * @see #showBreadcrumbPage()
- */
- private PageRec fDefaultPageRec = null;
-
- private ISelectionChangedListener fTreeViewerSelectionChangedListener = new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- fTreeViewerDebugContextProvider.activate(event.getSelection());
- }
- };
-
- private class ContextProviderProxy extends AbstractDebugContextProvider implements IDebugContextListener {
- private IDebugContextProvider fActiveProvider;
- private IDebugContextProvider[] fProviders;
-
- ContextProviderProxy(IDebugContextProvider[] providers) {
- super(LaunchView.this);
- fProviders = providers;
- fActiveProvider = providers[0];
- for (int i = 0; i < fProviders.length; i++) {
- fProviders[i].addDebugContextListener(this);
- }
- }
-
- void setActiveProvider(IDebugContextProvider provider) {
- if (!provider.equals(fActiveProvider)) {
- ISelection activeContext = getActiveContext();
- fActiveProvider = provider;
- ISelection newActiveContext = getActiveContext();
- if (!activeContext.equals(newActiveContext)) {
- fire(new DebugContextEvent(this, getActiveContext(), DebugContextEvent.ACTIVATED));
- }
- }
- }
-
- public ISelection getActiveContext() {
- ISelection activeContext = fActiveProvider.getActiveContext();
- if (activeContext != null) {
- return activeContext;
- }
- return TreeSelection.EMPTY;
- }
-
- public void debugContextChanged(DebugContextEvent event) {
- if (event.getSource().equals(fActiveProvider)) {
- fire(new DebugContextEvent(this, event.getContext(), event.getFlags()));
- }
- }
-
- void dispose() {
- for (int i = 0; i < fProviders.length; i++) {
- fProviders[i].removeDebugContextListener(this);
- }
- fProviders = null;
- fActiveProvider = null;
- }
- }
-
- private ContextProviderProxy fContextProviderProxy;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.DEBUG_VIEW;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#createActions()
- */
- protected void createActions() {
- setAction("Properties", new PropertyDialogAction(getSite(), getSite().getSelectionProvider())); //$NON-NLS-1$
- fEditConfigAction = new EditLaunchConfigurationAction();
- fAddToFavoritesAction = new AddToFavoritesAction();
- fEditSourceAction = new EditSourceLookupPathAction(this);
- fLookupAction = new LookupSourceAction(this);
- setAction(FIND_ACTION, new VirtualFindAction((InternalTreeModelViewer) getViewer()));
-
- addCapabilityAction(new TerminateCommandAction(), TERMINATE);
- addCapabilityAction(new DisconnectCommandAction(), DISCONNECT);
- addCapabilityAction(new SuspendCommandAction(), SUSPEND);
- addCapabilityAction(new ResumeCommandAction(), RESUME);
- addCapabilityAction(new StepReturnCommandAction(), STEP_RETURN);
- addCapabilityAction(new StepOverCommandAction(), STEP_OVER);
- addCapabilityAction(new StepIntoCommandAction(), STEP_INTO);
- addCapabilityAction(new DropToFrameCommandAction(), DROP_TO_FRAME);
- addCapabilityAction(new TerminateAndRemoveAction(), TERMINATE_AND_REMOVE);
- addCapabilityAction(new TerminateAndRelaunchAction(), TERMINATE_AND_RELAUNCH);
- addCapabilityAction(new RestartCommandAction(), RESTART);
- addCapabilityAction(new TerminateAllAction(), TERMINATE_ALL);
- addCapabilityAction(new ToggleStepFiltersAction(), TOGGLE_STEP_FILTERS);
- }
-
-
- /**
- * Initializes the action and associates it with the given id.
- *
- * @param capability
- * @param actionID
- */
- private void addCapabilityAction(DebugCommandAction capability, String actionID) {
- capability.init(this);
- setAction(actionID, capability);
- }
-
- /**
- * Disposes the given action.
- *
- * @param actionID
- */
- private void disposeCommandAction(String actionID) {
- DebugCommandAction action = (DebugCommandAction) getAction(actionID);
- action.dispose();
- }
-
- /**
- * Override the default implementation to create the breadcrumb page.
- *
- * @since 3.5
- * @see #fDefaultPageRec
- */
- public void createPartControl(final Composite parent) {
- super.createPartControl(parent);
-
- // Copy the global action handlers to the default page.
- setGlobalActionBarsToPage((IPageBookViewPage)getDefaultPage());
-
- // Add view as a selection listener to the site.
- getSite().getSelectionProvider().addSelectionChangedListener(this);
-
- // Set the tree viewer as the selection provider to the default page.
- // The page book view handles switching the between page selection
- // providers as needed.
- ((IPageBookViewPage)getDefaultPage()).getSite().setSelectionProvider(getViewer());
-
- // Call the PageBookView part listener to indirectly create the breadcrumb page.
- // This call eventually calls doCreatePage() implemented below.
- partActivated(new BreadcrumbWorkbenchPart(getSite()));
-
- fContextProviderProxy = new ContextProviderProxy(
- new IDebugContextProvider[] {fTreeViewerDebugContextProvider, fBreadcrumbPage.getContextProvider()});
- DebugUITools.getDebugContextManager().getContextService(getSite().getWorkbenchWindow()).addDebugContextProvider(fContextProviderProxy);
-
- // Create and configure actions for selecting view mode.
- createViewModeActions(parent);
- IPreferenceStore prefStore = DebugUIPlugin.getDefault().getPreferenceStore();
- String mode = prefStore.getString(IDebugPreferenceConstants.DEBUG_VIEW_MODE);
- setViewMode(mode, parent);
- for (int i = 0; i < fDebugViewModeActions.length; i++) {
- fDebugViewModeActions[i].setChecked(fDebugViewModeActions[i].getMode().equals(mode));
- }
-
- // Add a resize listener for the view to activate breadcrumb as needed.
- parent.addControlListener(new ControlListener() {
- public void controlMoved(ControlEvent e) {
- }
- public void controlResized(ControlEvent e) {
- if (parent.isDisposed()) {
- return;
- }
- if (IDebugPreferenceConstants.DEBUG_VIEW_MODE_AUTO.equals(fCurrentViewMode)) {
- autoSelectViewPage(parent);
- }
- }
- });
- }
-
- /**
- * Copies the view's global action handlers created by createActions(),
- * into the page site's action bars. This is necessary because the page
- * book view resets the view site's global actions after each page switch
- * (see bug 264618).
- *
- * @param page Page to copy the global actions into.
- *
- * @since 3.5
- */
- private void setGlobalActionBarsToPage(IPageBookViewPage page) {
- IActionBars pageActionBars = page.getSite().getActionBars();
- // Set the view site action bars created by createActions() to the
- // default page site.
- IActionBars bars = getViewSite().getActionBars();
- pageActionBars.setGlobalActionHandler(FIND_ACTION, bars.getGlobalActionHandler(FIND_ACTION));
- pageActionBars.setGlobalActionHandler(COPY_ACTION, bars.getGlobalActionHandler(COPY_ACTION));
- }
-
- /**
- * Override the default implementation to create the breadcrumb page.
- *
- * @since 3.5
- * @see #fDefaultPageRec
- */
- protected PageRec doCreatePage(IWorkbenchPart part) {
- if (part instanceof BreadcrumbWorkbenchPart) {
- fBreadcrumbPage = new BreadcrumbPage();
- fBreadcrumbPage.createControl(getPageBook());
- initPage(fBreadcrumbPage);
- setGlobalActionBarsToPage(fBreadcrumbPage);
- return new PageRec(part, fBreadcrumbPage);
- }
- return null;
- }
-
- /**
- * Override the default implementation to create the breadcrumb page.
- *
- * @since 3.5
- * @see #fDefaultPageRec
- */
- protected boolean isImportant(IWorkbenchPart part) {
- return part instanceof BreadcrumbWorkbenchPart;
- }
-
- /**
- * Override the default implementation to gain access at the default
- * page record.
- *
- * @since 3.5
- * @see #fDefaultPageRec
- */
- protected void showPageRec(PageRec pageRec) {
- if (pageRec.page == getDefaultPage()) {
- fDefaultPageRec = pageRec;
- }
-
- super.showPageRec(pageRec);
- }
-
- /**
- * Creates actions for controlling view mode.
- *
- * @param parent The view's parent control used to calculate view size
- * in auto mode.
- */
- private void createViewModeActions(final Composite parent) {
- IActionBars actionBars = getViewSite().getActionBars();
- IMenuManager viewMenu = actionBars.getMenuManager();
-
- fDebugViewModeActions = new DebugViewModeAction[3];
- fDebugViewModeActions[0] = new DebugViewModeAction(this, IDebugPreferenceConstants.DEBUG_VIEW_MODE_AUTO, parent);
- fDebugViewModeActions[1] = new DebugViewModeAction(this, IDebugPreferenceConstants.DEBUG_VIEW_MODE_FULL, parent);
- fDebugViewModeActions[2] = new DebugViewModeAction(this, IDebugPreferenceConstants.DEBUG_VIEW_MODE_COMPACT, parent);
- fBreadcrumbDropDownAutoExpandAction = new BreadcrumbDropDownAutoExpandAction(this);
-
- viewMenu.add(new Separator());
- final MenuManager modeSubmenu = new MenuManager(LaunchViewMessages.LaunchView_ViewModeMenu_label);
- modeSubmenu.setRemoveAllWhenShown(true);
- modeSubmenu.add(fDebugViewModeActions[0]);
- modeSubmenu.add(fDebugViewModeActions[1]);
- modeSubmenu.add(fDebugViewModeActions[2]);
- modeSubmenu.add(new Separator());
- modeSubmenu.add(fBreadcrumbDropDownAutoExpandAction);
- viewMenu.add(modeSubmenu);
- viewMenu.add(new Separator());
-
- modeSubmenu.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- modeSubmenu.add(fDebugViewModeActions[0]);
- modeSubmenu.add(fDebugViewModeActions[1]);
- modeSubmenu.add(fDebugViewModeActions[2]);
- modeSubmenu.add(new Separator());
- modeSubmenu.add(fBreadcrumbDropDownAutoExpandAction);
- }
- });
-
- }
-
-
- /**
- * Sets the current view mode. If needed, the active view page is changed.
- *
- * @param mode New mode to set.
- * @param parent The view's parent control used to calculate view size
- * in auto mode.
- *
- * @since 3.5
- */
- void setViewMode(String mode, Composite parent) {
- if (fCurrentViewMode.equals(mode)) {
- return;
- }
-
- fCurrentViewMode = mode;
- if (IDebugPreferenceConstants.DEBUG_VIEW_MODE_COMPACT.equals(mode)) {
- showBreadcrumbPage();
- } else if (IDebugPreferenceConstants.DEBUG_VIEW_MODE_FULL.equals(mode)) {
- showTreeViewerPage();
- } else {
- autoSelectViewPage(parent);
- }
- DebugUIPlugin.getDefault().getPreferenceStore().setValue(IDebugPreferenceConstants.DEBUG_VIEW_MODE, mode);
- }
-
- /**
- * Based on the current view size, select the active view page
- * (tree viewer vs. breadcrumb).
- *
- * @param parent View pane control.
- *
- * @since 3.5
- */
- private void autoSelectViewPage(Composite parent) {
- int breadcrumbHeight = fBreadcrumbPage.getHeight();
- if (parent.getClientArea().height < breadcrumbHeight + BREADCRUMB_TRIGGER_RANGE) {
- showBreadcrumbPage();
- }
- else if (parent.getClientArea().height > breadcrumbHeight + BREADCRUMB_STICKY_RANGE)
- {
- showTreeViewerPage();
- }
- }
-
-
- /**
- * Shows the tree viewer in the Debug view.
- *
- * @since 3.5
- */
- void showTreeViewerPage() {
- if (fDefaultPageRec != null && !getDefaultPage().equals(getCurrentPage())) {
- showPageRec(fDefaultPageRec);
- fContextProviderProxy.setActiveProvider(fTreeViewerDebugContextProvider);
- // Clear the selection in the breadcrumb to avoid having it re-selected
- // when the breadcrumb is activated again (bug 268124).
- fBreadcrumbPage.fCrumb.clearSelection();
- }
- }
-
- /**
- * Shows the breadcrumb in the Debug view.
- *
- * @since 3.5
- */
- void showBreadcrumbPage() {
- PageRec rec = getPageRec(fBreadcrumbPage);
- if (rec != null && !fBreadcrumbPage.equals(getCurrentPage())) {
- showPageRec(rec);
- // Ask the breadcrumb to take focus if we're the active part.
- if (getSite().getPage().getActivePart() == this) {
- setFocus();
- }
- fBreadcrumbPage.fCrumb.debugContextChanged(new DebugContextEvent(
- fTreeViewerDebugContextProvider,
- fTreeViewerDebugContextProvider.getActiveContext(),
- DebugContextEvent.ACTIVATED));
- fContextProviderProxy.setActiveProvider(fBreadcrumbPage.getContextProvider());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#createViewer(org.eclipse.swt.widgets.Composite)
- */
- protected Viewer createViewer(Composite parent) {
- fPresentation = new DelegatingModelPresentation();
- TreeModelViewer viewer = new TreeModelViewer(parent,
- SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.VIRTUAL,
- new DebugModelPresentationContext(IDebugUIConstants.ID_DEBUG_VIEW, fPresentation));
-
- viewer.addSelectionChangedListener(fTreeViewerSelectionChangedListener);
- viewer.getControl().addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent event) {
- if (event.character == SWT.DEL && event.stateMask == 0) {
- handleDeleteKeyPressed();
- }
- }
- });
- viewer.addViewerUpdateListener(this);
-
- viewer.setInput(DebugPlugin.getDefault().getLaunchManager());
- //setEventHandler(new LaunchViewEventHandler(this));
- fTreeViewerDebugContextProvider = new TreeViewerContextProvider(viewer);
-
- return viewer;
- }
-
- private void handleDeleteKeyPressed() {
- IStructuredSelection selection= (IStructuredSelection) getViewer().getSelection();
- Iterator iter= selection.iterator();
- Object item;
- boolean itemsToTerminate= false;
- ITerminate terminable;
- while (iter.hasNext()) {
- item= iter.next();
- if (item instanceof ITerminate) {
- terminable= (ITerminate) item;
- if (terminable.canTerminate() && !terminable.isTerminated()) {
- itemsToTerminate= true;
- break;
- }
- }
- }
- if (itemsToTerminate) {
- // Prompt the user to proceed with termination
- if (!MessageDialog.openQuestion(getSite().getShell(), DebugUIViewsMessages.LaunchView_Terminate_and_Remove_1, DebugUIViewsMessages.LaunchView_Terminate_and_remove_selected__2)) {
- return;
- }
- }
- MultiStatus status= new MultiStatus(DebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, DebugUIViewsMessages.LaunchView_Exceptions_occurred_attempting_to_terminate_and_remove_3, null);
- iter= selection.iterator();
- while (iter.hasNext()) {
- try {
- terminateAndRemove(iter.next());
- } catch (DebugException exception) {
- status.merge(exception.getStatus());
- }
- }
- if (!status.isOK()) {
- IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- DebugUIPlugin.errorDialog(window.getShell(), DebugUIViewsMessages.LaunchView_Terminate_and_Remove_4, DebugUIViewsMessages.LaunchView_Terminate_and_remove_failed_5, status);
- } else {
- DebugUIPlugin.log(status);
- }
- }
- }
-
- /**
- * Terminates and removes the given element from the launch manager
- */
- public static void terminateAndRemove(Object element) throws DebugException {
- ILaunch launch = DebugUIPlugin.getLaunch(element);
- ITerminate terminable = launch;
- if (terminable == null) {
- if (element instanceof ITerminate) {
- terminable = (ITerminate) element;
- }
- }
- if (terminable == null) {
- return;
- }
- if (!(terminable.canTerminate() || terminable.isTerminated())) {
- // Don't try to terminate or remove attached launches
- return;
- }
- try {
- if (!terminable.isTerminated()) {
- terminable.terminate();
- }
- } finally {
- if (launch != null) {
- ILaunchManager lManager= DebugPlugin.getDefault().getLaunchManager();
- lManager.removeLaunch(launch);
- }
- }
- }
-
- private void commonInit(IViewSite site) {
- site.getPage().addPartListener((IPartListener2) this);
- site.getWorkbenchWindow().addPageListener(this);
- site.getWorkbenchWindow().addPerspectiveListener(this);
- }
-
- private void preferenceInit(IViewSite site) {
- PREF_STATE_MEMENTO = PREF_STATE_MEMENTO + site.getId();
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- String string = store.getString(PREF_STATE_MEMENTO);
- if(string.length() > 0) {
- ByteArrayInputStream bin = new ByteArrayInputStream(string.getBytes());
- InputStreamReader reader = new InputStreamReader(bin);
- try {
- XMLMemento stateMemento = XMLMemento.createReadRoot(reader);
- setMemento(stateMemento);
- } catch (WorkbenchException e) {
- } finally {
- try {
- reader.close();
- bin.close();
- } catch (IOException e){}
- }
- }
- IMemento mem = getMemento();
-
- if (mem != null) {
- Boolean auto = mem.getBoolean(BREADCRUMB_DROPDOWN_AUTO_EXPAND);
- if(auto != null) {
- setBreadcrumbDropDownAutoExpand(auto.booleanValue());
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewPart#init(org.eclipse.ui.IViewSite)
- */
- public void init(IViewSite site) throws PartInitException {
- super.init(site);
- commonInit(site);
- preferenceInit(site);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewPart#init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento)
- */
- public void init(IViewSite site, IMemento memento) throws PartInitException {
- super.init(site, memento);
- commonInit(site);
- preferenceInit(site);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.PageBookView#partDeactivated(org.eclipse.ui.IWorkbenchPart)
- */
- public void partDeactivated(IWorkbenchPart part) {
- String id = part.getSite().getId();
- if (id.equals(getSite().getId())) {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- OutputStreamWriter writer = new OutputStreamWriter(bout);
-
- try {
- XMLMemento memento = XMLMemento.createWriteRoot("DebugViewMemento"); //$NON-NLS-1$
- saveViewerState(memento);
- memento.save(writer);
-
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- String xmlString = bout.toString();
- store.putValue(PREF_STATE_MEMENTO, xmlString);
- } catch (IOException e) {
- } finally {
- try {
- writer.close();
- bout.close();
- } catch (IOException e) {
- }
- }
- }
- super.partDeactivated(part);
- }
-
- /**
- * Saves the current state of the viewer
- * @param memento the memento to write the viewer state into
- */
- public void saveViewerState(IMemento memento) {
- memento.putBoolean(BREADCRUMB_DROPDOWN_AUTO_EXPAND, getBreadcrumbDropDownAutoExpand());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#configureToolBar(org.eclipse.jface.action.IToolBarManager)
- */
- protected void configureToolBar(IToolBarManager tbm) {
- tbm.add(new Separator(IDebugUIConstants.THREAD_GROUP));
- tbm.add(new Separator(IDebugUIConstants.STEP_GROUP));
- tbm.add(new GroupMarker(IDebugUIConstants.STEP_INTO_GROUP));
- tbm.add(new GroupMarker(IDebugUIConstants.STEP_OVER_GROUP));
- tbm.add(new GroupMarker(IDebugUIConstants.STEP_RETURN_GROUP));
- tbm.add(new GroupMarker(IDebugUIConstants.EMPTY_STEP_GROUP));
- tbm.add(new Separator(IDebugUIConstants.RENDER_GROUP));
-
- tbm.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(RESUME));
- tbm.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(SUSPEND));
- tbm.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(TERMINATE));
- tbm.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(DISCONNECT));
-
- tbm.appendToGroup(IDebugUIConstants.STEP_INTO_GROUP, getAction(STEP_INTO));
- tbm.appendToGroup(IDebugUIConstants.STEP_OVER_GROUP, getAction(STEP_OVER));
- tbm.appendToGroup(IDebugUIConstants.STEP_RETURN_GROUP, getAction(STEP_RETURN));
-
- tbm.appendToGroup(IDebugUIConstants.EMPTY_STEP_GROUP, getAction(DROP_TO_FRAME));
-
- tbm.appendToGroup(IDebugUIConstants.RENDER_GROUP, getAction(TOGGLE_STEP_FILTERS));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPart#dispose()
- */
- public void dispose() {
- getSite().getSelectionProvider().removeSelectionChangedListener(this);
- DebugUITools.getDebugContextManager().getContextService(getSite().getWorkbenchWindow()).removeDebugContextProvider(fContextProviderProxy);
- fContextProviderProxy.dispose();
- fTreeViewerDebugContextProvider.dispose();
- disposeActions();
- Viewer viewer = getViewer();
- if (viewer != null) {
- viewer.removeSelectionChangedListener(fTreeViewerSelectionChangedListener);
- ((TreeModelViewer)viewer).removeViewerUpdateListener(this);
- }
- IWorkbenchPage page = getSite().getPage();
- page.removePartListener((IPartListener2) this);
- IWorkbenchWindow window = getSite().getWorkbenchWindow();
- window.removePerspectiveListener(this);
- window.removePageListener(this);
-
- super.dispose();
- }
-
- private void disposeActions() {
- PropertyDialogAction properties = (PropertyDialogAction) getAction("Properties"); //$NON-NLS-1$
- properties.dispose();
-
- disposeCommandAction(TERMINATE);
- disposeCommandAction(DISCONNECT);
- disposeCommandAction(SUSPEND);
- disposeCommandAction(RESUME);
- disposeCommandAction(STEP_RETURN);
- disposeCommandAction(STEP_OVER);
- disposeCommandAction(STEP_INTO);
- disposeCommandAction(DROP_TO_FRAME);
- disposeCommandAction(TERMINATE_AND_REMOVE);
- disposeCommandAction(TERMINATE_AND_RELAUNCH);
- disposeCommandAction(RESTART);
- disposeCommandAction(TERMINATE_ALL);
- }
-
- /**
- * The selection has changed in the viewer. Show the
- * associated source code if it is a stack frame.
- *
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event) {
- updateObjects();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
- */
- public void doubleClick(DoubleClickEvent event) {
- ISelection selection= event.getSelection();
- if (!(selection instanceof IStructuredSelection)) {
- return;
- }
- IStructuredSelection ss= (IStructuredSelection)selection;
- Object o= ss.getFirstElement();
- if (o == null || o instanceof IStackFrame) {
- return;
- }
- StructuredViewer viewer = (StructuredViewer) getViewer();
- viewer.refresh(o);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveListener#perspectiveActivated(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor)
- */
- public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
- setActive(page.findView(getSite().getId()) != null);
- updateObjects();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveListener#perspectiveChanged(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor, java.lang.String)
- */
- public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) {
- setActive(page.findView(getSite().getId()) != null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveListener2#perspectiveChanged(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor, org.eclipse.ui.IWorkbenchPartReference, java.lang.String)
- */
- public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, IWorkbenchPartReference partRef, String changeId) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPageListener#pageActivated(org.eclipse.ui.IWorkbenchPage)
- */
- public void pageActivated(IWorkbenchPage page) {
- if (getSite().getPage().equals(page)) {
- setActive(true);
- updateObjects();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPageListener#pageClosed(org.eclipse.ui.IWorkbenchPage)
- */
- public void pageClosed(IWorkbenchPage page) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPageListener#pageOpened(org.eclipse.ui.IWorkbenchPage)
- */
- public void pageOpened(IWorkbenchPage page) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDebugView#getPresentation(java.lang.String)
- */
- public IDebugModelPresentation getPresentation(String id) {
- return ((DelegatingModelPresentation)fPresentation).getPresentation(id);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
- protected void fillContextMenu(IMenuManager menu) {
- TreeSelection sel = (TreeSelection) fTreeViewerDebugContextProvider.getActiveContext();
- Object element = sel != null && sel.size() > 0 ? sel.getFirstElement() : null;
-
- menu.add(new Separator(IDebugUIConstants.EMPTY_EDIT_GROUP));
- menu.add(new Separator(IDebugUIConstants.EDIT_GROUP));
- menu.add(getAction(FIND_ACTION));
- menu.add(new Separator(IDebugUIConstants.EMPTY_STEP_GROUP));
- menu.add(new Separator(IDebugUIConstants.STEP_GROUP));
- menu.add(new GroupMarker(IDebugUIConstants.STEP_INTO_GROUP));
- menu.add(new GroupMarker(IDebugUIConstants.STEP_OVER_GROUP));
- menu.add(new GroupMarker(IDebugUIConstants.STEP_RETURN_GROUP));
- menu.add(new Separator(IDebugUIConstants.RENDER_GROUP));
- menu.add(new Separator(IDebugUIConstants.EMPTY_THREAD_GROUP));
- menu.add(new Separator(IDebugUIConstants.THREAD_GROUP));
- menu.add(new Separator(IDebugUIConstants.EMPTY_LAUNCH_GROUP));
- menu.add(new Separator(IDebugUIConstants.LAUNCH_GROUP));
- IStructuredSelection selection = (IStructuredSelection) getSite().getSelectionProvider().getSelection();
- updateAndAdd(menu, fEditConfigAction, selection);
- updateAndAdd(menu, fAddToFavoritesAction, selection);
- updateAndAdd(menu, fEditSourceAction, selection);
- updateAndAdd(menu, fLookupAction, selection);
- menu.add(new Separator(IDebugUIConstants.EMPTY_RENDER_GROUP));
- menu.add(new Separator(IDebugUIConstants.RENDER_GROUP));
- menu.add(new Separator(IDebugUIConstants.PROPERTY_GROUP));
- PropertyDialogAction action = (PropertyDialogAction)getAction("Properties"); //$NON-NLS-1$
- /**
- * TODO hack to get around bug 148424, remove if UI ever fixes the PropertyDialogAction to respect enablesWhen conditions
- */
- action.setEnabled(action.isApplicableForSelection() && !(element instanceof ILaunch));
- menu.add(action);
- menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
-
- menu.appendToGroup(IDebugUIConstants.LAUNCH_GROUP, getAction(TERMINATE_AND_REMOVE));
- menu.appendToGroup(IDebugUIConstants.LAUNCH_GROUP, getAction(TERMINATE_ALL));
-
- menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(RESUME));
- menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(SUSPEND));
- menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(TERMINATE));
- menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(TERMINATE_AND_RELAUNCH));
- if (element instanceof IAdaptable && ((IAdaptable)element).getAdapter(IRestartHandler.class) != null) {
- menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(RESTART));
- }
- menu.appendToGroup(IDebugUIConstants.THREAD_GROUP, getAction(DISCONNECT));
-
- menu.appendToGroup(IDebugUIConstants.STEP_INTO_GROUP, getAction(STEP_INTO));
- menu.appendToGroup(IDebugUIConstants.STEP_OVER_GROUP, getAction(STEP_OVER));
- menu.appendToGroup(IDebugUIConstants.STEP_RETURN_GROUP, getAction(STEP_RETURN));
-
- menu.appendToGroup(IDebugUIConstants.EMPTY_STEP_GROUP, getAction(DROP_TO_FRAME));
-
- menu.appendToGroup(IDebugUIConstants.RENDER_GROUP, getAction(TOGGLE_STEP_FILTERS));
- }
-
- /**
- * Updates the enabled state of the given action based on the selection
- * and adds to the menu if enabled.
- *
- * @param menu menu to add the action to
- * @param action action to add if enabled
- * @param selection selection to update enabled state for
- */
- private void updateAndAdd(IMenuManager menu, SelectionListenerAction action, IStructuredSelection selection) {
- action.selectionChanged(selection);
- if (action.isEnabled()) {
- menu.add(action);
- }
- }
-
- /**
- * Sets whether this view is in the active page of a
- * perspective. Since a page can have more than one
- * perspective, this view only show's source when in
- * the active perspective/page.
- *
- * @param active whether this view is in the active page of a
- * perspective
- */
- protected void setActive(boolean active) {
- fIsActive = active;
- }
-
- /**
- * Returns whether this view is in the active page of
- * the active perspective and has been fully created.
- *
- * @return whether this view is in the active page of
- * the active perspective and has been fully created.
- */
- protected boolean isActive() {
- return fIsActive && getViewer() != null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.IShowInTarget#show(org.eclipse.ui.part.ShowInContext)
- */
- public boolean show(ShowInContext context) {
- ISelection selection = context.getSelection();
- if (selection != null) {
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection)selection;
- if (ss.size() == 1) {
- Object obj = ss.getFirstElement();
- if (obj instanceof IDebugTarget || obj instanceof IProcess) {
- Viewer viewer = getViewer();
- if (viewer instanceof InternalTreeModelViewer) {
- InternalTreeModelViewer tv = (InternalTreeModelViewer) viewer;
- tv.setSelection(selection, true, true);
- } else {
- viewer.setSelection(selection, true);
- }
- return true;
- }
- }
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.IShowInSource#getShowInContext()
- */
- public ShowInContext getShowInContext() {
- if (isActive()) {
- IStructuredSelection selection = (IStructuredSelection)getViewer().getSelection();
- if (selection.size() == 1) {
- Object object = selection.getFirstElement();
- if (object instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) object;
- IShowInSource show = (IShowInSource) adaptable.getAdapter(IShowInSource.class);
- if (show != null) {
- return show.getShowInContext();
- }
- }
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.IShowInTargetList#getShowInTargetIds()
- */
- public String[] getShowInTargetIds() {
- if (isActive()) {
- IStructuredSelection selection = (IStructuredSelection)getViewer().getSelection();
- if (selection.size() == 1) {
- Object object = selection.getFirstElement();
- if (object instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) object;
- IShowInTargetList show = (IShowInTargetList) adaptable.getAdapter(IShowInTargetList.class);
- if (show != null) {
- return show.getShowInTargetIds();
- }
- }
- }
- }
- return new String[0];
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partClosed(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partClosed(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partVisible(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partVisible(IWorkbenchPartReference partRef) {
- IWorkbenchPart part = partRef.getPart(false);
- if (part == this) {
- setActive(true);
-// TODO: Workaround for Bug #63332. Reexamine after M9.
-// updateContextListener();
- // When the launch view becomes visible, turn on the
- // debug action set. Note that the workbench will handle the
- // case where the user really doesn't want the action set
- // enabled - showActionSet(String) will do nothing for an
- // action set that's been manually disabled.
- getSite().getPage().showActionSet(IDebugUIConstants.DEBUG_ACTION_SET);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partOpened(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partOpened(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partActivated(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partActivated(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partBroughtToTop(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partDeactivated(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partDeactivated(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partHidden(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partHidden(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partInputChanged(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partInputChanged(IWorkbenchPartReference partRef) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#becomesVisible()
- */
- protected void becomesVisible() {
- super.becomesVisible();
- getViewer().refresh();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#updateComplete(org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor)
- */
- public void updateComplete(IViewerUpdate update) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#updateStarted(org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor)
- */
- public void updateStarted(IViewerUpdate update) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#viewerUpdatesBegin()
- */
- public synchronized void viewerUpdatesBegin() {
- IWorkbenchSiteProgressService progressService =
- (IWorkbenchSiteProgressService)getSite().getAdapter(IWorkbenchSiteProgressService.class);
- if (progressService != null) {
- progressService.incrementBusy();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#viewerUpdatesComplete()
- */
- public synchronized void viewerUpdatesComplete() {
- IWorkbenchSiteProgressService progressService =
- (IWorkbenchSiteProgressService)getSite().getAdapter(IWorkbenchSiteProgressService.class);
- if (progressService != null) {
- progressService.decrementBusy();
- }
- }
-
- /**
- * Returns whether the breadcrumb viewer is currently visible in the view.
- *
- * @since 3.5
- */
- boolean isBreadcrumbVisible() {
- return fBreadcrumbPage.equals(getCurrentPage());
- }
-
- /**
- * Returns whether the elements in breadcrumb's drop-down viewer should be
- * automatically expanded.
- *
- * @since 3.5
- */
- boolean getBreadcrumbDropDownAutoExpand() {
- return fBreadcrumbDropDownAutoExpand;
- }
-
- /**
- * Sets whether the elements in breadcrumb's drop-down viewer should be
- * automatically expanded.
- *
- * @since 3.5
- */
- void setBreadcrumbDropDownAutoExpand(boolean expand) {
- fBreadcrumbDropDownAutoExpand = expand;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java
deleted file mode 100644
index 6542fab63..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java
+++ /dev/null
@@ -1,518 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.internal.ui.viewers.breadcrumb.AbstractBreadcrumb;
-import org.eclipse.debug.internal.ui.viewers.breadcrumb.BreadcrumbViewer;
-import org.eclipse.debug.internal.ui.viewers.breadcrumb.IBreadcrumbDropDownSite;
-import org.eclipse.debug.internal.ui.viewers.breadcrumb.TreeViewerDropDown;
-import org.eclipse.debug.internal.ui.viewers.model.ILabelUpdateListener;
-import org.eclipse.debug.internal.ui.viewers.model.SubTreeModelViewer;
-import org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDeltaVisitor;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
-import org.eclipse.debug.ui.contexts.AbstractDebugContextProvider;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextProvider;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.BaseLabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ITreePathContentProvider;
-import org.eclipse.jface.viewers.ITreePathLabelProvider;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.viewers.ViewerLabel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MenuDetectEvent;
-import org.eclipse.swt.events.MenuDetectListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * @since 3.5
- */
-public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugContextListener, ILabelUpdateListener {
-
- private static class Input {
- final TreePath fPath;
-
- Input(TreePath path) {
- fPath = path;
- }
-
- public boolean equals(Object obj) {
- return obj instanceof Input &&
- ((fPath == null && ((Input)obj).fPath == null) ||
- (fPath != null && fPath.equals( ((Input)obj).fPath )));
- }
-
- public int hashCode() {
- return fPath == null ? 0 : fPath.hashCode();
- }
- }
-
- private static class ContentProvider implements ITreePathContentProvider {
-
- private static final Object[] EMPTY_ELEMENTS_ARRAY = new Object[0];
-
- public Input fInput;
-
- public Object[] getChildren(TreePath parentPath) {
- if (hasChildren(parentPath)) {
- return new Object[] { fInput.fPath.getSegment(parentPath.getSegmentCount()) };
- }
- return EMPTY_ELEMENTS_ARRAY;
- }
-
- public TreePath[] getParents(Object element) {
- // Not supported
- return new TreePath[] { TreePath.EMPTY };
- }
-
- public boolean hasChildren(TreePath parentPath) {
- if ( parentPath.getSegmentCount() == 0) {
- return fInput != null;
- } else if (fInput != null &&
- fInput.fPath != null &&
- fInput.fPath.getSegmentCount() > parentPath.getSegmentCount())
- {
- for (int i = 0; i < parentPath.getSegmentCount(); i++) {
- if (i >= fInput.fPath.getSegmentCount()) {
- return false;
- } else {
- Object parentElement = parentPath.getSegment(i);
- Object contextElement = fInput.fPath.getSegment(i);
- if (!parentElement.equals(contextElement)) {
- return false;
- }
- }
- }
- return true;
- }
- return false;
- }
-
- public Object[] getElements(Object inputElement) {
- if (fInput != null &&
- fInput.fPath != null)
- {
- return getChildren(TreePath.EMPTY);
- } else {
- return new Object[] { fgEmptyDebugContextElement };
- }
- }
-
- public void dispose() {
- fInput = null;
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (newInput instanceof Input) {
- fInput = ((Input)newInput);
- } else {
- fInput = null;
- }
- }
- }
-
- private class LabelProvider extends BaseLabelProvider implements ITreePathLabelProvider {
- public void updateLabel(ViewerLabel label, TreePath elementPath) {
- if (fgEmptyDebugContextElement.equals(elementPath.getLastSegment())) {
- label.setText(LaunchViewMessages.Breadcrumb_NoActiveContext);
- label.setImage(null);
- } else {
- ViewerLabel treeViewerLabel = fTreeViewer.getElementLabel(elementPath, null);
- if (treeViewerLabel == null) {
- label.setText(LaunchViewMessages.Breadcrumb_NoActiveContext);
- label.setImage(null);
- } else {
- label.setText(treeViewerLabel.getText());
- label.setTooltipText(treeViewerLabel.getText());
- label.setImage(treeViewerLabel.getImage());
- label.setFont(treeViewerLabel.getFont());
- label.setForeground(treeViewerLabel.getForeground());
- label.setBackground(treeViewerLabel.getBackground());
-
- }
- }
- }
- }
-
- private final LaunchView fView;
- private final TreeModelViewer fTreeViewer;
- private final IDebugContextProvider fTreeViewerContextProvider;
- private Input fBreadcrumbInput;
- static final private Object fgEmptyDebugContextElement = new Object();
- private BreadcrumbViewer fViewer;
- private boolean fRefreshBreadcrumb = false;
-
- private class BreadcrumbContextProvider extends AbstractDebugContextProvider implements IDebugContextListener, ISelectionChangedListener {
-
- private ISelection fBreadcrumbSelection = null;
-
- BreadcrumbContextProvider() {
- super(fView);
- fViewer.addSelectionChangedListener(this);
- fBreadcrumbSelection = fViewer.getSelection();
- fTreeViewerContextProvider.addDebugContextListener(this);
- }
-
- public ISelection getActiveContext() {
- if (fBreadcrumbSelection != null && !fBreadcrumbSelection.isEmpty()) {
- return fBreadcrumbSelection;
- } else {
- ISelection treeViewerSelection = fTreeViewerContextProvider.getActiveContext();
- return treeViewerSelection != null ? treeViewerSelection : StructuredSelection.EMPTY;
- }
- }
-
- void dispose() {
- fViewer.removeSelectionChangedListener(this);
- fTreeViewerContextProvider.removeDebugContextListener(this);
- }
-
- public void debugContextChanged(DebugContextEvent event) {
- fire(new DebugContextEvent(this, getActiveContext(), event.getFlags()));
- }
-
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection oldContext = getActiveContext();
- fBreadcrumbSelection = event.getSelection();
- if (!getActiveContext().equals(oldContext)) {
- fire(new DebugContextEvent(this, getActiveContext(), DebugContextEvent.ACTIVATED));
- }
- }
- }
-
- private BreadcrumbContextProvider fBreadcrumbContextProvider;
-
- public LaunchViewBreadcrumb(LaunchView view, TreeModelViewer treeViewer, IDebugContextProvider contextProvider) {
- fView = view;
- fTreeViewer = treeViewer;
- fTreeViewer.addLabelUpdateListener(this);
- fTreeViewerContextProvider = contextProvider;
- fBreadcrumbInput = new Input( getPathForSelection(fTreeViewerContextProvider.getActiveContext()) );
- fTreeViewerContextProvider.addDebugContextListener(this);
- }
-
- protected void activateBreadcrumb() {
- }
-
- protected void deactivateBreadcrumb() {
- if (fViewer.isDropDownOpen()) {
- Shell shell = fViewer.getDropDownShell();
- if (shell != null && !shell.isDisposed()) {
- shell.close();
- }
- }
- }
-
- protected BreadcrumbViewer createViewer(Composite parent) {
- fViewer = new BreadcrumbViewer(parent, SWT.NONE) {
- protected Control createDropDown(Composite dropDownParent, IBreadcrumbDropDownSite site, TreePath path) {
- return createDropDownControl(dropDownParent, site, path);
- }
- };
-
- // Force the layout of the breadcrumb viewer so that we may calcualte
- // its proper size.
- parent.pack(true);
-
- fViewer.setContentProvider(new ContentProvider());
- fViewer.setLabelProvider(new LabelProvider());
-
- createMenuManager();
-
- fViewer.setInput(getCurrentInput());
-
- fBreadcrumbContextProvider = new BreadcrumbContextProvider();
-
- return fViewer;
- }
-
- protected void createMenuManager() {
- MenuManager menuMgr = new MenuManager("#PopUp"); //$NON-NLS-1$
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- fView.fillContextMenu(mgr);
- }
- });
- final Menu menu= menuMgr.createContextMenu(fViewer.getControl());
-
- // register the context menu such that other plug-ins may contribute to it
- if (fView.getSite() != null) {
- fView.getSite().registerContextMenu(menuMgr, fViewer);
- }
- fView.addContextMenuManager(menuMgr);
-
- fViewer.addMenuDetectListener(new MenuDetectListener() {
- public void menuDetected(MenuDetectEvent event) {
- menu.setLocation(event.x + 10, event.y + 10);
- menu.setVisible(true);
- while (!menu.isDisposed() && menu.isVisible()) {
- if (!menu.getDisplay().readAndDispatch())
- menu.getDisplay().sleep();
- }
- }
- });
- }
-
- protected Object getCurrentInput() {
- return fBreadcrumbInput;
- }
-
- protected boolean open(ISelection selection) {
- // Let the drop-down control implementation itself handle activating a new context.
- return false;
- }
-
- public void dispose() {
- fBreadcrumbContextProvider = null;
- fTreeViewerContextProvider.removeDebugContextListener(this);
- fTreeViewer.removeLabelUpdateListener(this);
- fBreadcrumbContextProvider.dispose();
- fViewer = null;
- super.dispose();
- }
-
- public void debugContextChanged(DebugContextEvent event) {
- if (fView.isBreadcrumbVisible()) {
- fBreadcrumbInput = new Input(getPathForSelection(event.getContext()));
- if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) {
- setInput(getCurrentInput());
-
- // If the context was activated, then clear the selection in breadcrumb
- // so that the activated context will become the active context for the
- // window.
- fViewer.setSelection(StructuredSelection.EMPTY);
- } else {
- refresh();
- }
- }
- }
-
- public void labelUpdateStarted(ILabelUpdate update) {
- }
-
- public void labelUpdateComplete(ILabelUpdate update) {
- if (fBreadcrumbInput != null && fBreadcrumbInput.fPath != null) {
- if (fBreadcrumbInput.fPath.startsWith(update.getElementPath(), null)) {
- synchronized (this) {
- fRefreshBreadcrumb = true;
- }
- }
- }
- }
-
- public void labelUpdatesBegin() {
- }
-
- public void labelUpdatesComplete() {
- boolean refresh = false;
- synchronized(this) {
- refresh = fRefreshBreadcrumb;
- fRefreshBreadcrumb = false;
- }
- if (fView.isBreadcrumbVisible() && refresh) {
- new UIJob(fViewer.getControl().getDisplay(), "refresh breadcrumb") { //$NON-NLS-1$
- { setSystem(true); }
- public IStatus runInUIThread(IProgressMonitor monitor) {
- refresh();
- return Status.OK_STATUS;
- }
- }.schedule();
- }
- }
-
- IDebugContextProvider getContextProvider() {
- return fBreadcrumbContextProvider;
- }
-
- int getHeight() {
- return fViewer.getControl().getSize().y;
- }
-
- void clearSelection() {
- fViewer.setSelection(StructuredSelection.EMPTY);
- }
-
- private TreePath getPathForSelection(ISelection selection) {
- if (selection instanceof ITreeSelection && !selection.isEmpty()) {
- return ((ITreeSelection)selection).getPaths()[0];
- }
- return null;
- }
-
- public Control createDropDownControl(Composite parent, final IBreadcrumbDropDownSite site, TreePath paramPath) {
-
- TreeViewerDropDown dropDownTreeViewer = new TreeViewerDropDown() {
-
- SubTreeModelViewer fDropDownViewer;
-
- protected TreeViewer createTreeViewer(Composite composite, int style, final TreePath path) {
- fDropDownViewer = new SubTreeModelViewer(
- composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.VIRTUAL | SWT.POP_UP,
- fTreeViewer.getPresentationContext());
-
- Object launchViewInput = fTreeViewer.getInput();
- fDropDownViewer.setInput(launchViewInput, path.getParentPath());
-
- ViewerFilter[] filters = fTreeViewer.getFilters();
- fDropDownViewer.setFilters(filters);
-
- ModelDelta stateDelta = new ModelDelta(launchViewInput, IModelDelta.NO_CHANGE);
- fTreeViewer.saveElementState(TreePath.EMPTY, stateDelta, IModelDelta.EXPAND | IModelDelta.SELECT);
-
- // If we do not want to expand the elements in the drop-down.
- // Prune the delta to only select the element in the
- // top-most list.
- if (!fView.getBreadcrumbDropDownAutoExpand()) {
- final ModelDelta prunedDelta = new ModelDelta(launchViewInput, IModelDelta.NO_CHANGE);
- stateDelta.accept(new IModelDeltaVisitor() {
- ModelDelta copy = prunedDelta;
- public boolean visit(IModelDelta delta, int depth) {
- TreePath deltaPath = getViewerTreePath(delta);
- if (deltaPath.getSegmentCount() == 0) {
- // skip copying the root element, only copy it's child count
- copy.setChildCount(delta.getChildCount());
- } else if (deltaPath.getSegmentCount() != 0 && path.startsWith(deltaPath, null) ) {
- // Build up the delta copy along the path of the drop-down element.
- copy = copy.addNode(
- delta.getElement(), delta.getIndex(), delta.getFlags(), delta.getChildCount());
- }
-
- // If the delta is for the drop-down element, set its select flag and stop traversing
- // the delta..
- if (deltaPath.equals(path)) {
- copy.setFlags(IModelDelta.SELECT | IModelDelta.REVEAL);
- return false;
- }
-
- // Continue traversing the delta.
- return true;
- }
-
- private TreePath getViewerTreePath(IModelDelta node) {
- ArrayList list = new ArrayList();
- IModelDelta parentDelta = node.getParentDelta();
- while (parentDelta != null) {
- list.add(0, node.getElement());
- node = parentDelta;
- parentDelta = node.getParentDelta();
- }
- return new TreePath(list.toArray());
- }
- });
- stateDelta = prunedDelta;
- }
-
- fDropDownViewer.updateViewer(stateDelta);
-
- fDropDownViewer.addLabelUpdateListener(new ILabelUpdateListener() {
- public void labelUpdateComplete(ILabelUpdate update) {}
- public void labelUpdatesBegin() {}
- public void labelUpdateStarted(ILabelUpdate update) {}
- public void labelUpdatesComplete() {
- new UIJob(fViewer.getControl().getDisplay(), "resize breadcrub dropdown") { //$NON-NLS-1$
- { setSystem(true); }
- public IStatus runInUIThread(IProgressMonitor monitor) {
- site.updateSize();
- return Status.OK_STATUS;
- }
- }.schedule();
- }
- });
-
- return fDropDownViewer;
- }
-
- protected void openElement(ISelection selection) {
- if (fTreeViewer.getControl().isDisposed()) {
- return;
- }
-
- if (selection != null && (selection instanceof ITreeSelection) && !selection.isEmpty()) {
- // Create the path to the root element of the drop-down viewer. Need to calcualte
- // indexes and counts for the delta in order for the selection from the drop-down
- // viewer to work properly.
- TreeModelContentProvider contentProvider = (TreeModelContentProvider)fTreeViewer.getContentProvider();
- TreePath path = TreePath.EMPTY;
- int count = fTreeViewer.getChildCount(path);
- count = contentProvider.viewToModelCount(path, count);
- ModelDelta rootDelta =
- new ModelDelta(fTreeViewer.getInput(), -1, IModelDelta.NO_CHANGE, count);
- TreePath rootPath = fDropDownViewer.getRootPath();
- ModelDelta delta = rootDelta;
- for (int i = 0; i < rootPath.getSegmentCount(); i++) {
- Object element = rootPath.getSegment(i);
- int index = fTreeViewer.findElementIndex(path, element);
- index = contentProvider.viewToModelIndex(path, index);
- path = path.createChildPath(element);
- count = fTreeViewer.getChildCount(path);
- count = contentProvider.viewToModelCount(path, count);
- delta = delta.addNode(rootPath.getSegment(i), index, IModelDelta.NO_CHANGE, count);
- }
-
- // Create the delta and save the drop-down viewer's state to it.
- fDropDownViewer.saveElementState(TreePath.EMPTY, delta, IModelDelta.EXPAND | IModelDelta.SELECT);
-
- // Add the IModelDelta.FORCE flag to override the current selection in view.
- rootDelta.accept(new IModelDeltaVisitor(){
- public boolean visit(IModelDelta paramDelta, int depth) {
- if ((paramDelta.getFlags() & IModelDelta.SELECT) != 0) {
- ((ModelDelta)paramDelta).setFlags(paramDelta.getFlags() | IModelDelta.FORCE);
- }
- return true;
- }
- });
-
- // If elements in the drop-down were auto-expanded, then collapse the drop-down's sub tree in the
- // full viewer. After the drop-down's full expansion state is saved out to the tree viewer, the
- // tree viewer will accurately reflect the state changes made by the user.
- if (fView.getBreadcrumbDropDownAutoExpand()) {
- fTreeViewer.collapseToLevel(rootPath, TreeViewer.ALL_LEVELS);
- }
-
- // Save the state of the drop-down out into the tree viewer.
- fTreeViewer.updateViewer(rootDelta);
- fViewer.setSelection(StructuredSelection.EMPTY);
- site.close();
- }
-
- super.openElement(selection);
- }
- };
-
-
- return dropDownTreeViewer.createDropDown(parent, site, paramPath);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java
deleted file mode 100644
index 424c88b06..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-import org.eclipse.debug.internal.ui.viewers.model.InternalTreeModelViewer;
-import org.eclipse.debug.internal.ui.viewers.model.VirtualCopyToClipboardActionDelegate;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.swt.widgets.Widget;
-
-/**
- * @since 3.5
- */
-public class LaunchViewCopyToClipboardActionDelegate extends VirtualCopyToClipboardActionDelegate {
-
- protected TreeItem[] getPrunedSelection() {
- LaunchView view = (LaunchView)getView();
- if (view.isBreadcrumbVisible()) {
- ISelection selection = getSelection();
- if (selection instanceof ITreeSelection && getViewer() instanceof InternalTreeModelViewer) {
- if (selection.isEmpty()) {
- selection = new TreeSelection(TreePath.EMPTY);
- }
- return getSelectedItems((InternalTreeModelViewer)getViewer(), ((ITreeSelection)selection).getPaths()[0]);
- }
- return new TreeItem[0];
- } else {
- return super.getPrunedSelection();
- }
- }
-
- private TreeItem[] getSelectedItems(InternalTreeModelViewer viewer, TreePath path) {
- Widget item = viewer.findItem(path);
- if (item instanceof TreeItem) {
- return new TreeItem[] { (TreeItem)item };
- } else if (item instanceof Tree) {
- return ((Tree)item).getItems();
- }
- return new TreeItem[0];
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.java
deleted file mode 100755
index a33ae0f8a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- * Pawel Piech - Wind River - adapted to use in Debug view
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-import org.eclipse.osgi.util.NLS;
-
-public class LaunchViewMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.views.launch.LaunchViewMessages";//$NON-NLS-1$
-
- public static String Breadcrumb_NoActiveContext;
- public static String LaunchView_ViewModeMenu_label;
- public static String DebugViewModeAction_Auto_label;
- public static String DebugViewModeAction_Auto_tooltip;
- public static String DebugViewModeAction_Auto_description;
- public static String DebugViewModeAction_Full_label;
- public static String DebugViewModeAction_Full_tooltip;
- public static String DebugViewModeAction_Full_description;
- public static String DebugViewModeAction_Compact_label;
- public static String DebugViewModeAction_Compact_tooltip;
- public static String DebugViewModeAction_Compact_description;
-
- public static String BreadcrumbDropDownAutoExpandAction_label;
- public static String BreadcrumbDropDownAutoExpandAction_tooltip;
- public static String BreadcrumbDropDownAutoExpandAction_description;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, LaunchViewMessages.class);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.properties
deleted file mode 100755
index 839f9b775..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewMessages.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2009 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-# Pawel Piech - Wind River - adapted to use in Debug view
-###############################################################################
-
-Breadcrumb_NoActiveContext=No Active Context
-LaunchView_ViewModeMenu_label=&Layout
-DebugViewModeAction_Auto_label=&Automatic
-DebugViewModeAction_Auto_tooltip=Automatic
-DebugViewModeAction_Auto_description=Switch layout automatically when the view is resized
-DebugViewModeAction_Full_label=&Tree
-DebugViewModeAction_Full_tooltip=Tree
-DebugViewModeAction_Full_description=Always show the tree viewer
-DebugViewModeAction_Compact_label=&Breadcrumb
-DebugViewModeAction_Compact_tooltip=Breadcrumb
-DebugViewModeAction_Compact_description=Always show the breadcrumb viewer
-
-BreadcrumbDropDownAutoExpandAction_label=Auto-&Expand Breadcrumb
-BreadcrumbDropDownAutoExpandAction_tooltip=Auto-Expand Breadcrumb
-BreadcrumbDropDownAutoExpandAction_description=In the breadcrumb drop-down, automatically expand elements to reveal full selection in view.
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditor.java
deleted file mode 100644
index b25295f2e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditor.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.resource.JFaceColors;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IReusableEditor;
-import org.eclipse.ui.part.EditorPart;
-
-/**
- * Editor used when no source if found for a stack frame.
- *
- * @since 2.1
- */
-public class SourceNotFoundEditor extends EditorPart implements IReusableEditor {
-
- /**
- * Text widget used for this editor
- */
- private Text fText;
-
- /**
- * @see org.eclipse.ui.IEditorPart#doSave(IProgressMonitor)
- */
- public void doSave(IProgressMonitor monitor) {
- }
-
- /**
- * @see org.eclipse.ui.IEditorPart#doSaveAs()
- */
- public void doSaveAs() {
- }
-
- /**
- * @see org.eclipse.ui.IEditorPart#gotoMarker(IMarker)
- */
- public void gotoMarker(IMarker marker) {
- }
-
- /**
- * @see org.eclipse.ui.IEditorPart#init(IEditorSite, IEditorInput)
- */
- public void init(IEditorSite site, IEditorInput input) {
- setSite(site);
- setInput(input);
- }
-
- /**
- * @see org.eclipse.ui.IEditorPart#isDirty()
- */
- public boolean isDirty() {
- return false;
- }
-
- /**
- * @see org.eclipse.ui.IEditorPart#isSaveAsAllowed()
- */
- public boolean isSaveAsAllowed() {
- return false;
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPart#createPartControl(Composite)
- */
- public void createPartControl(Composite parent) {
- fText = new Text(parent,SWT.MULTI|SWT.READ_ONLY|SWT.WRAP);
- fText.setForeground(JFaceColors.getErrorText(fText.getDisplay()));
- fText.setBackground(fText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
- if (getEditorInput() != null) {
- setInput(getEditorInput());
- }
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPart#setFocus()
- */
- public void setFocus() {
- if (fText != null) {
- fText.setFocus();
- }
- }
-
- /**
- * @see IReusableEditor#setInput(org.eclipse.ui.IEditorInput)
- */
- public void setInput(IEditorInput input) {
- super.setInput(input);
- setPartName(input.getName());
- if (fText != null) {
- fText.setText(input.getToolTipText());
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditorInput.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditorInput.java
deleted file mode 100644
index daa0f90ef..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditorInput.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-
-import com.ibm.icu.text.MessageFormat;
-
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.internal.ui.views.DebugUIViewsMessages;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPersistableElement;
-
-/**
- * Editor input for a stack frame for which source could not be located.
- *
- * @since 2.1
- */
-public class SourceNotFoundEditorInput extends PlatformObject implements IEditorInput {
-
- /**
- * Associated stack frame
- */
- private IStackFrame fFrame;
-
- /**
- * Stack frame text (cached on creation)
- */
- private String fFrameText;
-
- /**
- * Constructs an editor input for the given stack frame,
- * to indicate source could not be found.
- *
- * @param frame stack frame
- */
- public SourceNotFoundEditorInput(IStackFrame frame) {
- fFrame = frame;
- IDebugModelPresentation pres = DebugUITools.newDebugModelPresentation(frame.getModelIdentifier());
- fFrameText = pres.getText(frame);
- pres.dispose();
- }
-
- /**
- * @see org.eclipse.ui.IEditorInput#exists()
- */
- public boolean exists() {
- return false;
- }
-
- /**
- * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return DebugUITools.getDefaultImageDescriptor(fFrame);
- }
-
- /**
- * @see org.eclipse.ui.IEditorInput#getName()
- */
- public String getName() {
- try {
- return fFrame.getName();
- } catch (DebugException e) {
- return DebugUIViewsMessages.SourceNotFoundEditorInput_Source_Not_Found_1;
- }
- }
-
- /**
- * @see org.eclipse.ui.IEditorInput#getPersistable()
- */
- public IPersistableElement getPersistable() {
- return null;
- }
-
- /**
- * @see org.eclipse.ui.IEditorInput#getToolTipText()
- */
- public String getToolTipText() {
- return MessageFormat.format(DebugUIViewsMessages.SourceNotFoundEditorInput_Source_not_found_for__0__2,new String[] {fFrameText});
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/StandardDecoration.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/StandardDecoration.java
deleted file mode 100644
index ea33cf20d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/StandardDecoration.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.launch;
-
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.ui.IDebugEditorPresentation;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * A reminder to remove any annotations created by an editor presentation
- */
-public class StandardDecoration extends Decoration {
-
- private IThread fThread;
- private IEditorPart fEditor;
- private IDebugEditorPresentation fPresentation;
-
- public StandardDecoration(IDebugEditorPresentation presentation, IEditorPart editorPart, IThread thread) {
- fThread = thread;
- fEditor = editorPart;
- fPresentation = presentation;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.launch.Decoration#remove()
- */
- public void remove() {
- fPresentation.removeAnnotations(fEditor, fThread);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.launch.Decoration#getThread()
- */
- public IThread getThread() {
- return fThread;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java
deleted file mode 100644
index 6d2b6d689..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java
+++ /dev/null
@@ -1,430 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - Ted Williams - [Memory View] Memory View: Workflow Enhancements (Bug 215432)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory;
-
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.IMemoryBlockListener;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPart;
-
-public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, ISelectionListener, SelectionListener, IMemoryView, ISelectionChangedListener, IMemoryViewPane, IDebugContextListener, IDebugEventSetListener{
-
- public static final String BEGINNING_POPUP = "popUpBegin"; //$NON-NLS-1$
- protected static final StructuredSelection EMPTY = new StructuredSelection();
-
- protected Composite fViewPaneCanvas;
- protected StackLayout fStackLayout;
- protected ViewTabEnablementManager fViewTabEnablementManager;
- protected CTabFolder fEmptyTabFolder;
- protected Hashtable fTabFolderForDebugView = new Hashtable();
- protected boolean fVisible;
- protected Hashtable fRenderingInfoTable;
- protected IMemoryBlockRetrieval fKey; // store the key for current tab folder
- protected ViewPaneSelectionProvider fSelectionProvider;
- protected IViewPart fParent;
- protected String fPaneId;
- private Composite fCanvas;
- protected String fLabel;
-
- public AbstractMemoryViewPane(IViewPart parent)
- {
- super();
- fParent = parent;
- fSelectionProvider = new ViewPaneSelectionProvider();
- }
-
- /**
- * Create the content of the view pane
- * @param parent
- * @return the control of the view pane
- */
- public Control createViewPane(Composite parent, String paneId, String label)
- {
- fPaneId = paneId;
- fLabel = label;
- fCanvas = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.makeColumnsEqualWidth = false;
- layout.numColumns = 1;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- GridData data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.grabExcessVerticalSpace = true;
- data.verticalAlignment = SWT.BEGINNING;
- data.horizontalAlignment = SWT.BEGINNING;
- fCanvas.setLayout(layout);
- fCanvas.setLayoutData(data);
-
- // memory view area
- Composite memoryViewAreaParent = fCanvas;
- Composite subCanvas = new Composite(memoryViewAreaParent, SWT.NONE);
- fViewPaneCanvas = subCanvas;
- fStackLayout = new StackLayout();
- GridData memoryAreaData = new GridData();
- memoryAreaData.grabExcessHorizontalSpace = true;
- memoryAreaData.grabExcessVerticalSpace = true;
- memoryAreaData.verticalAlignment = SWT.FILL;
- memoryAreaData.horizontalAlignment = SWT.FILL;
- fViewPaneCanvas.setLayout(fStackLayout);
- fViewPaneCanvas.setLayoutData(memoryAreaData);
-
- fViewTabEnablementManager = new ViewTabEnablementManager();
-
- fEmptyTabFolder = new CTabFolder(fViewPaneCanvas, SWT.NULL);
- setTabFolder(fEmptyTabFolder);
-
- addListeners();
-
- Object context = DebugUITools.getDebugContext();
- if (context != null)
- {
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
- if (retrieval != null)
- createFolder(retrieval);
- }
-
- fVisible = true;
-
- return fCanvas;
- }
-
- protected void addListeners()
- {
- MemoryViewUtil.getMemoryBlockManager().addListener(this);
- fParent.getViewSite().getPage().addSelectionListener(this);
- DebugUITools.getDebugContextManager().getContextService(fParent.getSite().getWorkbenchWindow()).addDebugContextListener(this);
- DebugPlugin.getDefault().addDebugEventListener(this);
- }
-
- protected void removeListeners()
- {
- MemoryViewUtil.getMemoryBlockManager().removeListener(this);
- fParent.getViewSite().getPage().removeSelectionListener(this);
- DebugUITools.getDebugContextManager().getContextService(fParent.getSite().getWorkbenchWindow()).removeDebugContextListener(this);
-
- if (fStackLayout.topControl != null)
- {
- CTabFolder old = (CTabFolder)fStackLayout.topControl;
-
- if (!old.isDisposed())
- {
- old.removeSelectionListener(this);
- old.removeSelectionListener(fViewTabEnablementManager);
- }
- }
- DebugPlugin.getDefault().removeDebugEventListener(this);
- }
-
- protected void setTabFolder(CTabFolder folder)
- {
- if (fStackLayout.topControl != null)
- {
- CTabFolder old = (CTabFolder)fStackLayout.topControl;
-
- if (!old.isDisposed())
- {
- old.removeSelectionListener(this);
- old.removeSelectionListener(fViewTabEnablementManager);
- }
- }
-
- fStackLayout.topControl = folder;
-
- if (folder.getItemCount() > 0)
- {
- CTabItem selectedItem = folder.getSelection();
-
- if (selectedItem != null)
- {
- Object selected = getCurrentSelection();
- if (selected != null)
- {
- fSelectionProvider.setSelection(new StructuredSelection(selected));
- }
- else
- {
- fSelectionProvider.setSelection(AbstractMemoryViewPane.EMPTY);
- }
- }
- }
- else
- {
- fSelectionProvider.setSelection(AbstractMemoryViewPane.EMPTY);
- }
-
- folder.addSelectionListener(this);
- folder.addSelectionListener(fViewTabEnablementManager);
- }
-
-
- private void createFolder(IMemoryBlockRetrieval memRetrieval)
- {
- //if we've got a tabfolder to go with the IMemoryBlockRetrieval, display it
- Integer key = MemoryViewUtil.getHashCode(memRetrieval);
- if (fTabFolderForDebugView.containsKey(key)) {
- if (fStackLayout.topControl != (CTabFolder)fTabFolderForDebugView.get(key)) {
- setTabFolder((CTabFolder)fTabFolderForDebugView.get(key));
- fViewPaneCanvas.layout();
- }
- } else { //otherwise, add a new one
- fTabFolderForDebugView.put(key, new CTabFolder(fViewPaneCanvas, SWT.NULL));
- setTabFolder((CTabFolder)fTabFolderForDebugView.get(key));
- fViewPaneCanvas.layout();
- }
- }
-
- public IMemoryViewTab getTopMemoryTab() {
-
- if (fStackLayout.topControl instanceof CTabFolder)
- {
- CTabFolder folder = (CTabFolder)fStackLayout.topControl;
- if (!folder.isDisposed())
- {
- int index = folder.getSelectionIndex();
- if (index >= 0) {
- CTabItem tab = folder.getItem(index);
- return (IMemoryViewTab)tab.getData();
- }
- }
- }
- return null;
- }
-
- protected void disposeTab(CTabItem tabItem)
- {
- if (tabItem == null)
- return;
-
- // dispose the tab item in case the view tab has not
- // cleaned up the tab item
- if (!tabItem.isDisposed())
- {
- tabItem.dispose();
- }
- }
-
- protected void emptyFolder()
- {
- setTabFolder(fEmptyTabFolder);
- if (!fViewPaneCanvas.isDisposed()) {
- fViewPaneCanvas.layout();
- }
- }
-
- public void addSelectionListener(ISelectionChangedListener listener)
- {
- if (fSelectionProvider == null)
- fSelectionProvider = new ViewPaneSelectionProvider();
-
- fSelectionProvider.addSelectionChangedListener(listener);
- }
-
- public void removeSelctionListener(ISelectionChangedListener listener)
- {
- if (fSelectionProvider == null)
- return;
-
- fSelectionProvider.removeSelectionChangedListener(listener);
- }
-
- public ISelectionProvider getSelectionProvider()
- {
- return fSelectionProvider;
- }
-
- public void handleDebugEvents(DebugEvent[] events)
- {
- for (int i = 0; i < events.length; i++)
- {
- Object source = events[i].getSource();
- if (events[i].getKind() == DebugEvent.TERMINATE && source instanceof IMemoryBlockRetrieval)
- {
- //When a memory block retrieval terminates, it and its
- //tab folders should be removed from our map.
- IMemoryBlockRetrieval ret = (IMemoryBlockRetrieval)source;
- if (ret != null)
- {
- final Integer key = MemoryViewUtil.getHashCode(ret);
- final Object folder = fTabFolderForDebugView.get(key);
- if (folder != null && folder != fEmptyTabFolder && (!((CTabFolder)folder).isDisposed()))
- {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- //remove the tab folder , and all contained tab items
- disposeOfFolder((CTabFolder) folder);
- if (fTabFolderForDebugView != null)
- fTabFolderForDebugView.remove(key);
- }
- });
- }
- }
- }
- }
-
- }
-
-
-
- public void dispose()
- {
- removeListeners();
-
- // dispose empty folders
- fEmptyTabFolder.dispose();
-
- // dispose all other folders
- try {
-
- if (fTabFolderForDebugView != null) {
- Enumeration enumeration = fTabFolderForDebugView.elements();
-
- while (enumeration.hasMoreElements())
- {
- CTabFolder tabFolder = (CTabFolder)enumeration.nextElement();
- disposeOfFolder(tabFolder);
- }
-
- // set to null so that clean up is only done once
- fTabFolderForDebugView.clear();
- fTabFolderForDebugView = null;
- }
- } catch (Exception e) {
-
- DebugUIPlugin.logErrorMessage("Exception occurred when the Memory View is disposed."); //$NON-NLS-1$
- }
- }
-
- /**
- * Helper method to dispose of a tab folder,
- * and of any tab items it contains.
- * Must be called from the UI thread.
- * */
- private void disposeOfFolder(CTabFolder tabFolder)
- {
- if (!tabFolder.isDisposed())
- {
-
- // if tab folder is not empty, dipose view tabs
- CTabItem[] tabs = tabFolder.getItems();
-
- for (int i=0; i<tabs.length; i++)
- {
- disposeTab(tabs[i]);
- }
-
- tabFolder.dispose();
- }
- }
-
- public void setVisible(boolean visible)
- {
- fVisible = visible;
-
- IMemoryViewTab currentTab = getTopMemoryTab();
- if (currentTab != null)
- currentTab.setEnabled(visible);
- }
-
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
- selectionChanged(fParent,selection);
-
- fSelectionProvider.setSelection(selection);
- }
-
- /**
- * @return the unique identifier of the view pane
- */
- public String getPaneId()
- {
- return fPaneId;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#getControl()
- */
- public Control getControl() {
- return fCanvas;
- }
-
- public boolean isVisible()
- {
- return fVisible;
- }
-
- public String getLabel()
- {
- return fLabel;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.memory.IMemoryBlockListener#MemoryBlockAdded(org.eclipse.debug.core.model.IMemoryBlock)
- */
- abstract public void memoryBlocksAdded(IMemoryBlock[] memoryBlocks);
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.memory.IMemoryBlockListener#MemoryBlockRemoved(org.eclipse.debug.core.model.IMemoryBlock)
- */
- abstract public void memoryBlocksRemoved(final IMemoryBlock[] memoryBlocks);
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- abstract public void selectionChanged(IWorkbenchPart part, ISelection selection);
-
- /**
- * @return current selection from the view pane
- */
- abstract public Object getCurrentSelection();
-
- /**
- * retore the view pane based on current selection from the debug view
- * and the memory blocks and renderings currently exist
- */
- abstract public void restoreViewPane();
-
- /**
- * @return actions to be contributed to the view pane's toolbar
- */
- abstract public IAction[] getActions();
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java
deleted file mode 100644
index c0188450b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java
+++ /dev/null
@@ -1,430 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.StringTokenizer;
-
-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.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.core.model.IMemoryBlockRetrievalExtension;
-import org.eclipse.debug.core.model.ITerminate;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
-import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
-import org.eclipse.debug.ui.memory.IMemoryRenderingType;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-
-/**
- * Action for adding memory block.
- *
- * @since 3.0
- */
-public class AddMemoryBlockAction extends Action implements IDebugContextListener, IDebugEventSetListener{
-
- protected IAdaptable fCurrentContext = null;
- protected IMemoryBlock fLastMemoryBlock;
- private boolean fAddDefaultRenderings = true;
- protected IMemoryRenderingSite fSite;
-
- public AddMemoryBlockAction(IMemoryRenderingSite site)
- {
- initialize(site);
- }
-
- /**
- * @param addDefaultRenderings - specify if the action should add
- * default renderings for the new memory block when it is run
- */
- AddMemoryBlockAction(IMemoryRenderingSite site, boolean addDefaultRenderings)
- {
- initialize(site);
- fAddDefaultRenderings = addDefaultRenderings;
- }
-
- /**
- *
- */
- private void initialize(IMemoryRenderingSite site) {
- setText(DebugUIMessages.AddMemoryBlockAction_title);
- doInitialization(site);
- }
-
-
- public AddMemoryBlockAction(String text, int style, IMemoryRenderingSite site)
- {
- super(text, style);
- doInitialization(site);
- }
-
- /**
- *
- */
- private void doInitialization(IMemoryRenderingSite site) {
- fSite = site;
- setToolTipText(DebugUIMessages.AddMemoryBlockAction_tooltip);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_MONITOR_EXPRESSION));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_MONITOR_EXPRESSION));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_MONITOR_EXPRESSION));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".addMemoryMonitorAction_context"); //$NON-NLS-1$
-
- // listen for context changed
- DebugUITools.getDebugContextManager().getContextService(site.getSite().getWorkbenchWindow()).addDebugContextListener(this);
-
- // get current context
- fCurrentContext = DebugUITools.getDebugContext();
-
- // set up enablement based on current selection
- updateAction(fCurrentContext);
-
- DebugPlugin.getDefault().addDebugEventListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- boolean exit = false;
- String prefillExp = null;
- String prefillLength = null;
- while (!exit)
- {
- exit = true;
-
- Object elem = DebugUITools.getDebugContext();
-
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(elem);
-
- if (retrieval == null)
- return;
-
- Shell shell= DebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
- // create dialog to ask for expression/address to block
- MonitorMemoryBlockDialog dialog = new MonitorMemoryBlockDialog(shell, retrieval, prefillExp, prefillLength);
- dialog.open();
- int returnCode = dialog.getReturnCode();
- if (returnCode == Window.CANCEL)
- {
- return;
- }
- // get expression entered in dialog
- String input = dialog.getExpression();
-
- // remember expression and length
- prefillExp = input;
- prefillLength = dialog.getLength();
-
- ArrayList expressions = new ArrayList();
-
- if (input.length() == 0)
- {
- expressions.add(IInternalDebugCoreConstants.EMPTY_STRING);
- }
- else
- {
- StringTokenizer tokenizer = new StringTokenizer(input, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens())
- {
- expressions.add(tokenizer.nextToken());
- }
- }
- final String[] expressionsArray = (String[])expressions.toArray(new String[expressions.size()]);
- exit = true;
-
- final boolean finalExit = exit;
- final Object finalElement = elem;
- final IMemoryBlockRetrieval finalRetrieval = retrieval;
- final MonitorMemoryBlockDialog finalDialog = dialog;
- Job job = new Job("Add Memory Block") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- addMemoryBlocks(finalExit, finalElement, finalRetrieval, finalDialog, expressionsArray);
- return Status.OK_STATUS;
- }};
- job.setSystem(true);
- job.schedule();
- }
- }
-
- /**
- * @param exit
- * @param elem
- * @param standardMemRetrieval
- * @param dialog
- * @param expressionsArray
- * @return
- */
- private boolean addMemoryBlocks(boolean exit, Object elem, IMemoryBlockRetrieval standardMemRetrieval, MonitorMemoryBlockDialog dialog, final String[] expressionsArray) {
- for (int i=0; i<expressionsArray.length; i++)
- {
- String expression = expressionsArray[i].trim();
- try {
- if (standardMemRetrieval instanceof IMemoryBlockRetrievalExtension)
- {
- // if the debug session supports IMemoryBlockExtensionRetrieval
- IMemoryBlockRetrievalExtension memRetrieval = (IMemoryBlockRetrievalExtension)standardMemRetrieval;
-
- // get extended memory block with the expression entered
- IMemoryBlockExtension memBlock = memRetrieval.getExtendedMemoryBlock(expression, elem);
-
- // add block to memory block manager
- if (memBlock != null)
- {
- fLastMemoryBlock = memBlock;
-
- IMemoryBlock[] memArray = new IMemoryBlock[]{memBlock};
-
- MemoryViewUtil.getMemoryBlockManager().addMemoryBlocks(memArray);
- if (fAddDefaultRenderings)
- addDefaultRenderings(memBlock);
- }
- else
- {
- // open error if it failed to retrieve a memory block
- MemoryViewUtil.openError(DebugUIMessages.AddMemoryBlockAction_title, DebugUIMessages.AddMemoryBlockAction_noMemoryBlock, null);
- exit = false;
- }
- }
- else
- {
- // if the debug session does not support IMemoryBlockExtensionRetrieval
- expression = expression.toUpperCase();
- String hexPrefix = "0X"; //$NON-NLS-1$
- if (expression.startsWith(hexPrefix))
- {
- expression = expression.substring(hexPrefix.length());
- }
-
- // convert the expression to an address
- BigInteger address = new BigInteger(expression, 16);
-
- long longAddress = address.longValue();
-
- // get the length of memory to block
- String strLength = dialog.getLength();
-
- long length = Long.parseLong(strLength);
-
- // must monitor at least one line
- if (length <= 0)
- {
- String message = DebugUIMessages.AddMemoryBlockAction_failed + "\n" + DebugUIMessages.AddMemoryBlockAction_input_invalid; //$NON-NLS-1$
- MemoryViewUtil.openError(DebugUIMessages.AddMemoryBlockAction_title, message, null);
- exit = false;
- continue;
- }
-
- // get standard memory block
- IMemoryBlock memBlock = standardMemRetrieval.getMemoryBlock(longAddress, length);
-
- // make sure the memory block returned is not an instance of IMemoryBlockExtension
- if (memBlock instanceof IMemoryBlockExtension)
- {
- Status status = new Status(IStatus.WARNING, DebugUIPlugin.getUniqueIdentifier(), 0,
- "IMemoryBlockRetrieval returns IMemoryBlockExtension. This may result in unexpected behavior.", null); //$NON-NLS-1$
- DebugUIPlugin.log(status);
- }
-
- if (memBlock != null)
- {
- // add memory block to memory block manager
- fLastMemoryBlock = memBlock;
- IMemoryBlock[] memArray = new IMemoryBlock[]{memBlock};
-
- MemoryViewUtil.getMemoryBlockManager().addMemoryBlocks(memArray);
- if (fAddDefaultRenderings)
- addDefaultRenderings(memBlock);
- }
- else
- {
- // otherwise open up an error doalog
- MemoryViewUtil.openError(DebugUIMessages.AddMemoryBlockAction_title, DebugUIMessages.AddMemoryBlockAction_noMemoryBlock, null);
- exit = false;
- }
- }
- } catch (DebugException e1) {
- MemoryViewUtil.openError(DebugUIMessages.AddMemoryBlockAction_title, DebugUIMessages.AddMemoryBlockAction_failed, e1);
- exit = false;
- }
- catch(NumberFormatException e2)
- {
- String message = DebugUIMessages.AddMemoryBlockAction_failed + "\n" + DebugUIMessages.AddMemoryBlockAction_input_invalid; //$NON-NLS-1$
- MemoryViewUtil.openError(DebugUIMessages.AddMemoryBlockAction_title, message, null);
- exit = false;
- }
- }
- return exit;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
- */
- public void handleDebugEvents(DebugEvent[] events) {
- for (int i=0; i < events.length; i++)
- handleDebugEvent(events[i]);
- }
-
- private void handleDebugEvent(DebugEvent event)
- {
- // update action enablement based on debug event
- Object src = event.getSource();
- IDebugTarget srcDT = null;
- IDebugTarget selectionDT = null;
-
- if (event.getKind() == DebugEvent.TERMINATE)
- {
- if (src instanceof ITerminate && src instanceof IDebugElement)
- {
- srcDT = ((IDebugElement)src).getDebugTarget();
- }
-
- if (fCurrentContext instanceof IDebugElement)
- {
- selectionDT = ((IDebugElement)fCurrentContext).getDebugTarget();
- }
-
- // disable action if the debug target is terminated.
- if (srcDT == selectionDT)
- {
- setEnabled(false);
- }
- }
- // handle change event from memory block retrieval object
- // to allow non-standard debug models to update the action
- else if (event.getKind() == DebugEvent.CHANGE && event.getDetail() == DebugEvent.STATE)
- {
- Object evtSrc = event.getSource();
- if (evtSrc == MemoryViewUtil.getMemoryBlockRetrieval(fCurrentContext))
- updateAction(fCurrentContext);
- }
- }
-
- /**
- * Return the last memory block added to memory block manager via this action.
- * @return Returns the fLastMemoryBlock.
- */
- public IMemoryBlock getLastMemoryBlock() {
- return fLastMemoryBlock;
- }
-
- protected void dispose() {
-
- // remove listeners
- DebugPlugin.getDefault().removeDebugEventListener(this);
- DebugUITools.getDebugContextManager().getContextService(fSite.getSite().getWorkbenchWindow()).removeDebugContextListener(this);
- }
-
- private void addDefaultRenderings(IMemoryBlock memoryBlock)
- {
- IMemoryRenderingType primaryType = DebugUITools.getMemoryRenderingManager().getPrimaryRenderingType(memoryBlock);
- IMemoryRenderingType renderingTypes[] = DebugUITools.getMemoryRenderingManager().getDefaultRenderingTypes(memoryBlock);
-
- // create primary rendering
- try {
- if (primaryType != null)
- {
- createRenderingInContainer(memoryBlock, primaryType, IDebugUIConstants.ID_RENDERING_VIEW_PANE_1);
- }
- else if (renderingTypes.length > 0)
- {
- primaryType = renderingTypes[0];
- createRenderingInContainer(memoryBlock, renderingTypes[0], IDebugUIConstants.ID_RENDERING_VIEW_PANE_1);
- }
- } catch (CoreException e1) {
- DebugUIPlugin.log(e1);
- }
-
- for (int i = 0; i<renderingTypes.length; i++)
- {
- try {
- boolean create = true;
- if (primaryType != null)
- {
- if (primaryType.getId().equals(renderingTypes[i].getId()))
- create = false;
- }
- if (create)
- createRenderingInContainer(memoryBlock, renderingTypes[i], IDebugUIConstants.ID_RENDERING_VIEW_PANE_2);
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- }
-
- /**
- * @param memoryBlock
- * @param primaryType
- * @throws CoreException
- */
- private void createRenderingInContainer(IMemoryBlock memoryBlock, IMemoryRenderingType primaryType, String paneId) throws CoreException {
- IMemoryRendering rendering = primaryType.createRendering();
- IMemoryRenderingContainer container = fSite.getContainer(paneId);
- rendering.init(container, memoryBlock);
- container.addMemoryRendering(rendering);
- }
-
- protected MemoryView getMemoryView()
- {
- if (fSite instanceof MemoryView)
- return (MemoryView)fSite;
- return null;
- }
-
- protected void updateAction(final Object debugContext)
- {
- Job job = new Job("Update Add Memory Block Action") { //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- setEnabled(MemoryViewUtil.isValidContext(debugContext));
- return Status.OK_STATUS;
- }};
- job.setSystem(true);
- job.schedule();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener#contextEvent(org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent)
- */
- public void debugContextChanged(DebugContextEvent event) {
- if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
- IAdaptable context = DebugUITools.getDebugContext();
- updateAction(context);
- fCurrentContext = context;
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingAction.java
deleted file mode 100644
index ab9fe9825..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingAction.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * WindRiver - Bug 192028 [Memory View] Memory view does not
- * display memory blocks that do not reference IDebugTarget
- * Ted Williams - WindRiver - Bug 215432 - [Memory View] Memory View: Workflow Enhancements
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Toolbar "Add Memory Rendering Action" from Memory Rendering Pane
- */
-public class AddMemoryRenderingAction extends AddMemoryBlockAction {
-
- private IMemoryRenderingContainer fContainer;
-
- public AddMemoryRenderingAction(IMemoryRenderingContainer container)
- {
- super(DebugUIMessages.AddMemoryRenderingAction_Add_renderings, AS_PUSH_BUTTON, container.getMemoryRenderingSite());
- setToolTipText(DebugUIMessages.AddMemoryRenderingAction_Add_renderings);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, DebugUIPlugin.getUniqueIdentifier() + ".AddRenderingContextAction_context"); //$NON-NLS-1$
- fContainer = container;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- if (fContainer instanceof RenderingViewPane)
- ((RenderingViewPane) fContainer).showCreateRenderingTab();
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingContextAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingContextAction.java
deleted file mode 100644
index 77393eb3f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingContextAction.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
-import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
-
-public class AddMemoryRenderingContextAction implements IViewActionDelegate {
-
- private IMemoryRenderingSite fMemoryView;
-
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
-
- if (view instanceof IMemoryRenderingSite)
- {
- fMemoryView = (IMemoryRenderingSite)view;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
-
- if (fMemoryView == null)
- return;
-
- IMemoryRenderingContainer container = getRenderingContainer(action);
- if (container != null)
- {
- AddMemoryRenderingAction addAction = new AddMemoryRenderingAction(container);
- addAction.run();
- addAction.dispose();
- }
- }
-
- /**
- * @param action
- * @return
- */
- private IMemoryRenderingContainer getRenderingContainer(IAction action) {
- IMemoryRenderingContainer[] viewPanes = fMemoryView.getMemoryRenderingContainers();
- String actionId = action.getId();
- IMemoryRenderingContainer selectedPane = null;
-
- for (int i=0; i<viewPanes.length; i++)
- {
- if (actionId.indexOf(viewPanes[i].getId()) != -1)
- {
- selectedPane = viewPanes[i];
- break;
- }
- }
-
- return selectedPane;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- IMemoryRenderingContainer container = getRenderingContainer(action);
- if (container instanceof RenderingViewPane)
- {
- if (!((RenderingViewPane)container).canAddRendering())
- action.setEnabled(false);
- else
- action.setEnabled(true);
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java
deleted file mode 100644
index 3eef011ab..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java
+++ /dev/null
@@ -1,586 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * WindRiver - Bug 192028 [Memory View] Memory view does not
- * display memory blocks that do not reference IDebugTarget
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IMemoryBlockListener;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingBindingsListener;
-import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
-import org.eclipse.debug.ui.memory.IMemoryRenderingType;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.progress.UIJob;
-import org.eclipse.ui.progress.WorkbenchJob;
-
-/**
- * Dialog allowing user to add a memory rendering
- */
-public class AddMemoryRenderingDialog extends SelectionDialog {
-
- private IMemoryBlock[] fMemoryBlocks;
- private Combo memoryBlock;
- private ListViewer fViewer;
- private IMemoryBlock fSelectedMemoryBlock;
- private Button addNew;
-
- private ISelectionChangedListener fSelectionChangedListener;
- private SelectionListener fSelectionListener;
- private SelectionAdapter fAddNewSelectionAdapter;
- private IMemoryRenderingSite fSite;
-
- private IMemoryBlockListener fMemoryBlockListener = new IMemoryBlockListener(){
-
- public void memoryBlocksAdded(final IMemoryBlock[] memory)
- {
- if (memory.length > 0)
- {
- IMemoryBlock currentBlock = getMemoryBlockToSelect(memory[0]);
- if (currentBlock == null)
- {
- addNew();
- }
- else
- {
- populateDialog(currentBlock);
- }
- }
- }
- public void memoryBlocksRemoved(IMemoryBlock[] memory)
- {
- }
- };
-
- private IMemoryRenderingBindingsListener fBindingListener = new IMemoryRenderingBindingsListener()
- {
- public void memoryRenderingBindingsChanged() {
- UIJob job = new UIJob("refresh"){ //$NON-NLS-1$
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- fViewer.refresh();
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
-
- };
-
- class MemoryRenderingLabelProvider implements ILabelProvider
- {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- public Image getImage(Object element) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object element) {
- if (element instanceof IMemoryRenderingType)
- {
- String label = ((IMemoryRenderingType)element).getLabel();
- return label;
- }
- return element.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- */
- public void dispose() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener) {
- }
-
- }
-
- class MemoryRenderingContentProvider implements IStructuredContentProvider
- {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object inputElement) {
- IMemoryRenderingType[] renderings = DebugUITools.getMemoryRenderingManager().getRenderingTypes((IMemoryBlock)inputElement);
- return renderings;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#close()
- */
- public boolean close() {
-
- fViewer.removeSelectionChangedListener(fSelectionChangedListener);
- memoryBlock.removeSelectionListener(fSelectionListener);
- addNew.removeSelectionListener(fAddNewSelectionAdapter);
- DebugPlugin.getDefault().getMemoryBlockManager().removeListener(fMemoryBlockListener);
- DebugUITools.getMemoryRenderingManager().removeListener(fBindingListener);
-
- return super.close();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
- */
- protected void createButtonsForButtonBar(Composite parent) {
- super.createButtonsForButtonBar(parent);
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.dialogs.SelectionDialog#getResult()
- */
- public Object[] getResult() {
-
- Object[] results = super.getResult();
-
- if (results != null)
- {
- Object[] renderings = ((IStructuredSelection)results[0]).toArray();
- return renderings;
- }
- return new Object[0];
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#cancelPressed()
- */
- protected void cancelPressed() {
-
- setResult(null);
-
- super.cancelPressed();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
-
- ISelection select = fViewer.getSelection();
- setSelectionResult(new Object[]{select});
-
- super.okPressed();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, DebugUIPlugin.getUniqueIdentifier() + ".AddMemoryRenderingDialog_context"); //$NON-NLS-1$
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout compositeLayout = new GridLayout();
- compositeLayout.numColumns = 3;
- compositeLayout.makeColumnsEqualWidth = true;
- composite.setLayout(compositeLayout);
-
- GridData comositeSpec= new GridData();
- comositeSpec.grabExcessVerticalSpace= true;
- comositeSpec.grabExcessHorizontalSpace= true;
- comositeSpec.horizontalAlignment= GridData.FILL;
- comositeSpec.verticalAlignment= GridData.CENTER;
- composite.setLayoutData(comositeSpec);
-
- Label textLabel = new Label(composite, SWT.NONE);
- textLabel.setText(DebugUIMessages.AddMemoryRenderingDialog_Memory_Monitor);
- GridData textLayout = new GridData();
- textLayout.verticalAlignment=GridData.CENTER;
- textLayout.horizontalAlignment=GridData.BEGINNING;
- textLabel.setLayoutData(textLayout);
-
- memoryBlock = new Combo(composite, SWT.BORDER | SWT.READ_ONLY);
- GridData spec= new GridData(GridData.FILL_HORIZONTAL);
- spec.grabExcessVerticalSpace= false;
- spec.grabExcessHorizontalSpace= false;
- spec.horizontalAlignment= GridData.FILL;
- spec.verticalAlignment= GridData.FILL;
- spec.horizontalSpan = 4;
- memoryBlock.setLayoutData(spec);
-
- Label filler = new Label(composite, SWT.NONE);
- filler.setText(" "); //$NON-NLS-1$
- GridData fillerData = new GridData(GridData.FILL_HORIZONTAL);
- fillerData.horizontalSpan = 2;
- filler.setLayoutData(fillerData);
-
- addNew = new Button(composite, SWT.NONE);
- addNew.setText(DebugUIMessages.AddMemoryRenderingDialog_Add_New);
- GridData specButton= new GridData();
- specButton.horizontalAlignment= GridData.END;
- specButton.verticalAlignment= GridData.CENTER;
- addNew.setLayoutData(specButton);
-
- fAddNewSelectionAdapter = new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent e) {
- RetargetAddMemoryBlockAction action = new RetargetAddMemoryBlockAction(fSite, false);
- action.run();
- action.dispose();
- }};
-
- addNew.addSelectionListener(fAddNewSelectionAdapter);
-
- fSelectionListener = new SelectionListener(){
-
- public void widgetSelected(SelectionEvent e) {
-
- int idx = memoryBlock.getSelectionIndex();
-
- // avoid null pointer exception
- if (fMemoryBlocks == null)
- return;
-
- fSelectedMemoryBlock = fMemoryBlocks[idx];
-
- fViewer.setInput(fSelectedMemoryBlock);
-
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }};
-
- memoryBlock.addSelectionListener(fSelectionListener);
-
- Label renderingLabel = new Label(composite, SWT.NONE);
- renderingLabel.setText(DebugUIMessages.AddMemoryRenderingDialog_Memory_renderings);
- GridData renderingLayout = new GridData();
- renderingLayout.horizontalAlignment = GridData.BEGINNING;
- renderingLayout.verticalAlignment = GridData.CENTER;
- renderingLayout.horizontalSpan = 3;
- renderingLabel.setLayoutData(renderingLayout);
-
- fViewer = new ListViewer(composite);
- fViewer.setContentProvider(new MemoryRenderingContentProvider());
- fViewer.setLabelProvider(new MemoryRenderingLabelProvider());
-
- GridData listLayout = new GridData(GridData.FILL_BOTH);
- listLayout.horizontalSpan = 3;
- listLayout.heightHint =140;
- fViewer.getControl().setLayoutData(listLayout);
-
- fViewer.addDoubleClickListener(new IDoubleClickListener (){
-
- public void doubleClick(DoubleClickEvent event) {
- okPressed();
- }});
-
- IMemoryBlock currentBlock = getMemoryBlockToSelect(null);
- if (currentBlock == null)
- {
- addNew();
- }
- else
- {
- populateDialog(currentBlock);
- }
-
-
- fSelectionChangedListener = new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = fViewer.getSelection();
-
- if (selection.isEmpty())
- {
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- }
- else
- {
- getButton(IDialogConstants.OK_ID).setEnabled(true);
- }
- }};
-
- fViewer.addSelectionChangedListener(fSelectionChangedListener);
-
- DebugPlugin.getDefault().getMemoryBlockManager().addListener(fMemoryBlockListener);
- DebugUITools.getMemoryRenderingManager().addListener(fBindingListener);
-
- return composite;
- }
-
- public AddMemoryRenderingDialog(Shell parent, IMemoryRenderingSite site) {
- super(parent);
- super.setTitle(DebugUIMessages.AddMemoryRenderingDialog_Add_memory_rendering);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- fSite = site;
- }
-
-
- private void doPopulateDialog(Combo combo, ListViewer viewer, String[] labels, int selectionIdx, IMemoryBlock currentBlock)
- {
- // clean up
- combo.removeAll();
-
- for (int i=0; i<labels.length; i++)
- {
- combo.add(labels[i]);
- }
-
- combo.select(selectionIdx);
- fSelectedMemoryBlock = currentBlock;
-
- viewer.setInput(currentBlock);
- }
-
- private IMemoryBlock getMemoryBlockToSelect(IMemoryBlock lastAdded)
- {
- IMemoryBlock currentBlock = null;
-
- if (lastAdded != null)
- currentBlock = lastAdded;
- else
- {
- // take Memory View's selection if possible
- ISelectionProvider selectionProvider = fSite.getSite().getSelectionProvider();
- ISelection selection = null;
-
- if (selectionProvider != null)
- selection = selectionProvider.getSelection();
- else // otherwise, take selection from selection service
- selection = DebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection(IDebugUIConstants.ID_MEMORY_VIEW);
-
- IMemoryBlock element = getMemoryBlock(selection);
-
- if (element == null)
- {
- IAdaptable context = DebugUITools.getDebugContext();
-
- if (context != null)
- {
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
-
- if (retrieval == null)
- return currentBlock;
-
- IMemoryBlock[] blocks = new IMemoryBlock[0];
-
- if (retrieval != null)
- blocks = MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieval);
-
- if (blocks.length > 0)
- currentBlock = blocks[0];
- }
- }
- else
- {
- currentBlock = element;
- }
- }
- return currentBlock;
- }
-
- private String[] getLabels(IMemoryBlock[] memoryBlocks)
- {
- String[] labels = new String[memoryBlocks.length];
- for (int i=0; i<memoryBlocks.length; i++)
- {
- String text = IInternalDebugCoreConstants.EMPTY_STRING;
- if (memoryBlocks[i] instanceof IMemoryBlockExtension)
- {
- try {
- text = ((IMemoryBlockExtension)memoryBlocks[i]).getExpression();
-
- if (text == null)
- text = DebugUIMessages.AddMemoryRenderingDialog_Unknown;
-
- if (((IMemoryBlockExtension)memoryBlocks[i]).getBigBaseAddress() != null)
- {
- text += " : 0x"; //$NON-NLS-1$
- text += ((IMemoryBlockExtension)memoryBlocks[i]).getBigBaseAddress().toString(16);
- }
- } catch (DebugException e) {
- long address = memoryBlocks[i].getStartAddress();
- text = Long.toHexString(address);
- }
- }
- else
- {
- long address = memoryBlocks[i].getStartAddress();
- text = Long.toHexString(address);
- }
-
- // ask decorator to decorate to ensure consistent label
- ILabelDecorator decorator = (ILabelDecorator)fMemoryBlocks[i].getAdapter(ILabelDecorator.class);
- if (decorator != null)
- text = decorator.decorateText(text, fMemoryBlocks[i]);
-
- labels[i] = text;
- }
- return labels;
- }
-
- private IMemoryBlock getMemoryBlock(ISelection selection)
- {
- if (!(selection instanceof IStructuredSelection))
- return null;
-
- //only single selection of debug element is allowed for this action
- if (selection.isEmpty() || ((IStructuredSelection)selection).size() > 1)
- {
- return null;
- }
-
- Object elem = ((IStructuredSelection)selection).getFirstElement();
-
- if (elem instanceof IMemoryBlock)
- return (IMemoryBlock)elem;
- else if (elem instanceof IMemoryRendering)
- return ((IMemoryRendering)elem).getMemoryBlock();
- else
- return null;
- }
-
- public IMemoryBlock getMemoryBlock()
- {
- return fSelectedMemoryBlock;
- }
-
- /**
- * @param currentBlock
- */
- private void populateDialog(IMemoryBlock currentBlock) {
- final IMemoryBlock selectMB = currentBlock;
- Job job = new Job("Populate dialog") //$NON-NLS-1$
- {
- protected IStatus run(IProgressMonitor monitor) {
- IMemoryBlockRetrieval mbRetrieval = MemoryViewUtil.getMemoryBlockRetrieval(selectMB);
-
- if (mbRetrieval != null)
- {
- fMemoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(mbRetrieval);
- int selectionIdx = 0;
- for (int i=0; i<fMemoryBlocks.length; i++)
- {
- if (fMemoryBlocks[i] == selectMB)
- {
- selectionIdx = i;
- break;
- }
- }
-
- final String[] labels = getLabels(fMemoryBlocks);
- final int idx = selectionIdx;
- final IMemoryBlock selectedBlk = selectMB;
- WorkbenchJob wbJob = new WorkbenchJob("populate dialog"){ //$NON-NLS-1$
-
- public IStatus runInUIThread(IProgressMonitor wbMonitor) {
- doPopulateDialog(memoryBlock, fViewer, labels, idx, selectedBlk);
- return Status.OK_STATUS;
- }};
- wbJob.setSystem(true);
- wbJob.schedule();
- }
- else
- {
- DebugUIPlugin.logErrorMessage("Unable to obtain memory block retrieval."); //$NON-NLS-1$
- }
- return Status.OK_STATUS;
- }};
- job.setSystem(true);
- job.schedule();
- }
-
- /**
- *
- */
- private void addNew() {
- WorkbenchJob job = new WorkbenchJob("populate dialog"){ //$NON-NLS-1$
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- memoryBlock.add(DebugUIMessages.AddMemoryRenderingDialog_Add_New);
- memoryBlock.select(0);
- return Status.OK_STATUS;
- }};
- job.setSystem(true);
- job.schedule();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/CodePagesPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/CodePagesPreferencePage.java
deleted file mode 100644
index 0e9a10395..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/CodePagesPreferencePage.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.StringFieldEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-public class CodePagesPreferencePage extends FieldEditorPreferencePage {
-
- private StringFieldEditor fEbcdicCodePage;
- private StringFieldEditor fAsciiCodePage;
-
- protected CodePagesPreferencePage() {
- super(FieldEditorPreferencePage.GRID);
- setPreferenceStore(DebugUITools.getPreferenceStore());
- setTitle(DebugUIMessages.CodePagesPrefDialog_1);
- }
-
- protected void createFieldEditors() {
- fAsciiCodePage = new StringFieldEditor(IDebugUIConstants.PREF_DEFAULT_ASCII_CODE_PAGE, DebugUIMessages.CodePagesPrefDialog_2, getFieldEditorParent());
- fAsciiCodePage.setEmptyStringAllowed(false);
- addField(fAsciiCodePage);
-
- fEbcdicCodePage = new StringFieldEditor(IDebugUIConstants.PREF_DEFAULT_EBCDIC_CODE_PAGE, DebugUIMessages.CodePagesPrefDialog_4, getFieldEditorParent());
- fEbcdicCodePage.setEmptyStringAllowed(false);
- addField(fEbcdicCodePage);
- }
-
- public boolean performOk() {
-
- if (fAsciiCodePage == null || fEbcdicCodePage == null)
- return super.performOk();
-
- // check that the codepages are supported
- String asciiCodePage = fAsciiCodePage.getStringValue();
- asciiCodePage = asciiCodePage.trim();
- try {
- new String(new byte[]{1}, asciiCodePage);
- } catch (UnsupportedEncodingException e) {
- Shell shell = DebugUIPlugin.getShell();
- if (shell != null)
- {
- IStatus status = DebugUIPlugin.newErrorStatus(DebugUIMessages.CodePagesPrefDialog_0, e);
- ErrorDialog.openError(shell, DebugUIMessages.CodePagesPrefDialog_6, DebugUIMessages.CodePagesPrefDialog_7, status); //
- }
- return false;
- }
-
- String ebcdicCodePage = fEbcdicCodePage.getStringValue();
- ebcdicCodePage = ebcdicCodePage.trim();
- try {
- new String(new byte[]{1}, ebcdicCodePage);
- } catch (UnsupportedEncodingException e) {
- Shell shell = DebugUIPlugin.getShell();
- if (shell != null)
- {
- IStatus status = DebugUIPlugin.newErrorStatus(DebugUIMessages.CodePagesPrefDialog_0, e);
- ErrorDialog.openError(shell, DebugUIMessages.CodePagesPrefDialog_8, DebugUIMessages.CodePagesPrefDialog_9, status); //
- }
- return false;
- }
- return super.performOk();
- }
-
- protected Control createContents(Composite parent) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, DebugUIPlugin.getUniqueIdentifier() + ".CodePagesPrefDialog_context"); //$NON-NLS-1$
- return super.createContents(parent);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryView.java
deleted file mode 100644
index aa0ae6580..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryView.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-
-/**
- * Functions to allow user to control the Memory View or the Memory Rendering View
- *
- * @since 3.0
- */
-public interface IMemoryView
-{
- /**
- * @return the top view tab from the Memory View
- */
- public IMemoryViewTab getTopMemoryTab( );
-
- /**
- * @return all view tabs from current tab folder
- */
- public IMemoryViewTab[] getAllViewTabs();
-
- /**
- * Move specified view tab to the top
- * @param viewTab
- */
- public void moveToTop(IMemoryViewTab viewTab);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewPane.java
deleted file mode 100644
index e7329f13d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewPane.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-
-/**
- * Represent a view pane in the memory view.
- *
- * This is an internal interface for mananging the view panes within the Memory View
- * @since 3.1
- */
-public interface IMemoryViewPane {
-
- /**
- * Create the view pane with the given parent composite, and pane
- * id.
- * @param parent
- * @param paneId
- * @param label
- * @return the control of the view pane
- */
- public Control createViewPane(Composite parent, String paneId, String label);
-
- /**
- * Restore view pane based on current selection from the debug view.
- * Create memory blocks or renderings that currently exist in the debug
- * session.
- */
- public void restoreViewPane();
-
- /**
- * Dispose the view pane
- */
- public void dispose();
-
- /**
- * @return unique identifier of the view pane
- */
- public String getId();
-
- /**
- * @return array of actions to be contributed to the view pane's
- * acition bar.
- */
- public IAction[] getActions();
-
- /**
- * Add the given selection listener to the view pane. The selection
- * listener gets notified when the selection from the view pane
- * has changed.
- * @param listener
- */
- public void addSelectionListener(ISelectionChangedListener listener);
-
- /**
- * Remove the selection listener from the view pane. The listener
- * will no longer get notified when selection is changed.
- * @param listener
- */
- public void removeSelctionListener(ISelectionChangedListener listener);
-
- /**
- * @return the selection provider of the view pane
- */
- public ISelectionProvider getSelectionProvider();
-
- /**
- * @return the control for ths memory view pane
- */
- public Control getControl();
-
- /**
- * Called when the view pane becomes visible or hidden
- * @param visible visibility state of teh view pane
- */
- public void setVisible(boolean visible);
-
- /**
- * @return if the view pane is currently visible
- */
- public boolean isVisible();
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewTab.java
deleted file mode 100644
index c9dab6a24..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewTab.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-
-
-/**
- * Represent a view tab in the Memory View or Memory Rendering View
- *
- * Refer to AbstractMemoryViewTab.
- * This is an internal interface. This class is not intended to be implemented by clients.
- *
- * @since 3.0
- */
-public interface IMemoryViewTab
-{
- /**
- * Remove the view tab.
- */
- public void dispose();
-
- /**
- * @return if the view tab is disposed
- */
- public boolean isDisposed();
-
- /**
- * @return enablement state of the view tab.
- */
- public boolean isEnabled();
-
-
- /**
- * Sets the enablament state of the view tab.
- * @param enabled
- */
- public void setEnabled(boolean enabled);
-
- /**
- * Set view tab's label
- * @param label
- */
- public void setTabLabel(String label);
-
- /**
- * @return view tab's label, null if the label is not available
- */
- public String getTabLabel();
-
- /**
- * @return the rendering of this view tab
- */
- public IMemoryRendering getRendering();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/LinkRenderingPanesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/LinkRenderingPanesAction.java
deleted file mode 100644
index 767f3c588..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/LinkRenderingPanesAction.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
-import org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
-/**
- * Action to link/unlink rendering view panes
- */
-public class LinkRenderingPanesAction implements IViewActionDelegate{
-
- IMemoryRenderingSite fRenderingSite;
- private MemoryViewSynchronizationService fMemSyncService;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
-
- if (view instanceof IMemoryRenderingSite)
- {
- fRenderingSite = (IMemoryRenderingSite)view;
-
- IMemoryRenderingSynchronizationService syncService = fRenderingSite.getSynchronizationService();
-
- if (syncService instanceof MemoryViewSynchronizationService)
- fMemSyncService = (MemoryViewSynchronizationService)syncService;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
-
- if (fMemSyncService == null)
- return;
-
- fMemSyncService.setEnabled(!fMemSyncService.isEnabled());
- updateActionState(action);
- }
-
- /**
- * @param action
- */
- private void updateActionState(IAction action) {
-
- if (fMemSyncService == null)
- return;
-
- if (fMemSyncService.isEnabled())
- action.setChecked(true);
- else
- action.setChecked(false);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- updateActionState(action);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java
deleted file mode 100644
index 4862fdeb2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java
+++ /dev/null
@@ -1,570 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * WindRiver - Bug 192028 [Memory View] Memory view does not
- * display memory blocks that do not reference IDebugTarget
-
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.IMemoryBlockListener;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.memory.provisional.MemoryViewPresentationContext;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
-import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.MessageDialog;
-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.StructuredViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.UIJob;
-
-
-/**
- * Tree viewer for memory blocks
- */
-public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionChangedListener, IMemoryViewPane, IMemoryRenderingContainer{
-
- public static final String PANE_ID = DebugUIPlugin.getUniqueIdentifier() + ".MemoryView.MemoryBlocksTreeViewPane"; //$NON-NLS-1$
-
- private IViewPart fParent;
- private MemoryViewTreeViewer fTreeViewer;
- protected IMemoryBlockRetrieval fRetrieval;
- private ViewPaneSelectionProvider fSelectionProvider;
- private AddMemoryBlockAction fAddMemoryBlockAction;
- private IAction fRemoveMemoryBlockAction;
- private IAction fRemoveAllMemoryBlocksAction;
- private String fPaneId;
- private boolean fVisible = true;
- private TreeViewPaneContextListener fDebugContextListener;
- private ViewPaneEventHandler fEvtHandler;
- private String fLabel;
-
- class TreeViewerRemoveMemoryBlocksAction extends Action
- {
- TreeViewerRemoveMemoryBlocksAction()
- {
- super();
- setText(DebugUIMessages.RemoveMemoryBlockAction_title);
-
- setToolTipText(DebugUIMessages.RemoveMemoryBlockAction_tooltip);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_REMOVE_MEMORY));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_REMOVE_MEMORY));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_REMOVE_MEMORY));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".RemoveMemoryBlockAction_context"); //$NON-NLS-1$
- setEnabled(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- ISelection selected = fTreeViewer.getSelection();
-
- if (selected != null && selected instanceof IStructuredSelection)
- {
- Object[] selectedMemBlks = ((IStructuredSelection)selected).toArray();
- ArrayList memoryBlocks = new ArrayList();
- for (int i=0; i<selectedMemBlks.length; i++)
- {
- if (selectedMemBlks[i] instanceof IMemoryBlock)
- memoryBlocks.add(selectedMemBlks[i]);
- }
-
- DebugPlugin.getDefault().getMemoryBlockManager().removeMemoryBlocks((IMemoryBlock[])memoryBlocks.toArray(new IMemoryBlock[memoryBlocks.size()]));
- }
- }
- }
-
- class TreeViewerRemoveAllMemoryBlocksAction extends Action
- {
- TreeViewerRemoveAllMemoryBlocksAction()
- {
- super();
- setText(DebugUIMessages.MemoryBlocksTreeViewPane_2);
-
- setToolTipText(DebugUIMessages.MemoryBlocksTreeViewPane_2);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_REMOVE_ALL));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_REMOVE_ALL));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_REMOVE_ALL));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".RemoveAllMemoryBlocksAction_context"); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
-
- IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
- if (window == null) {
- return;
- }
- boolean proceed = MessageDialog.openQuestion(window.getShell(), DebugUIMessages.MemoryBlocksTreeViewPane_0, DebugUIMessages.MemoryBlocksTreeViewPane_1); //
- if (proceed) {
- IMemoryBlock[] memoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(fRetrieval);
- DebugPlugin.getDefault().getMemoryBlockManager().removeMemoryBlocks(memoryBlocks);
- }
- }
- }
-
- class ViewPaneEventHandler implements IMemoryBlockListener, IDebugEventSetListener
- {
- private boolean fDisposed = false;
-
- public ViewPaneEventHandler()
- {
- DebugPlugin.getDefault().getMemoryBlockManager().addListener(this);
- DebugPlugin.getDefault().addDebugEventListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
- fDisposed = true;
- DebugPlugin.getDefault().getMemoryBlockManager().removeListener(this);
- DebugPlugin.getDefault().removeDebugEventListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.memory.IMemoryBlockListener#MemoryBlockAdded(org.eclipse.debug.core.model.IMemoryBlock)
- */
- public void memoryBlocksAdded(final IMemoryBlock[] memory) {
- // if the content provider is disposed, do not handle event
- if (fDisposed)
- return;
- updateActionsEnablement();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.memory.IMemoryBlockListener#MemoryBlockRemoved(org.eclipse.debug.core.model.IMemoryBlock)
- */
- public void memoryBlocksRemoved(final IMemoryBlock[] memory) {
- if (fDisposed)
- return;
- updateActionsEnablement();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.BasicDebugViewContentProvider#doHandleDebugEvent(org.eclipse.debug.core.DebugEvent)
- */
- protected void doHandleDebugEvent(DebugEvent event) {
-
- // if the view is disposed, do not handle event
- if (fDisposed)
- return;
-
- if (event.getKind() == DebugEvent.TERMINATE)
- {
- // should only handle the terminate event if the target is terminated
- if (event.getSource() instanceof IDebugTarget)
- {
- IMemoryBlockRetrieval srcRetrieval = MemoryViewUtil.getMemoryBlockRetrieval(event.getSource());
- if (srcRetrieval == fRetrieval)
- {
- // #setInput must be done on the UI thread
- UIJob job = new UIJob("setInput"){ //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
-
- // if viewpane is disposed, do not handle event
- if (fTreeViewer.getContentProvider() == null)
- return Status.OK_STATUS;
-
- fTreeViewer.setInput(null);
- return Status.OK_STATUS;
- }};
-
- job.setSystem(true);
- job.schedule();
- }
- }
- }
- }
-
- public void handleDebugEvents(DebugEvent[] events) {
- for (int i=0; i<events.length; i++)
- {
- doHandleDebugEvent(events[i]);
- }
- }
- }
-
- class TreeViewPaneContextListener implements IDebugContextListener
- {
- public void contextActivated(ISelection selection) {
-
- if (selection.isEmpty() && fRetrieval != null)
- {
- fRetrieval = null;
- if (fTreeViewer != null && fTreeViewer.getContentProvider() != null)
- fTreeViewer.setInput(fRetrieval);
- updateActionsEnablement();
- return;
- }
-
- if (selection instanceof IStructuredSelection)
- {
- Object obj = ((IStructuredSelection)selection).getFirstElement();
- if (obj instanceof IAdaptable)
- {
- IAdaptable context = (IAdaptable)obj;
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
- if (retrieval != null && retrieval != fRetrieval &&
- fTreeViewer != null && fTreeViewer.getContentProvider() != null)
- {
- // set new setting
- fRetrieval = retrieval;
- fTreeViewer.setInput(fRetrieval);
- }
- updateActionsEnablement();
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener#contextEvent(org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent)
- */
- public void debugContextChanged(DebugContextEvent event) {
- if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
- contextActivated(event.getContext());
- }
- }
- }
-
- public MemoryBlocksTreeViewPane(IViewPart parent)
- {
- fParent = parent;
- fSelectionProvider = new ViewPaneSelectionProvider();
- }
-
- public Control createViewPane(Composite parent, String paneId, String label)
- {
- fPaneId = paneId;
- int style = SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.VIRTUAL;
-
- fLabel = label;
-
- IMemoryRenderingSite site = getMemoryRenderingSite();
- MemoryViewPresentationContext presentationContext = new MemoryViewPresentationContext(site, this, null);
- fTreeViewer = new MemoryViewTreeViewer(parent, style, presentationContext);
-
- IAdaptable context = DebugUITools.getDebugContext();
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
- if (retrieval != null)
- fTreeViewer.setInput(retrieval);
-
- fRetrieval = retrieval;
-
- fParent.getViewSite().getSelectionProvider().addSelectionChangedListener(this);
- fParent.getViewSite().getPage().addSelectionListener(this);
-
- fDebugContextListener = new TreeViewPaneContextListener();
- DebugUITools.getDebugContextManager().getContextService(fParent.getSite().getWorkbenchWindow()).addDebugContextListener(fDebugContextListener);
-
- fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection treeSelected = event.getSelection();
- fSelectionProvider.setSelection(treeSelected);
- }});
-
- updateRetrieval();
- fEvtHandler = new ViewPaneEventHandler();
-
- // create context menu
- MenuManager mgr = createContextMenuManager();
- Menu menu = mgr.createContextMenu(fTreeViewer.getControl());
- fTreeViewer.getControl().setMenu(menu);
-
- GridData data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.grabExcessVerticalSpace = true;
- data.horizontalAlignment = SWT.FILL;
- data.verticalAlignment = SWT.FILL;
- fTreeViewer.getControl().setLayoutData(data);
-
- updateActionsEnablement();
-
- return fTreeViewer.getControl();
- }
-
-
- /**
- *
- */
- private void updateRetrieval() {
-
- Object context = DebugUITools.getDebugContext();
- fRetrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
- }
-
- protected MenuManager createContextMenuManager() {
- MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- manager.add(fAddMemoryBlockAction);
- manager.add(fRemoveMemoryBlockAction);
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
- });
-
- // register a context menu manager, use its pane id as the menu id
- fParent.getSite().registerContextMenu(getId(), menuMgr, fSelectionProvider);
- return menuMgr;
- }
-
- public void dispose()
- {
- fParent.getViewSite().getSelectionProvider().removeSelectionChangedListener(this);
- fParent.getViewSite().getPage().removeSelectionListener(this);
- fAddMemoryBlockAction.dispose();
- DebugUITools.getDebugContextManager().getContextService(fParent.getSite().getWorkbenchWindow()).removeDebugContextListener(fDebugContextListener);
- fEvtHandler.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-
-
-
- if (selection instanceof IStructuredSelection)
- {
- Object obj = ((IStructuredSelection)selection).getFirstElement();
-
- if (obj instanceof IMemoryBlock)
- {
- // if the selection event comes from this view
- if (part == fParent)
- {
- // do not change selection if the selection is already correct
- ISelection treeSel = fTreeViewer.getSelection();
- if (treeSel instanceof IStructuredSelection)
- {
- if (((IStructuredSelection)treeSel).getFirstElement() == obj)
- return;
- }
- // remove itself as selection listener when handling selection changed event
- removeSelctionListener(this);
- fTreeViewer.setSelection(selection);
- // remove itself as selection listener when handling selection changed event
- addSelectionListener(this);
- }
- }
- }
-
- }
-
-
-
- public String getId()
- {
- return fPaneId;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#getActions()
- */
- public IAction[] getActions() {
-
- if (fAddMemoryBlockAction == null)
- fAddMemoryBlockAction = new RetargetAddMemoryBlockAction((IMemoryRenderingSite)fParent);
-
- if (fRemoveMemoryBlockAction == null)
- {
- fRemoveMemoryBlockAction = new TreeViewerRemoveMemoryBlocksAction();
- }
-
- if (fRemoveAllMemoryBlocksAction == null)
- {
- fRemoveAllMemoryBlocksAction = new TreeViewerRemoveAllMemoryBlocksAction();
- }
-
- updateActionsEnablement();
-
- return new IAction[]{fAddMemoryBlockAction, fRemoveMemoryBlockAction, fRemoveAllMemoryBlocksAction};
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#addSelectionListener(org.eclipse.jface.viewers.ISelectionChangedListener)
- */
- public void addSelectionListener(ISelectionChangedListener listener)
- {
- if (fSelectionProvider == null)
- fSelectionProvider = new ViewPaneSelectionProvider();
-
- fSelectionProvider.addSelectionChangedListener(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#removeSelctionListener(org.eclipse.jface.viewers.ISelectionChangedListener)
- */
- public void removeSelctionListener(ISelectionChangedListener listener)
- {
- if (fSelectionProvider == null)
- return;
-
- fSelectionProvider.removeSelectionChangedListener(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#getSelectionProvider()
- */
- public ISelectionProvider getSelectionProvider() {
- return fSelectionProvider;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#restoreViewPane()
- */
- public void restoreViewPane() {
- updateRetrieval();
- updateActionsEnablement();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#getControl()
- */
- public Control getControl() {
- return fTreeViewer.getControl();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#setVisible(boolean)
- */
- public void setVisible(boolean visible) {
- if (fVisible != visible)
- {
- fVisible = visible;
-
- if(fVisible)
- {
- fTreeViewer.refresh();
- fTreeViewer.getControl().setFocus();
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#isVisible()
- */
- public boolean isVisible() {
- return fVisible;
- }
-
- private void updateActionsEnablement()
- {
- if (fRemoveMemoryBlockAction == null)
- return;
-
- if (fRemoveAllMemoryBlocksAction == null)
- return;
-
- if (fRetrieval != null)
- {
- IMemoryBlock[] memBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(fRetrieval);
- if(memBlocks.length > 0)
- {
- fRemoveMemoryBlockAction.setEnabled(true);
- fRemoveAllMemoryBlocksAction.setEnabled(true);
- }
- else
- {
- fRemoveMemoryBlockAction.setEnabled(false);
- fRemoveAllMemoryBlocksAction.setEnabled(false);
- }
- }
- else
- {
- fRemoveMemoryBlockAction.setEnabled(false);
- fRemoveAllMemoryBlocksAction.setEnabled(false);
- }
- }
-
- public void selectionChanged(SelectionChangedEvent event) {
- // only handle selection changed from parent's selection provider
- if (event.getSource() == fParent.getSite().getSelectionProvider())
- {
- MemoryBlocksTreeViewPane.this.selectionChanged(fParent, event.getSelection());
- }
- }
-
- public StructuredViewer getViewer()
- {
- return fTreeViewer;
- }
-
- public IMemoryRenderingSite getMemoryRenderingSite() {
- if (fParent instanceof IMemoryRenderingSite)
- return (IMemoryRenderingSite)fParent;
- return null;
- }
-
- public void addMemoryRendering(IMemoryRendering rendering) {
- // do nothing
- }
-
- public void removeMemoryRendering(IMemoryRendering rendering) {
- // do nothing
- }
-
- public IMemoryRendering[] getRenderings() {
- return new IMemoryRendering[0];
- }
-
- public IMemoryRendering getActiveRendering() {
- return null;
- }
-
- public String getLabel() {
- return fLabel;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
deleted file mode 100644
index 5e8333be2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
+++ /dev/null
@@ -1,857 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - Ted Williams - [Memory View] Memory View: Workflow Enhancements (Bug 215432)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.views.variables.VariablesViewMessages;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
-import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
-import org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.action.ToolBarManager;
-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.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.custom.ViewForm;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IPartListener2;
-import org.eclipse.ui.IViewReference;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartReference;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.contexts.IContextService;
-import org.eclipse.ui.handlers.IHandlerService;
-import org.eclipse.ui.part.ViewPart;
-
-/**
- *
- * @since 3.0
- */
-public class MemoryView extends ViewPart implements IMemoryRenderingSite {
-
- protected MemoryViewSelectionProvider fSelectionProvider;
- private MemoryViewPartListener fPartListener;
-
- private SashForm fSashForm;
- private Hashtable fViewPanes = new Hashtable();
- private Hashtable fViewPaneControls = new Hashtable();
- private ArrayList fVisibleViewPanes = new ArrayList();
- private boolean fVisible;
-
- private ArrayList fWeights = new ArrayList();
-
- private static final String VISIBILITY_PREF = IDebugUIConstants.ID_MEMORY_VIEW+".viewPanesVisibility"; //$NON-NLS-1$
- private static final String ID_MEMORY_VIEW_CONTEXT = "org.eclipse.debug.ui.memoryview"; //$NON-NLS-1$
- private static final String ID_ADD_MEMORY_BLOCK_COMMAND = "org.eclipse.debug.ui.commands.addMemoryMonitor"; //$NON-NLS-1$
- private static final String ID_TOGGLE_MEMORY_MONITORS_PANE_COMMAND = "org.eclipse.debug.ui.commands.toggleMemoryMonitorsPane"; //$NON-NLS-1$
- private static final String ID_NEXT_MEMORY_BLOCK_COMMAND = "org.eclipse.debug.ui.commands.nextMemoryBlock"; //$NON-NLS-1$
- private static final String ID_NEW_RENDERING_COMMAND = "org.eclipse.debug.ui.commands.newRendering"; //$NON-NLS-1$
- private static final String ID_CLOSE_RENDERING_COMMAND = "org.eclipse.debug.ui.commands.closeRendering"; //$NON-NLS-1$
-
- public static final String VIEW_PANE_ORIENTATION_PREF = IDebugUIConstants.ID_MEMORY_VIEW+".orientation"; //$NON-NLS-1$
- public static final int HORIZONTAL_VIEW_ORIENTATION = 0;
- public static final int VERTICAL_VIEW_ORIENTATION =1;
-
- private String[] defaultVisiblePaneIds ={MemoryBlocksTreeViewPane.PANE_ID, IDebugUIConstants.ID_RENDERING_VIEW_PANE_1};
-
- private MemoryBlocksTreeViewPane fMemBlkViewer;
-
- private MemoryViewSynchronizationService fSyncService;
-
- private boolean fPinMBDisplay = false; // pin memory block display, on by default
- private static int fViewCnt = 0;
-
- private AbstractHandler fAddHandler;
- private AbstractHandler fToggleMonitorsHandler;
- private AbstractHandler fNextMemoryBlockHandler;
- private AbstractHandler fNewRenderingHandler;
- private AbstractHandler fCloseRenderingHandler;
-
- private ViewPaneOrientationAction[] fOrientationActions;
- private int fViewOrientation = HORIZONTAL_VIEW_ORIENTATION;
-
- private String fActivePaneId;
-
- class MemoryViewSelectionProvider implements ISelectionProvider, ISelectionChangedListener
- {
- ArrayList fListeners = new ArrayList();
-
- IStructuredSelection fSelections = new StructuredSelection();
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
- */
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- if (!fListeners.contains(listener))
- fListeners.add(listener);
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
- */
- public ISelection getSelection()
- {
- return fSelections;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
- */
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- if (fListeners.contains(listener))
- fListeners.remove(listener);
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection)
- */
- public void setSelection(ISelection selection)
- {
- if (selection instanceof IStructuredSelection)
- {
- boolean fireChanged = false;
-
- // only fire change event if the selection has really changed
- if (fSelections.getFirstElement() != ((IStructuredSelection)selection).getFirstElement())
- fireChanged = true;
-
- fSelections = (IStructuredSelection)selection;
-
- if (fireChanged)
- fireChanged();
- }
- }
-
- public void fireChanged()
- {
- SelectionChangedEvent evt = new SelectionChangedEvent(this, getSelection());
- for (int i=0; i<fListeners.size(); i++)
- {
- ((ISelectionChangedListener)fListeners.get(i)).selectionChanged(evt);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection viewPaneSelection = event.getSelection();
-
- if (viewPaneSelection instanceof IStructuredSelection)
- {
- Object selected = ((IStructuredSelection)viewPaneSelection).getFirstElement();
-
- if (selected != null)
- {
- StructuredSelection strucSelection = new StructuredSelection(new Object[]{selected});
- setSelection(strucSelection);
- }
- else
- {
- setSelection(viewPaneSelection);
- }
- }
- }
- }
-
- class MemoryViewPartListener implements IPartListener2
- {
- IMemoryRenderingSite fView = null;
-
- public MemoryViewPartListener(IMemoryRenderingSite view)
- {
- fView = view;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partActivated(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partActivated(IWorkbenchPartReference ref) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partBroughtToTop(IWorkbenchPartReference ref) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partClosed(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partClosed(IWorkbenchPartReference ref) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partDeactivated(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partDeactivated(IWorkbenchPartReference ref) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partHidden(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partHidden(IWorkbenchPartReference ref) {
-
- IWorkbenchPart part = ref.getPart(false);
-
- if (part == fView)
- {
- setVisible(false);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partVisible(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partVisible(IWorkbenchPartReference ref) {
- IWorkbenchPart part = ref.getPart(false);
-
- if (part == fView)
- {
- setVisible(true);
- restoreView();
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partInputChanged(org.eclipse.ui.IWorkbenchPartReference)
- */
- public void partInputChanged(IWorkbenchPartReference ref) {
- }
-
- public void partOpened(IWorkbenchPartReference ref)
- {
- }
- }
-
- public void init(IViewSite site) throws PartInitException {
- super.init(site);
-
- fViewCnt ++;
- String secondaryId = site.getSecondaryId();
- if (secondaryId != null)
- MemoryViewIdRegistry.registerView(secondaryId);
-
- // only do this the first time
- // not sure if there is a bug in the UI... if the view is
- // not a primary view and if it's hidden, the view is not
- // init and created until it becomes visible.
- if (fViewCnt == 1)
- {
- // also try to find other views and register
- if (DebugUIPlugin.getActiveWorkbenchWindow() != null &&
- DebugUIPlugin.getActiveWorkbenchWindow().getActivePage() != null)
- {
- IViewReference references[] = DebugUIPlugin.getActiveWorkbenchWindow().getActivePage().getViewReferences();
- for (int i=0; i<references.length; i++)
- {
- if (references[i].getSecondaryId() != null)
- {
- MemoryViewIdRegistry.registerView(references[i].getSecondaryId());
- }
- }
- }
- }
-
- fSyncService = new MemoryViewSynchronizationService();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
- */
- public void createPartControl(Composite parent) {
- fSashForm = new SashForm(parent, SWT.HORIZONTAL);
-
- fSelectionProvider = new MemoryViewSelectionProvider();
-
- // set up selection provider and listeners
- getSite().setSelectionProvider(fSelectionProvider);
-
- createMemoryBlocksTreeViewPane(fSashForm);
- createRenderingViewPane(IDebugUIConstants.ID_RENDERING_VIEW_PANE_1);
- createRenderingViewPane(IDebugUIConstants.ID_RENDERING_VIEW_PANE_2);
-
- setVisible(true);
-
- // set up weights in sashform
- Integer[] weights = (Integer[])fWeights.toArray(new Integer[fWeights.size()]);
- int[] intWeights = new int[weights.length];
- for (int i=0; i<weights.length; i++)
- {
- intWeights[i] = weights[i].intValue();
- }
- fSashForm.setWeights(intWeights);
- loadViewPanesVisibility();
-
- createOrientationActions();
- loadOrientation();
-
- fPartListener = new MemoryViewPartListener(this);
- getSite().getPage().addPartListener(fPartListener);
- activateHandlers();
- // restore view pane after finishing creating all the view panes
- restoreView();
- }
-
-
- public void activateHandlers() {
- ICommandService commandSupport = (ICommandService)getSite().getService(ICommandService.class);
- IHandlerService handlerService = (IHandlerService)getSite().getService(IHandlerService.class);
- IContextService contextSupport = (IContextService)getSite().getService(IContextService.class);
-
- if (commandSupport != null && handlerService != null && contextSupport != null)
- {
- contextSupport.activateContext(ID_MEMORY_VIEW_CONTEXT);
-
- fAddHandler = new AbstractHandler() {
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IAdaptable context = DebugUITools.getDebugContext();
- if (context != null && MemoryViewUtil.isValidSelection(new StructuredSelection(context)))
- {
- RetargetAddMemoryBlockAction action = new RetargetAddMemoryBlockAction(MemoryView.this);
- action.run();
- action.dispose();
- }
- return null;
- }};
- handlerService.activateHandler(ID_ADD_MEMORY_BLOCK_COMMAND, fAddHandler);
-
- fToggleMonitorsHandler = new AbstractHandler() {
- public Object execute(ExecutionEvent event) throws ExecutionException {
- ToggleMemoryMonitorsAction action = new ToggleMemoryMonitorsAction();
- action.init(MemoryView.this);
- action.run();
- action.dispose();
- return null;
- }
- };
-
- handlerService.activateHandler(ID_TOGGLE_MEMORY_MONITORS_PANE_COMMAND, fToggleMonitorsHandler);
-
- fNextMemoryBlockHandler = new AbstractHandler() {
-
- public Object execute(ExecutionEvent event)
- throws ExecutionException {
- SwitchMemoryBlockAction action = new SwitchMemoryBlockAction();
- action.init(MemoryView.this);
- action.run();
- action.dispose();
- return null;
- }
- };
- handlerService.activateHandler(ID_NEXT_MEMORY_BLOCK_COMMAND, fNextMemoryBlockHandler);
-
- fCloseRenderingHandler = new AbstractHandler() {
-
- public Object execute(ExecutionEvent event)
- throws ExecutionException {
-
- IMemoryRenderingContainer container = getContainer(fActivePaneId);
- if (container != null)
- {
- if (container instanceof RenderingViewPane) {
- if (!((RenderingViewPane) container).canRemoveRendering())
- return null;
- }
- IMemoryRendering activeRendering = container.getActiveRendering();
- if (activeRendering != null)
- {
- container.removeMemoryRendering(activeRendering);
- }
- }
-
- return null;
- }
- };
- handlerService.activateHandler(ID_CLOSE_RENDERING_COMMAND, fCloseRenderingHandler);
-
- fNewRenderingHandler = new AbstractHandler() {
-
- public Object execute(ExecutionEvent event)
- throws ExecutionException {
-
- IMemoryRenderingContainer container = getContainer(fActivePaneId);
-
- if (container != null && container instanceof RenderingViewPane)
- {
- RenderingViewPane pane = (RenderingViewPane)container;
- if (pane.canAddRendering())
- pane.showCreateRenderingTab();
- }
- return null;
- }
- };
- handlerService.activateHandler(ID_NEW_RENDERING_COMMAND, fNewRenderingHandler);
- }
- }
-
- /**
- *
- */
- private void createMemoryBlocksTreeViewPane(Composite parent) {
-
- fMemBlkViewer = new MemoryBlocksTreeViewPane(this);
- fViewPanes.put(MemoryBlocksTreeViewPane.PANE_ID, fMemBlkViewer);
- ViewForm viewerViewForm = new ViewForm(parent, SWT.NONE);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(viewerViewForm, IDebugUIConstants.PLUGIN_ID + ".MemoryView_context"); //$NON-NLS-1$
- fViewPaneControls.put(MemoryBlocksTreeViewPane.PANE_ID, viewerViewForm);
- fWeights.add(new Integer(15));
-
- fMemBlkViewer.addSelectionListener(fSelectionProvider);
-
- Control viewerControl = fMemBlkViewer.createViewPane(viewerViewForm, MemoryBlocksTreeViewPane.PANE_ID, DebugUIMessages.MemoryView_Memory_monitors);
- viewerViewForm.setContent(viewerControl);
-
- ISelection selection = fMemBlkViewer.getSelectionProvider().getSelection();
- if (selection != null)
- fSelectionProvider.setSelection(selection);
-
- ToolBarManager viewerToolBarMgr = new ToolBarManager(SWT.FLAT);
- IAction[] actions = fMemBlkViewer.getActions();
- for (int i=0; i<actions.length; i++)
- {
- viewerToolBarMgr.add(actions[i]);
- }
- ToolBar viewerToolbar = viewerToolBarMgr.createControl(viewerViewForm);
- viewerViewForm.setTopRight(viewerToolbar);
-
- Label viewerLabel = new Label(viewerViewForm, SWT.WRAP);
- viewerLabel.setText(DebugUIMessages.MemoryView_Memory_monitors);
- viewerViewForm.setTopLeft(viewerLabel);
-
- fMemBlkViewer.getControl().addFocusListener(new FocusAdapter() {
- public void focusGained(FocusEvent e) {
- fActivePaneId = fMemBlkViewer.getId();
- }});
- }
-
- /**
- * @return an activate listener for the given view pane
- *
- */
- private Listener createDeactivateListener(final IMemoryViewPane viewPane) {
- Listener deactivateListener = new Listener() {
- private String id=viewPane.getId();
- public void handleEvent(Event event) {
- if (fActivePaneId.equals(id))
- viewPane.removeSelctionListener(fSelectionProvider);
- }};
- return deactivateListener;
- }
-
- /**
- * @return a deactivate listener for the given view pane
- */
- private Listener createActivateListener(final IMemoryViewPane viewPane) {
- Listener activateListener = new Listener() {
- private String id=viewPane.getId();
- public void handleEvent(Event event) {
- fActivePaneId = id;
- viewPane.addSelectionListener(fSelectionProvider);
- fSelectionProvider.setSelection(viewPane.getSelectionProvider().getSelection());
- }};
- return activateListener;
- }
-
- /**
- *
- */
- public void createRenderingViewPane(final String paneId) {
- final RenderingViewPane renderingPane = new RenderingViewPane(this);
- fViewPanes.put(paneId, renderingPane);
- ViewForm renderingViewForm = new ViewForm(fSashForm, SWT.NONE);
- fViewPaneControls.put(paneId, renderingViewForm);
- fWeights.add(new Integer(40));
-
- Control renderingControl = renderingPane.createViewPane(renderingViewForm, paneId, DebugUIMessages.MemoryView_Memory_renderings, true, true);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(renderingControl, IDebugUIConstants.PLUGIN_ID + ".MemoryView_context"); //$NON-NLS-1$
- renderingViewForm.setContent(renderingControl);
-
- Listener renderingActivateListener = createActivateListener(renderingPane);
- renderingControl.addListener(SWT.Activate, renderingActivateListener);
-
- Listener renderingDeactivateListener = createDeactivateListener(renderingPane);
- renderingControl.addListener(SWT.Deactivate, renderingDeactivateListener);
-
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
- */
- public void setFocus() {
- if (fActivePaneId == null)
- fActivePaneId = fMemBlkViewer.getId();
-
- IMemoryViewPane pane = getViewPane(fActivePaneId);
- pane.getControl().setFocus();
- }
-
- public void dispose() {
- getSite().getPage().removePartListener(fPartListener);
-
- Enumeration enumeration = fViewPanes.elements();
- while (enumeration.hasMoreElements())
- {
- Object element = enumeration.nextElement();
- if (element instanceof IMemoryViewPane)
- {
- ((IMemoryViewPane)element).dispose();
- }
- }
-
- fViewPaneControls.clear();
-
- IViewSite viewSite = getViewSite();
- String secondaryId = viewSite.getSecondaryId();
- if (secondaryId != null)
- MemoryViewIdRegistry.deregisterView(secondaryId);
-
- fSyncService.shutdown();
-
- if (fAddHandler != null)
- fAddHandler.dispose();
-
- if (fToggleMonitorsHandler != null)
- fToggleMonitorsHandler.dispose();
-
- if (fNextMemoryBlockHandler != null)
- fNextMemoryBlockHandler.dispose();
-
- super.dispose();
- }
-
- private void setVisible(boolean visible)
- {
- IMemoryViewPane[] viewPanes = getViewPanes();
-
- for (int i=0; i<viewPanes.length; i++)
- {
- // if currently visible, take view pane's visibility into account
- // else force view pane to be visible if it is listed in
- // "visible view panes" array list.
- if (fVisible)
- viewPanes[i].setVisible(visible && viewPanes[i].isVisible());
- else
- {
- if (isViewPaneVisible(viewPanes[i].getId()))
- viewPanes[i].setVisible(visible);
- }
- }
-
- fVisible = visible;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMultipaneMemoryView#getViewPane(java.lang.String)
- */
- public IMemoryViewPane getViewPane(String paneId) {
- return (IMemoryViewPane)fViewPanes.get(paneId);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMultipaneMemoryView#getViewPanes()
- */
- public IMemoryViewPane[] getViewPanes() {
- IMemoryViewPane[] viewPanes = new IMemoryViewPane[fViewPanes.size()];
-
- Enumeration enumeration = fViewPanes.elements();
- int i=0;
- while (enumeration.hasMoreElements())
- {
- viewPanes[i] = (IMemoryViewPane)enumeration.nextElement();
- i++;
- }
-
- return viewPanes;
- }
-
- /**
- * Restore each view pane from the memory view based on current
- * debug selection
- */
- private void restoreView() {
- IMemoryViewPane[] viewPanes = getViewPanes();
- for (int i=0; i<viewPanes.length; i++)
- {
- viewPanes[i].restoreViewPane();
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMultipaneMemoryView#showViewPane(boolean, java.lang.String)
- */
- public void showViewPane(boolean show, String paneId) {
-
- Control viewPaneControl = (Control)fViewPaneControls.get(paneId);
-
- if (viewPaneControl != null)
- {
- Control children[] = fSashForm.getChildren();
-
- for (int i=0; i<children.length; i++)
- {
- if (children[i] == viewPaneControl)
- {
- children[i].setVisible(show);
- IMemoryViewPane viewPane = (IMemoryViewPane)fViewPanes.get(paneId);
- if (viewPane != null)
- viewPane.setVisible(show);
- }
- }
- fSashForm.layout();
- }
-
- storeViewPaneVisibility();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMultipaneMemoryView#isViewPaneVisible(java.lang.String)
- */
- public boolean isViewPaneVisible(String paneId) {
- return fVisibleViewPanes.contains(paneId);
- }
-
- private void storeViewPaneVisibility()
- {
- fVisibleViewPanes.clear();
- Preferences prefs = DebugUIPlugin.getDefault().getPluginPreferences();
- StringBuffer visibleViewPanes= new StringBuffer();
-
- Enumeration enumeration = fViewPaneControls.keys();
-
- while (enumeration.hasMoreElements())
- {
- String paneId = (String)enumeration.nextElement();
-
- Control control = (Control)fViewPaneControls.get(paneId);
- if (control.isVisible())
- {
- visibleViewPanes.append(paneId);
- visibleViewPanes.append(","); //$NON-NLS-1$
- fVisibleViewPanes.add(paneId);
- }
- }
-
- prefs.setValue(getVisibilityPrefId(), visibleViewPanes.toString());
- }
-
- private void loadViewPanesVisibility()
- {
- Preferences prefs = DebugUIPlugin.getDefault().getPluginPreferences();
- String visiblePanes = prefs.getString(getVisibilityPrefId());
-
- if (visiblePanes != null && visiblePanes.length() > 0)
- {
- StringTokenizer tokenizer = new StringTokenizer(visiblePanes, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens())
- {
- String paneId = tokenizer.nextToken();
- fVisibleViewPanes.add(paneId);
- }
- }
- else
- {
- for (int i=0 ;i<defaultVisiblePaneIds.length; i++)
- {
- fVisibleViewPanes.add(defaultVisiblePaneIds[i]);
- }
- }
-
- Enumeration enumeration = fViewPaneControls.keys();
- while (enumeration.hasMoreElements())
- {
- String paneId = (String)enumeration.nextElement();
- boolean visible = false;
- if(fVisibleViewPanes.contains(paneId))
- visible = true;
-
- Control control = (Control)fViewPaneControls.get(paneId);
- control.setVisible(visible);
-
- IMemoryViewPane viewPane = (IMemoryViewPane)fViewPanes.get(paneId);
- viewPane.setVisible(visible);
- }
-
- fSashForm.layout();
- }
-
- private void loadOrientation()
- {
- Preferences prefs = DebugUIPlugin.getDefault().getPluginPreferences();
- fViewOrientation = prefs.getInt(getOrientationPrefId());
-
- for (int i=0; i<fOrientationActions.length; i++)
- {
- if (fOrientationActions[i].getOrientation() == fViewOrientation)
- {
- fOrientationActions[i].run();
- }
- }
- updateOrientationActions();
- }
-
- private void saveOrientation()
- {
- Preferences prefs = DebugUIPlugin.getDefault().getPluginPreferences();
- prefs.setValue(getOrientationPrefId(), fViewOrientation);
- }
-
- private void updateOrientationActions()
- {
- for (int i=0; i<fOrientationActions.length; i++)
- {
- if (fOrientationActions[i].getOrientation() == fViewOrientation)
- {
- fOrientationActions[i].setChecked(true);
- }
- else
- {
- fOrientationActions[i].setChecked(false);
- }
-
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingSite#getSynchronizationService()
- */
- public IMemoryRenderingSynchronizationService getSynchronizationService() {
- return fSyncService;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingSite#getMemoryRenderingContainers()
- */
- public IMemoryRenderingContainer[] getMemoryRenderingContainers() {
- Enumeration enumeration = fViewPanes.elements();
- ArrayList containers = new ArrayList();
- while (enumeration.hasMoreElements()){
- Object obj = enumeration.nextElement();
- if (obj instanceof IMemoryRenderingContainer)
- containers.add(obj);
- }
-
- return (IMemoryRenderingContainer[])containers.toArray(new IMemoryRenderingContainer[containers.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingSite#getContainer(java.lang.String)
- */
- public IMemoryRenderingContainer getContainer(String id) {
- Object viewPane = fViewPanes.get(id);
-
- if (viewPane instanceof IMemoryRenderingContainer)
- return (IMemoryRenderingContainer)viewPane;
-
- return null;
- }
-
- public boolean isPinMBDisplay() {
- return fPinMBDisplay;
- }
-
-
- public void setPinMBDisplay(boolean pinMBDisplay) {
- fPinMBDisplay = pinMBDisplay;
- }
-
- private String getVisibilityPrefId()
- {
- IViewSite vs = getViewSite();
- String viewId = vs.getSecondaryId();
-
- if (viewId != null)
- return VISIBILITY_PREF + "." + viewId; //$NON-NLS-1$
-
- return VISIBILITY_PREF;
- }
-
- private String getOrientationPrefId()
- {
- IViewSite vs = getViewSite();
- String viewId = vs.getSecondaryId();
-
- if (viewId != null)
- return VIEW_PANE_ORIENTATION_PREF + "." + viewId; //$NON-NLS-1$
-
- return VIEW_PANE_ORIENTATION_PREF;
- }
-
- private void createOrientationActions()
- {
- IActionBars actionBars = getViewSite().getActionBars();
- IMenuManager viewMenu = actionBars.getMenuManager();
-
- fOrientationActions = new ViewPaneOrientationAction[2];
- fOrientationActions[0] = new ViewPaneOrientationAction(this, HORIZONTAL_VIEW_ORIENTATION);
- fOrientationActions[1] = new ViewPaneOrientationAction(this, VERTICAL_VIEW_ORIENTATION);
-
- viewMenu.add(new Separator());
- MenuManager layoutSubMenu = new MenuManager(VariablesViewMessages.VariablesView_40);
- layoutSubMenu.add(fOrientationActions[0]);
- layoutSubMenu.add(fOrientationActions[1]);
- viewMenu.add(layoutSubMenu);
- viewMenu.add(new Separator());
- }
-
- public void setViewPanesOrientation(int orientation)
- {
- fViewOrientation = orientation;
- if (fViewOrientation == VERTICAL_VIEW_ORIENTATION)
- fSashForm.setOrientation(SWT.VERTICAL);
- else
- fSashForm.setOrientation(SWT.HORIZONTAL);
-
- saveOrientation();
- updateOrientationActions();
- }
-
- public int getViewPanesOrientation()
- {
- return fViewOrientation;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewIdRegistry.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewIdRegistry.java
deleted file mode 100644
index f26a4901e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewIdRegistry.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory;
-
-import java.util.ArrayList;
-
-/**
- * Class for managing the secondary ids for Memory View
- *
- */
-public class MemoryViewIdRegistry{
-
- private static ArrayList fgRegistry;
-
- public static void registerView(String secondaryId)
- {
- ArrayList registry = getRegistry();
-
- if (!registry.contains(secondaryId))
- {
- registry.add(secondaryId);
- }
- }
-
- public static void deregisterView(String secondaryId)
- {
- ArrayList registry = getRegistry();
-
- if (registry.contains(secondaryId))
- {
- registry.remove(secondaryId);
- }
- }
-
- public static String getUniqueSecondaryId(String viewId)
- {
- int cnt = 0;
- String id = viewId + "." + cnt; //$NON-NLS-1$
- ArrayList registry = getRegistry();
- while (registry.contains(id))
- {
- cnt ++;
- id = viewId + "." + cnt; //$NON-NLS-1$
- }
- return id;
- }
-
- private static ArrayList getRegistry()
- {
- if (fgRegistry == null)
- fgRegistry = new ArrayList();
-
- return fgRegistry;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPrefAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPrefAction.java
deleted file mode 100644
index 9b54d9fc2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPrefAction.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jface.preference.PreferenceNode;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
-public class MemoryViewPrefAction implements IViewActionDelegate {
-
- public void init(IViewPart view) {
-
- }
-
- public void run(IAction action) {
-
- PreferenceManager prefManager = new PreferenceManager();
-
- ResetMemoryBlockPreferencePage page = new ResetMemoryBlockPreferencePage();
- IPreferenceNode node = new PreferenceNode("org.eclipse.debug.ui.memory.resetMemoryBlock", page); //$NON-NLS-1$
- prefManager.addToRoot(node);
-
- SetPaddedStringPreferencePage page2 = new SetPaddedStringPreferencePage();
- IPreferenceNode node2 = new PreferenceNode("org.eclipse.debug.ui.memory.setPaddedString", page2); //$NON-NLS-1$
- prefManager.addToRoot(node2);
-
- CodePagesPreferencePage page3 = new CodePagesPreferencePage();
- IPreferenceNode node3 = new PreferenceNode("org.eclipse.debug.ui.memory.codePages", page3); //$NON-NLS-1$
- prefManager.addToRoot(node3);
-
- final PreferenceDialog dialog = new PreferenceDialog(DebugUIPlugin.getShell(), prefManager);
-
- BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), new Runnable() {
- public void run() {
- dialog.create();
- dialog.open();
- }
- });
-
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
-
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java
deleted file mode 100644
index 29a937679..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory;
-
-import java.math.BigInteger;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.debug.core.IMemoryBlockListener;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Synchronization service for the memory view.
- * @since 3.1
- */
-public class MemoryViewSynchronizationService implements
- IMemoryRenderingSynchronizationService, IMemoryBlockListener, IPropertyChangeListener {
-
- private static final int ENABLED = 0;
- private static final int ENABLING = 1;
- private static final int DISABLED = 2;
-
- private Hashtable fSynchronizeInfo;
- private int fEnableState = ENABLED;
- private Hashtable fPropertyListeners;
-
- private IMemoryRendering fLastChangedRendering;
- private IMemoryRendering fSyncServiceProvider;
-
- private static final boolean DEBUG_SYNC_SERVICE = false;
-
- public MemoryViewSynchronizationService()
- {
- fSynchronizeInfo = new Hashtable();
- fPropertyListeners = new Hashtable();
- MemoryViewUtil.getMemoryBlockManager().addListener(this);
- }
-
- /**
- * Wrapper for ISynchronizedMemoryBlockView
- * Holds a list of property filters for the view.
- */
- class PropertyListener
- {
- IPropertyChangeListener fListener;
- String[] fFilters;
-
- public PropertyListener(IPropertyChangeListener listener, String[] properties)
- {
- fListener = listener;
-
- if(properties != null)
- {
- fFilters = properties;
- }
- }
-
- /**
- * If the property matches one of the filters, the property
- * is valid and the view should be notified about its change.
- * @param property
- * @return if the property is specified in the filter
- */
- public boolean isValidProperty(String property){
- if (fFilters == null)
- return true;
- for (int i=0; i<fFilters.length; i++)
- {
- if (fFilters[i].equals(property))
- {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Set property filters, indicating what property change events
- * the listener is interested in.
- * @param filters
- */
- public void setPropertyFilters(String[] filters){
- fFilters = filters;
- }
-
- /**
- * @return Returns the fListener.
- */
- public IPropertyChangeListener getListener() {
- return fListener;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IMemoryBlockViewSynchronizer#getSynchronizedProperty(org.eclipse.debug.ui.ISynchronizedMemoryBlockView, java.lang.String)
- */
- public Object getSynchronizedProperty(IMemoryBlock memoryBlock, String propertyId)
- {
- SynchronizeInfo info = (SynchronizeInfo)fSynchronizeInfo.get(memoryBlock);
-
- if (info != null)
- {
- Object value = info.getProperty(propertyId);
- return value;
- }
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IMemoryBlockListener#MemoryBlockAdded(org.eclipse.debug.core.model.IMemoryBlock)
- */
- public void memoryBlocksAdded(IMemoryBlock[] memoryBlocks) {
- // do nothing when a memory block is added
- // create a synchronize info object when there is a fView
- // tab registered to be synchronized.
-
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IMemoryBlockListener#MemoryBlockRemoved(org.eclipse.debug.core.model.IMemoryBlock)
- */
- public void memoryBlocksRemoved(IMemoryBlock[] memoryBlocks) {
-
- // Sync info can be null if the service is already shut down
- if (fSynchronizeInfo == null)
- return;
-
- for (int i=0; i<memoryBlocks.length; i++)
- {
- IMemoryBlock memory = memoryBlocks[i];
-
- if (fLastChangedRendering != null && fLastChangedRendering.getMemoryBlock() == memory)
- fLastChangedRendering = null;
-
- if (fSyncServiceProvider != null && fSyncServiceProvider.getMemoryBlock() == memory)
- fSyncServiceProvider = null;
-
- // delete the info object and remove it from fSynchronizeInfo
- // when the memory block is deleted
- SynchronizeInfo info = (SynchronizeInfo)fSynchronizeInfo.get(memory);
-
- if (info != null)
- {
- info.delete();
- fSynchronizeInfo.remove(memory);
- }
- }
- }
-
- /**
- * Clean up when the plugin is shutdown
- */
- public void shutdown()
- {
- if (fSynchronizeInfo != null)
- {
- Enumeration enumeration = fSynchronizeInfo.elements();
-
- // clean up all synchronize info objects
- while (enumeration.hasMoreElements()){
- SynchronizeInfo info = (SynchronizeInfo)enumeration.nextElement();
- info.delete();
- }
-
- fSynchronizeInfo.clear();
- fSynchronizeInfo = null;
- }
- MemoryViewUtil.getMemoryBlockManager().removeListener(this);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener, java.lang.String[])
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener, String[] properties) {
-
- PropertyListener propertylistener = new PropertyListener(listener, properties);
-
- if (!fPropertyListeners.contains(propertylistener))
- {
- fPropertyListeners.put(listener, propertylistener);
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener) {
- if (fPropertyListeners.containsKey(listener))
- {
- fPropertyListeners.remove(listener);
- }
- }
-
- /**
- * Fire property change events
- * @param propertyId
- */
- public void firePropertyChanged(final PropertyChangeEvent evt)
- {
- // do not fire property changed event if the synchronization
- // service is disabled
- if (fEnableState == DISABLED)
- return;
-
- // Make sure the synchronizer does not swallow any events
- // Values of the properties are updated in the syncrhonizer immediately.
- // Change events are queued up on the UI Thread.
- Display.getDefault().syncExec(new Runnable()
- {
- public void run()
- {
- if (fSynchronizeInfo == null)
- return;
-
- IMemoryRendering rendering = (IMemoryRendering)evt.getSource();
- String propertyId = evt.getProperty();
-
- SynchronizeInfo info = (SynchronizeInfo)fSynchronizeInfo.get(rendering.getMemoryBlock());
- if (info != null)
- {
- Object value = info.getProperty(propertyId);
- if (value != null)
- {
- Enumeration enumeration = fPropertyListeners.elements();
-
- while(enumeration.hasMoreElements())
- {
- PropertyListener listener = (PropertyListener)enumeration.nextElement();
-
- IPropertyChangeListener origListener = listener.getListener();
-
- // if it's a valid property - valid means that it's listed in the property filters
- if (listener.isValidProperty(propertyId)){
- PropertyChangeNotifier notifier = new PropertyChangeNotifier(origListener, evt);
- SafeRunner.run(notifier);
- }
- }
- }
- }
- }
- });
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService#getProperty(org.eclipse.debug.core.model.IMemoryBlock, java.lang.String)
- */
- public Object getProperty(IMemoryBlock block, String property) {
-
- // When the synchronization service is disabled
- // return null for all queries to properties
- // This is to ensure that renderings are not synchronized
- // to new synchronization properties when the sync service is
- // disabled.
- if (!isEnabled())
- return null;
-
- SynchronizeInfo info = (SynchronizeInfo)fSynchronizeInfo.get(block);
-
- if (info != null)
- return info.getProperty(property);
-
- return null;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if (event == null || !(event.getSource() instanceof IMemoryRendering))
- {
- return;
- }
-
- // Do not handle any property changed event as the
- // sync service is being enabled.
- // Otheriwse, current sync info provider may overwrite
- // sync info unexpectedly. We want to sync with the rendering
- // that is last changed.
- if (fEnableState == ENABLING)
- return;
-
- IMemoryRendering rendering = ((IMemoryRendering)event.getSource());
- IMemoryBlock memoryBlock = rendering.getMemoryBlock();
- String propertyId = event.getProperty();
- Object value = event.getNewValue();
-
- if (DEBUG_SYNC_SERVICE)
- {
- System.out.println("SYNC SERVICE RECEIVED CHANGED EVENT:"); //$NON-NLS-1$
- System.out.println("Source: " + rendering); //$NON-NLS-1$
- System.out.println("Property: " + propertyId); //$NON-NLS-1$
- System.out.println("Value: " + value); //$NON-NLS-1$
-
- if (value instanceof BigInteger)
- {
- System.out.println("Value in hex: " + ((BigInteger)value).toString(16)); //$NON-NLS-1$
- }
- }
-
- if (memoryBlock == null)
- return;
-
- if (propertyId == null)
- return;
-
- // find the synchronize info object for the memory block
- SynchronizeInfo info = (SynchronizeInfo)fSynchronizeInfo.get(memoryBlock);
-
- // if info is not available, need to create one to hold the property
- if (info == null)
- {
- info = new SynchronizeInfo(memoryBlock);
- fSynchronizeInfo.put(memoryBlock, info);
- }
-
- // get the value of the property
- Object oldValue = info.getProperty(propertyId);
-
- if (oldValue == null)
- {
- // if the value has never been added to the info object
- // set the property and fire a change event
- info.setProperty(propertyId, value);
- fLastChangedRendering = rendering;
- firePropertyChanged(event);
- return;
- }
- else if (!oldValue.equals(value))
- {
- // if the value has changed
- // set the property and fire a change event
- info.setProperty(propertyId, value);
- fLastChangedRendering = rendering;
- firePropertyChanged(event);
- }
- }
-
- public void setEnabled(boolean enabled)
- {
- if (enabled && fEnableState == ENABLED)
- return;
-
- if (!enabled && fEnableState == DISABLED)
- return;
-
- try
- {
- if (enabled)
- {
- fEnableState = ENABLING;
- // get sync info from the sync service provider
- if (fLastChangedRendering != null)
- {
- IMemoryBlock memBlock = fLastChangedRendering.getMemoryBlock();
- SynchronizeInfo info = (SynchronizeInfo)fSynchronizeInfo.get(memBlock);
- String[] ids = info.getPropertyIds();
-
- // stop handling property changed event while the
- // synchronization service is being enabled
- // this is to get around problem when the last changed
- // rendering is not currently the sync info provider
-
- for (int i=0; i<ids.length; i++)
- {
- PropertyChangeEvent evt = new PropertyChangeEvent(fLastChangedRendering, ids[i], null, info.getProperty(ids[i]));
- firePropertyChanged(evt);
- }
- }
- }
- }
- finally
- {
- if (enabled)
- fEnableState = ENABLED;
- else
- fEnableState = DISABLED;
- }
- }
-
- public boolean isEnabled()
- {
- return fEnableState == ENABLED;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService#setSynchronizationProvider(org.eclipse.debug.ui.memory.IMemoryRendering)
- */
- public void setSynchronizationProvider(IMemoryRendering rendering) {
-
- if (DEBUG_SYNC_SERVICE)
- System.out.println("SYNCHRONIZATION PROVIDER: " + rendering); //$NON-NLS-1$
-
- if (fSyncServiceProvider != null)
- fSyncServiceProvider.removePropertyChangeListener(this);
-
- if (rendering != null)
- rendering.addPropertyChangeListener(this);
-
- fSyncServiceProvider = rendering;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService#getSynchronizationProvider()
- */
- public IMemoryRendering getSynchronizationProvider() {
- return fSyncServiceProvider;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java
deleted file mode 100644
index b39cd4f10..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - Ted Williams - [Memory View] Memory View: Workflow Enhancements (Bug 215432)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.internal.ui.views.memory.renderings.ErrorRendering;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.IBasicPropertyConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.progress.WorkbenchJob;
-
-/**
- * Represents a tab in the Memory View. This is where memory renderings
- * are hosted in the Memory View.
- * @since 3.1
- */
-public class MemoryViewTab implements IMemoryViewTab, IPropertyChangeListener, Listener {
-
- private IMemoryRendering fRendering;
- private CTabItem fTabItem;
- private DisposeListener fDisposeListener;
- private boolean fEnabled;
- private boolean fIsDisposed = false;
- private Control fControl;
- private RenderingViewPane fContainer;
-
-
- public MemoryViewTab(CTabItem tabItem, IMemoryRendering rendering, RenderingViewPane container)
- {
- fTabItem = tabItem;
- fRendering = rendering;
- fContainer = container;
-
- // set the rendering as the synchronization provider
- // as the new rendering should be in focus and have control
- // after it's created
-
- if (container.getMemoryRenderingSite().getSynchronizationService() != null)
- container.getMemoryRenderingSite().getSynchronizationService().setSynchronizationProvider(rendering);
- Control control = createViewTab();
-
- control.addListener(SWT.Activate, this);
- control.addListener(SWT.Deactivate, this);
-
- fTabItem.setControl(control);
- fTabItem.setData(this);
- fTabItem.setText(getLabel());
- fTabItem.setImage(getImage());
-
- fTabItem.addDisposeListener(fDisposeListener = new DisposeListener() {
-
- public void widgetDisposed(DisposeEvent e) {
- fTabItem.removeDisposeListener(fDisposeListener);
- dispose();
- }});
- }
-
- private Control createViewTab()
- {
- ISafeRunnable safeRunnable = new ISafeRunnable() {
-
- public void handleException(Throwable exception) {
- // create an error rendering to fill the view tab
- ErrorRendering rendering = new ErrorRendering(fRendering.getRenderingId(), exception);
- rendering.init(fContainer, fRendering.getMemoryBlock());
-
- // dispose the rendering
- fRendering.dispose();
-
- fRendering = rendering;
- fControl = rendering.createControl(fTabItem.getParent());
- }
-
- public void run() throws Exception {
- fControl = fRendering.createControl(fTabItem.getParent());
- fRendering.addPropertyChangeListener(getInstance());
- }};
-
- SafeRunner.run(safeRunnable);
- return fControl;
- }
-
- private String getLabel()
- {
- return fRendering.getLabel();
- }
-
- private Image getImage()
- {
- return fRendering.getImage();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewTab#dispose()
- */
- public void dispose() {
-
- if (fIsDisposed)
- return;
-
- fIsDisposed = true;
-
- fRendering.removePropertyChangeListener(this);
-
- if (!fControl.isDisposed())
- {
- fControl.removeListener(SWT.Activate, this);
- fControl.removeListener(SWT.Deactivate, this);
- }
-
- // always deactivate rendering before disposing it.
- fRendering.deactivated();
-
- fRendering.dispose();
- }
-
- public boolean isDisposed()
- {
- return fIsDisposed;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewTab#isEnabled()
- */
- public boolean isEnabled() {
- return fEnabled;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewTab#setEnabled(boolean)
- */
- public void setEnabled(boolean enabled) {
- fEnabled = enabled;
-
- if (fEnabled)
- fRendering.becomesVisible();
- else
- fRendering.becomesHidden();
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewTab#setTabLabel(java.lang.String)
- */
- public void setTabLabel(String label) {
- fTabItem.setText(label);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewTab#getTabLabel()
- */
- public String getTabLabel() {
- return fTabItem.getText();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewTab#getRendering()
- */
- public IMemoryRendering getRendering() {
- return fRendering;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(final PropertyChangeEvent event) {
-
- // make sure this runs on the UI thread, otherwise, it
- // will get to a swt exception
-
- WorkbenchJob job = new WorkbenchJob("MemoryViewTab PropertyChanged") { //$NON-NLS-1$
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if (isDisposed())
- return Status.OK_STATUS;
-
- if (event.getSource() == fRendering)
- {
- if (event.getProperty().equals(IBasicPropertyConstants.P_TEXT))
- {
- Object value = event.getNewValue();
- if (value != null && value instanceof String)
- {
- String label = (String)value;
- setTabLabel(label);
- }
- else
- {
- setTabLabel(fRendering.getLabel());
- }
- }
-
- if (event.getProperty().equals(IBasicPropertyConstants.P_IMAGE))
- {
- Object value = event.getNewValue();
- if (value != null && value instanceof Image)
- {
- Image image = (Image)value;
- fTabItem.setImage(image);
- }
- else
- {
- fTabItem.setImage(fRendering.getImage());
- }
- }
- }
- return Status.OK_STATUS;
- }
- };
- job.setSystem(true);
- job.schedule();
- }
-
- private MemoryViewTab getInstance()
- {
- return this;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
- */
- public void handleEvent(Event event) {
- if (event.type == SWT.Activate)
- {
- fRendering.activated();
- fContainer.setRenderingSelection(fRendering);
- }
- if (event.type == SWT.Deactivate)
- {
- fRendering.deactivated();
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeModelContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeModelContentProvider.java
deleted file mode 100644
index 0cd6802a4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeModelContentProvider.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.internal.ui.viewers.PartPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
-
-public class MemoryViewTreeModelContentProvider extends
- TreeModelContentProvider {
-
- protected void updateNodes(IModelDelta[] nodes) {
-
- if (getViewer() instanceof TreeModelViewer)
- {
- TreeModelViewer viewer = (TreeModelViewer) getViewer();
-
- for (int i = 0; i < nodes.length; i++) {
- IModelDelta node = nodes[i];
- int flags = node.getFlags();
-
- if ((flags & IModelDelta.ADDED) != 0) {
- if (node.getElement() instanceof IMemoryBlock) {
- if ((flags & IModelDelta.SELECT) != 0) {
- PartPresentationContext context = (PartPresentationContext) viewer
- .getPresentationContext();
- if (context.getPart() instanceof MemoryView) {
- MemoryView view = (MemoryView) context
- .getPart();
- if (view.isPinMBDisplay()) {
- // turn off select if the view is currently
- // pinned
- flags |= IModelDelta.SELECT;
- flags ^= IModelDelta.SELECT;
- }
- }
- }
-
- // override and select the first memory block
- if (isFirstMemoryBlock()) {
- flags |= IModelDelta.SELECT;
- }
- }
- }
- if ((flags & IModelDelta.ADDED) != 0) {
- handleAdd(node);
- }
- if ((flags & IModelDelta.REMOVED) != 0) {
- handleRemove(node);
- }
- if ((flags & IModelDelta.CONTENT) != 0) {
- handleContent(node);
- }
- if ((flags & IModelDelta.EXPAND) != 0) {
- handleExpand(node);
- }
- if ((flags & IModelDelta.SELECT) != 0) {
- handleSelect(node);
- }
- if ((flags & IModelDelta.STATE) != 0) {
- handleState(node);
- }
- if ((flags & IModelDelta.INSERTED) != 0) {
- handleInsert(node);
- }
- if ((flags & IModelDelta.REPLACED) != 0) {
- handleReplace(node);
- }
- if ((flags & IModelDelta.INSTALL) != 0) {
- handleInstall(node);
- }
- if ((flags & IModelDelta.UNINSTALL) != 0) {
- handleUninstall(node);
- }
- updateNodes(node.getChildDeltas());
- }
- }
- }
-
- private boolean isFirstMemoryBlock()
- {
- Object input = getViewer().getInput();
- if (input instanceof IMemoryBlockRetrieval)
- {
- IMemoryBlock[] memoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks((IMemoryBlockRetrieval)input);
- if (memoryBlocks.length == 1)
- return true;
- }
- return false;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeViewer.java
deleted file mode 100644
index e97c86ea1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeViewer.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Customized tree viewer for the Memory View
- * This Tree Viewer has a specialized update policy for the memory view.
- * When the model fires a ADDED delta, the update policy handles the event as follows:
- * If the ADDED delta is accompanied by SELECT, and the added element is an memory blok, then
- * the udpate policy asks the Memory View if the it is currently pinned to a memory block. If the view
- * is currently pinned, then the SELECT delta is ignored.
- *
- * If the ADDED delta and SELECT delta are recieved in separate nodes, then the delta will be handled as-is and would
- * not take the pinning state of the memory view into account.
- *
- */
-public class MemoryViewTreeViewer extends TreeModelViewer {
-
- public MemoryViewTreeViewer(Composite parent, int style,
- IPresentationContext context) {
- super(parent, style, context);
- }
-
- /*
- * Need to have a customized content provider to define a special update policy for the Memory View
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.InternalTreeModelViewer#createContentProvider()
- */
- protected ITreeModelContentProvider createContentProvider() {
- return new MemoryViewTreeModelContentProvider();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java
deleted file mode 100644
index 7836738b8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory;
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-
-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.DebugPlugin;
-import org.eclipse.debug.core.IMemoryBlockManager;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * Util class for Memory View
- *
- * @since 3.0
- */
-public class MemoryViewUtil {
-
- public static final int[] ignoreKeyEvents =
- {
- SWT.ARROW_UP,
- SWT.ARROW_DOWN,
- SWT.ARROW_LEFT,
- SWT.ARROW_RIGHT,
- SWT.PAGE_UP,
- SWT.PAGE_DOWN,
- SWT.HOME,
- SWT.END,
- SWT.INSERT,
- SWT.F1,
- SWT.F2,
- SWT.F3,
- SWT.F4,
- SWT.F5,
- SWT.F6,
- SWT.F7,
- SWT.F8,
- SWT.F9,
- SWT.F10,
- SWT.F11,
- SWT.F12,
- SWT.F13,
- SWT.F14,
- SWT.F15,
- SWT.HELP,
- SWT.CAPS_LOCK,
- SWT.NUM_LOCK,
- SWT.SCROLL_LOCK,
- SWT.PAUSE,
- SWT.BREAK,
- SWT.PRINT_SCREEN,
- SWT.ESC,
- SWT.CTRL,
- SWT.ALT,
- SWT.SHIFT
- };
-
- public static ArrayList MEMORY_BLOCKS_HISTORY = new ArrayList();
-
- /**
- * @param selection
- * @return true if the given selection is valid for creating a memory block
- */
- static public boolean isValidSelection(ISelection selection) {
-
- if (!(selection instanceof IStructuredSelection))
- return false;
-
- //only single selection is allowed for this action
- if (selection.isEmpty() || ((IStructuredSelection)selection).size() > 1)
- {
- return false;
- }
-
- Object elem = ((IStructuredSelection)selection).getFirstElement();
-
- return isValidContext(elem);
- }
-
-
- /**
- * @param elem
- * @return
- */
- public static boolean isValidContext(Object elem) {
- // if not debug element
- if (!(elem instanceof IAdaptable))
- return false;
-
- IMemoryBlockRetrieval memRetrieval =(IMemoryBlockRetrieval) ((IAdaptable)elem).getAdapter(IMemoryBlockRetrieval.class);
-
- IDebugTarget debugTarget = null;
- if (elem instanceof IDebugElement) {
- debugTarget = ((IDebugElement)elem).getDebugTarget();
- } else {
- debugTarget = (IDebugTarget)((IAdaptable)elem).getAdapter(IDebugTarget.class);
- }
-
- if (memRetrieval == null)
- {
- // if debug element returns null from getAdapter, assume its debug target is going to retrieve memory blocks
- memRetrieval = debugTarget;
- }
-
- // not valid if the debug target is already terminated
- if (debugTarget != null && (debugTarget.isTerminated() || debugTarget.isDisconnected()))
- return false;
-
- if (memRetrieval != null && memRetrieval.supportsStorageRetrieval()) {
- return true;
- }
-
- return false;
- }
-
-
- /**
- * Helper function to open an error dialog.
- * @param title
- * @param message
- * @param e
- */
- static public void openError (final String title, final String message, final Exception e)
- {
- UIJob uiJob = new UIJob("open error"){ //$NON-NLS-1$
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
-// open error for the exception
- String detail = IInternalDebugCoreConstants.EMPTY_STRING;
- if (e != null)
- detail = e.getMessage();
-
- Shell shell = DebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
-
- MessageDialog.openError(
- shell,
- title,
- message + "\n" + detail); //$NON-NLS-1$
- return Status.OK_STATUS;
- }};
- uiJob.setSystem(true);
- uiJob.schedule();
- }
-
- static IMemoryBlockManager getMemoryBlockManager()
- {
- return DebugPlugin.getDefault().getMemoryBlockManager();
- }
-
- static public boolean isLinuxGTK()
- {
- String ws = Platform.getWS();
- return ws.equals(Platform.WS_GTK);
- }
-
- /**
- * Checks to see if the event is valid for activating
- * cell editing in a view tab
- * @param event
- * @return true if the edit event is valid for activating the cell editor
- */
- public static boolean isValidEditEvent(int event) {
- for (int i = 0; i < MemoryViewUtil.ignoreKeyEvents.length; i++) {
- if (event == MemoryViewUtil.ignoreKeyEvents[i])
- return false;
- }
- return true;
- }
-
- public static BigInteger alignToBoundary(BigInteger integer, int numberOfUnitsPerLine)
- {
- BigInteger[] result = integer.divideAndRemainder(BigInteger.valueOf(numberOfUnitsPerLine));
- integer = integer.subtract(result[1]);
- return integer;
- }
-
- public static void addHistory(String expression)
- {
- if (!MEMORY_BLOCKS_HISTORY.contains(expression))
- MEMORY_BLOCKS_HISTORY.add(0, expression);
-
- if (MEMORY_BLOCKS_HISTORY.size() > 5)
- MEMORY_BLOCKS_HISTORY.remove(MEMORY_BLOCKS_HISTORY.size()-1);
- }
-
- public static String[] getHistory()
- {
- return (String[])MEMORY_BLOCKS_HISTORY.toArray(new String[MEMORY_BLOCKS_HISTORY.size()]);
- }
-
- /**
- * Return the memory block retrieval of the given object
- * @param object
- * @return the memory block retrieval of the given object or <code>null</code>
- * if no memory block retrieval can be found
- *
- * Returning null for the memory block retrieval will result in errors in operations
- * that follow.
- *
- * Non-standard debug models must provide a memory block retrieval via
- * <code>getAdapter(IMemoryBlockRetrieval.class</code>
- */
- public static IMemoryBlockRetrieval getMemoryBlockRetrieval(Object object)
- {
- IMemoryBlockRetrieval retrieval = null;
-
- // if memory block extension, retrieval must be queired throught its interface
- if (object instanceof IMemoryBlockExtension)
- return ((IMemoryBlockExtension)object).getMemoryBlockRetrieval();
-
- // check if the object can adapt to a memory block retrieval
- if (object instanceof IAdaptable)
- {
- IAdaptable adaptable = (IAdaptable)object;
- retrieval = (IMemoryBlockRetrieval)adaptable.getAdapter(IMemoryBlockRetrieval.class);
- }
-
- // if cannot adapt and the object itself is already an IMemoryBlockRetrieval, return that.
- if (retrieval == null && object instanceof IMemoryBlockRetrieval)
- {
- retrieval = (IMemoryBlockRetrieval)object;
- }
-
- // otherewise, default back to the debug target
- if (retrieval == null && object instanceof IDebugElement)
- {
- IDebugElement de = (IDebugElement)object;
- retrieval = de.getDebugTarget();
- }
-
- return retrieval;
- }
-
- /**
- * Returns the hash code for this object, as an Integer.
- * */
- public static Integer getHashCode(Object o)
- {
- return new Integer(o.hashCode());
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MonitorMemoryBlockDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MonitorMemoryBlockDialog.java
deleted file mode 100644
index 474a6ea74..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MonitorMemoryBlockDialog.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.core.model.IMemoryBlockRetrievalExtension;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.TrayDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @since 3.0
- */
-public class MonitorMemoryBlockDialog extends TrayDialog implements ModifyListener{
-
- private Combo expressionInput;
- private Text lengthInput;
- private String expression;
- private String length;
- private boolean needLength = true;
- private String fPrefillExp = null;
- private String fPrefillLength = null;
-
- /**
- * the predefined width of the wrapping label for the expression to enter combo
- * @since 3.3
- */
- private static final int LABEL_WIDTH = 210;
-
- /**
- * @param parentShell
- */
- public MonitorMemoryBlockDialog(Shell parentShell, IMemoryBlockRetrieval memRetrieval, String prefillExp, String prefillLength) {
- super(parentShell);
-
- if (memRetrieval instanceof IMemoryBlockRetrievalExtension)
- needLength = false;
-
- fPrefillExp = prefillExp;
- fPrefillLength = prefillLength;
- setShellStyle(getShellStyle() | SWT.RESIZE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- Composite comp = (Composite) super.createDialogArea(parent);
- SWTFactory.createWrapLabel(comp, DebugUIMessages.MonitorMemoryBlockDialog_EnterExpressionToMonitor, 1, LABEL_WIDTH);
- expressionInput = SWTFactory.createCombo(comp, SWT.BORDER, 1, MemoryViewUtil.getHistory());
- if (fPrefillExp != null) {
- expressionInput.setText(fPrefillExp);
- }
- expressionInput.addModifyListener(this);
-
- if (needLength) {
- SWTFactory.createLabel(comp, DebugUIMessages.MonitorMemoryBlockDialog_NumberOfBytes, 1);
- lengthInput = SWTFactory.createSingleText(comp, 1);
- if (fPrefillLength != null) {
- lengthInput.setText(fPrefillLength);
- }
- lengthInput.addModifyListener(this);
- }
- PlatformUI.getWorkbench().getHelpSystem().setHelp(comp, IDebugUIConstants.PLUGIN_ID + ".MonitorMemoryBlockDialog_context"); //$NON-NLS-1$
- return comp;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
-
- newShell.setText(DebugUIMessages.MonitorMemoryBlockDialog_MonitorMemory);
- }
-
- /**
- * @return the entered expression
- */
- public String getExpression() {
- return expression;
- }
-
- /**
- * @return the entered length
- */
- public String getLength() {
- return length;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
-
- expression = expressionInput.getText();
-
- // add to HISTORY list
- MemoryViewUtil.addHistory(expression);
-
- if (needLength)
- length = lengthInput.getText();
-
- super.okPressed();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- public void modifyText(ModifyEvent e) {
- updateOKButtonState();
- }
-
- private void updateOKButtonState() {
- if (needLength)
- {
- String lengthText = lengthInput.getText();
- String input = expressionInput.getText();
-
- if (input == null || input.equals(IInternalDebugCoreConstants.EMPTY_STRING) || lengthText == null || lengthText.equals(IInternalDebugCoreConstants.EMPTY_STRING))
- {
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- }
- else
- {
- getButton(IDialogConstants.OK_ID).setEnabled(true);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createButtonBar(org.eclipse.swt.widgets.Composite)
- */
- protected Control createButtonBar(Composite parent) {
-
- Control ret = super.createButtonBar(parent);
-
- if (needLength)
- updateOKButtonState();
- else
- // always enable the OK button if we only need the expression
- getButton(IDialogConstants.OK_ID).setEnabled(true);
-
- return ret;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/NewMemoryViewAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/NewMemoryViewAction.java
deleted file mode 100644
index 2e62da38d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/NewMemoryViewAction.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-
-/**
- * Action for opening a new memory view.
- */
-public class NewMemoryViewAction implements IViewActionDelegate {
-
- private MemoryView fView;
- public void init(IViewPart view) {
- if (view instanceof MemoryView)
- fView = (MemoryView)view;
- }
-
- public void run(IAction action) {
-
- String secondaryId = MemoryViewIdRegistry.getUniqueSecondaryId(IDebugUIConstants.ID_MEMORY_VIEW);
- try {
- IWorkbenchPage page = DebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IViewPart newView = page.showView(IDebugUIConstants.ID_MEMORY_VIEW, secondaryId, IWorkbenchPage.VIEW_ACTIVATE);
-
- // set initial selection for new view
- setInitialSelection(newView);
- setInitialViewSettings(newView);
-
- } catch (PartInitException e) {
- // if view cannot be opened, open error
- DebugUIPlugin.log(e);
- }
- }
-
- private void setInitialSelection(IViewPart newView) {
- ISelection selection = fView.getSite().getSelectionProvider().getSelection();
- if (selection instanceof IStructuredSelection)
- {
- IStructuredSelection strucSel = (IStructuredSelection)selection;
-
- // return if current selection is empty
- if (strucSel.isEmpty())
- return;
-
- Object obj = strucSel.getFirstElement();
-
- if (obj == null)
- return;
-
- if (obj instanceof IMemoryRendering)
- {
- IMemoryBlock memBlock = ((IMemoryRendering)obj).getMemoryBlock();
- strucSel = new StructuredSelection(memBlock);
- newView.getSite().getSelectionProvider().setSelection(strucSel);
- }
- else if (obj instanceof IMemoryBlock)
- {
- newView.getSite().getSelectionProvider().setSelection(strucSel);
- }
- }
- }
-
- private void setInitialViewSettings(IViewPart newView) {
- if (fView != null && newView instanceof MemoryView)
- {
- MemoryView newMView = (MemoryView)newView;
- IMemoryViewPane[] viewPanes = fView.getViewPanes();
- int orientation = fView.getViewPanesOrientation();
- for (int i=0; i<viewPanes.length; i++)
- {
- // copy view pane visibility
- newMView.showViewPane(fView.isViewPaneVisible(viewPanes[i].getId()), viewPanes[i].getId());
- }
-
- // do not want to copy renderings as it could be very expensive
- // create a blank view and let user creates renderings as needed
-
- // set orientation of new view
- newMView.setViewPanesOrientation(orientation);
- }
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
-
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PinMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PinMemoryBlockAction.java
deleted file mode 100644
index 93f5fa3d3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PinMemoryBlockAction.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
-/**
- * Action for pinning the display of the memory view to
- * the current memory block. The view would not change
- * selection when a new memory block is added if the diplay is pinned.
- *
- */
-public class PinMemoryBlockAction implements IViewActionDelegate {
-
- private MemoryView fView;
- public void init(IViewPart view) {
- if (view instanceof MemoryView)
- fView = (MemoryView)view;
-
- }
-
- public void run(IAction action) {
- if (fView == null)
- return;
-
- boolean pin = !fView.isPinMBDisplay();
- fView.setPinMBDisplay(pin);
-
- action.setChecked(pin);
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PropertyChangeNotifier.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PropertyChangeNotifier.java
deleted file mode 100644
index 4b50660d2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PropertyChangeNotifier.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-
-/**
- * Fire properties changes events in ISafeRunnable to ensure that
- * exceptions are caught and handled.
- * @since 3.1
- */
-public class PropertyChangeNotifier implements ISafeRunnable
-{
-
- IPropertyChangeListener fListener;
- PropertyChangeEvent fEvt;
-
- public PropertyChangeNotifier(IPropertyChangeListener listener, PropertyChangeEvent evt)
- {
- fListener = listener;
- fEvt = evt;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable)
- */
- public void handleException(Throwable exception) {
- DebugUIPlugin.log(exception);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.ISafeRunnable#run()
- */
- public void run() throws Exception {
- fListener.propertyChange(fEvt);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveMemoryRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveMemoryRenderingAction.java
deleted file mode 100644
index 0b5618cba..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveMemoryRenderingAction.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
-import org.eclipse.jface.action.Action;
-
-
-/**
- * Remove Memory Rendering action
- * This action serves two purposes:
- * - remove memory rendering from Memory Rendering Pane
- * - quck way to remove a memory block from Memory Rendering Pane
- *
- * When user clicks on the this tool bar action, it simply removes
- * the top view tab from Memory Rendering Pane.
- * @since 3.0
- */
-public class RemoveMemoryRenderingAction extends Action
-{
- private IMemoryRenderingContainer fViewPane;
- public RemoveMemoryRenderingAction(IMemoryRenderingContainer viewPane)
- {
- // create action as drop down
- super(DebugUIMessages.RemoveMemoryRenderingAction_Remove_rendering, AS_PUSH_BUTTON);
- setText(DebugUIMessages.RemoveMemoryRenderingAction_Remove_rendering);
-
- setToolTipText(DebugUIMessages.RemoveMemoryRenderingAction_Remove_rendering);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_REMOVE_MEMORY));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_REMOVE_MEMORY));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_REMOVE_MEMORY));
- fViewPane = viewPane;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
-
- // user has click on the RemoveMemoryRendering button
- IMemoryViewTab topTab = getViewTab();
-
- if (topTab != null)
- {
- IMemoryRendering rendering = topTab.getRendering();
-
- if (rendering != null)
- {
- fViewPane.removeMemoryRendering(rendering);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see com.ibm.debug.defaultrenderings.internal.actions.AbstractMemoryAction#getViewTab()
- */
- IMemoryViewTab getViewTab() {
- if (fViewPane instanceof IMemoryView)
- {
- return ((IMemoryView)fViewPane).getTopMemoryTab();
- }
- return null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveRenderingContextAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveRenderingContextAction.java
deleted file mode 100644
index c908ef62b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveRenderingContextAction.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
-import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
-/**
- * @since 3.0
- *
- */
-public class RemoveRenderingContextAction implements IViewActionDelegate {
-
- private IMemoryRenderingSite fMemoryView;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- if (view instanceof IMemoryRenderingSite)
- {
- fMemoryView = (IMemoryRenderingSite)view;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- if (fMemoryView == null)
- return;
-
- IMemoryRenderingContainer container = getRenderingContainer(action);
- if (container != null)
- {
- RemoveMemoryRenderingAction removeAction = new RemoveMemoryRenderingAction(container);
- removeAction.run();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- IMemoryRenderingContainer container = getRenderingContainer(action);
- if (container instanceof RenderingViewPane)
- {
- if (!((RenderingViewPane)container).canRemoveRendering())
- action.setEnabled(false);
- else
- action.setEnabled(true);
- }
- }
-
- /**
- * @param action
- * @return
- */
- private IMemoryRenderingContainer getRenderingContainer(IAction action) {
- IMemoryRenderingContainer[] viewPanes = fMemoryView.getMemoryRenderingContainers();
- String actionId = action.getId();
- IMemoryRenderingContainer selectedPane = null;
-
- for (int i=0; i<viewPanes.length; i++)
- {
- if (actionId.indexOf(viewPanes[i].getId()) != -1)
- {
- selectedPane = viewPanes[i];
- break;
- }
- }
-
- return selectedPane;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java
deleted file mode 100644
index a2cf26290..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java
+++ /dev/null
@@ -1,1276 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * WindRiver - Bug 192028 [Memory View] Memory view does not
- * display memory blocks that do not reference IDebugTarget
- * ARM - Bug 192028 [Memory View] Memory view does not
- * display memory blocks that do not reference IDebugTarget
- * WindRiver - Bug 216509 [Memory View] typo, s/isMeomryBlockRemoved/isMemoryBlockRemoved
- * Wind River Systems - Ted Williams - [Memory View] Memory View: Workflow Enhancements (Bug 215432)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory;
-
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.views.memory.renderings.CreateRendering;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
-import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
-import org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService;
-import org.eclipse.debug.ui.memory.IResettableMemoryRendering;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ColorRegistry;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.CTabFolder2Adapter;
-import org.eclipse.swt.custom.CTabFolderEvent;
-import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPreferenceConstants;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.UIJob;
-
-
-
-/**
- * Represents a rendering view pane in the Memory View.
- * This hosts the memory view tabs in the view.
- * @since 3.1
- *
- */
-public class RenderingViewPane extends AbstractMemoryViewPane implements IMemoryRenderingContainer{
-
- public static final String RENDERING_VIEW_PANE_ID = DebugUIPlugin.getUniqueIdentifier() + ".MemoryView.RenderingViewPane"; //$NON-NLS-1$
-
- private Hashtable fTabFolderForMemoryBlock = new Hashtable();
- private Hashtable fMemoryBlockFromTabFolder = new Hashtable();
-
- private ViewPaneRenderingMgr fRenderingMgr;
-
- private IMemoryRenderingSite fRenderingSite;
- private Set fAddedRenderings = new HashSet();
- private Set fAddedMemoryBlocks = new HashSet();
-
- private boolean fCanAddRendering = true;
- private boolean fCanRemoveRendering = true;
-
- private boolean fIsDisposed = false;
-
- /**
- * @param parent is the view hosting this view pane
- * @param paneId is the identifier assigned by the Memory View
- *
- * Pane id is assigned with the following format.
- * Rendering view pane created has its id assigned to
- * org.eclipse.debug.ui.MemoryView.RenderingViewPane.#.
- * # is a number indicating the order of which the rendering view
- * pane is created. First rendering view pane created will have its
- * id assigned to org.eclipse.debug.ui.MemoryView.RenderingViewPane.1.
- * Second rendering view pane created will have its id assigned to
- * org.eclipse.debug.ui.MemoryView.RenderingViewPane.2. and so on.
- * View pane are created from left to right by the Memory View.
- *
- */
- public RenderingViewPane(IViewPart parent) {
- super(parent);
-
- if (parent instanceof IMemoryRenderingSite)
- fRenderingSite = (IMemoryRenderingSite)parent;
- else
- {
- DebugUIPlugin.logErrorMessage("Parent for the rendering view pane is invalid."); //$NON-NLS-1$
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.memory.IMemoryBlockListener#MemoryBlockAdded(org.eclipse.debug.core.model.IMemoryBlock)
- */
- public void memoryBlocksAdded(final IMemoryBlock[] memoryBlocks) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
-
- if (isDisposed())
- return;
-
- // check condition before doing anything
- if (memoryBlocks == null || memoryBlocks.length <= 0)
- return;
-
- for (int i=0; i<memoryBlocks.length; i++)
- {
- IMemoryBlock memory = memoryBlocks[i];
-
- if (!fTabFolderForMemoryBlock.containsKey(memory))
- {
- createFolderForMemoryBlock(memory);
- }
- fAddedMemoryBlocks.add(memory);
- updateToolBarActionsEnablement();
- }
- }});
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.memory.IMemoryBlockListener#MemoryBlockRemoved(org.eclipse.debug.core.model.IMemoryBlock)
- */
- public void memoryBlocksRemoved(final IMemoryBlock[] memoryBlocks) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- for (int j=0; j<memoryBlocks.length; j++)
- {
- IMemoryBlock mbRemoved = memoryBlocks[j];
- if (fTabFolderForMemoryBlock == null)
- {
- return;
- }
-
- // get all renderings from this memory block and remove them from the view
- IMemoryRendering[] renderings = fRenderingMgr.getRenderingsFromMemoryBlock(mbRemoved);
-
- for (int k=0; k<renderings.length; k++)
- {
- removeMemoryRendering(renderings[k]);
- }
-
- // remove a the tab folder if the memory block is removed
- CTabFolder tabFolder =
- (CTabFolder) fTabFolderForMemoryBlock.get(mbRemoved);
-
- if (tabFolder == null)
- continue;
-
- fTabFolderForMemoryBlock.remove(mbRemoved);
- fMemoryBlockFromTabFolder.remove(tabFolder);
- IMemoryBlockRetrieval retrieve = MemoryViewUtil.getMemoryBlockRetrieval(mbRemoved);
- if (retrieve != null)
- {
- if (fTabFolderForDebugView.contains(tabFolder))
- {
- fTabFolderForDebugView.remove(MemoryViewUtil.getHashCode(retrieve));
- }
- }
-
- if (!tabFolder.isDisposed()) {
- // dispose all view tabs belonging to the tab folder
- CTabItem[] items = tabFolder.getItems();
-
- for (int i=0; i<items.length; i++)
- {
- disposeTab(items[i]);
- }
-
- // dispose the tab folder
- tabFolder.dispose();
-
- // if this is the top control
- if (tabFolder == fStackLayout.topControl)
- {
-
- // if memory view is visible and have a selection
- // follow memory view's selection
-
- ISelection selection = DebugUIPlugin.getActiveWorkbenchWindow().getSelectionService().getSelection(IDebugUIConstants.ID_MEMORY_VIEW);
- IMemoryBlock mbToSelect = getMemoryBlock(selection);
-
- if (mbToSelect != null)
- {
- // memory view may not have got the event and is still displaying
- // the deleted memory block
- if (mbToSelect != mbRemoved)
- handleMemoryBlockSelection(null, mbToSelect);
- else if ((MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieve).length > 0))
- {
- mbToSelect = MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieve)[0];
- handleMemoryBlockSelection(null, mbToSelect);
- }
- else
- {
- emptyFolder();
- }
- }
- else if (MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieve).length > 0)
- { // get to the next folder
- mbToSelect = MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieve)[0];
- handleMemoryBlockSelection(null, mbToSelect);
- }
- else
- {
- emptyFolder();
-
- }
- }
-
- // if not the top control
- // no need to do anything
- }
-
- fAddedMemoryBlocks.remove(mbRemoved);
- updateToolBarActionsEnablement();
- }
- }
- });
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(final IWorkbenchPart part, final ISelection selection) {
- if (fIsDisposed)
- return;
-
- // do not schedule job if any of these conditions are true
- if(part == RenderingViewPane.this)
- return;
-
- if (!(selection instanceof IStructuredSelection))
- return;
-
- if (selection == AbstractMemoryViewPane.EMPTY)
- return;
-
- UIJob job = new UIJob("RenderingViewPane selectionChanged"){ //$NON-NLS-1$
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- try {
-
- if (isDisposed())
- return Status.OK_STATUS;
-
- if (selection.isEmpty())
- {
- // if the event comes from Memory View
- // pick empty tab folder as the memory view is no longer displaying anything
- if (part.getSite().getId().equals(IDebugUIConstants.ID_MEMORY_VIEW))
- {
- if (part == getMemoryRenderingSite().getSite().getPart())
- {
- IMemoryViewTab lastViewTab = getTopMemoryTab();
-
- if (lastViewTab != null)
- lastViewTab.setEnabled(false);
-
- emptyFolder();
- }
- }
-
- // do not do anything if there is no selection
- // In the case when a debug adpater fires a debug event incorrectly, Launch View sets
- // selection to nothing. If the view tab is disabled, it erases all the "delta" information
- // in the content. This may not be desirable as it will cause memory to show up as
- // unchanged when it's actually changed. Do not disable the view tab until there is a
- // valid selection.
-
- return Status.OK_STATUS;
- }
-
- // back up current view tab
- IMemoryViewTab lastViewTab = getTopMemoryTab();
-
- if (!(selection instanceof IStructuredSelection))
- return Status.OK_STATUS;
-
- Object elem = ((IStructuredSelection)selection).getFirstElement();
-
- if (elem instanceof IMemoryBlock)
- {
- // if the selection event comes from this view
- if (part == getMemoryRenderingSite())
- {
- // find the folder associated with the given IMemoryBlockRetrieval
- IMemoryBlock memBlock = (IMemoryBlock)elem;
-
- // should never get here... added code for safety
- if (fTabFolderForMemoryBlock == null)
- {
- if (lastViewTab != null)
- lastViewTab.setEnabled(false);
-
- emptyFolder();
- return Status.OK_STATUS;
- }
-
- handleMemoryBlockSelection(lastViewTab, memBlock);
- }
- }
- }
- catch(SWTException se)
- {
- DebugUIPlugin.log(se);
- }
- return Status.OK_STATUS;
- }};
- job.setSystem(true);
- job.schedule();
- }
-
- public void handleMemoryBlockSelection(final IMemoryViewTab lastViewTab, final IMemoryBlock memBlock) {
- // Do not check if the debug target of mb is removed
- // We should not get into this method if the debug target of the memory block is terminated
- // Memory Block Manager gets the terminate event and would have removed all memory blocks
- // associated with the debug target
- // Therefore, we will never try to set a selection to a memory block whose target is terminated
-
- // check current memory block
- CTabFolder currentFolder = (CTabFolder) fStackLayout.topControl;
- if (currentFolder != null && !currentFolder.isDisposed()) {
- IMemoryBlock currentBlk = (IMemoryBlock) fMemoryBlockFromTabFolder.get(currentFolder);
- if (currentBlk != null) {
- if (currentBlk == memBlock)
- return;
- }
- }
-
- if (getTopMemoryTab() != null) {
- if (getTopMemoryTab().getRendering().getMemoryBlock() == memBlock) {
- return;
- }
- }
-
- // if we've got a tabfolder to go with the IMemoryBlock, display
- // it
- if (fTabFolderForMemoryBlock.containsKey(memBlock)) {
- if (fStackLayout.topControl != (CTabFolder) fTabFolderForMemoryBlock.get(memBlock)) {
- setTabFolder((CTabFolder) fTabFolderForMemoryBlock.get(memBlock));
- fViewPaneCanvas.layout();
- }
- } else { // otherwise, add a new one
- CTabFolder folder = createTabFolder(fViewPaneCanvas);
-
- fTabFolderForMemoryBlock.put(memBlock, folder);
- fMemoryBlockFromTabFolder.put(folder, memBlock);
- setTabFolder((CTabFolder) fTabFolderForMemoryBlock.get(memBlock));
- fViewPaneCanvas.layout();
- fAddedMemoryBlocks.add(memBlock);
-
- newCreateRenderingForFolder(memBlock, folder);
- }
-
- // restore view tabs
- IMemoryRendering[] renderings = fRenderingMgr.getRenderingsFromMemoryBlock(memBlock);
- CTabFolder toDisplay = (CTabFolder) fStackLayout.topControl;
-
- // if only CreateRendering is present, restore renderings
- if (isRestoreViewTabs(toDisplay)) {
- restoreViewTabs(renderings);
- }
-
- // disable last view tab as it becomes hidden
- IMemoryViewTab newViewTab = getTopMemoryTab();
-
- if (lastViewTab != null && lastViewTab != newViewTab) {
- lastViewTab.setEnabled(false);
- }
-
- if (newViewTab != null) {
- // if new view tab is not already enabled, enable it
- if (!newViewTab.isEnabled()) {
- // if the view tab is visible, enable it
- if (fVisible) {
- newViewTab.setEnabled(fVisible);
- }
- }
- }
-
- IMemoryViewTab viewTab = getTopMemoryTab();
- if (viewTab != null)
- setRenderingSelection(viewTab.getRendering());
-
- //set toolbar actions enabled/disabled
- updateToolBarActionsEnablement();
- }
-
- private boolean isRestoreViewTabs(CTabFolder folder)
- {
- if (canAddRendering())
- return (folder.getItemCount() == 1 && getTopMemoryTab().getRendering() instanceof CreateRendering);
- else
- return (folder.getItemCount() == 0);
- }
-
- private int getIndexOfCreateRenderingTab(CTabFolder folder)
- {
- for(int i = 0; i < folder.getItemCount(); i++)
- if(folder.getItem(i).getData() instanceof MemoryViewTab &&
- ((MemoryViewTab) folder.getItem(i).getData()).getRendering() instanceof CreateRendering)
- return i;
-
- return -1;
- }
-
- public void memoryBlockRenderingAdded(final IMemoryRendering rendering) {
-
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
-
- if (isDisposed())
- return;
-
- if (fAddedRenderings.contains(rendering))
- return;
-
- IMemoryBlock memoryblk = rendering.getMemoryBlock();
-
- CTabFolder tabFolder = (CTabFolder) fTabFolderForMemoryBlock.get(memoryblk);
-
- if (tabFolder == null)
- {
- tabFolder = createFolderForMemoryBlock(memoryblk);
- }
-
- if (tabFolder == fStackLayout.topControl)
- {
- // disable current view tab
- if (getTopMemoryTab() != null) {
- deactivateRendering(getTopMemoryTab());
- getTopMemoryTab().setEnabled(false);
- }
- }
- fAddedRenderings.add(rendering);
-
- int index = getIndexOfCreateRenderingTab(tabFolder);
- if (index < 0)
- index = 0;
- CTabItem tab = createTab(tabFolder, index);
-
- MemoryViewTab viewTab = new MemoryViewTab(tab, rendering,getInstance());
- tabFolder.setSelection(tabFolder.indexOf(tab));
-
- if (tabFolder == fStackLayout.topControl)
- {
- setRenderingSelection(viewTab.getRendering());
-
- // disable top view tab if the view pane is not visible
- IMemoryViewTab top = getTopMemoryTab();
- if (top != null)
- top.setEnabled(fVisible);
- }
- else
- {
- deactivateRendering(viewTab);
- viewTab.setEnabled(false);
- }
-
- updateToolBarActionsEnablement();
- }
- });
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.memory.IMemoryRenderingListener#MemoryBlockRenderingRemoved(org.eclipse.debug.internal.core.memory.IMemoryRendering)
- */
- public void memoryBlockRenderingRemoved(final IMemoryRendering rendering) {
- final IMemoryBlock memory = rendering.getMemoryBlock();
-
- // need to run the following code on the UI Thread to avoid invalid thread access exception
- Display.getDefault().asyncExec(new Runnable()
- {
- public void run()
- {
- if (!fAddedRenderings.contains(rendering))
- return;
-
- fAddedRenderings.remove(rendering);
-
- CTabFolder tabFolder = (CTabFolder) fStackLayout.topControl;
-
- if (tabFolder.isDisposed())
- return;
-
- CTabItem[] tabs = tabFolder.getItems();
- boolean foundTab = false;
- for (int i = 0; i < tabs.length; i++)
- {
- IMemoryViewTab viewTab = (IMemoryViewTab) tabs[i].getData();
-
- if (tabs[i].isDisposed())
- continue;
-
-
- if (viewTab.getRendering().getMemoryBlock() == memory)
- {
- if (viewTab.getRendering() == rendering)
- {
- foundTab = true;
- disposeTab(tabs[i]);
- break;
- }
-
- }
- }
-
- // if a tab is not found in the current top control
- // this deletion is a result of a debug target termination
- // find memory from other folder and dispose the view tab
- if (!foundTab)
- {
- Enumeration enumeration = fTabFolderForMemoryBlock.elements();
- while (enumeration.hasMoreElements())
- {
- CTabFolder otherTabFolder = (CTabFolder) enumeration.nextElement();
- tabs = otherTabFolder.getItems();
- IMemoryViewTab viewTab = null;
- for (int i = 0; i < tabs.length; i++)
- {
- viewTab = (IMemoryViewTab) tabs[i].getData();
- if (viewTab.getRendering().getMemoryBlock() == memory)
- {
- if (viewTab.getRendering() == rendering)
- {
- foundTab = true;
- disposeTab(tabs[i]);
- break;
- }
- }
- }
- }
- }
- IMemoryViewTab top = getTopMemoryTab();
-
- // update selection
- if (top != null)
- setRenderingSelection(top.getRendering());
-
- updateToolBarActionsEnablement();
- }
- });
-
- }
-
- /**
- * @param viewTab
- */
- protected void setRenderingSelection(IMemoryRendering rendering) {
-
- if (rendering != null)
- {
- fSelectionProvider.setSelection(new StructuredSelection(rendering));
- }
- }
-
- private void restoreViewTabs(IMemoryRendering[] renderings)
- {
- for (int i=0; i<renderings.length; i++)
- {
- memoryBlockRenderingAdded(renderings[i]);
- }
- }
-
- private void handleDebugElementSelection(final IMemoryViewTab lastViewTab, final IAdaptable element)
- {
- // get current memory block retrieval and debug target
- IMemoryBlockRetrieval currentRetrieve = null;
-
- // get tab folder
- CTabFolder tabFolder = (CTabFolder) fStackLayout.topControl;
-
- // get memory block
- IMemoryBlock currentBlock = (IMemoryBlock)fMemoryBlockFromTabFolder.get(tabFolder);
-
- if (currentBlock != null)
- {
- currentRetrieve = MemoryViewUtil.getMemoryBlockRetrieval(currentBlock);
-
- // backup current retrieve and tab folder
- if (currentRetrieve != null && tabFolder != null)
- {
- fTabFolderForDebugView.put(MemoryViewUtil.getHashCode(currentRetrieve), tabFolder);
- }
- }
-
- // find the folder associated with the given IMemoryBlockRetrieval
- IMemoryBlockRetrieval retrieve = MemoryViewUtil.getMemoryBlockRetrieval(element);
-
- // if debug target has changed
- // switch to that tab folder
- if (retrieve != null && retrieve != currentRetrieve)
- {
- Integer key = MemoryViewUtil.getHashCode(retrieve);
- CTabFolder folder = (CTabFolder)fTabFolderForDebugView.get(key);
-
- if (folder != null)
- {
- setTabFolder(folder);
- fTabFolderForDebugView.put(key, folder);
- fViewPaneCanvas.layout();
- }
- else
- {
- // find out if there is any memory block for this debug target
- // and set up tab folder for the memory blocks
- IMemoryBlock blocks[] = MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieve);
-
- if (blocks.length > 0)
- {
- handleMemoryBlockSelection(null, blocks[0]);
- }
- else
- {
- emptyFolder();
- fTabFolderForDebugView.put(key, fEmptyTabFolder);
- fViewPaneCanvas.layout();
- }
- }
- }
-
- // disable last view tab as it becomes hidden
- IMemoryViewTab newViewTab = getTopMemoryTab();
-
- if (lastViewTab != null && lastViewTab != newViewTab)
- {
- lastViewTab.setEnabled(false);
- }
-
- if (newViewTab != null)
- {
- // if new view tab is not already enabled, enable it
- if (!newViewTab.isEnabled())
- {
- // if the view tab is visible, enable it
- if (fVisible)
- {
- newViewTab.setEnabled(fVisible);
- }
- }
-
- // should only change selection if the new view tab is different
- if (lastViewTab != newViewTab)
- setRenderingSelection(newViewTab.getRendering());
- }
- //set toolbar actions enabled/disabled
- updateToolBarActionsEnablement();
- }
-
- protected void addListeners() {
- super.addListeners();
-
- // must directly listen for selection events from parent's selection provider
- // to ensure that we get the selection event from the tree viewer pane even
- // if the view does not have focuse
- fParent.getSite().getSelectionProvider().addSelectionChangedListener(this);
- }
- protected void removeListeners() {
- super.removeListeners();
- fParent.getSite().getSelectionProvider().removeSelectionChangedListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e) {
-
- if (getTopMemoryTab() == null)
- return;
-
- IMemoryRendering rendering = getTopMemoryTab().getRendering();
-
- if (rendering != null)
- {
- fSelectionProvider.setSelection(new StructuredSelection(rendering));
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
- */
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- public Object getCurrentSelection() {
- if (getTopMemoryTab() != null)
- if (getTopMemoryTab().getRendering() != null)
- return getTopMemoryTab().getRendering();
- return null;
- }
-
- /* (non-Javadoc)
- * @see com.ibm.debug.extended.ui.IMemoryView#getAllViewTabs()
- */
- public IMemoryViewTab[] getAllViewTabs() {
-
- // otherwise, find the view tab to display
- CTabFolder folder = (CTabFolder) fStackLayout.topControl;
- CTabItem[] items = folder.getItems();
-
- IMemoryViewTab[] viewTabs = new IMemoryViewTab[folder.getItemCount()];
-
- for(int i=0; i<items.length; i++){
- viewTabs[i] = (IMemoryViewTab)items[i].getData();
- }
-
- return viewTabs;
- }
-
- /* (non-Javadoc)
- * @see com.ibm.debug.extended.ui.IMemoryView#moveToTop(com.ibm.debug.extended.ui.IMemoryViewTab)
- */
- public void moveToTop(IMemoryViewTab viewTab) {
-
- IMemoryViewTab lastViewTab = getTopMemoryTab();
-
- if (viewTab == lastViewTab)
- return;
-
- // otherwise, find the view tab to display
- CTabFolder folder = (CTabFolder) fStackLayout.topControl;
- CTabItem[] items = folder.getItems();
-
- for (int i = 0; i < items.length; i++) {
- IMemoryViewTab tab =
- (IMemoryViewTab) items[i].getData();
- if (viewTab == tab) {
-
- boolean isEnabled = lastViewTab.isEnabled();
-
- // switch to that viewTab
- lastViewTab.setEnabled(false);
- folder.setSelection(i);
-
- setRenderingSelection(tab.getRendering());
-
- getTopMemoryTab().setEnabled(isEnabled && fVisible);
- break;
- }
- }
- }
-
- private CTabFolder createTabFolder(Composite parent)
- {
- CTabFolder folder = new CTabFolder(parent, SWT.NO_REDRAW_RESIZE | SWT.NO_TRIM | SWT.FLAT);
-
- ColorRegistry reg = JFaceResources.getColorRegistry();
- Color c1 = reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_BG_START"), //$NON-NLS-1$
- c2 = reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_BG_END"); //$NON-NLS-1$
- folder.setSelectionBackground(new Color[] {c1, c2}, new int[] {100}, true);
- folder.setSelectionForeground(reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_TEXT_COLOR")); //$NON-NLS-1$
- folder.setSimple(PlatformUI.getPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS));
- folder.setBorderVisible(true);
- folder.setFont(fViewPaneCanvas.getFont());
-
- folder.addCTabFolder2Listener(new CTabFolder2Adapter() {
- public void close(CTabFolderEvent event) {
- if(event.item.getData() instanceof MemoryViewTab)
- RenderingViewPane.this.removeMemoryRendering(((MemoryViewTab) event.item.getData()).getRendering());
- event.doit = false;
- }
- });
- return folder;
- }
-
- public void restoreViewPane() {
-
- // get current selection from memory view
-
- ISelection selection = null;
- if (fParent.getSite().getSelectionProvider() != null)
- selection = fParent.getSite().getSelectionProvider().getSelection();
-
- IMemoryBlock memoryBlock = null;
- if (selection != null)
- {
- memoryBlock = getMemoryBlock(selection);
- }
-
- if (memoryBlock == null)
- {
- // get selection from this view
- selection = fSelectionProvider.getSelection();
-
- if (MemoryViewUtil.isValidSelection(selection))
- {
- Object elem = ((IStructuredSelection)selection).getFirstElement();
-
- if (!(elem instanceof IMemoryBlock))
- return;
-
- memoryBlock = (IMemoryBlock)elem;
- }
- }
-
- if (memoryBlock == null)
- {
- // get a memory block from current debug context
- IAdaptable context = DebugUITools.getDebugContext();
- if (context != null)
- {
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
-
- if (retrieval != null)
- {
- IMemoryBlock[] blocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(retrieval);
- if (blocks.length > 0)
- memoryBlock = blocks[0];
- }
- }
- }
-
- if (memoryBlock != null)
- {
- if (!fTabFolderForMemoryBlock.containsKey(memoryBlock))
- {
- // create tab folder if a tab folder does not already exist
- // for the memory block
- CTabFolder folder = createTabFolder(fViewPaneCanvas);
-
- fTabFolderForMemoryBlock.put(memoryBlock, folder);
- fMemoryBlockFromTabFolder.put(folder, memoryBlock);
- setTabFolder((CTabFolder)fTabFolderForMemoryBlock.get(memoryBlock));
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(memoryBlock);
- if (retrieval != null)
- fTabFolderForDebugView.put(MemoryViewUtil.getHashCode(retrieval), fTabFolderForMemoryBlock.get(memoryBlock));
- else
- DebugUIPlugin.logErrorMessage("Memory block retrieval for memory block is null."); //$NON-NLS-1$
-
- fViewPaneCanvas.layout();
- fAddedMemoryBlocks.add(memoryBlock);
-
- // every time we create a folder, we have to create a CreateRendering
- newCreateRenderingForFolder(memoryBlock, folder);
- }
-
- if (fTabFolderForMemoryBlock.containsKey(memoryBlock))
- {
- CTabFolder toDisplay = (CTabFolder)fTabFolderForMemoryBlock.get(memoryBlock);
-
- if (toDisplay != null)
- {
- setTabFolder(toDisplay);
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(memoryBlock);
-
- if (retrieval != null)
- fTabFolderForDebugView.put(MemoryViewUtil.getHashCode(retrieval), toDisplay);
- else
- DebugUIPlugin.logErrorMessage("Memory block retrieval is null for memory block."); //$NON-NLS-1$
-
- fViewPaneCanvas.layout();
-
- // restore view tabs
- IMemoryRendering[] renderings = fRenderingMgr.getRenderingsFromMemoryBlock(memoryBlock);
-
- // if only CreateRendering is present, restore renderings
- if (isRestoreViewTabs(toDisplay))
- {
- restoreViewTabs(renderings);
- }
- }
- }
-
- // disable current storag block
-
- IMemoryViewTab top = getTopMemoryTab();
-
- if (top != null)
- top.setEnabled(fVisible);
- }
- }
-
- public void dispose() {
- fIsDisposed = true;
-
- super.dispose();
-
- fTabFolderForMemoryBlock.clear();
- fTabFolderForMemoryBlock = null;
-
- fMemoryBlockFromTabFolder.clear();
- fMemoryBlockFromTabFolder = null;
-
- fRenderingMgr.dispose();
- fRenderingMgr = null;
-
- fAddedMemoryBlocks.clear();
- fAddedRenderings.clear();
- }
-
- public Control createViewPane(Composite parent, String paneId, String label, boolean canAddRendering, boolean canRemoveRendering) {
- return doCreateViewPane(parent, paneId, label, canAddRendering, canRemoveRendering);
- }
-
- public Control createViewPane(Composite parent, String paneId, String label) {
- return doCreateViewPane(parent, paneId, label, true, true);
- }
-
- /**
- * @param parent
- * @param paneId
- * @param label
- * @param canAddRendering
- * @param canRemoveRendering
- * @return
- */
- private Control doCreateViewPane(Composite parent, String paneId, String label, boolean canAddRendering,
- boolean canRemoveRendering) {
- Control control = super.createViewPane(parent, paneId, label);
- fCanAddRendering = canAddRendering;
- fCanRemoveRendering = canRemoveRendering;
- fRenderingMgr = new ViewPaneRenderingMgr(this);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugUIConstants.PLUGIN_ID + ".MemoryRenderingView_context"); //$NON-NLS-1$
- return control;
- }
-
- public IAction[] getActions() {
- return new IAction[0];
- }
-
- // enable/disable toolbar action
- protected void updateToolBarActionsEnablement()
- {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.AbstractMemoryViewPane#emptyFolder()
- */
- protected void emptyFolder() {
- super.emptyFolder();
- updateToolBarActionsEnablement();
- fSelectionProvider.setSelection(AbstractMemoryViewPane.EMPTY);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IRenderingViewPane#addMemoryRendering(org.eclipse.debug.internal.ui.views.memory.IMemoryRendering)
- */
- public void addMemoryRendering(IMemoryRendering rendering) {
-
- if (rendering == null)
- return;
-
- memoryBlockRenderingAdded(rendering);
- fRenderingMgr.addMemoryBlockRendering(rendering);
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IRenderingViewPane#removeMemoryRendering(org.eclipse.debug.internal.ui.views.memory.IMemoryRendering)
- */
- public void removeMemoryRendering(IMemoryRendering rendering) {
-
- if (rendering == null)
- return;
-
- memoryBlockRenderingRemoved(rendering);
-
- if (fRenderingMgr != null)
- fRenderingMgr.removeMemoryBlockRendering(rendering);
-
- }
-
- private RenderingViewPane getInstance()
- {
- return this;
- }
-
- private IMemoryBlock getMemoryBlock(ISelection selection)
- {
- if (!(selection instanceof IStructuredSelection))
- return null;
-
- //only single selection of PICLDebugElements is allowed for this action
- if (selection.isEmpty() || ((IStructuredSelection)selection).size() > 1)
- {
- return null;
- }
-
- Object elem = ((IStructuredSelection)selection).getFirstElement();
-
- if (elem instanceof IMemoryBlock)
- return (IMemoryBlock)elem;
- else if (elem instanceof IMemoryRendering)
- return ((IMemoryRendering)elem).getMemoryBlock();
- else
- return null;
- }
-
- private void deactivateRendering(IMemoryViewTab viewTab)
- {
- if (viewTab == null)
- return;
-
- if (!viewTab.isDisposed())
- {
- viewTab.getRendering().deactivated();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IRenderingViewPane#getMemoryRenderingSite()
- */
- public IMemoryRenderingSite getMemoryRenderingSite() {
- return fRenderingSite;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingContainer#getId()
- */
- public String getId() {
- return getPaneId();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingContainer#getRenderings()
- */
- public IMemoryRendering[] getRenderings() {
- return fRenderingMgr.getRenderings();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingContainer#getActiveRendering()
- */
- public IMemoryRendering getActiveRendering() {
- if (getTopMemoryTab() == null)
- return null;
- return getTopMemoryTab().getRendering();
- }
-
- /**
- * Reset the memory renderings within this view pane.
- * @param memoryBlock - reset renderings associated with the given memory block
- * @param resetVisible - reset what's currently visible if the parameter is true.
- * Otherwise, the view pane will reset all renderings associated with the given
- * memory block.
- */
- public void resetRenderings(IMemoryBlock memoryBlock, boolean resetVisible)
- {
- // if we only reset what's visible and the view pane is not visible
- // do nothing.
- if (resetVisible && !isVisible())
- return;
-
- if(resetVisible)
- {
- IMemoryRendering rendering = getActiveRendering();
- if (rendering != null)
- {
- if (rendering.getMemoryBlock() == memoryBlock)
- {
- if (rendering instanceof IResettableMemoryRendering)
- {
- IResettableMemoryRendering resettableRendering = (IResettableMemoryRendering)rendering;
- try {
- resettableRendering.resetRendering();
- } catch (DebugException e) {
- // do not pop up error message
- // error message is annoying where there are multiple rendering
- // panes and renderings to reset
- }
- }
- }
- }
- }
- else
- {
- // get all renderings associated with the given memory block
- IMemoryRendering[] renderings = fRenderingMgr.getRenderingsFromMemoryBlock(memoryBlock);
-
- // back up current synchronization provider
- IMemoryRendering originalProvider = null;
- IMemoryRenderingSynchronizationService service = getMemoryRenderingSite().getSynchronizationService();
- if (service != null)
- originalProvider = service.getSynchronizationProvider();
-
- for (int i=0; i<renderings.length; i++)
- {
- if (renderings[i] instanceof IResettableMemoryRendering)
- {
- try {
-
- // This is done to allow user to select multiple memory monitors and
- // reset their renderings.
- // In this case, a hidden rendering will not be the sync provider to the sync
- // service. When the reset happens, the top visible address and selected
- // address is not updated in the sync service. When the rendering later
- // becomes visible, the rendering gets the sync info from the sync service
- // and will try to sync up with old information, giving user the impression
- // that the rendering was never reset. By forcing the rendering that we
- // are trying to reset as the synchronization provider, we ensure that
- // the rendering is able to update its sync info even though the rendering
- // is currently hidden.
- if (service != null)
- service.setSynchronizationProvider(renderings[i]);
- ((IResettableMemoryRendering)renderings[i]).resetRendering();
- } catch (DebugException e) {
- // do not pop up error message
- // error message is annoying where there are multiple rendering
- // panes and renderings to reset
- }
- }
- }
-
- // restore synchronization provider
- if (service != null)
- service.setSynchronizationProvider(originalProvider);
- }
- }
-
- private boolean isDisposed()
- {
- return fIsDisposed;
- }
-
- public void showCreateRenderingTab()
- {
- IMemoryRendering activeRendering = RenderingViewPane.this.getActiveRendering();
- if(activeRendering == null)
- return;
-
- IMemoryBlock memoryblk = activeRendering.getMemoryBlock();
-
- final CTabFolder tabFolder = (CTabFolder) fTabFolderForMemoryBlock.get(memoryblk);
- if (tabFolder != null)
- {
- Display.getDefault().asyncExec(new Runnable() {
- public void run()
- {
- int index = getIndexOfCreateRenderingTab(tabFolder);
- if (index >= 0)
- tabFolder.setSelection(index);
- }
- });
- }
- }
-
- public void contextActivated(final ISelection selection) {
-
- UIJob job = new UIJob("contextActivated"){ //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor)
- {
- if (isDisposed())
- return Status.OK_STATUS;
-
- IMemoryViewTab lastViewTab = getTopMemoryTab();
-
- if (MemoryViewUtil.isValidSelection(selection))
- {
- if (!(selection instanceof IStructuredSelection))
- return Status.OK_STATUS;
-
- Object elem = ((IStructuredSelection)selection).getFirstElement();
-
- if (elem instanceof IAdaptable)
- {
- handleDebugElementSelection(lastViewTab, (IAdaptable)elem);
- }
- }
- else
- {
- if (lastViewTab != null)
- lastViewTab.setEnabled(false);
-
- if (fStackLayout.topControl != fEmptyTabFolder)
- emptyFolder();
-
- }
- return Status.OK_STATUS;
- }};
- job.setSystem(true);
- job.schedule();
- }
-
- /**
- * @param memory
- */
- private CTabFolder createFolderForMemoryBlock(IMemoryBlock memory) {
- CTabFolder folder = createTabFolder(fViewPaneCanvas);
-
- fTabFolderForMemoryBlock.put(memory, folder);
- fMemoryBlockFromTabFolder.put(folder, memory);
-
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(memory);
- if (retrieval != null)
- {
- fTabFolderForDebugView.put(MemoryViewUtil.getHashCode(retrieval), folder);
- }
- else {
- DebugUIPlugin.logErrorMessage("Memory block retrieval for memory block is null"); //$NON-NLS-1$
- }
-
- newCreateRenderingForFolder(memory, folder);
-
- return folder;
- }
-
- private void newCreateRenderingForFolder(IMemoryBlock memory,
- CTabFolder folder) {
-
- if (!canAddRendering())
- return;
-
- CTabItem newItem = new CTabItem(folder, SWT.NONE);
- CreateRendering rendering = new CreateRendering(getInstance());
- rendering.init(getInstance(), memory);
- new MemoryViewTab(newItem, rendering, getInstance());
- folder.setSelection(0);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener#contextEvent(org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent)
- */
- public void debugContextChanged(DebugContextEvent event) {
- if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
- contextActivated(event.getContext());
- }
- }
-
- /**
- * @return whether this container allows user to add rendering manually
- * @since 3.4
- */
- public boolean canAddRendering()
- {
- return fCanAddRendering;
- }
-
- /**
- * @return whether this container allows user to remove rendering manually
- * @since 3.4
- */
- public boolean canRemoveRendering()
- {
- return fCanRemoveRendering;
- }
-
- /**
- * @param tabFolder
- * @param index
- * @return
- */
- private CTabItem createTab(CTabFolder tabFolder, int index) {
- int swtStyle = SWT.CLOSE;
- if (!canRemoveRendering())
- swtStyle = SWT.NONE;
- CTabItem tab = new CTabItem(tabFolder, swtStyle, index);
- return tab;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java
deleted file mode 100644
index ebcb6801f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
-/**
- * The popup menu action for a memory rendering used to reset the current selection
- * to the default first memory position
- *
- * @since 3.2.0
- */
-public class ResetMemoryBlockAction implements IViewActionDelegate{
-
- private IViewPart fView;
- private ArrayList fSelectedMB = new ArrayList();
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- fView = view;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- if (fSelectedMB.isEmpty()) {
- return;
- }
- boolean resetVisible = false;
- String resetPref = DebugUITools.getPreferenceStore().getString(IDebugPreferenceConstants.PREF_RESET_MEMORY_BLOCK);
- if (resetPref.equals(IDebugPreferenceConstants.RESET_VISIBLE)) {
- resetVisible = true;
- }
- Iterator iter = fSelectedMB.iterator();
- while(iter.hasNext()) {
- IMemoryBlock mb = (IMemoryBlock)iter.next();
- if (fView instanceof MemoryView) {
- MemoryView memView = (MemoryView)fView;
- IMemoryRenderingContainer[] containers = memView.getMemoryRenderingContainers();
-
- for (int i=0; i<containers.length; i++) {
- if (containers[i] instanceof RenderingViewPane) {
- ((RenderingViewPane)containers[i]).resetRenderings(mb, resetVisible);
- }
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- action.setEnabled(!selection.isEmpty());
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection strucSel = (IStructuredSelection) selection;
- Object[] objs = strucSel.toArray();
- fSelectedMB.clear();
- for (int i = 0; i < objs.length; i++) {
- if (objs[i] instanceof IMemoryBlock)
- fSelectedMB.add(objs[i]);
- if (objs[i] instanceof IMemoryRendering)
- fSelectedMB.add(((IMemoryRendering) objs[i]).getMemoryBlock());
- }
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockPreferencePage.java
deleted file mode 100644
index 1aa89987e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockPreferencePage.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.RadioGroupFieldEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.PlatformUI;
-
-public class ResetMemoryBlockPreferencePage extends FieldEditorPreferencePage{
-
- public ResetMemoryBlockPreferencePage()
- {
- super(FieldEditorPreferencePage.GRID);
- setPreferenceStore(DebugUITools.getPreferenceStore());
- setTitle(DebugUIMessages.ResetMemoryBlockPreferencePage_0);
- }
-
-
- protected void createFieldEditors() {
- RadioGroupFieldEditor editor = new RadioGroupFieldEditor(IDebugPreferenceConstants.PREF_RESET_MEMORY_BLOCK, DebugUIMessages.ResetMemoryBlockPreferencePage_1, 1, new String[][] {{DebugUIMessages.ResetMemoryBlockPreferencePage_2, IDebugPreferenceConstants.RESET_VISIBLE},{DebugUIMessages.ResetMemoryBlockPreferencePage_3, IDebugPreferenceConstants.RESET_ALL}}, getFieldEditorParent());
- addField(editor);
- }
-
- protected Control createContents(Composite parent) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugUIConstants.PLUGIN_ID + ".resetMemoryMonitor_preference_page_context"); //$NON-NLS-1$
- return super.createContents(parent);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java
deleted file mode 100644
index dfa60c091..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.actions.IAddMemoryBlocksTarget;
-import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
-
-/**
- * This is the retargettable add memory block action in the Memory View.
- * All AddMemoryBlock actions in the view will use this action to make sure
- * that clients can override the "Add Memory Monitor" dialog.
- *
- */
-public class RetargetAddMemoryBlockAction extends AddMemoryBlockAction {
-
- public RetargetAddMemoryBlockAction(IMemoryRenderingSite site)
- {
- super(site);
- }
-
- public RetargetAddMemoryBlockAction(IMemoryRenderingSite site, boolean addDefaultRenderings)
- {
- super(site, addDefaultRenderings);
- }
-
- public RetargetAddMemoryBlockAction(String text, int style, IMemoryRenderingSite site)
- {
- super(text, style, site);
- }
-
- public void run() {
- // get current selection from Debug View
- Object debugContext = DebugUITools.getDebugContext();
- IAddMemoryBlocksTarget target = getAddMemoryBlocksTarget(debugContext);
-
- if (target != null)
- {
- try {
- if (target.supportsAddMemoryBlocks(getMemoryView()))
- {
- target.addMemoryBlocks(getMemoryView(), getMemoryView().getSite().getSelectionProvider().getSelection());
- }
- else
- super.run();
- } catch (CoreException e) {
- DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), ActionMessages.RetargetAddMemoryBlockAction_0, ActionMessages.RetargetAddMemoryBlockAction_1, e);
- }
- }
- else
- {
- super.run();
- }
- }
-
- protected void updateAction(Object debugContext) {
-
- try {
- IAddMemoryBlocksTarget target = getAddMemoryBlocksTarget(debugContext);
-
- if (target != null)
- {
- if (target.supportsAddMemoryBlocks(getMemoryView()))
- {
- if (getMemoryView().getSite().getSelectionProvider() != null)
- setEnabled(target.canAddMemoryBlocks(getMemoryView(), getMemoryView().getSite().getSelectionProvider().getSelection()));
- else
- super.updateAction(debugContext);
- }
- else
- super.updateAction(debugContext);
- }
- else
- {
- super.updateAction(debugContext);
- }
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
-
- private IAddMemoryBlocksTarget getAddMemoryBlocksTarget(Object debugContext)
- {
- IMemoryBlockRetrieval standardMemRetrieval = MemoryViewUtil.getMemoryBlockRetrieval(debugContext);
-
- if (standardMemRetrieval == null)
- return null;
-
- IAddMemoryBlocksTarget target = null;
-
- if (standardMemRetrieval instanceof IAddMemoryBlocksTarget)
- {
- target = (IAddMemoryBlocksTarget) standardMemRetrieval;
- }
- else if (standardMemRetrieval instanceof IAdaptable)
- {
- target = (IAddMemoryBlocksTarget)((IAdaptable)standardMemRetrieval).getAdapter(IAddMemoryBlocksTarget.class);
- }
- return target;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SetPaddedStringPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SetPaddedStringPreferencePage.java
deleted file mode 100644
index 559c20c63..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SetPaddedStringPreferencePage.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.StringFieldEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.PlatformUI;
-
-public class SetPaddedStringPreferencePage extends FieldEditorPreferencePage {
-
- private StringFieldEditor fPaddedString;
-
- public SetPaddedStringPreferencePage()
- {
- super(FieldEditorPreferencePage.GRID);
- setPreferenceStore(DebugUITools.getPreferenceStore());
- setTitle(DebugUIMessages.SetPaddedStringDialog_0);
-
- }
-
- protected void createFieldEditors() {
- fPaddedString = new StringFieldEditor(IDebugUIConstants.PREF_PADDED_STR, DebugUIMessages.SetPaddedStringPreferencePage_0, getFieldEditorParent());
- fPaddedString.setEmptyStringAllowed(false);
- fPaddedString.setTextLimit(5);
- addField(fPaddedString);
- }
-
- protected Label createDescriptionLabel(Composite parent) {
- Label label = new Label(parent, SWT.NONE);
- label.setText(DebugUIMessages.SetPaddedStringDialog_1);
- return label;
- }
-
- protected Control createContents(Composite parent) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugUIConstants.PLUGIN_ID + ".SetPaddedStrDialog_context"); //$NON-NLS-1$
- return super.createContents(parent);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java
deleted file mode 100644
index a6d135739..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java
+++ /dev/null
@@ -1,410 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * WindRiver - Bug 192028 [Memory View] Memory view does not
- * display memory blocks that do not reference IDebugTarget
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IMemoryBlockListener;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.progress.UIJob;
-import org.eclipse.ui.progress.WorkbenchJob;
-
-/**
- * The switch memory block action, used
- */
-public class SwitchMemoryBlockAction extends Action implements IViewActionDelegate, IActionDelegate2 {
-
- /**
- * A job that updates the enablement of the of the backing action delegate in the UI thread
- *
- * @since 3.3.0
- */
- class UpdateActionEnablementJob extends UIJob {
-
- /**
- * Constructor
- */
- public UpdateActionEnablementJob() {
- super("Update Action Enablement"); //$NON-NLS-1$
- setSystem(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.IProgressMonitor)
- */
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if (fAction != null) {
- IAdaptable context = DebugUITools.getDebugContext();
- if (context != null) {
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
-
- if (retrieval != null) {
- IMemoryBlock[] memoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(retrieval);
- fAction.setEnabled(memoryBlocks.length > 0);
- return Status.OK_STATUS;
- }
- else if (getViewer() != null) {
- Object input = getViewer().getInput();
- if (input instanceof IMemoryBlockRetrieval) {
- retrieval = (IMemoryBlockRetrieval)input;
- IMemoryBlock[] memoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(retrieval);
- fAction.setEnabled(memoryBlocks.length > 0);
- return Status.OK_STATUS;
- }
- }
- }
- fAction.setEnabled(false);
- }
- return Status.CANCEL_STATUS;
- }
- }
-
- private IViewPart fView;
- private MenuCreator fMenuCreator;
- private IAction fAction;
- private UpdateActionEnablementJob fUpdateJob = new UpdateActionEnablementJob();
-
- /**
- * Memoryblock listener to update action delegate enablement
- */
- private IMemoryBlockListener fListener = new IMemoryBlockListener() {
- public void memoryBlocksAdded(IMemoryBlock[] memory) {
- if (fAction != null) {
- fUpdateJob.schedule();
- }
- }
-
- public void memoryBlocksRemoved(IMemoryBlock[] memory) {
- if (fAction != null) {
- fUpdateJob.schedule();
- }
- }
- };
-
- /**
- * Listens for debug context changes and updates action delegate enablement
- */
- private IDebugContextListener fDebugContextListener = new IDebugContextListener() {
- public void debugContextChanged(DebugContextEvent event) {
- if (fAction != null) {
- fUpdateJob.schedule();
- }
- }
- };
-
- /**
- * Switch tab folder for fMemoryBlock to the top in Memory Rendering View
- */
- class SwitchToAction extends Action {
- private IMemoryBlock fMemoryblock;
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- if (fView == null) {
- return;
- }
- // tell the view to switch memory block
- fView.getSite().getSelectionProvider().setSelection(new StructuredSelection(fMemoryblock));
- }
-
- public SwitchToAction(final IMemoryBlock memBlk, boolean buildLabel) {
- super();
- if (buildLabel) {
- setText(DebugUIMessages.SwitchMemoryBlockAction_4);
- Job job = new Job("SwtichToAction"){ //$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
- getLabels(memBlk);
- return Status.OK_STATUS;
- }};
- job.setSystem(true);
- job.schedule();
- }
- fMemoryblock = memBlk;
- }
-
- public SwitchToAction(final IMemoryBlock memBlk, String label) {
- super(label);
- fMemoryblock = memBlk;
- }
-
- private void getLabels(final IMemoryBlock memBlk) {
- StringBuffer text = new StringBuffer(IInternalDebugCoreConstants.EMPTY_STRING);
- String label = new String(IInternalDebugCoreConstants.EMPTY_STRING);
- if (memBlk instanceof IMemoryBlockExtension) {
- String expression = ((IMemoryBlockExtension)memBlk).getExpression();
- if (expression == null) {
- expression = DebugUIMessages.SwitchMemoryBlockAction_0;
- }
- text.append(expression);
- }
- else {
- long address = memBlk.getStartAddress();
- text.append(Long.toHexString(address));
- }
-
- label = text.toString();
- label = decorateLabel(memBlk, label);
-
- final String finalLabel = label;
- WorkbenchJob job = new WorkbenchJob("SwtichToAction Update Label") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- SwitchToAction.super.setText(finalLabel);
- return Status.OK_STATUS;
- }};
- job.setSystem(true);
- job.schedule();
- }
- }
-
- /**
- * Menu creator for the action
- */
- class MenuCreator implements IMenuCreator {
- Menu dropdown;
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#dispose()
- */
- public void dispose() {
- if (dropdown != null)
- dropdown.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
- */
- public Menu getMenu(Control parent) {
- if (dropdown != null) {
- dropdown.dispose();
- dropdown = null;
- }
- if (dropdown == null) {
- dropdown = new Menu(parent);
-
- // get all memory blocks from tree viewer
- IMemoryBlock[] allMemoryBlocks = null;
-
- // get selection from memory view
- IMemoryBlock memoryBlock = getCurrentMemoryBlock();
-
- Object context = DebugUITools.getDebugContext();
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
- if (retrieval != null) {
- allMemoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(retrieval);
- }
- if (allMemoryBlocks != null) {
- for (int i=0; i<allMemoryBlocks.length; i++) {
- SwitchToAction action = new SwitchToAction(allMemoryBlocks[i], true);
- if (allMemoryBlocks[i] == memoryBlock) {
- action.setChecked(true);
- }
- ActionContributionItem item = new ActionContributionItem(action);
- item.fill(dropdown, -1);
- item.getAction().setChecked(true);
- }
- }
- }
- return dropdown;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
- */
- public Menu getMenu(Menu parent) {
- return null;
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- fView = view;
- DebugUITools.getDebugContextManager().getContextService(fView.getViewSite().getWorkbenchWindow()).addDebugContextListener(fDebugContextListener);
- DebugPlugin.getDefault().getMemoryBlockManager().addListener(fListener);
- fUpdateJob.runInUIThread(new NullProgressMonitor());
- }
-
- /**
- * Returns the current memory blocks tree viewer, or <code>null</code>
- * @return the memory blocks tree viewer or <code>null</code>
- */
- private StructuredViewer getViewer() {
- if (fView instanceof MemoryView) {
- MemoryView memView = (MemoryView)fView;
- IMemoryViewPane pane = memView.getViewPane(MemoryBlocksTreeViewPane.PANE_ID);
- if (pane instanceof MemoryBlocksTreeViewPane) {
- StructuredViewer viewer = ((MemoryBlocksTreeViewPane)pane).getViewer();
- return viewer;
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- switchToNext();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- switchToNext();
- }
-
- private void switchToNext() {
- IAdaptable context = DebugUITools.getDebugContext();
- if (context instanceof IDebugElement) {
- IDebugElement debugContext = (IDebugElement)context;
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(debugContext);
-
- if (retrieval != null) {
- IMemoryBlock[] memoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(retrieval);
- doSwitchToNext(memoryBlocks);
- }
- }
- }
-
- /**
- * @param memoryBlocks
- */
- private void doSwitchToNext(IMemoryBlock[] memoryBlocks) {
- // only run if there is more than one memory block
- if (memoryBlocks.length > 1) {
- IMemoryBlock current = getCurrentMemoryBlock();
- int next = 0;
- if (current != null) {
- for (int i=0; i<memoryBlocks.length; i++) {
- if (memoryBlocks[i] == current) {
- next = i+1;
- }
- }
- }
- if (next > memoryBlocks.length-1) {
- next = 0;
- }
- SwitchToAction switchAction = new SwitchToAction(memoryBlocks[next], false);
- switchAction.run();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {}
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- fAction = action;
- fUpdateJob.runInUIThread(new NullProgressMonitor());
- fMenuCreator = new MenuCreator();
- action.setMenuCreator(fMenuCreator);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#dispose()
- */
- public void dispose() {
- fAction = null;
- DebugPlugin.getDefault().getMemoryBlockManager().removeListener(fListener);
- DebugUITools.getDebugContextManager().getContextService(fView.getViewSite().getWorkbenchWindow()).removeDebugContextListener(fDebugContextListener);
- if (fMenuCreator != null) {
- fMenuCreator.dispose();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- switchToNext();
- }
-
- /**
- * Returns the current memory block
- * @return the current memory block or <code>null</code>
- */
- private IMemoryBlock getCurrentMemoryBlock() {
- if (fView == null) {
- return null;
- }
- ISelection memBlkSelection = fView.getSite().getSelectionProvider().getSelection();
- IMemoryBlock memoryBlock = null;
-
- if (memBlkSelection != null) {
- if (!memBlkSelection.isEmpty() && memBlkSelection instanceof IStructuredSelection) {
- Object obj = ((IStructuredSelection)memBlkSelection).getFirstElement();
- if (obj instanceof IMemoryBlock) {
- memoryBlock = (IMemoryBlock)obj;
- }
- else if (obj instanceof IMemoryRendering) {
- memoryBlock = ((IMemoryRendering)obj).getMemoryBlock();
- }
- }
- }
- return memoryBlock;
- }
-
- /**
- * Decorate the label for the specified <code>IMemoryBlock</code>
- * @param memBlk
- * @param label
- * @return the decorated label for the specified <code>IMemoryBlock</code>
- */
- private String decorateLabel(final IMemoryBlock memBlk, String label) {
- ILabelDecorator decorator = (ILabelDecorator)memBlk.getAdapter(ILabelDecorator.class);
- if (decorator != null) {
- label = decorator.decorateText(label, memBlk);
- }
- return label;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SynchronizeInfo.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SynchronizeInfo.java
deleted file mode 100644
index 974b876eb..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SynchronizeInfo.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import org.eclipse.debug.core.model.IMemoryBlock;
-
-
-/**
- * Stores synchronization information for a memory block
- * Each object of synchronization information contains a memory block,
- * a list of views to be synchronized and a list of properties to be syncrhonized.
- * The views are responsible for defining properties to be synchronized and notifying
- * the synchronizer of properties changes. This is only for keeping track of
- * values of synchronized properties and firing events when properties are changed.
- *
- * Memory block serves as a key for synchronization. Views displaying the same
- * memory block can be synchronized. Views displaying different memory block
- * cannot be synchronized.
- *
- * @since 3.0
- */
-public class SynchronizeInfo
-{
- private IMemoryBlock fBlock; // memory block blocked by the views
- private Hashtable fProperties; // list of properties to be synchronized
-
- /**
- * Create a new synchronization info object for the memory block
- * @param block
- */
- public SynchronizeInfo(IMemoryBlock block)
- {
- fBlock = block;
- fProperties = new Hashtable();
- }
-
-
- /**
- * Set a property and its value to the info object
- * @param propertyId
- * @param value
- */
- public void setProperty(String propertyId, Object value)
- {
- if (propertyId == null)
- return;
-
- if (value == null)
- return;
-
- fProperties.put(propertyId, value);
- }
-
- /**
- * Returns the value of the property from the info object
- * @param propertyId
- * @return value of the property
- */
- public Object getProperty(String propertyId)
- {
- if (propertyId == null)
- return null;
-
- Object value = fProperties.get(propertyId);
-
- return value;
- }
-
- /**
- * @return all the property ids stored in this sync info object
- */
- public String[] getPropertyIds()
- {
- if (fProperties == null)
- return new String[0];
-
- Enumeration enumeration = fProperties.keys();
- ArrayList ids = new ArrayList();
-
- while (enumeration.hasMoreElements())
- {
- ids.add(enumeration.nextElement());
- }
-
- return (String[])ids.toArray(new String[ids.size()]);
- }
-
- /**
- * Clean up the synchronization info object
- */
- public void delete()
- {
-
- if (fProperties != null){
- fProperties.clear();
- fProperties = null;
- }
-
- if (fBlock != null){
- fBlock = null;
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleMemoryMonitorsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleMemoryMonitorsAction.java
deleted file mode 100644
index 8595c838f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleMemoryMonitorsAction.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory;
-
-
-/**
- * Toggles the visiblity of a view pane.
- * @since 3.1
- *
- */
-public class ToggleMemoryMonitorsAction extends ToggleViewPaneAction {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.ToggleViewPaneAction#getPaneId()
- */
- public String getPaneId() {
- return MemoryBlocksTreeViewPane.PANE_ID;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleSplitPaneAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleSplitPaneAction.java
deleted file mode 100644
index 68d1474c6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleSplitPaneAction.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Toggles the visibility of the rendering view pane 2.
- * @since 3.1
- *
- */
-public class ToggleSplitPaneAction extends ToggleViewPaneAction {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.ToggleViewPaneAction#getPaneId()
- */
- public String getPaneId() {
- return IDebugUIConstants.ID_RENDERING_VIEW_PANE_2;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleViewPaneAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleViewPaneAction.java
deleted file mode 100644
index 645c2d706..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleViewPaneAction.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
-/**
- * @since 3.1
- */
-abstract public class ToggleViewPaneAction extends Action implements IViewActionDelegate, IActionDelegate2, IPropertyChangeListener {
-
- MemoryView fView;
- IAction fAction;
-
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- if (view instanceof MemoryView)
- {
- fView = (MemoryView)view;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
-
- if (fView == null)
- return;
-
- fView.showViewPane(!fView.isViewPaneVisible(getPaneId()), getPaneId());
-
- if (fView.isViewPaneVisible(getPaneId()))
- action.setChecked(true);
- else
- action.setChecked(false);
-
- }
-
- public void run() {
- if (fView == null)
- return;
-
- fView.showViewPane(!fView.isViewPaneVisible(getPaneId()), getPaneId());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- if (fView.isViewPaneVisible(getPaneId()))
- action.setChecked(true);
- else
- action.setChecked(false);
- }
-
- public void dispose() {
- DebugUITools.getPreferenceStore().removePropertyChangeListener(this);
- }
-
- public void init(IAction action) {
- fAction = action;
- DebugUITools.getPreferenceStore().addPropertyChangeListener(this);
- }
-
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- public void propertyChange(PropertyChangeEvent event) {
- if (fView != null && fAction != null)
- {
- if (fView.isViewPaneVisible(getPaneId()))
- fAction.setChecked(true);
- else
- fAction.setChecked(false);
- }
- }
-
- abstract public String getPaneId();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneOrientationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneOrientationAction.java
deleted file mode 100644
index 5c7f26f37..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneOrientationAction.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.Action;
-import org.eclipse.ui.PlatformUI;
-
-class ViewPaneOrientationAction extends Action
-{
- private MemoryView fView;
- private int fOrientation;
-
- ViewPaneOrientationAction(MemoryView view, int orientation)
- {
- super(IInternalDebugCoreConstants.EMPTY_STRING, AS_RADIO_BUTTON);
- fView = view;
- fOrientation = orientation;
-
- if (orientation == MemoryView.HORIZONTAL_VIEW_ORIENTATION) {
- setText(DebugUIMessages.ViewPaneOrientationAction_0);
- setToolTipText(DebugUIMessages.ViewPaneOrientationAction_1);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_RIGHT));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE_RIGHT));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DETAIL_PANE_RIGHT));
- } else if (orientation == MemoryView.VERTICAL_VIEW_ORIENTATION) {
- setText(DebugUIMessages.ViewPaneOrientationAction_2);
- setToolTipText(DebugUIMessages.ViewPaneOrientationAction_3);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_UNDER));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE_UNDER));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DETAIL_PANE_UNDER));
- }
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.MEMORY_VIEW_PANE_ORIENTATION_ACTION);
- }
-
- public void run() {
- fView.setViewPanesOrientation(fOrientation);
- }
-
- public int getOrientation()
- {
- return fOrientation;
- }
- }
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java
deleted file mode 100644
index a8c040c29..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java
+++ /dev/null
@@ -1,407 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory;
-
-import java.io.IOException;
-import java.util.ArrayList;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.core.LaunchManager;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
-import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
-import org.eclipse.debug.ui.memory.IMemoryRenderingType;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * A View Pane Rendering Manager manages all the rendering from a view pane.
- * It is responsible for handling debug events and removing renderings
- * from the view pane as a debug session is terminated.
- * In addition, the rendering manager is responsible for persisting memory renderings.
- * Renderings need to be persisted when the memory view is disposed. If the view is
- * opened again, the same set of renderings will be created in the view pane if
- * the renderings are still valid.
- * @since 3.1
- */
-public class ViewPaneRenderingMgr implements IDebugEventSetListener{
-
- private ArrayList fRenderings = new ArrayList();
- private IMemoryRenderingContainer fViewPane;
-
- private static final String RENDERINGS_TAG = "persistedMemoryRenderings"; //$NON-NLS-1$
- private static final String MEMORY_RENDERING_TAG = "memoryRendering"; //$NON-NLS-1$
- private static final String MEMORY_BLOCK = "memoryBlock"; //$NON-NLS-1$
- private static final String RENDERING_ID = "renderingId"; //$NON-NLS-1$
-
- public ViewPaneRenderingMgr(IMemoryRenderingContainer viewPane)
- {
- fViewPane = viewPane;
- loadPersistedRenderings(getPrefId());
- }
-
- public void removeMemoryBlockRendering(IMemoryBlock mem, String renderingId)
- {
- if(fRenderings == null)
- return;
-
- IMemoryRendering[] toRemove = getRenderings(mem, renderingId);
-
- for (int i=0; i<toRemove.length; i++)
- {
- fRenderings.remove(toRemove[i]);
-
- // remove listener after the last memory block has been removed
- if (fRenderings.size() == 0)
- {
- DebugPlugin.getDefault().removeDebugEventListener(this);
- }
- }
-
- storeRenderings();
- }
-
-
- public void addMemoryBlockRendering(IMemoryRendering rendering) {
-
- // do not allow duplicated objects
- if (fRenderings.contains(rendering))
- return;
-
- fRenderings.add(rendering);
-
- // add listener for the first memory block added
- if (fRenderings.size() == 1)
- {
- DebugPlugin.getDefault().addDebugEventListener(this);
- }
-
- storeRenderings();
- }
-
-
- public void removeMemoryBlockRendering(IMemoryRendering rendering) {
- if(rendering == null)
- return;
-
- if(!fRenderings.contains(rendering))
- return;
-
- fRenderings.remove(rendering);
-
- // remove listener after the last memory block has been removed
- if (fRenderings.size() == 0)
- {
- DebugPlugin.getDefault().removeDebugEventListener(this);
- }
-
- storeRenderings();
- }
-
- public IMemoryRendering[] getRenderings(IMemoryBlock mem, String renderingId)
- {
- if (renderingId == null)
- {
- return getRenderingsFromMemoryBlock(mem);
- }
-
- ArrayList ret = new ArrayList();
- for (int i=0; i<fRenderings.size(); i++)
- {
- if (fRenderings.get(i) instanceof IMemoryRendering)
- {
- IMemoryRendering rendering = (IMemoryRendering)fRenderings.get(i);
- if (rendering.getMemoryBlock() == mem && renderingId.equals(rendering.getRenderingId()))
- {
- ret.add(rendering);
- }
- }
- }
-
- return (IMemoryRendering[])ret.toArray(new IMemoryRendering[ret.size()]);
- }
-
- public IMemoryRendering[] getRenderings()
- {
- return (IMemoryRendering[])fRenderings.toArray(new IMemoryRendering[fRenderings.size()]);
- }
-
- public IMemoryRendering[] getRenderingsFromDebugTarget(IDebugTarget target)
- {
- ArrayList ret = new ArrayList();
- for (int i=0; i<fRenderings.size(); i++)
- {
- if (fRenderings.get(i) instanceof IMemoryRendering)
- {
- IMemoryRendering rendering = (IMemoryRendering)fRenderings.get(i);
- if (rendering.getMemoryBlock().getDebugTarget() == target)
- {
- ret.add(rendering);
- }
- }
- }
-
- return (IMemoryRendering[])ret.toArray(new IMemoryRendering[ret.size()]);
- }
-
-
- public IMemoryRendering[] getRenderingsFromMemoryBlock(IMemoryBlock block)
- {
- ArrayList ret = new ArrayList();
- for (int i=0; i<fRenderings.size(); i++)
- {
- if (fRenderings.get(i) instanceof IMemoryRendering)
- {
- IMemoryRendering rendering = (IMemoryRendering)fRenderings.get(i);
- if (rendering.getMemoryBlock() == block)
- {
- ret.add(rendering);
- }
- }
- }
-
- return (IMemoryRendering[])ret.toArray(new IMemoryRendering[ret.size()]);
- }
-
-
-
- public void handleDebugEvents(DebugEvent[] events) {
-
- for (int i=0; i < events.length; i++)
- handleDebugEvent(events[i]);
-
- }
-
- public void handleDebugEvent(DebugEvent event) {
- Object obj = event.getSource();
- IDebugTarget dt = null;
-
- if (event.getKind() == DebugEvent.TERMINATE)
- {
- // a terminate event could happen from an IThread or IDebugTarget
- // Only handle terminate event from debug target
- if (obj instanceof IDebugTarget)
- {
- dt = ((IDebugTarget)obj);
-
- // returns empty array if dt == null
- IMemoryRendering[] deletedrendering = getRenderingsFromDebugTarget(dt);
-
- for (int i=0; i<deletedrendering.length; i++)
- {
- removeMemoryBlockRendering(deletedrendering[i].getMemoryBlock(), deletedrendering[i].getRenderingId());
- fViewPane.removeMemoryRendering(deletedrendering[i]);
- }
- }
- }
- }
-
- public void dispose()
- {
- // remove all renderings
- fRenderings.clear();
-
- String secondaryId = getViewSiteSecondaryId();
- if (secondaryId != null)
- {
- // do not save renderings if this is not the primary rendering view
- String prefid = getPrefId();
- Preferences prefs = DebugUIPlugin.getDefault().getPluginPreferences();
- prefs.setToDefault(prefid);
- }
-
- DebugPlugin.getDefault().removeDebugEventListener(this);
- }
-
- /**
- * Store renderings as preferences. If renderings are stored, renderings
- * can be persisted even after the memory view is closed.
- */
- private void storeRenderings()
- {
- Preferences prefs = DebugUIPlugin.getDefault().getPluginPreferences();
- String renderingsStr= IInternalDebugCoreConstants.EMPTY_STRING;
- try {
- renderingsStr= getRenderingsAsXML();
- } catch (IOException e) {
- DebugUIPlugin.log(e);
- } catch (ParserConfigurationException e) {
- DebugUIPlugin.log(e);
- } catch (TransformerException e) {
- DebugUIPlugin.log(e);
- }
-
- String prefid = getPrefId();
-
- if (renderingsStr != null)
- prefs.setValue(prefid, renderingsStr);
- else
- prefs.setToDefault(prefid);
- }
-
- private String getPrefId() {
- // constructs id based on memory view's secondary id + the rendering view pane id
- // format: secondaryId:viewPaneId
- StringBuffer id = new StringBuffer();
- IMemoryRenderingSite renderingSite = fViewPane.getMemoryRenderingSite();
- IWorkbenchPartSite ps = renderingSite.getSite();
- if (ps instanceof IViewSite)
- {
- IViewSite vs = (IViewSite)ps;
- String secondaryId = vs.getSecondaryId();
- if (secondaryId != null)
- {
- id.append(secondaryId);
- id.append(":"); //$NON-NLS-1$
- }
-
- }
- id.append(fViewPane.getId());
- String prefId = id.toString();
- return prefId;
- }
-
- /**
- * Convert renderings to xml text
- * @return
- * @throws IOException
- * @throws ParserConfigurationException
- * @throws TransformerException
- */
- private String getRenderingsAsXML() throws IOException, ParserConfigurationException, TransformerException {
- IMemoryRendering[] renderings= (IMemoryRendering[])fRenderings.toArray(new IMemoryRendering[fRenderings.size()]);
-
- if (renderings.length == 0)
- return null;
-
- Document document= LaunchManager.getDocument();
- Element rootElement= document.createElement(RENDERINGS_TAG);
- document.appendChild(rootElement);
- for (int i = 0; i < renderings.length; i++) {
- IMemoryRendering rendering= renderings[i];
- Element element= document.createElement(MEMORY_RENDERING_TAG);
- element.setAttribute(MEMORY_BLOCK, Integer.toString(rendering.getMemoryBlock().hashCode()));
- element.setAttribute(RENDERING_ID, rendering.getRenderingId());
- rootElement.appendChild(element);
- }
- return LaunchManager.serializeDocument(document);
- }
-
- /**
- * Load renderings currently stored.
- */
- private void loadPersistedRenderings(String prefId) {
- String renderingsStr= DebugUIPlugin.getDefault().getPluginPreferences().getString(prefId);
- if (renderingsStr.length() == 0) {
- return;
- }
- Element root;
- try {
- root = DebugPlugin.parseDocument(renderingsStr);
- } catch (CoreException e) {
- DebugUIPlugin.logErrorMessage("An exception occurred while loading memory renderings."); //$NON-NLS-1$
- return;
- }
- if (!root.getNodeName().equals(RENDERINGS_TAG)) {
- DebugUIPlugin.logErrorMessage("Invalid format encountered while loading memory renderings."); //$NON-NLS-1$
- return;
- }
- NodeList list= root.getChildNodes();
- boolean renderingsAdded= false;
- for (int i= 0, numItems= list.getLength(); i < numItems; i++) {
- Node node= list.item(i);
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element element= (Element) node;
- if (!element.getNodeName().equals(MEMORY_RENDERING_TAG)) {
- DebugUIPlugin.logErrorMessage("Invalid XML element encountered while loading memory rendering."); //$NON-NLS-1$
- continue;
- }
- String memoryBlockHashCode= element.getAttribute(MEMORY_BLOCK);
- String renderingId = element.getAttribute(RENDERING_ID);
-
- IMemoryBlock[] memoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks();
- IMemoryBlock memoryBlock = null;
- for (int j=0; j<memoryBlocks.length; j++)
- {
- if (Integer.toString(memoryBlocks[j].hashCode()).equals(memoryBlockHashCode))
- memoryBlock = memoryBlocks[j];
- }
-
- if (memoryBlock != null)
- {
- IMemoryRenderingType[] types = DebugUITools.getMemoryRenderingManager().getRenderingTypes(memoryBlock);
- IMemoryRenderingType type = null;
- for (int k=0; k<types.length; k++)
- {
- if (types[k].getId().equals(renderingId))
- type = types[k];
- }
-
- // if memory block is not found, the rendering is no longer valid
- // simply ignore the rendering
- if (type != null)
- {
- try {
-
- IMemoryRendering rendering = type.createRendering();
- if (rendering != null)
- {
- rendering.init(fViewPane, memoryBlock);
- if (!fRenderings.contains(rendering))
- {
- fRenderings.add(rendering);
- renderingsAdded= true;
- }
- }
- } catch (CoreException e1) {
- DebugUIPlugin.log(e1);
- }
- }
- }
- }
- }
- if (renderingsAdded) {
- DebugPlugin.getDefault().addDebugEventListener(this);
- }
- }
-
- /**
- * @return secondary id, or null if not available
- */
- private String getViewSiteSecondaryId()
- {
- IMemoryRenderingSite renderingSite = fViewPane.getMemoryRenderingSite();
- IWorkbenchPartSite ps = renderingSite.getSite();
- if (ps instanceof IViewSite)
- {
- IViewSite vs = (IViewSite)ps;
- String secondaryId = vs.getSecondaryId();
- return secondaryId;
- }
- return null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneSelectionProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneSelectionProvider.java
deleted file mode 100644
index c375da726..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneSelectionProvider.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-import java.util.ArrayList;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-
-
-/**
- * Handles selection changes in a rendering view pane.
- * @since 3.1
- *
- */
-public class ViewPaneSelectionProvider implements ISelectionProvider
-{
- ArrayList fListeners = new ArrayList();
- ISelection fSelection;
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
- */
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- if (!fListeners.contains(listener))
- fListeners.add(listener);
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
- */
- public ISelection getSelection()
- {
- return fSelection;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
- */
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- if (fListeners.contains(listener))
- fListeners.remove(listener);
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection)
- */
- public void setSelection(ISelection selection)
- {
- fSelection = selection;
- fireChanged();
- }
-
- public void fireChanged()
- {
- SelectionChangedEvent evt = new SelectionChangedEvent(this, getSelection());
- for (int i=0; i<fListeners.size(); i++)
- {
- ((ISelectionChangedListener)fListeners.get(i)).selectionChanged(evt);
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java
deleted file mode 100644
index 13631cd25..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - Ted Williams - [Memory View] Memory View: Workflow Enhancements (Bug 215432)
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory;
-
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-
-/**
- * Controls view tab enablement based on tab folder selection
- *
- * @since 3.0
- */
-public class ViewTabEnablementManager implements SelectionListener {
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e) {
- if (e.getSource() instanceof CTabFolder)
- {
- handleTabFolderSelection(e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
- */
- public void widgetDefaultSelected(SelectionEvent e) {
-
-
- }
-
- private void handleTabFolderSelection(SelectionEvent event)
- {
- CTabFolder folder = (CTabFolder)event.getSource();
-
- CTabItem selectedItem = folder.getSelection();
- IMemoryViewTab selectedViewTab;
-
- // get selected view tab
- if (selectedItem != null)
- {
- Object obj = selectedItem.getData();
-
- if (obj instanceof IMemoryViewTab)
- {
- selectedViewTab = (IMemoryViewTab)obj;
- }
- else
- {
- return;
- }
- }
- else
- {
- return;
- }
-
- // get all tabs
- CTabItem[] allTabs = folder.getItems();
-
- // check all tabs to make sure they are enabled/disabled properly
- for (int i=0; i<allTabs.length; i++)
- {
- IMemoryViewTab viewTab;
- Object obj = allTabs[i].getData();
-
- if (obj instanceof IMemoryViewTab)
- {
- viewTab = (IMemoryViewTab)obj;
-
- // if view tab matches the selected item
- if (viewTab == selectedViewTab && !viewTab.isEnabled() )
- {
- // if the item has been selected and this tab is not enabled
- // enable it.
- viewTab.setEnabled(true);
- viewTab.getRendering().activated();
-
- }
- else if (viewTab != selectedViewTab && viewTab.isEnabled())
- {
- // if the tab is not selected, disable it
- viewTab.setEnabled(false);
- viewTab.getRendering().deactivated();
- }
- }
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRendering.java
deleted file mode 100644
index 4d2b01e90..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRendering.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTextRendering;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.util.PropertyChangeEvent;
-
-
-
-
-/**
- * Convert bytes into ASCII string and vice versa
- * @since 3.1
- */
-public class ASCIIRendering extends AbstractAsyncTextRendering{
-
- private final int numCharsPerByte = 1;
-
-
- public ASCIIRendering(String renderingId)
- {
- super(renderingId);
- String codepage = DebugUITools.getPreferenceStore().getString(IDebugUIConstants.PREF_DEFAULT_ASCII_CODE_PAGE);
- setCodePage(codepage);
- }
-
- public void dispose() {
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.AbstractMemoryRendering#getNumCharsPerByte()
- */
- public int getNumCharsPerByte() {
- return numCharsPerByte;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.AbstractTableRendering#getBytes(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[], java.lang.String)
- */
- public byte[] getBytes(
- String renderingId,
- BigInteger address,
- MemoryByte[] currentValues,
- String data) {
-
- byte[] bytes = super.getBytes(renderingId, address, currentValues, data);
-
- // undo the replacement of 1's to 0's.
- for (int i=0; i<bytes.length && i < currentValues.length; i++)
- {
- if (bytes[i] == 1 && currentValues[i].getValue() == 0)
- {
- bytes[i] = 0;
- }
- }
-
- return bytes;
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.AbstractTableRendering#getString(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[])
- */
- public String getString(
- String renderingId,
- BigInteger address,
- MemoryByte[] data) {
-
- MemoryByte[] copy = new MemoryByte[data.length];
-
- // If a byte equals zero, it represents null in a string
- // and often causes subsequent string not displayed or printed properly
- // Replace all null with 1's
- for (int i=0; i<data.length; i++){
- copy[i] = new MemoryByte();
- if (data[i].getValue() == 0)
- {
- copy[i].setValue((byte)1);
- }
- else
- {
- copy[i].setValue(data[i].getValue());
- }
- copy[i].setFlags(data[i].getFlags());
- }
-
- return super.getString(renderingId, address, copy);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
-
- // handle code page changed event
- if (event.getProperty().equals(IDebugUIConstants.PREF_DEFAULT_ASCII_CODE_PAGE))
- {
- String codePage = (String)event.getNewValue();
- setCodePage(codePage);
-
- if (isVisible())
- // just update labels, don't need to reget memory
- updateLabels();
- }
-
- super.propertyChange(event);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRenderingTypeDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRenderingTypeDelegate.java
deleted file mode 100644
index 73c01e051..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRenderingTypeDelegate.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate;
-
-/**
- * The delegate for creating an ASCII rendering.
- * @since 3.1
- */
-public class ASCIIRenderingTypeDelegate implements IMemoryRenderingTypeDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate#createRendering(java.lang.String)
- */
- public IMemoryRendering createRendering(String id) throws CoreException {
- return new ASCIIRendering(id);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractBaseTableRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractBaseTableRendering.java
deleted file mode 100644
index 7eb33d120..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractBaseTableRendering.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.ui.memory.AbstractMemoryRendering;
-import org.eclipse.debug.ui.memory.IRepositionableMemoryRendering;
-
-/**
- * Internal base class to allow AbstractTableRendering and AbstractAsyncTableRendering
- * to share actions and dialogs. This abstract class is not to be published.
- *
- * @since 3.2
- */
-public abstract class AbstractBaseTableRendering extends AbstractMemoryRendering implements IRepositionableMemoryRendering{
-
- public AbstractBaseTableRendering(String renderingId) {
- super(renderingId);
- }
-
- /**
- * Format view tab based on the bytes per line and column.
- *
- * @param bytesPerLine - number of bytes per line, possible values: (1 / 2 / 4 / 8 / 16) * addressableSize
- * @param columnSize - number of bytes per column, possible values: (1 / 2 / 4 / 8 / 16) * addressableSize
- * @return true if format is successful, false, otherwise
- */
- abstract public boolean format(int bytesPerLine, int columnSize);
-
- /**
- * Returns the addressible size of this rendering's memory block in bytes.
- *
- * @return the addressible size of this rendering's memory block in bytes
- */
- abstract public int getAddressableSize();
-
- /**
- * Resize column to the preferred size.
- */
- abstract public void resizeColumnsToPreferredSize();
-
- /**
- * Returns the number of addressable units per row.
- *
- * @return number of addressable units per row
- */
- abstract public int getAddressableUnitPerLine();
-
- /**
- * Returns the number of addressable units per column.
- *
- * @return number of addressable units per column
- */
- abstract public int getAddressableUnitPerColumn();
-
- /**
- * Returns the number of bytes displayed in a single column cell.
- *
- * @return the number of bytes displayed in a single column cell
- */
- abstract public int getBytesPerColumn();
-
- /**
- * Returns the number of bytes displayed in a row.
- *
- * @return the number of bytes displayed in a row
- */
- abstract public int getBytesPerLine();
-
- /**
- * Updates labels of this rendering.
- */
- abstract public void updateLabels();
-
- /**
- * @return the label of this rendering
- */
- abstract public String getLabel();
-
- /**
- * Refresh the table viewer with the current top visible address.
- * Update labels in the memory rendering.
- */
- abstract public void refresh();
-
- /**
- * Moves the cursor to the specified address.
- * Will load more memory if the address is not currently visible.
- *
- * @param address address to position cursor at
- * @throws DebugException if an exception occurrs
- */
- abstract public void goToAddress(BigInteger address) throws DebugException;
-
- /**
- * Returns the currently selected address in this rendering.
- *
- * @return the currently selected address in this rendering
- */
- abstract public BigInteger getSelectedAddress();
-
- /**
- * Returns the currently selected content in this rendering as a String.
- *
- * @return the currently selected content in this rendering
- */
- abstract public String getSelectedAsString();
-
- /**
- * Returns the currently selected content in this rendering as MemoryByte.
- *
- * @return the currently selected content in array of MemoryByte.
- * Returns an empty array if the selected address is out of buffered range.
- */
- abstract public MemoryByte[] getSelectedAsBytes();
-
- /**
- * Returns the number of characters a byte will convert to
- * or -1 if unknown.
- *
- * @return the number of characters a byte will convert to
- * or -1 if unknown
- */
- abstract public int getNumCharsPerByte();
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IResettableMemoryRendering#resetRendering()
- */
- abstract public void resetRendering() throws DebugException;
-
- /**
- * Returns text for the given memory bytes at the specified address for the specified
- * rendering type. This is called by the label provider for.
- * Subclasses must override.
- *
- * @param renderingTypeId rendering type identifier
- * @param address address where the bytes belong to
- * @param data the bytes
- * @return a string to represent the memory. Cannot not return <code>null</code>.
- * Returns a string to pad the cell if the memory cannot be converted
- * successfully.
- */
- abstract public String getString(String renderingTypeId, BigInteger address,
- MemoryByte[] data);
-
- /**
- * Returns bytes for the given text corresponding to bytes at the given
- * address for the specified rendering type. This is called by the cell modifier
- * when modifying bytes in a memory block.
- * Subclasses must convert the string value to an array of bytes. The bytes will
- * be passed to the debug adapter for memory block modification.
- * Returns <code>null</code> if the bytes cannot be formatted properly.
- *
- * @param renderingTypeId rendering type identifier
- * @param address address the bytes begin at
- * @param currentValues current values of the data in bytes format
- * @param newValue the string to be converted to bytes
- * @return the bytes converted from a string
- */
- abstract public byte[] getBytes(String renderingTypeId, BigInteger address,
- MemoryByte[] currentValues, String newValue);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractIntegerRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractIntegerRendering.java
deleted file mode 100644
index 9f11c9779..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractIntegerRendering.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
-
-/**
- * Abstract implementation to an integer rendering.
- * @since 3.1
- *
- */
-public abstract class AbstractIntegerRendering extends AbstractAsyncTableRendering {
-
- private int fDisplayEndianess = RenderingsUtil.ENDIANESS_UNKNOWN;
-
- public AbstractIntegerRendering(String renderingId){
- super(renderingId);
- }
-
- public void init(IMemoryRenderingContainer container, IMemoryBlock block) {
- super.init(container, block);
-
- // default to big endian for simple memory block
- if (!(block instanceof IMemoryBlockExtension))
- fDisplayEndianess = RenderingsUtil.BIG_ENDIAN;
- }
-
- /**
- * @return Returns the currentEndianess.
- */
- public int getDisplayEndianess() {
- return fDisplayEndianess;
- }
-
- /**
- * @param currentEndianess The currentEndianess to set.
- */
- public void setDisplayEndianess(int currentEndianess) {
- fDisplayEndianess = currentEndianess;
- }
-
- protected int getBytesEndianess(MemoryByte[] data) {
- int endianess = RenderingsUtil.ENDIANESS_UNKNOWN;
-
- if (!data[0].isEndianessKnown())
- return endianess;
-
- if (data[0].isBigEndian())
- endianess = RenderingsUtil.BIG_ENDIAN;
- else
- endianess = RenderingsUtil.LITTLE_ENDIAN;
- for (int i=1; i<data.length; i++)
- {
- // if endianess is not known for a byte, return unknown
- if (!data[i].isEndianessKnown())
- return RenderingsUtil.ENDIANESS_UNKNOWN;
-
- int byteEndianess = data[i].isBigEndian()?RenderingsUtil.BIG_ENDIAN:RenderingsUtil.LITTLE_ENDIAN;
- if (byteEndianess != endianess)
- {
- endianess = RenderingsUtil.ENDIANESS_UNKNOWN;
- break;
- }
- }
- return endianess;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractTableRenderingLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractTableRenderingLabelProvider.java
deleted file mode 100644
index 8fcbf331a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractTableRenderingLabelProvider.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.memory.AbstractTableRendering;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Abstract label provider for an ITableMemoryViewTab
- *
- * @since 3.0
- */
-abstract public class AbstractTableRenderingLabelProvider extends LabelProvider implements ITableLabelProvider{
-
- protected AbstractTableRendering fRendering;
-
- /**
- *
- * Constructor for MemoryViewLabelProvider
- */
- public AbstractTableRenderingLabelProvider() {
- super();
- }
-
- public AbstractTableRenderingLabelProvider(AbstractTableRendering rendering){
- fRendering = rendering;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- */
- public void dispose() {
- fRendering = null;
- super.dispose();
- }
-
- /**
- * @see ITableLabelProvider#getColumnImage(Object, int)
- */
- public Image getColumnImage(Object element, int columnIndex) {
-
- if (columnIndex == 0)
- {
- return DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_OBJECT_MEMORY);
- }
- else if (columnIndex > (fRendering.getBytesPerLine()/fRendering.getBytesPerColumn()))
- {
- return DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_OBJECT_MEMORY);
- }
- else
- {
- // if memory in the range has changed, return delta icon
- int startOffset = (columnIndex-1)*fRendering.getBytesPerColumn();
- int endOffset = startOffset + fRendering.getBytesPerColumn() - 1;
- if (((TableRenderingLine)element).isRangeChange(startOffset, endOffset)) {
- return DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_OBJECT_MEMORY_CHANGED);
- }
- return DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_OBJECT_MEMORY);
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
- */
- public String getColumnText(Object element, int columnIndex) {
- String columnLabel = null;
-
- if (columnIndex == 0)
- {
- columnLabel = ((TableRenderingLine)element).getAddress();
-
- // consult model presentation for address presentation
- }
- else if (columnIndex > (fRendering.getBytesPerLine()/fRendering.getBytesPerColumn()))
- {
- columnLabel = " "; //$NON-NLS-1$
- }
- else
- {
- int start = (columnIndex-1)*fRendering.getBytesPerColumn();
- int end = start + fRendering.getBytesPerColumn();
-
- MemoryByte[] bytes = ((TableRenderingLine)element).getBytes(start, end);
- BigInteger address = new BigInteger(((TableRenderingLine)element).getAddress(), 16);
- address = address.add(BigInteger.valueOf(start));
-
- columnLabel = fRendering.getString(fRendering.getRenderingId(), address, bytes);
- }
- return columnLabel;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractVirtualContentTableModel.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractVirtualContentTableModel.java
deleted file mode 100644
index c366b2dcc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractVirtualContentTableModel.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.util.ArrayList;
-
-import org.eclipse.debug.internal.ui.viewers.AsynchronousTableModel;
-import org.eclipse.debug.internal.ui.viewers.AsynchronousViewer;
-import org.eclipse.debug.internal.ui.viewers.ModelNode;
-
-abstract public class AbstractVirtualContentTableModel extends AsynchronousTableModel{
-
- public AbstractVirtualContentTableModel(AsynchronousViewer viewer) {
- super(viewer);
- }
-
- public Object[] getElements()
- {
- ModelNode[] nodes = getNodes(getRootNode().getElement());
- ArrayList result = new ArrayList();
- if (nodes != null)
- {
- for (int i=0; i<nodes.length; i++)
- {
- ModelNode[] children = nodes[i].getChildrenNodes();
- if (children != null)
- {
- for (int j=0; j<children.length; j++)
- {
- result.add(children[j].getElement());
- }
- }
- }
-
- return result.toArray();
- }
- return new Object[0];
- }
-
- public Object getElement(int idx)
- {
- Object[] elements = getElements();
- if (idx >=0 && idx < elements.length)
- return elements[idx];
-
- return null;
- }
-
-
- public int indexOfElement(Object element)
- {
- Object[] elements = getElements();
-
- for (int i=0; i<elements.length; i++)
- {
- if (elements[i] == element)
- return i;
- }
- return -1;
- }
-
- abstract public int indexOfKey(Object key);
-
- abstract public int columnOf(Object element, Object key);
-
- abstract public Object getKey(int idx);
-
- abstract public Object getKey(Object element);
-
- abstract public Object getKey(int idx, int col);
-
- public void handleViewerChanged()
- {
-
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncCopyTableRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncCopyTableRenderingAction.java
deleted file mode 100644
index 9caa554f9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncCopyTableRenderingAction.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.util.ArrayList;
-
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-
-/**
- * Copy action for <code>AbstractAsyncTableRendering</code>. Only copy what is visible in the view.
- *
- */
-public class AsyncCopyTableRenderingAction extends
- CopyTableRenderingToClipboardAction {
-
- public AsyncCopyTableRenderingAction(AbstractBaseTableRendering rendering, StructuredViewer viewer) {
- super(rendering, viewer);
- }
-
- protected String concatenateTableAsString(TableItem[] itemList) {
-
- Table table = null;
- if (itemList.length > 0)
- table = itemList[0].getParent();
-
- int topIndex = table.getTopIndex();
- int itemCount = table.getItemCount();
- int numVisibleLines = Math.min((table.getBounds().height / table.getItemHeight()) + 2, itemCount - topIndex);
-
- ArrayList items = new ArrayList();
-
- // start at top index until there is no more data in the table
- for (int i=topIndex; i< topIndex + numVisibleLines; i++)
- {
- if (itemList[i].getData() != null)
- {
- items.add(itemList[i]);
- }
- else
- break;
- }
-
- return super.concatenateTableAsString((TableItem[]) items.toArray(new TableItem[items.size()]));
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java
deleted file mode 100644
index 114864147..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.util.ArrayList;
-
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.printing.Printer;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-
-/**
- * Print action for <code>AbstractAsyncTableRendering</code>. Only print what is visible in the view.
- *
- */
-public class AsyncPrintTableRenderingAction extends PrintTableRenderingAction {
-
- public AsyncPrintTableRenderingAction(AbstractBaseTableRendering rendering, StructuredViewer viewer) {
- super(rendering, viewer);
- }
-
- protected void printTable(TableItem[] itemList, GC printGC, Printer printer) {
- Table table = null;
- if (itemList.length > 0)
- table = itemList[0].getParent();
-
- int topIndex = table.getTopIndex();
- int itemCount = table.getItemCount();
- int numVisibleLines = Math.min((table.getBounds().height / table.getItemHeight()) + 2, itemCount - topIndex);
-
- ArrayList items = new ArrayList();
-
- // start at top index until there is no more data in the table
- for (int i=topIndex; i< topIndex + numVisibleLines; i++)
- {
- if (itemList[i].getData() != null)
- {
- items.add(itemList[i]);
- }
- else
- break;
- }
-
- super.printTable((TableItem[])items.toArray(new TableItem[items.size()]), printGC, printer);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java
deleted file mode 100644
index 28a2f9e07..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
-import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
-import org.eclipse.debug.ui.memory.MemoryRenderingElement;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.swt.widgets.TableItem;
-
-/**
- * @since 3.1
- *
- */
-// TODO: if we want "true" flexible hierarchy, also need to allow clients
-// to plug cell modifier in case the element is not MemorySegment
-public class AsyncTableRenderingCellModifier implements ICellModifier {
-
- private AbstractAsyncTableRendering fRendering;
- private boolean fMBSupportsValueModification = false;
-
- private ICellModifier fCustomModifier;
-
- public AsyncTableRenderingCellModifier(AbstractAsyncTableRendering rendering, ICellModifier customModifier) {
- fRendering = rendering;
- fCustomModifier = customModifier;
-
- Job job = new Job("AsyncTableRenderingCellModifier"){ //$NON-NLS-1$
-
- protected IStatus run(IProgressMonitor monitor) {
- fMBSupportsValueModification = fRendering.getMemoryBlock().supportsValueModification();
- return Status.OK_STATUS;
- }};
- job.setSystem(true);
- job.schedule();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object,
- * java.lang.String)
- */
- public boolean canModify(Object element, String property) {
- boolean canModify = true;
- try {
- if (!(element instanceof MemorySegment))
- return false;
-
- if (!isValueModificationSupported()) {
- return false;
- }
-
- MemorySegment line = (MemorySegment) element;
- if (TableRenderingLine.P_ADDRESS.equals(property)) {
- return false;
- }
-
- // property is stored as number of addressable unit away from the
- // line address
- // to calculate offset to the memory line array, offset =
- // numberofAddressableUnit * addressableSize
- int addressableSize = getAddressableSize();
-
- int offset = Integer.valueOf(property, 16).intValue() * addressableSize;
-
- MemoryByte[] bytes = line.getBytes(offset, fRendering.getBytesPerColumn());
-
- if (fCustomModifier != null)
- {
- BigInteger address = line.getAddress().add(BigInteger.valueOf(offset));
- MemoryRenderingElement mElement = new MemoryRenderingElement(fRendering, address, bytes);
- return fCustomModifier.canModify(mElement, null);
- }
-
- for (int i = 0; i < bytes.length; i++) {
- if (!bytes[i].isWritable()) {
- canModify = false;
- }
- }
- return canModify;
- } catch (NumberFormatException e) {
- canModify = false;
- return canModify;
- }
- }
-
- /**
- * @return
- */
- private int getAddressableSize() {
- int addressableSize = fRendering.getAddressableSize();
- if (addressableSize < 1)
- addressableSize = 1;
- return addressableSize;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object,
- * java.lang.String)
- */
- public Object getValue(Object element, String property) {
-
- // give back the value of the column
-
- if (!(element instanceof MemorySegment))
- return null;
-
- MemorySegment line = (MemorySegment) element;
- try {
- if (TableRenderingLine.P_ADDRESS.equals(property))
- return line.getAddress();
-
- int offsetToLineBuffer = Integer.valueOf(property, 16).intValue() * getAddressableSize();
- MemoryByte[] memory = line.getBytes(offsetToLineBuffer, fRendering.getBytesPerColumn());
-
- int offsetFromLineAddress = Integer.valueOf(property, 16).intValue();
- BigInteger address = line.getAddress().add(BigInteger.valueOf(offsetFromLineAddress));
-
- if (fCustomModifier != null)
- {
- MemoryRenderingElement mElement = new MemoryRenderingElement(fRendering, address, memory);
- return fCustomModifier.getValue(mElement, null);
- }
-
- // ask the rendering for a string representation of the bytes
- return fRendering.getString(fRendering.getRenderingId(), address, memory);
-
- } catch (NumberFormatException e) {
- return "00"; //$NON-NLS-1$
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object,
- * java.lang.String, java.lang.Object)
- */
- public void modify(Object element, final String property, final Object value) {
-
- MemorySegment segment = null;
- if (element instanceof TableItem) {
- Object data = ((TableItem)element).getData();
- if (data != null && data instanceof MemorySegment)
- segment = (MemorySegment)data;
-
- } else if (element instanceof MemorySegment){
- segment = (MemorySegment) element;
- }
-
- if (segment == null)
- return;
-
- final MemorySegment line = segment;
-
- Job job = new Job("Set Values"){ //$NON-NLS-1$
-
- protected IStatus run(IProgressMonitor monitor) {
- try {
- // calculate offset to update
- final IMemoryBlock memoryBlk = fRendering.getMemoryBlock();
-
- // number of addressable units from the line's start address
- int offsetFromLineAddress = Integer.valueOf(property, 16).intValue();
-
- // this offset is number of addressable unit from memory block's base address
- final BigInteger offsetFromMBBase = getOffset(memoryBlk, line.getAddress(), offsetFromLineAddress);
-
- // property is number of addressable unit from line address
- // to calculate proper offset in the memoryViewLine's array
- // offset = numberOfAddressableUnit * addressableSize
- int offsetToLineBuffer = Integer.valueOf(property, 16).intValue() * getAddressableSize();
-
- MemoryByte[] oldArray = line.getBytes(offsetToLineBuffer, fRendering.getBytesPerColumn());
-
- // address is line address + addressable unit into the line
- BigInteger address = line.getAddress();
- address = address.add(BigInteger.valueOf(offsetFromLineAddress));
-
- if (fCustomModifier != null) {
- MemoryRenderingElement mElement = new MemoryRenderingElement(fRendering, address, oldArray);
- fCustomModifier.modify(mElement, null, value);
- return Status.OK_STATUS;
- }
-
- if (!(value instanceof String))
- {
- DebugUIPlugin.logErrorMessage("Cell modifier cannot handle non-string values."); //$NON-NLS-1$
- return Status.OK_STATUS;
- }
-
- byte[] bytes = null;
- String oldValue = (String) getValue(line, property);
- if (!oldValue.equals(value)) {
- bytes = fRendering.getBytes(fRendering.getRenderingId(), address, oldArray, (String) value);
-
- if (bytes == null)
- return Status.OK_STATUS;
-
- if (bytes.length == 0)
- return Status.OK_STATUS;
-
- if (bytes.length <= oldArray.length) {
- boolean changed = false;
- // check that the bytes returned has actually changed
- for (int i = 0; i < bytes.length; i++) {
- if (bytes[i] != oldArray[i].getValue()) {
- changed = true;
- break;
- }
- }
- if (!changed)
- return Status.OK_STATUS;
- }
- } else {
- // return if value has not changed
- return Status.OK_STATUS;
- }
-
- final byte[] newByteValues = bytes;
-
- if (memoryBlk instanceof IMemoryBlockExtension)
- ((IMemoryBlockExtension) memoryBlk).setValue(offsetFromMBBase, newByteValues);
- else
- memoryBlk.setValue(offsetFromMBBase.longValue(), newByteValues);
- } catch (DebugException e) {
- MemoryViewUtil.openError(DebugUIMessages.MemoryViewCellModifier_failure_title, DebugUIMessages.MemoryViewCellModifier_failed, e);
- } catch (NumberFormatException e) {
- MemoryViewUtil.openError(DebugUIMessages.MemoryViewCellModifier_failure_title, DebugUIMessages.MemoryViewCellModifier_failed + "\n" + DebugUIMessages.MemoryViewCellModifier_data_is_invalid, null); //$NON-NLS-1$
- }
- return Status.OK_STATUS;
- }};
-
- job.setSystem(true);
- job.schedule();
- }
-
- private BigInteger getOffset(IMemoryBlock memory, BigInteger lineAddress, int lineOffset) throws DebugException {
-
- BigInteger memoryAddr;
-
- if (memory instanceof IMemoryBlockExtension) {
- memoryAddr = ((IMemoryBlockExtension) memory).getBigBaseAddress();
- } else {
- memoryAddr = BigInteger.valueOf(memory.getStartAddress());
- }
-
- if (memoryAddr == null)
- memoryAddr = new BigInteger("0"); //$NON-NLS-1$
-
- return lineAddress.subtract(memoryAddr).add(BigInteger.valueOf(lineOffset));
- }
-
- private boolean isValueModificationSupported()
- {
- return fMBSupportsValueModification;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java
deleted file mode 100644
index 8d5056a30..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
-import org.eclipse.debug.internal.ui.memory.provisional.MemoryViewPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.TableUpdatePolicy;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.ui.progress.UIJob;
-
-/**
- * This update policy updates immediately after a model changed event. The update policy will
- * only update if the rendering is visible. Cache from the content manager is cleared
- * when the memory block has changed when the rendering is not visible
- *
- */
-public class AsyncTableRenderingUpdatePolicy extends TableUpdatePolicy
-{
- public void modelChanged(IModelDelta node, IModelProxy proxy) {
-
- // clear current cache as it becomes invalid when the memory block is changed
- AbstractVirtualContentTableModel model = getTableViewer().getVirtualContentModel();
-
- if (model != null)
- {
- IContentChangeComputer computer = null;
- if (model instanceof IContentChangeComputer)
- computer = (IContentChangeComputer)model;
-
- clearCache(computer);
-
- if (!containsEvent(node))
- {
- return;
- }
-
- if (node.getElement() instanceof IMemoryBlock && (node.getFlags() & IModelDelta.CONTENT) != 0)
- {
- if (computer != null && getTableViewer() != null)
- {
- // only cache if the rendering is not currently displaying error
- if (!getTableViewer().getRendering().isDisplayingError())
- {
- // cache visible elelements
- computer.cache(model.getElements());
- }
- }
-
- // update policy figured out what's changed in the memory block
- // and will tell rendering to update accordinly.
- // Updating the rendering indirectly update the table viewer
- notifyRendering(node, proxy);
- handleMemoryBlockChanged((IMemoryBlock)node.getElement(), node);
- return;
-
- }
- else if (node.getElement() instanceof IMemoryBlock && (node.getFlags() & IModelDelta.STATE) != 0)
- {
- // override handling of state change event
- // let the super class deals with the rest of the changes
- handleMemoryBlockChanged((IMemoryBlock)node.getElement(), node);
- return;
- }
- }
-
- super.modelChanged(node, proxy);
- }
-
- /**
- * @param computer
- */
- protected void clearCache(IContentChangeComputer computer) {
- if (computer != null)
- computer.clearCache();
- }
-
- private void notifyRendering(IModelDelta node, IModelProxy proxy) {
- if (getTableViewer() != null)
- {
- IModelChangedListener listener = (IModelChangedListener)getTableViewer().getRendering().getAdapter(IModelChangedListener.class);
- if (listener != null)
- listener.modelChanged(node, proxy);
- }
- }
-
- protected void handleMemoryBlockChanged(IMemoryBlock mb, IModelDelta delta)
- {
- try {
- if (getViewer().getPresentationContext() instanceof MemoryViewPresentationContext)
- {
- MemoryViewPresentationContext context = (MemoryViewPresentationContext)getViewer().getPresentationContext();
- final AbstractAsyncTableRendering rendering = getTableRendering(context);
- if (rendering != null)
- {
- if ((delta.getFlags() & IModelDelta.CONTENT) != 0)
- {
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)rendering.getAdapter(TableRenderingContentDescriptor.class);
-
- if (descriptor != null)
- {
- final BigInteger address = getMemoryBlockBaseAddress(mb);
- if (!descriptor.isMemoryBlockBaseAddressInitialized() || !address.equals(descriptor.getContentBaseAddress()))
- {
- descriptor.updateContentBaseAddress();
- UIJob job = new UIJob("go to address"){ //$NON-NLS-1$
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- try {
- rendering.goToAddress(address);
- } catch (DebugException e) {
- if (getTableViewer() != null)
- getTableViewer().handlePresentationFailure(null, e.getStatus());
- }
- return Status.OK_STATUS;
- }};
- job.setSystem(true);
- job.schedule();
- }
- else
- {
- rendering.refresh();
- }
- }
- }
- else
- {
- rendering.updateLabels();
- }
- }
- }
- } catch (DebugException e) {
- if (getTableViewer() != null)
- getTableViewer().handlePresentationFailure(null, e.getStatus());
- }
- }
-
- private BigInteger getMemoryBlockBaseAddress(IMemoryBlock mb) throws DebugException
- {
- if (mb instanceof IMemoryBlockExtension)
- return ((IMemoryBlockExtension)mb).getBigBaseAddress();
- else
- return BigInteger.valueOf(mb.getStartAddress());
- }
-
- private AsyncTableRenderingViewer getTableViewer()
- {
- if (getViewer() instanceof AsyncTableRenderingViewer)
- return (AsyncTableRenderingViewer)getViewer();
- return null;
- }
-
- private boolean containsEvent(IModelDelta delta)
- {
- if (getViewer().getPresentationContext() instanceof MemoryViewPresentationContext)
- {
- MemoryViewPresentationContext context = (MemoryViewPresentationContext) getViewer().getPresentationContext();
- if (context.getRendering() instanceof AbstractAsyncTableRendering)
- {
- AbstractAsyncTableRendering rendering = (AbstractAsyncTableRendering)context.getRendering();
- if (!rendering.isVisible())
- return false;
- }
- }
- return true;
- }
-
- protected AbstractAsyncTableRendering getTableRendering(MemoryViewPresentationContext context)
- {
- IMemoryRendering memRendering = context.getRendering();
- if (memRendering != null && memRendering instanceof AbstractAsyncTableRendering)
- {
- return (AbstractAsyncTableRendering)memRendering;
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java
deleted file mode 100644
index d49156999..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java
+++ /dev/null
@@ -1,1041 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
-import org.eclipse.debug.internal.ui.viewers.AbstractUpdatePolicy;
-import org.eclipse.debug.internal.ui.viewers.AsynchronousModel;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IStatusMonitor;
-import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ICellEditorListener;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.TableCursor;
-import org.eclipse.swt.custom.TableEditor;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.progress.UIJob;
-
-public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
-
- private AbstractAsyncTableRendering fRendering;
-
- // selection keys
- private Object fPendingSelection;
- private Object fSelectionKey;
-
- // cursor and associated listeners
- private TableCursor fTableCursor;
- private KeyAdapter fCursorKeyAdapter;
- private TraverseListener fCursorTraverseListener;
- private MouseAdapter fCursorMouseListener;
- private SelectionAdapter fCursorSelectionListener;
-
- // cursor editor and associated listeners
- private TableEditor fCursorEditor;
- private KeyAdapter fEditorKeyListener;
- private CellEditorListener fCellEditorListener;
-
- private class CellEditorListener implements ICellEditorListener {
-
- private CellEditor fEditor;
- private int fRow;
- private int fCol;
-
- public CellEditorListener(int row, int col, CellEditor editor) {
- fEditor = editor;
- fRow = row;
- fCol = col;
- }
-
- public void applyEditorValue() {
- fEditor.removeListener(this);
- modifyValue(fRow, fCol, fEditor.getValue());
- }
-
- public void cancelEditor() {
- fEditor.removeListener(this);
- }
-
- public void editorValueChanged(boolean oldValidState,
- boolean newValidState) {
- }
-
- public int getRow()
- {
- return fRow;
- }
-
- public int getCol()
- {
- return fCol;
- }
- }
-
- private boolean fPendingFormatViewer;
-
-
- public AsyncTableRenderingViewer(AbstractAsyncTableRendering rendering, Composite parent, int style) {
- super(parent, style);
- fRendering = rendering;
-
- getTable().addMouseListener(new MouseAdapter() {
- public void mouseDown(MouseEvent e) {
- handleTableMouseEvent(e);
- }});
-
- createCursor(getTable());
- }
-
- public AbstractUpdatePolicy createUpdatePolicy() {
- return new AsyncTableRenderingUpdatePolicy();
- }
-
- public AbstractAsyncTableRendering getRendering()
- {
- return fRendering;
- }
-
- private void createCursor(Table table)
- {
- fTableCursor = new TableCursor(table, SWT.NONE);
-
- Display display = fTableCursor.getDisplay();
-
- // set up cursor color
- fTableCursor.setBackground(display.getSystemColor(SWT.COLOR_LIST_SELECTION));
- fTableCursor.setForeground(display.getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT));
-
- fTableCursor.setFont(JFaceResources.getFont(IInternalDebugUIConstants.FONT_NAME));
-
- fCursorKeyAdapter = new KeyAdapter() {
- public void keyPressed(KeyEvent e)
- {
- handleCursorKeyPressed(e);
- }
- };
-
- fTableCursor.addKeyListener(fCursorKeyAdapter);
-
- fCursorTraverseListener = new TraverseListener() {
- public void keyTraversed(TraverseEvent e) {
- handleCursorTraverseEvt(e);
- }};
-
- fTableCursor.addTraverseListener(fCursorTraverseListener);
-
- fCursorMouseListener = new MouseAdapter() {
- public void mouseDown(MouseEvent e) {
- handleCursorMouseEvent(e);
- }};
- fTableCursor.addMouseListener(fCursorMouseListener);
-
- // cursor may be disposed before disposed is called
- // remove listeners whenever the cursor is disposed
- fTableCursor.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- if (fTableCursor == null)
- return;
- fTableCursor.removeTraverseListener(fCursorTraverseListener);
- fTableCursor.removeKeyListener(fCursorKeyAdapter);
- fTableCursor.removeMouseListener(fCursorMouseListener);
- fTableCursor.removeSelectionListener(fCursorSelectionListener);
- }});
-
- fCursorSelectionListener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleCursorMoved();
- }
- };
- fTableCursor.addSelectionListener(fCursorSelectionListener);
- fCursorEditor = new TableEditor (getTable());
- }
-
- private void handleCursorKeyPressed(KeyEvent event)
- {
- if (event.character == '\r' && event.getSource() instanceof TableCursor)
- {
- activateCellEditor(null);
- return;
- }
-
- if (MemoryViewUtil.isValidEditEvent(event.keyCode))
- {
- // activate edit as soon as user types something at the cursor
- if (event.getSource() instanceof TableCursor)
- {
- int col = fTableCursor.getColumn();
- if (getCellEditors()[col] instanceof TextCellEditor)
- {
- String initialValue = String.valueOf(event.character);
- activateCellEditor(initialValue);
- }
- }
- }
- }
-
- private void handleCursorMouseEvent(MouseEvent e){
- if (e.button == 1)
- {
- int col = fTableCursor.getColumn();
- if (col > 0 && col <= (getNumCol()))
- activateCellEditor(null);
- }
- }
-
- private void handleCursorTraverseEvt(TraverseEvent e){
- if (fTableCursor.getRow() == null)
- return;
-
- Table table = (Table)fTableCursor.getParent();
- int row = table.indexOf(fTableCursor.getRow());
- int col = fTableCursor.getColumn();
- if (col == getNumCol() && e.keyCode == SWT.ARROW_RIGHT)
- {
- if (row + 1>= table.getItemCount())
- {
- return;
- }
-
- row = row +1;
- col = 0;
- fTableCursor.setSelection(row, col);
- }
- if (col <= 1 && e.keyCode == SWT.ARROW_LEFT)
- {
- if (row-1 < 0)
- {
- return;
- }
-
- row = row - 1;
- col = getNumCol()+1;
- fTableCursor.setSelection(row, col);
- }
-
- handleCursorMoved();
- }
-
- /**
- * Update selected address.
- * Load more memory if required.
- */
- private void handleCursorMoved()
- {
- fSelectionKey = getSelectionKeyFromCursor();
- fPendingSelection = null;
-
- if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING)
- System.out.println(Thread.currentThread().getName() + " cursor moved selection is: " + ((BigInteger)fSelectionKey).toString(16)); //$NON-NLS-1$
-
- // now check to see if the cursor is approaching buffer limit
- handleScrollBarSelection();
- fireSelectionChanged(fSelectionKey);
- }
-
- private int getNumCol() {
-
- int bytesPerLine = fRendering.getBytesPerLine();
- int columnSize = fRendering.getBytesPerColumn();
-
- return bytesPerLine/columnSize;
- }
-
- /**
- * Sets the cursor at the specified address
- * @param key selection key
- */
- public void setSelection(Object key)
- {
- fPendingSelection = key;
- attemptSetKeySelection();
- }
-
- public Object getSelectionKey()
- {
- return fSelectionKey;
- }
-
- private synchronized void attemptSetKeySelection()
- {
- if (fPendingSelection != null) {
- doAttemptSetKeySelection(fPendingSelection);
- }
-
- }
-
- synchronized private Object doAttemptSetKeySelection(final Object key)
- {
- if (getBufferTopKey() == null || getBufferEndKey() == null)
- return key;
-
- // calculate selected row address
- int[] location = getCoordinatesFromKey(key);
- if(location.length == 0)
- {
- return key;
- }
-
- UIJob uiJob = new UIJob("Set Cursor Selection"){ //$NON-NLS-1$
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- try {
- if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING)
- System.out.println(getRendering() + " set cursor selection " + ((BigInteger)key).toString(16)); //$NON-NLS-1$
-
- if (fPendingSelection != null && fPendingSelection != key)
- return Status.OK_STATUS;
-
- if (fTableCursor.isDisposed())
- return Status.OK_STATUS;
-
- // by the time this is called, the location may not be valid anymore
- int[] newLocation = getCoordinatesFromKey(key);
- if (newLocation.length == 0)
- {
- Object selectionKey = getSelectionKey();
- fPendingSelection = selectionKey;
- return Status.OK_STATUS;
- }
-
- fSelectionKey = key;
- fPendingSelection = null;
-
- if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING)
- {
- System.out.println(getRendering() + " set cursor selection, row is " + getTable().getItem(newLocation[0]).getData()); //$NON-NLS-1$
- System.out.println(getRendering() + " set cursor selection, model is " + getVirtualContentModel().getElement(newLocation[0])); //$NON-NLS-1$
- }
-
- fTableCursor.setSelection(newLocation[0], newLocation[1]);
- showTableCursor(true);
-
- // show the column for the selection
- getTable().showColumn(getTable().getColumn(newLocation[1]));
-
- int topIndex = getTable().getTopIndex();
- Object topKey = getVirtualContentModel().getKey(topIndex);
- setTopIndexKey(topKey);
-
-
- } catch (RuntimeException e) {
-
- // by the time this is called, the selection may no longer
- // get the latest selection and try to set selection again
- Object selectionKey = getSelectionKey();
- fPendingSelection = selectionKey;
- doAttemptSetKeySelection(selectionKey);
- }
- return Status.OK_STATUS;
- }};
-
- uiJob.setSystem(true);
- uiJob.schedule();
-
- return null;
- }
-
- /**
- *
- * @param key
- * @return the coordinates of the key
- * Element[0] is the row index
- * Element[1] is the column index
- */
- private int[] getCoordinatesFromKey(Object key)
- {
- final int row = indexOf(key);
-
- if (row == -1)
- {
- return new int[0];
- }
-
- Object element = getVirtualContentModel().getElement(row);
- final int col = columnOf(element, key);
-
- if (col == -1)
- {
- return new int[0];
- }
- return new int[]{row, col};
- }
-
- private Object getSelectionKeyFromCursor()
- {
- int idx = getTable().indexOf(fTableCursor.getRow());
- int col = fTableCursor.getColumn();
-
- return getVirtualContentModel().getKey(idx, col);
- }
-
- private Object getBufferTopKey()
- {
- return getKey(0);
- }
-
- private Object getBufferEndKey()
- {
- AbstractVirtualContentTableModel model = getVirtualContentModel();
-
- if (model != null)
- return getKey(model.getElements().length-1);
- return null;
- }
-
- public int indexOf(Object key)
- {
- int idx = -1;
- AbstractVirtualContentTableModel model = getVirtualContentModel();
- if (model != null)
- idx = model.indexOfKey(key);
- return idx;
- }
-
- private int columnOf(Object element, Object key)
- {
- int idx = -1;
- AbstractVirtualContentTableModel model = getVirtualContentModel();
- if (model != null)
- {
- idx = model.columnOf(element, key);
- }
- return idx;
- }
-
- public Object getKey(int index)
- {
- AbstractVirtualContentTableModel model = getVirtualContentModel();
- if (model != null)
- {
- Object key = model.getKey(index);
- return key;
- }
- return null;
- }
-
- public Object getKey(int row, int col)
- {
- AbstractVirtualContentTableModel model = getVirtualContentModel();
- if (model != null)
- return model.getKey(row, col);
- return null;
- }
-
-
- protected synchronized void preservingSelection(Runnable updateCode) {
- Object oldTopIndexKey = null;
-
- if (getPendingSetTopIndexKey() == null) {
- // preserve selection
- oldTopIndexKey = getTopIndexKey();
- }
- else
- {
- oldTopIndexKey = getPendingSetTopIndexKey();
- }
- Object oldSelectionKey = null;
- try {
- if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING)
- {
- if (oldTopIndexKey != null)
- System.out.println(getRendering() + " preserve top index: " + ((BigInteger)oldTopIndexKey).toString(16)); //$NON-NLS-1$
- else
- System.out.println("top index key is null, nothing to preserve"); //$NON-NLS-1$
- }
-
- if (fPendingSelection != null)
- oldSelectionKey = fPendingSelection;
- else
- oldSelectionKey = getSelectionKey();
-
- if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING)
- {
- if (oldTopIndexKey != null)
- System.out.println(getRendering() + " preserve selection: " + ((BigInteger)oldSelectionKey).toString(16)); //$NON-NLS-1$
- else
- System.out.println("selection key is null, nothing to preserve"); //$NON-NLS-1$
- }
-
- // perform the update
- updateCode.run();
-
- } finally {
-
- if (oldSelectionKey != null)
- {
- if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING)
- System.out.println(getRendering() + " preserved selection " + ((BigInteger)oldSelectionKey).toString(16)); //$NON-NLS-1$
- setSelection(oldSelectionKey);
- }
-
- if (getPendingSetTopIndexKey() != null)
- {
- if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING)
- System.out.println(getRendering() + " finished top index: " + ((BigInteger)oldTopIndexKey).toString(16)); //$NON-NLS-1$
- setTopIndex(getPendingSetTopIndexKey());
- }
- else if (oldTopIndexKey != null)
- {
- setTopIndex(oldTopIndexKey);
-
- if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING)
- System.out.println(getRendering() + " finished top index: " + ((BigInteger)oldTopIndexKey).toString(16)); //$NON-NLS-1$
- }
- }
- }
-
- public void dispose()
- {
- super.dispose();
-
- if (fTableCursor != null && !fTableCursor.isDisposed())
- {
- fCursorEditor.dispose();
- fCursorEditor = null;
-
- fTableCursor.removeTraverseListener(fCursorTraverseListener);
- fTableCursor.removeKeyListener(fCursorKeyAdapter);
- fTableCursor.removeMouseListener(fCursorMouseListener);
- fTableCursor.removeSelectionListener(fCursorSelectionListener);
-
- fTableCursor.dispose();
- fTableCursor = null;
- }
- }
-
- public void showTableCursor(final boolean show)
- {
-
- Display display = DebugUIPlugin.getDefault().getWorkbench().getDisplay();
- if (Thread.currentThread() == display.getThread())
- {
- if (!fTableCursor.isDisposed())
- {
- if (fTableCursor.isVisible() != show)
- fTableCursor.setVisible(show);
- }
- }
- else
- {
- UIJob job = new UIJob("show table cursor"){ //$NON-NLS-1$
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if (!fTableCursor.isDisposed())
- {
- if (fTableCursor.isVisible() != show)
- fTableCursor.setVisible(show);
- }
- return Status.OK_STATUS;
- }};
-
- job.setSystem(true);
- job.schedule();
- }
- }
-
- private void handleTableMouseEvent(MouseEvent e) {
- // figure out new cursor position based on here the mouse is pointing
- TableItem[] tableItems = getTable().getItems();
- TableItem selectedRow = null;
- int colNum = -1;
- int numCol = getColumnProperties().length;
-
- for (int j=0; j<tableItems.length; j++)
- {
- TableItem item = tableItems[j];
- if (item.getData() != null)
- {
- for (int i=0; i<numCol; i++)
- {
- Rectangle bound = item.getBounds(i);
- if (bound.contains(e.x, e.y))
- {
- colNum = i;
- selectedRow = item;
- break;
- }
- }
- }
- if (colNum >= 0)
- break;
- }
-
- // if column position cannot be determined, return
- if (colNum < 1)
- return;
-
- // handle user mouse click onto table
- // move cursor to new position
- if (selectedRow != null)
- {
- int row = getTable().indexOf(selectedRow);
- showTableCursor(true);
- fTableCursor.setSelection(row, colNum);
-
- // manually call this since we don't get an event when
- // the table cursor changes selection.
- handleCursorMoved();
-
- fTableCursor.setFocus();
- }
- }
-
- /**
- * Activate cell editor and prefill it with initial value.
- * If initialValue is null, use cell content as initial value
- * @param initialValue
- */
- private void activateCellEditor(String initialValue) {
-
- final int col = fTableCursor.getColumn();
- final int row = indexOf(fSelectionKey);
-
- if (row < 0)
- return;
-
- // do not allow user to edit address column
- if (col == 0 || col > getNumCol()) {
- return;
- }
-
- ICellModifier cellModifier = null;
-
- cellModifier = getCellModifier();
-
- TableItem tableItem = getTable().getItem(row);
-
- Object element = tableItem.getData();
-
- if (element != null) {
- Object property = getColumnProperties()[col];
- Object value = cellModifier.getValue(element, (String) property);
- boolean canEdit = cellModifier
- .canModify(element, (String) property);
-
- if (!canEdit)
- return;
-
- CellEditor editor = getCellEditors()[col];
- if (editor != null) {
- // The control that will be the editor must be a child of the
- // Table
- Control control = editor.getControl();
-
- Object cellValue = null;
-
- if (initialValue != null) {
- cellValue = initialValue;
- } else {
- cellValue = value;
- }
-
- editor.setValue(cellValue);
-
- fCursorEditor.horizontalAlignment = SWT.LEFT;
- fCursorEditor.grabHorizontal = true;
-
- // Open the editor editor in selected column of the selected
- // row.
- fCursorEditor.setEditor(control, tableItem, col);
-
- // Assign focus to the editor control
- editor.setFocus();
-
- if (initialValue != null && control instanceof Text) {
- ((Text) control).clearSelection();
- }
-
- control.setFont(JFaceResources
- .getFont(IInternalDebugUIConstants.FONT_NAME));
-
- // add listeners for the editor control
- addListeners(control);
-
- fCellEditorListener = new CellEditorListener(row, col, editor);
- editor.addListener(fCellEditorListener);
-
- // move cursor below editor control
- fTableCursor.moveBelow(control);
- }
- }
- }
-
- private void deactivateEditor(CellEditor editor)
- {
- removeListeners(editor.getControl());
- fTableCursor.moveAbove(editor.getControl());
- fTableCursor.setFocus();
- }
-
- /*
- * @param editor
- */
- private void addListeners(Control control) {
-
- fEditorKeyListener = new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- handleKeyEventInEditor(e);
- }
- };
-
- control.addKeyListener(fEditorKeyListener);
- }
-
- /**
- * @param event
- */
- private void handleKeyEventInEditor(KeyEvent event) {
-
- final KeyEvent e = event;
- Display.getDefault().asyncExec(new Runnable()
- {
- public void run()
- {
- Object obj = e.getSource();
- if (obj instanceof Control)
- {
- Control control = (Control)obj;
- int row = fCellEditorListener.getRow();
- int col = fCellEditorListener.getCol();
-
- try
- {
- switch (e.keyCode)
- {
- case 0:
- doHandleKeyEvent(row, col);
- break;
- case SWT.ESC:
- cancelEditing(row, col);
- break;
- default :
- doHandleKeyEvent(row, col);
- break;
- }
- }
- catch (NumberFormatException e1)
- {
- MemoryViewUtil.openError(DebugUIMessages.MemoryViewCellModifier_failure_title,
- DebugUIMessages.MemoryViewCellModifier_data_is_invalid, null);
-
- fTableCursor.setSelection(row, col);
- handleCursorMoved();
-
- removeListeners(control);
- }
- }
- }
- });
- }
-
- private void doHandleKeyEvent(int row, int col)
- {
- int numCharsPerByte = fRendering.getNumCharsPerByte();
- if (numCharsPerByte > 0)
- {
- Object value = getCellEditors()[col].getValue();
- if (getCellEditors()[col] instanceof TextCellEditor && value instanceof String)
- {
- String str = (String)value;
-
- if (str.length() > fRendering.getBytesPerColumn()*numCharsPerByte)
- {
- String newValue = str;
-
- CellEditor editor = getCellEditors()[col];
- editor.setValue(newValue.substring(0,fRendering.getBytesPerColumn()* numCharsPerByte));
-
- // We want to call modify value here to avoid race condition.
- // Relying on the editor event to modify the cell may introduce a race condition since
- // we try to activate another cell editor in this method. If we happen to use same cell
- // editor in the next activation, the value of the editor may be incorrect when the listener gets the event.
- // We may write the wrong value in that case. Calling modify here allows us to capture the value
- // now and send that to the model.
- fCellEditorListener.cancelEditor();
- deactivateEditor(editor);
- modifyValue(fCellEditorListener.getRow(), fCellEditorListener.getCol(), editor.getValue());
-
- // if cursor is at the end of a line, move to next line
- if (col >= getNumCol())
- {
- col = 1;
- row++;
- }
- else
- {
- col++;
- }
-
- fTableCursor.setSelection(row, col);
- handleCursorMoved();
-
- activateCellEditor(newValue.substring(fRendering.getBytesPerColumn()*numCharsPerByte));
- }
- }
- }
- }
-
- private void cancelEditing(int row, int col)
- {
- // if user has pressed escape, do not commit the changes
- // remove listener to avoid getting notified on the modify value
- fCellEditorListener.cancelEditor();
- deactivateEditor(getCellEditors()[col]);
-
- fTableCursor.setSelection(row, col);
- handleCursorMoved();
-
- // cursor needs to have focus to remove focus from cell editor
- fTableCursor.setFocus();
- }
-
- /**
- * @param control
- */
- private void removeListeners(Control control) {
-
- control.removeKeyListener(fEditorKeyListener);
- }
-
- /**
- * Modify value and send new value to debug adapter
- * @param row
- * @param col
- * @param newValue
- * @throws NumberFormatException
- */
- private void modifyValue(int row, int col, Object newValue) throws NumberFormatException
- {
- if (newValue instanceof String && ((String)newValue).length() == 0)
- {
- // do not do anything if user has not entered anything
- return;
- }
-
- if (row >= 0 && row < getTable().getItemCount())
- {
- TableItem tableItem = getTable().getItem(row);
-
- Object property = getColumnProperties()[col];
- getCellModifier().modify(tableItem, (String)property, newValue);
- }
- }
-
- public TableCursor getCursor()
- {
- return fTableCursor;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ContentViewer#getLabelProvider()
- * Implemented minimum to work with PrintTableRendering action.
- * This is not a real table labe provider, only goes to the table
- * to get the text at the specified row and column.
- */
- public IBaseLabelProvider getLabelProvider() {
- return new ITableLabelProvider() {
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- int idx = getVirtualContentModel().indexOfElement(element);
- if (idx >= 0 )
- {
- TableItem item = getTable().getItem(idx);
- return item.getText(columnIndex);
- }
- return IInternalDebugCoreConstants.EMPTY_STRING;
- }
-
- public void addListener(ILabelProviderListener listener) {
- }
-
- public void dispose() {
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- }};
- }
-
- public void formatViewer()
- {
- if (getModel() == null || !hasPendingUpdates())
- doFormatViewer();
- else
- // do not format in the middle of an update
- // set pending update and will format when update is completed
- fPendingFormatViewer = true;
- }
-
- /**
- *
- */
- private void doFormatViewer() {
- fPendingFormatViewer = false;
- preservingSelection(new Runnable() {
-
- public void run() {
- // causes the content of the table viewer to be replaced
- // without asking content adapter for content
- AbstractVirtualContentTableModel model = getVirtualContentModel();
- if (model != null)
- {
- model.handleViewerChanged();
- }
- }});
- }
-
- private void fireSelectionChanged(Object selectionKey)
- {
- if (selectionKey != null)
- {
- SelectionChangedEvent evt = new SelectionChangedEvent(this, new StructuredSelection(selectionKey));
- fireSelectionChanged(evt);
- }
- }
-
- public void handlePresentationFailure(IStatusMonitor monitor, IStatus status) {
- super.handlePresentationFailure(monitor, status);
- }
-
- public void refresh(boolean getContent)
- {
- if (getContent)
- refresh();
- else
- {
- preservingSelection(new Runnable() {
-
- public void run() {
- AbstractVirtualContentTableModel model = getVirtualContentModel();
- if (model != null)
- {
- Object[] elements = model.getElements();
- model.remove(elements);
- model.add(elements);
- }
- }});
- }
- }
-
- protected void tableTopIndexSetComplete() {
-
- if (!fTableCursor.isDisposed())
- {
- // TODO: work around swt bug, must force a table cursor redraw after top index is changed
- // BUG 130130
- int[] coordinates = getCoordinatesFromKey(getSelectionKey());
- if (coordinates.length > 0)
- fTableCursor.setVisible(true);
- else
- fTableCursor.setVisible(false);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousViewer#getModel()
- */
- public AsynchronousModel getModel() {
- return super.getModel();
- }
-
- // TODO: need pluggable model to be truly flexible
- protected AbstractVirtualContentTableModel createVirtualContentTableModel() {
- return new TableRenderingModel(this);
- }
-
- protected void updateComplete(IStatusMonitor monitor) {
- super.updateComplete(monitor);
-
- if (!hasPendingUpdates() && !fTableCursor.isDisposed())
- {
- attemptSetKeySelection();
- fTableCursor.redraw();
-
- // if the viewer has pending top index, then more updates will come in
- // and the cursor should not be redrawn yet.
- if (!hasPendingSetTopIndex())
- {
- preservingSelection(new Runnable() {
-
- public void run() {
-
- int[] coordinates = getCoordinatesFromKey(getSelectionKey());
- if (coordinates.length > 0)
- fTableCursor.setVisible(true);
- else
- fTableCursor.setVisible(false);
- }});
- }
- }
-
- if (!hasPendingUpdates() && fPendingFormatViewer)
- {
- formatViewer();
- resizeColumnsToPreferredSize();
- }
- }
-
- protected void clear(Widget item) {
- super.clear(item);
-
- // this table viewer assumes that #getData will return null
- // set data to null when clearing an item.
- // only visible item will get SET DATA event again and at that time
- // the viewer would set the data back.
- if (item instanceof TableItem)
- {
- item.setData(null);
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncVirtualContentTableViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncVirtualContentTableViewer.java
deleted file mode 100644
index cb000c906..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncVirtualContentTableViewer.java
+++ /dev/null
@@ -1,483 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.viewers.AsynchronousModel;
-import org.eclipse.debug.internal.ui.viewers.AsynchronousTableViewer;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IStatusMonitor;
-import org.eclipse.debug.internal.ui.viewers.provisional.ILabelRequestMonitor;
-import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.ScrollBar;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.progress.UIJob;
-
-abstract public class AsyncVirtualContentTableViewer extends AsynchronousTableViewer {
-
- private Object fPendingTopIndexKey;
- private ArrayList fTopIndexQueue = new ArrayList();
-
- private boolean fPendingResizeColumns;
- private ListenerList fVirtualContentListeners;
- private SelectionListener fScrollSelectionListener;
- private ListenerList fPresentationErrorListeners;
- private Object fTopIndexKey;
-
- public static boolean DEBUG_DYNAMIC_LOADING = false;
-
- public AsyncVirtualContentTableViewer(Composite parent, int style) {
- super(parent, style);
- fVirtualContentListeners = new ListenerList();
- fPresentationErrorListeners = new ListenerList();
- initScrollBarListener();
- }
-
- private void initScrollBarListener()
- {
- ScrollBar scroll = getTable().getVerticalBar();
- fScrollSelectionListener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleScrollBarSelection();
- }};
- scroll.addSelectionListener(fScrollSelectionListener);
- }
-
- public void setTopIndex(Object key)
- {
- fPendingTopIndexKey = key;
- attemptSetTopIndex();
- }
-
- protected Object getPendingSetTopIndexKey()
- {
- return fPendingTopIndexKey;
- }
-
- protected void handlePresentationFailure(IStatusMonitor monitor, IStatus status) {
- notifyPresentationError(monitor, status);
- }
-
- public void disposeColumns()
- {
- // clean up old columns
- TableColumn[] oldColumns = getTable().getColumns();
-
- for (int i=0; i<oldColumns.length; i++)
- {
- oldColumns[i].dispose();
- }
- }
-
- public void disposeCellEditors()
- {
- // clean up old cell editors
- CellEditor[] oldCellEditors = getCellEditors();
-
- if (oldCellEditors != null)
- {
- for (int i=0; i<oldCellEditors.length; i++)
- {
- oldCellEditors[i].dispose();
- }
- }
- }
-
- /**
- * Resize column to the preferred size.
- */
- public void resizeColumnsToPreferredSize() {
- fPendingResizeColumns = true;
- fPendingResizeColumns = attemptResizeColumnsToPreferredSize();
- }
-
- private boolean attemptResizeColumnsToPreferredSize()
- {
- if (fPendingResizeColumns)
- {
- if(!hasPendingUpdates()) {
- UIJob job = new UIJob("packcolumns"){ //$NON-NLS-1$
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- Table table = getTable();
-
- if (!table.isDisposed())
- {
- // if table size is zero, the rendering has not been made visible
- // cannot pack until the rendering is visible
- if (table.getSize().x > 0)
- {
- TableColumn[] columns = table.getColumns();
- for (int i=0 ;i<columns.length-1; i++)
- {
- columns[i].pack();
- }
- }
- else
- {
- fPendingResizeColumns = true;
- }
- }
- return Status.OK_STATUS;
- }};
- job.setSystem(true);
- job.schedule();
- return false;
- }
- }
- return fPendingResizeColumns;
- }
-
- /**
- * Attempts to update any pending setTopIndex
- *
- * @param reveal whether to reveal the selection
- */
- protected synchronized void attemptSetTopIndex() {
- if (fPendingTopIndexKey != null) {
- Object remaining = doAttemptSetTopIndex(fPendingTopIndexKey);
- if (remaining == null)
- {
- fPendingTopIndexKey = remaining;
- }
- }
- }
-
- private synchronized Object doAttemptSetTopIndex(final Object topIndexKey)
- {
- final int i = getVirtualContentModel().indexOfKey(topIndexKey);
- if (i >= 0)
- {
- UIJob job = new UIJob("set top index"){ //$NON-NLS-1$
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if (getTable().isDisposed())
- {
- fTopIndexQueue.clear();
- return Status.OK_STATUS;
- }
-
- int idx = getVirtualContentModel().indexOfKey(topIndexKey);
- if (idx >= 0)
- {
- if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING)
- System.out.println("actual set top index: " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$
- fPendingTopIndexKey = null;
- setTopIndexKey(topIndexKey);
- getTable().setTopIndex(idx);
- tableTopIndexSetComplete();
-
- if (getTable().getTopIndex() != idx )
- {
- if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING)
- System.out.println(">>> FAILED set top index : " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$
-
- // only retry if we have pending updates
- if (hasPendingUpdates())
- {
- if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING)
- System.out.println(">>> Retry top index: " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$
-
- fPendingTopIndexKey = topIndexKey;
- }
- }
- }
- else
- {
- if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING)
- System.out.println("cannot find key, put it back to the queue: " + topIndexKey); //$NON-NLS-1$
- fPendingTopIndexKey = topIndexKey;
- }
-
- // remove the top index key from queue when it is processed
- removeKeyFromQueue(topIndexKey);
-
- return Status.OK_STATUS;
- }};
-
- // set top index does not happen immediately, keep track of
- // all pending set top index
- addKeyToQueue(topIndexKey);
-
- job.setSystem(true);
- job.schedule();
- return topIndexKey;
- }
- return topIndexKey;
- }
-
- protected void tableTopIndexSetComplete()
- {
-
- }
-
- public void addVirtualContentListener(IVirtualContentListener listener)
- {
- fVirtualContentListeners.add(listener);
- }
-
- public void removeVirtualContentListener(IVirtualContentListener listener)
- {
- fVirtualContentListeners.remove(listener);
- }
-
- protected void notifyListenersAtBufferStart()
- {
- int topIdx = getTable().getTopIndex();
- Object[] listeners = fVirtualContentListeners.getListeners();
-
- for (int i = 0; i < listeners.length; i++) {
- final IVirtualContentListener listener = (IVirtualContentListener) listeners[i];
- if (topIdx < listener.getThreshold(IVirtualContentListener.BUFFER_START))
- {
- SafeRunner.run(new ISafeRunnable() {
- public void run() throws Exception {
- listener.handledAtBufferStart();
- }
- public void handleException(Throwable exception) {
- DebugUIPlugin.log(exception);
- }
- });
- }
- }
- }
-
- protected void notifyListenersAtBufferEnd()
- {
- Object[] listeners = fVirtualContentListeners.getListeners();
- int topIdx = getTable().getTopIndex();
- int bottomIdx = topIdx + getNumberOfVisibleLines();
- int elementsCnt = getVirtualContentModel().getElements().length;
- int numLinesLeft = elementsCnt - bottomIdx;
-
- for (int i = 0; i < listeners.length; i++) {
- final IVirtualContentListener listener = (IVirtualContentListener) listeners[i];
- if (numLinesLeft <= listener.getThreshold(IVirtualContentListener.BUFFER_END))
- {
- SafeRunner.run(new ISafeRunnable() {
- public void run() throws Exception {
- listener.handleAtBufferEnd();
- }
- public void handleException(Throwable exception) {
- DebugUIPlugin.log(exception);
- }
- });
- }
- }
- }
-
- protected void handleScrollBarSelection()
- {
-// ignore event if there is pending set top index in the queue
- if (!fTopIndexQueue.isEmpty())
- return;
- topIndexChanged();
- }
-
- public void topIndexChanged()
- {
- if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING)
- {
- MemorySegment a = (MemorySegment)getTable().getItem(getTable().getTopIndex()).getData();
- System.out.println(Thread.currentThread().getName() + " " + this + " handle scroll bar moved: top index: " + a.getAddress().toString(16)); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- setTopIndexKey(getVirtualContentModel().getKey(getTable().getTopIndex()));
-
- notifyListenersAtBufferStart();
- notifyListenersAtBufferEnd();
- }
-
- protected void setTopIndexKey(Object key)
- {
- fTopIndexKey = key;
- }
-
- protected Object getTopIndexKey()
- {
- return fTopIndexKey;
- }
-
- protected synchronized void preservingSelection(Runnable updateCode) {
- Object oldTopIndexKey = null;
- if (fPendingTopIndexKey == null) {
- // preserve selection
- oldTopIndexKey = getTopIndexKey();
- }
- else
- {
- oldTopIndexKey = fPendingTopIndexKey;
- }
-
- try {
-
- // perform the update
- updateCode.run();
- } finally {
- if (oldTopIndexKey != null)
- {
- setTopIndex(oldTopIndexKey);
- }
- }
-
- }
-
- public void addPresentationErrorListener(IPresentationErrorListener errorListener)
- {
- fPresentationErrorListeners.add(errorListener);
- }
-
- public void removePresentationErrorListener(IPresentationErrorListener errorListener)
- {
- fPresentationErrorListeners.remove(errorListener);
- }
-
- private void notifyPresentationError(final IStatusMonitor monitor, final IStatus status)
- {
- Object[] listeners = fPresentationErrorListeners.getListeners();
-
- for (int i = 0; i < listeners.length; i++) {
-
- if (listeners[i] instanceof IPresentationErrorListener)
- {
- final IPresentationErrorListener listener = (IPresentationErrorListener)listeners[i];
- SafeRunner.run(new ISafeRunnable() {
- public void run() throws Exception {
- listener.handlePresentationFailure(monitor, status);
- }
- public void handleException(Throwable exception) {
- DebugUIPlugin.log(exception);
- }
- });
- }
- }
- }
-
- protected AsynchronousModel createModel() {
- return createVirtualContentTableModel();
- }
-
- abstract protected AbstractVirtualContentTableModel createVirtualContentTableModel();
-
- private void addKeyToQueue(Object topIndexKey)
- {
- synchronized(fTopIndexQueue){
- if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING)
- System.out.println(" >>> add to top index queue: " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$
- fTopIndexQueue.add(topIndexKey);
- }
- }
-
- private void removeKeyFromQueue(Object topIndexKey)
- {
- synchronized(fTopIndexQueue){
- if (AsyncVirtualContentTableViewer.DEBUG_DYNAMIC_LOADING)
- System.out.println(" >>> remove frome top index queue: " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$
- fTopIndexQueue.remove(topIndexKey);
- }
- }
-
- public AbstractVirtualContentTableModel getVirtualContentModel()
- {
- if (getModel() instanceof AbstractVirtualContentTableModel)
- return (AbstractVirtualContentTableModel) getModel();
- return null;
- }
-
- private int getNumberOfVisibleLines()
- {
- Table table = getTable();
- int height = table.getSize().y;
-
- // when table is not yet created, height is zero
- if (height == 0)
- {
- // make use of the table viewer to estimate table size
- height = table.getParent().getSize().y;
- }
-
- // height of border
- int border = table.getHeaderHeight();
-
- // height of scroll bar
- int scroll = table.getHorizontalBar().getSize().y;
-
- // height of table is table's area minus border and scroll bar height
- height = height-border-scroll;
-
- // calculate number of visible lines
- int lineHeight = getMinTableItemHeight(table);
-
- int numberOfLines = height/lineHeight;
-
- if (numberOfLines <= 0)
- return 20;
-
- return numberOfLines;
- }
-
- private int getMinTableItemHeight(Table table){
-
- // Hack to get around Linux GTK problem.
- // On Linux GTK, table items have variable item height as
- // carriage returns are actually shown in a cell. Some rows will be
- // taller than others. When calculating number of visible lines, we
- // need to find the smallest table item height. Otherwise, the rendering
- // underestimates the number of visible lines. As a result the rendering
- // will not be able to get more memory as needed.
- if (MemoryViewUtil.isLinuxGTK())
- {
- // check each of the items and find the minimum
- TableItem[] items = table.getItems();
- int minHeight = table.getItemHeight();
- for (int i=0; i<items.length; i++)
- {
- if (items[i].getData() != null)
- minHeight = Math.min(items[i].getBounds(0).height, minHeight);
- }
-
- return minHeight;
-
- }
- return table.getItemHeight();
- }
-
- protected void updateComplete(IStatusMonitor monitor) {
- super.updateComplete(monitor);
- attemptSetTopIndex();
- if (monitor instanceof ILabelRequestMonitor)
- {
- fPendingResizeColumns = attemptResizeColumnsToPreferredSize();
- }
- }
-
- protected boolean hasPendingSetTopIndex()
- {
- return !fTopIndexQueue.isEmpty();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java
deleted file mode 100644
index e1b72a8a3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * @since 3.0
- *
- */
-public abstract class BasicDebugViewContentProvider implements IStructuredContentProvider, IDebugEventSetListener {
-
- protected StructuredViewer fViewer;
- protected boolean fDisposed= false;
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
- fDisposed= true;
- }
-
- /**
- * Returns whether this content provider has already
- * been disposed.
- */
- protected boolean isDisposed() {
- return fDisposed;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- fViewer= (StructuredViewer) viewer;
- }
-
- protected void asyncExec(Runnable r) {
- if (fViewer != null) {
- Control ctrl= fViewer.getControl();
- if (ctrl != null && !ctrl.isDisposed()) {
- ctrl.getDisplay().asyncExec(r);
- }
- }
- }
-
- protected void syncExec(Runnable r) {
- if (fViewer != null) {
- Control ctrl= fViewer.getControl();
- if (ctrl != null && !ctrl.isDisposed()) {
- ctrl.getDisplay().syncExec(r);
- }
- }
- }
-
- /**
- * Refreshes the viewer - must be called in UI thread.
- */
- protected void refresh() {
- if (fViewer != null) {
- fViewer.refresh();
- }
- }
-
- /**
- * Refresh the given element in the viewer - must be called in UI thread.
- */
- protected void refresh(Object element) {
- if (fViewer != null) {
- fViewer.refresh(element);
- }
- }
-
- /**
- * Handle debug events on the main thread.
- * @param event
- */
- public void handleDebugEvent(final DebugEvent event) {
- if (fViewer == null) {
- return;
- }
- Object element= event.getSource();
- if (element == null) {
- return;
- }
- Runnable r= new Runnable() {
- public void run() {
- if (!isDisposed()) {
- doHandleDebugEvent(event);
- }
- }
- };
-
- asyncExec(r);
- }
-
- /* (non-Javadoc)
- * @see IDebugEventSetListener#handleDebugEvents(DebugEvent[])
- */
- public void handleDebugEvents(DebugEvent[] events) {
- for (int i=0; i < events.length; i++)
- handleDebugEvent(events[i]);
- }
-
- /**
- * Performs an update based on the event
- */
- protected abstract void doHandleDebugEvent(DebugEvent event);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BigEndianAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BigEndianAction.java
deleted file mode 100644
index 94d7d154c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BigEndianAction.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Show integers in Big Endian
- */
-public class BigEndianAction implements IObjectActionDelegate {
-
- AbstractIntegerRendering fRendering;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
-
- if (fRendering == null)
- return;
-
- if (fRendering.getDisplayEndianess() != RenderingsUtil.BIG_ENDIAN){
- fRendering.setDisplayEndianess(RenderingsUtil.BIG_ENDIAN);
- fRendering.refresh();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
-
- if (selection == null)
- return;
-
- if (selection instanceof IStructuredSelection)
- {
- Object obj = ((IStructuredSelection)selection).getFirstElement();
- if (obj == null)
- return;
-
- if (obj instanceof AbstractIntegerRendering)
- {
- fRendering = (AbstractIntegerRendering)obj;
- }
-
- int endianess = RenderingsUtil.ENDIANESS_UNKNOWN;
- if (fRendering.getDisplayEndianess() == RenderingsUtil.ENDIANESS_UNKNOWN)
- {
- MemoryByte[] selectedBytes = fRendering.getSelectedAsBytes();
- for (int i=0; i<selectedBytes.length; i++)
- {
- if (!selectedBytes[i].isEndianessKnown())
- {
- endianess = RenderingsUtil.ENDIANESS_UNKNOWN;
- break;
- }
- if (i==0)
- {
- endianess = selectedBytes[i].isBigEndian()?RenderingsUtil.BIG_ENDIAN:RenderingsUtil.LITTLE_ENDIAN;
- }
- else
- {
- int byteEndianess = selectedBytes[i].isBigEndian()?RenderingsUtil.BIG_ENDIAN:RenderingsUtil.LITTLE_ENDIAN;
- if (endianess != byteEndianess)
- {
- endianess = RenderingsUtil.ENDIANESS_UNKNOWN;
- break;
- }
- }
- }
- }
- else
- endianess = fRendering.getDisplayEndianess();
-
- if (endianess == RenderingsUtil.BIG_ENDIAN)
- action.setChecked(true);
- else
- action.setChecked(false);
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java
deleted file mode 100644
index 43ad789a6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.PlatformUI;
-
-
-/**
- * Toobar Copy View Tab to Clipboard action
- *
- * @since 3.0
- */
-public class CopyTableRenderingToClipboardAction extends Action
-{
- private final String COLUMN_SEPERATOR = " "; //$NON-NLS-1$
-
- protected AbstractBaseTableRendering fRendering;
- protected StructuredViewer fViewer;
-
- public CopyTableRenderingToClipboardAction(AbstractBaseTableRendering rendering, StructuredViewer viewer)
- {
- super();
- fRendering = rendering;
- fViewer = viewer;
- setText(DebugUIMessages.CopyViewToClipboardAction_title);
- setToolTipText(DebugUIMessages.CopyViewToClipboardAction_tooltip);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_COPY_VIEW_TO_CLIPBOARD));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_COPY_VIEW_TO_CLIPBOARD));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_COPY_VIEW_TO_CLIPBOARD));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".PrintViewTabContextAction_context"); //$NON-NLS-1$
- }
-
- protected String concatenateTableAsString(TableItem[] itemList) {
- if (itemList.length == 0) return null;
-
- StringBuffer tableContents = new StringBuffer();
-
- Table table = (Table)fViewer.getControl();
- int numColumns = table.getColumnCount();
- ITableLabelProvider labelProvider = (ITableLabelProvider)fViewer.getLabelProvider();
- TableColumn columns[] = table.getColumns();
-
- // get title of view tab
- String label = fRendering.getLabel();
- tableContents.append(label);
- tableContents.append(System.getProperty("line.separator")); //$NON-NLS-1$
- tableContents.append(COLUMN_SEPERATOR);
-
- int charsPerByte = fRendering.getNumCharsPerByte();
- if (charsPerByte < 0)
- charsPerByte = 4;
-
- //get the column headers and line them up properly
- for (int k=0; k < numColumns; k++) {
-
- StringBuffer columnLabel = new StringBuffer(columns[k].getText());
- int numBytes = 0;
- int numChars = 0;
-
- if (k > 0)
- {
- numBytes = fRendering.getBytesPerColumn();
- numChars = numBytes * charsPerByte;
- }
- else
- {
- // special for address column
- IMemoryBlock memBlock = fRendering.getMemoryBlock();
- if (memBlock instanceof IMemoryBlockExtension)
- {
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)fRendering.getAdapter(TableRenderingContentDescriptor.class);
- if (descriptor == null)
- {
- try {
- numBytes = ((IMemoryBlockExtension)memBlock).getAddressSize();
- } catch (DebugException e) {
- numBytes = 0;
- }
- }
- else
- numBytes = descriptor.getAddressSize();
-
- // check address size
- if (numBytes <= 0)
- numBytes = 4;
- }
- else
- {
- numBytes = 4;
- }
- numChars = numBytes*2;
-
- }
-
- while (columnLabel.length() < numChars)
- {
- columnLabel.append(" "); //$NON-NLS-1$
- }
-
- tableContents.append(columnLabel);
- tableContents.append(COLUMN_SEPERATOR);
- }
-
- tableContents.append(System.getProperty("line.separator")); //$NON-NLS-1$
- StringBuffer temp;
-
- //get the column contents from all the rows
- for (int i=0; i < itemList.length; i++) {
- for (int j=0; j < numColumns; j++) {
- tableContents.append(COLUMN_SEPERATOR);
-
- temp = new StringBuffer(labelProvider.getColumnText(itemList[i].getData(), j));
-
- if (j>0)
- {
- int numBytes = fRendering.getBytesPerColumn();
- int numChars = numBytes * charsPerByte;
- while (temp.length() < numChars)
- {
- temp.append(" "); //$NON-NLS-1$
- }
- }
-
- tableContents.append(temp);
- }
- tableContents.append(System.getProperty("line.separator")); //$NON-NLS-1$
- }
- return tableContents.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
-
- if (fRendering == null)
- return;
-
- if (! (fViewer.getControl() instanceof Table))
- return;
-
- Table table = (Table)fViewer.getControl();
-
- if (table == null)
- return;
- Clipboard clip= null;
- try {
- clip = new Clipboard(table.getDisplay());
- TableItem[] tableItems = table.getItems();
- String tableAsString = new String();
- tableAsString = concatenateTableAsString(tableItems);
- if (!tableAsString.equals(IInternalDebugCoreConstants.EMPTY_STRING)) {
- TextTransfer plainTextTransfer = TextTransfer.getInstance();
- clip.setContents(new Object[] {tableAsString}, new Transfer[] {plainTextTransfer});
- }
- } finally {
- if (clip != null) {
- clip.dispose();
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java
deleted file mode 100644
index e1f6d8479..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * WindRiver - Bug 192028 [Memory View] Memory view does not
- * display memory blocks that do not reference IDebugTarget
- * Wind River Systems - Ted Williams - [Memory View] Memory View: Workflow Enhancements (Bug 215432)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.memory.AbstractMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingBindingsListener;
-import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
-import org.eclipse.debug.ui.memory.IMemoryRenderingType;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IBasicPropertyConstants;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ListViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.progress.WorkbenchJob;
-
-/**
- * The rendering to allow users to create a rendering.
- * @since 3.1
- */
-public class CreateRendering extends AbstractMemoryRendering implements IMemoryRenderingBindingsListener {
-
- private ListViewer fViewer;
- private Label fMemoryBlockLabel;
- private IMemoryRenderingContainer fContainer;
- private Composite fCanvas;
- private String fLabel;
-
- private String fTabLabel;
-
- public CreateRendering(IMemoryRenderingContainer container)
- {
- super("org.eclipse.debug.internal.ui.views.createrendering"); //$NON-NLS-1$
- fContainer = container;
- }
-
- class MemoryRenderingLabelProvider implements ILabelProvider
- {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- public Image getImage(Object element) {
- return DebugUIPlugin.getImageDescriptorRegistry().get(
- DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_MONITOR_EXPRESSION));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object element) {
- if (element instanceof IMemoryRenderingType)
- {
- String label = ((IMemoryRenderingType)element).getLabel();
- return label;
- }
- return element.toString();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void addListener(ILabelProviderListener listener) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- */
- public void dispose() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
- */
- public void removeListener(ILabelProviderListener listener) {
- }
-
- }
-
- class MemoryRenderingContentProvider implements IStructuredContentProvider
- {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object inputElement) {
- IMemoryRenderingType[] renderings = DebugUITools.getMemoryRenderingManager().getRenderingTypes((IMemoryBlock)inputElement);
- return renderings;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#createControl(org.eclipse.swt.widgets.Composite)
- */
- public Control createControl(Composite parent) {
- fCanvas = new Composite(parent, SWT.NONE);
- GridLayout compositeLayout = new GridLayout();
- compositeLayout.numColumns = 2;
- compositeLayout.makeColumnsEqualWidth = false;
- fCanvas.setLayout(compositeLayout);
-
- GridData comositeSpec= new GridData();
- comositeSpec.grabExcessVerticalSpace= true;
- comositeSpec.grabExcessHorizontalSpace= true;
- comositeSpec.horizontalAlignment= GridData.FILL;
- comositeSpec.verticalAlignment= GridData.CENTER;
- fCanvas.setLayoutData(comositeSpec);
-
- fMemoryBlockLabel = new Label(fCanvas, SWT.BORDER);
-
- String memoryBlockLabel = " "; //$NON-NLS-1$
- memoryBlockLabel = getLabel();
-
- fMemoryBlockLabel.setText(" " + DebugUIMessages.CreateRenderingTab_Memory_monitor + memoryBlockLabel + " "); //$NON-NLS-1$ //$NON-NLS-2$
- GridData textLayout = new GridData();
- textLayout.verticalAlignment=GridData.CENTER;
- textLayout.horizontalAlignment=GridData.BEGINNING;
- fMemoryBlockLabel.setLayoutData(textLayout);
-
- Label renderingLabel = new Label(fCanvas, SWT.NONE);
- renderingLabel.setText(DebugUIMessages.CreateRenderingTab_Select_renderings_to_create);
- GridData renderingLayout = new GridData();
- renderingLayout.horizontalAlignment = GridData.BEGINNING;
- renderingLayout.verticalAlignment = GridData.CENTER;
- renderingLayout.horizontalSpan = 2;
- renderingLabel.setLayoutData(renderingLayout);
-
- fViewer = new ListViewer(fCanvas);
- fViewer.setContentProvider(new MemoryRenderingContentProvider());
- fViewer.setLabelProvider(new MemoryRenderingLabelProvider());
- fViewer.setInput(getMemoryBlock());
-
- if (fViewer.getElementAt(0) != null)
- {
- fViewer.getList().select(0);
- }
-
- GridData listLayout = new GridData(GridData.FILL_BOTH);
- listLayout.horizontalSpan = 1;
- fViewer.getControl().setLayoutData(listLayout);
-
- fViewer.addDoubleClickListener(new IDoubleClickListener (){
-
- public void doubleClick(DoubleClickEvent event) {
- addRenderings();
- }});
-
- // listen for enter being pressed
- fViewer.getList().addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- if (e.character == SWT.CR)
- addRenderings();
- }});
-
- Button addButton = new Button(fCanvas, SWT.NONE);
- addButton.setText(DebugUIMessages.CreateRenderingTab_Add_renderings);
- GridData buttonLayout = new GridData();
- buttonLayout.horizontalAlignment = GridData.BEGINNING;
- buttonLayout.verticalAlignment = GridData.BEGINNING;
- addButton.setLayoutData(buttonLayout);
-
- addButton.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent e) {
- addRenderings();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- addRenderings();
- }});
-
- DebugUITools.getMemoryRenderingManager().addListener(this);
-
- return fCanvas;
- }
-
- private void addRenderings()
- {
- ISelection selection = fViewer.getSelection();
- Object[] renderings = null;
-
- if (selection instanceof IStructuredSelection)
- {
- IStructuredSelection strucSelection = (IStructuredSelection)selection;
-
- renderings = strucSelection.toArray();
- }
-
- if (renderings == null)
- {
- Status stat = new Status(
- IStatus.ERROR,DebugUIPlugin.getUniqueIdentifier(),
- DebugException.INTERNAL_ERROR, DebugUIMessages.CreateRenderingTab_0, null);
- DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), DebugUIMessages.CreateRenderingTab_1, DebugUIMessages.CreateRenderingTab_2, stat); //
- return;
- }
-
- // ask for debug target and memory block retrieval
- IMemoryBlockRetrieval standardMemRetrieval = MemoryViewUtil.getMemoryBlockRetrieval(getMemoryBlock());
-
- if (standardMemRetrieval == null)
- return;
-
- // make a copy of the container, may be diposed when a rendering is added
- IMemoryRenderingContainer container = fContainer;
- // add memory renderings to Memory Rendering Manager
- for (int i=0; i<renderings.length; i++)
- {
- if (renderings[i] instanceof IMemoryRenderingType)
- {
- try {
- IMemoryRendering rendering = ((IMemoryRenderingType)renderings[i]).createRendering();
- if (rendering != null)
- {
- rendering.init(container, getMemoryBlock());
- container.addMemoryRendering(rendering);
- }
- } catch (CoreException e) {
-
- MemoryViewUtil.openError(DebugUIMessages.CreateRendering_0, DebugUIMessages.CreateRendering_1, e); //
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#dispose()
- */
- public void dispose() {
- fViewer = null;
- fCanvas = null;
- fContainer = null;
- fMemoryBlockLabel = null;
- DebugUITools.getMemoryRenderingManager().removeListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.memory.AbstractMemoryRendering#getControl()
- */
- public Control getControl() {
- return fCanvas;
- }
- public void memoryRenderingBindingsChanged() {
- if (fViewer != null)
- fViewer.refresh();
- }
-
- public String getLabel() {
- if (fTabLabel == null)
- {
- fTabLabel = DebugUIMessages.CreateRendering_2;
- updateRenderingLabel();
- }
-
- return fTabLabel;
- }
-
- public Image getImage() {
- return DebugUIPlugin.getImageDescriptorRegistry().get(
- DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_MONITOR_EXPRESSION));
- }
-
- public void becomesVisible() {
- // Do nothing, do not want to connect/disconnect from clients
- }
-
- public void becomesHidden() {
- // Do nothing, do not want to connect/disconnect from clients
- }
-
- protected void updateRenderingLabel()
- {
- Job job = new Job("Update Rendering Label"){ //$NON-NLS-1$
-
- protected IStatus run(IProgressMonitor monitor) {
- fLabel = CreateRendering.super.getLabel();
- fTabLabel = DebugUIMessages.CreateRenderingTab_label ;
-
- firePropertyChangedEvent(new PropertyChangeEvent(CreateRendering.this, IBasicPropertyConstants.P_TEXT, null, fTabLabel));
-
- WorkbenchJob wbJob = new WorkbenchJob("Create Rendering Update Label"){ //$NON-NLS-1$
-
- public IStatus runInUIThread(IProgressMonitor wbMonitor) {
- if (fMemoryBlockLabel != null)
- {
- fMemoryBlockLabel.setText(DebugUIMessages.CreateRenderingTab_Memory_monitor + " " + fLabel ); //$NON-NLS-1$
- fMemoryBlockLabel.getParent().layout();
- }
- return Status.OK_STATUS;
- }};
- wbJob.setSystem(true);
- wbJob.schedule();
- return Status.OK_STATUS;
- }};
- job.setSystem(true);
- job.schedule();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/DefaultEndianessAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/DefaultEndianessAction.java
deleted file mode 100644
index 1c37061ad..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/DefaultEndianessAction.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Restore default endianess.
- * For IMemoryBlockExtension, default is governed by the attributes set
- * in its memory bytes.
- * For IMemoryBlock, default is big endian.
- *
- */
-public class DefaultEndianessAction implements IObjectActionDelegate {
-
- AbstractIntegerRendering fRendering;
- public DefaultEndianessAction() {
- super();
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- }
-
- public void run(IAction action) {
- if (fRendering != null)
- {
- if (fRendering.getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- fRendering.setDisplayEndianess(RenderingsUtil.ENDIANESS_UNKNOWN);
- }
- else
- {
- fRendering.setDisplayEndianess(RenderingsUtil.BIG_ENDIAN);
- }
- fRendering.refresh();
- }
-
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- if (selection == null)
- return;
-
- if (selection instanceof IStructuredSelection)
- {
- Object obj = ((IStructuredSelection)selection).getFirstElement();
- if (obj == null)
- return;
-
- if (obj instanceof AbstractIntegerRendering)
- {
- fRendering = (AbstractIntegerRendering)obj;
- }
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ErrorRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ErrorRendering.java
deleted file mode 100644
index 36743b9cd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ErrorRendering.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.memory.AbstractMemoryRendering;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.TextViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * A dummy rendering for displaying an error message in a view tab.
- * @since 3.1
- */
-/**
- * @author chanskw
- *
- */
-public class ErrorRendering extends AbstractMemoryRendering {
-
- private TextViewer fTextViewer;
- private String fRenderingId;
- private Throwable fException;
-
- /**
- * @param renderingId - id of rendering that the memory view has failed
- * to create.
- */
- public ErrorRendering(String renderingId, Throwable exception)
- {
- super("org.eclipse.debug.internal.ui.views.memory.errorrendering"); //$NON-NLS-1$
- fRenderingId = renderingId;
- fException = exception;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#createControl(org.eclipse.swt.widgets.Composite)
- */
- public Control createControl(Composite parent) {
- fTextViewer = new TextViewer(parent, SWT.READ_ONLY);
- fTextViewer.setDocument(new Document());
- StyledText styleText = fTextViewer.getTextWidget();
-
- styleText.setText("\r\n\r\n" + DebugUIMessages.EmptyViewTab_Unable_to_create + "\n" + getRenderingName() + "\n\n" + DebugUIMessages.ErrorRendering_0 + fException.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
-
- return fTextViewer.getControl();
- }
-
-
- /**
- *
- */
- private String getRenderingName() {
-
- if (DebugUITools.getMemoryRenderingManager().getRenderingType(fRenderingId)!= null)
- {
- String name =
- DebugUITools.getMemoryRenderingManager()
- .getRenderingType(fRenderingId)
- .getLabel();
-
- return name;
- }
- return "Unknown"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.memory.AbstractMemoryRendering#getControl()
- */
- public Control getControl() {
- return fTextViewer.getControl();
- }
-
- public void refresh() {
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingAction.java
deleted file mode 100644
index c3ae82db8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingAction.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.Action;
-import org.eclipse.ui.PlatformUI;
-
-public class FormatTableRenderingAction extends Action {
-
- private AbstractBaseTableRendering fRendering;
-
- int fColumnSize = -1;
- int fRowSize = -1;
-
- public FormatTableRenderingAction(AbstractBaseTableRendering rendering)
- {
- fRendering = rendering;
- setText(DebugUIMessages.FormatTableRenderingAction_16);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".FormatTableRenderingAction_context"); //$NON-NLS-1$
- }
-
- public void run() {
- FormatTableRenderingDialog dialog = new FormatTableRenderingDialog(fRendering, DebugUIPlugin.getShell());
- dialog.open();
- fColumnSize = dialog.getColumnSize();
- fRowSize = dialog.getRowSize();
- if (fColumnSize > 0 && fRowSize > 0)
- {
- int addressableSize = fRendering.getAddressableSize();
- int columnSizeInBytes = addressableSize * fColumnSize;
- int rowSizeInBytes = addressableSize * fRowSize;
- fRendering.format(rowSizeInBytes, columnSizeInBytes);
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java
deleted file mode 100644
index b541a7a94..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java
+++ /dev/null
@@ -1,563 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * QNX - Alena Laskavaia Bug 240330 - [Memory View] Items per row should not be limited to 16
- * Freescale - Teodor Madan Bug 248486 - [Memory View] Need a way to set default memory view format for a particular renderer
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.memory.IPersistableDebugElement;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.TrayDialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.PageBook;
-
-public class FormatTableRenderingDialog extends TrayDialog
- {
-
- // possible number of addressable units per column
- private int[] fColumnSizes = new int[] {1, 2, 4, 8, 16, 32, 64, 128};
-
- // possible number of addressable units per column
- private int[] fRowSizes = new int[] {1, 2, 4, 8, 16, 32, 64, 128};
-
- private Combo fColumnControl;
- private Combo fRowControl;
-
- private int fCurrentColIdx = -1;
- private int fCurrentRowIdx = -1;
- private Control fPreivewPage;
- private PageBook fPreviewPageBook;
- private Button fDefaultButton;
- private Text fDefaultColValue;
- private Text fDefaultRowValue;
- private AbstractBaseTableRendering fRendering;
- private int fColumnSize;
- private int fRowSize;
- private Label fMsgLabel;
- private boolean fDisableCancel = false;
- private String fMsg;
-
-
- public FormatTableRenderingDialog(AbstractBaseTableRendering rendering, Shell parentShell) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- fRendering = rendering;
- fMsg = DebugUIMessages.FormatTableRenderingAction_1;
- }
-
- protected Control createDialogArea(Composite parent) {
- getShell().setText(DebugUIMessages.FormatTableRenderingAction_0);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugUIConstants.PLUGIN_ID + ".FormatTableRenderingDialog_context"); //$NON-NLS-1$
-
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- layout.makeColumnsEqualWidth = false;
- composite.setLayout(layout);
- GridData data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.grabExcessVerticalSpace = true;
- data.horizontalAlignment = SWT.FILL;
- data.verticalAlignment = SWT.FILL;
- composite.setLayoutData(data);
-
- fMsgLabel = new Label(composite, SWT.NONE);
- fMsgLabel.setText(fMsg);
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = SWT.BEGINNING;
- data.horizontalSpan = 3;
- fMsgLabel.setLayoutData(data);
-
- Label rowLabel = new Label(composite, SWT.NONE);
- rowLabel.setText(DebugUIMessages.FormatTableRenderingAction_2);
- fRowControl = new Combo(composite, SWT.READ_ONLY);
- for (int i=0; i<fRowSizes.length; i++)
- {
- fRowControl.add(String.valueOf(fRowSizes[i]));
- }
-
- fRowControl.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent e) {
- if (fCurrentRowIdx != fRowControl.getSelectionIndex())
- {
- fCurrentRowIdx = fRowControl.getSelectionIndex();
- refreshPreviewPage();
- updateButtons();
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }});
-
- data = new GridData();
- data.grabExcessHorizontalSpace = false;
- data.horizontalAlignment = SWT.BEGINNING;
- fRowControl.setLayoutData(data);
-
- Label unit = new Label(composite, SWT.NONE);
- unit.setText(DebugUIMessages.FormatTableRenderingAction_3);
-
- Label columnLabel = new Label(composite, SWT.NONE);
- columnLabel.setText(DebugUIMessages.FormatTableRenderingAction_4);
- fColumnControl = new Combo(composite, SWT.READ_ONLY);
- for (int i=0; i<fColumnSizes.length; i++)
- {
- fColumnControl.add(String.valueOf(fColumnSizes[i]));
- }
-
- fColumnControl.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent e) {
- if (fCurrentColIdx != fColumnControl.getSelectionIndex())
- {
- fCurrentColIdx = fColumnControl.getSelectionIndex();
- refreshPreviewPage();
- updateButtons();
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }});
-
- data = new GridData();
- data.grabExcessHorizontalSpace = false;
- data.horizontalAlignment = SWT.BEGINNING;
- fColumnControl.setLayoutData(data);
-
- unit = new Label(composite, SWT.NONE);
- unit.setText(DebugUIMessages.FormatTableRenderingAction_5);
-
- populateDialog();
-
- fDefaultButton = new Button(composite, SWT.NONE);
- fDefaultButton.setText(DebugUIMessages.FormatTableRenderingAction_8);
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.grabExcessVerticalSpace = true;
- data.horizontalAlignment = SWT.END;
- data.horizontalSpan = 3;
- fDefaultButton.setLayoutData(data);
-
- fDefaultButton.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent e) {
- saveDefaults();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
-
- }});
-
- Group group = new Group(composite, SWT.NONE);
- group.setText(DebugUIMessages.FormatTableRenderingAction_7);
- group.setLayout(new GridLayout());
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.grabExcessVerticalSpace = true;
- data.horizontalAlignment = SWT.FILL;
- data.verticalAlignment = SWT.FILL;
- data.horizontalSpan = 3;
- group.setLayoutData(data);
-
- fPreviewPageBook = new PageBook(group, SWT.NONE);
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.grabExcessVerticalSpace = true;
- data.horizontalAlignment = SWT.FILL;
- data.verticalAlignment = SWT.FILL;
- fPreviewPageBook.setLayoutData(data);
-
- int rowSize = fRowSizes[fRowControl.getSelectionIndex()];
- int colSize = fColumnSizes[fColumnControl.getSelectionIndex()];
-
- fPreivewPage = createPreviewPage(fPreviewPageBook, rowSize, colSize);
- fPreviewPageBook.showPage(fPreivewPage);
-
- Label defaultRow = new Label(composite, SWT.NONE);
- defaultRow.setText(DebugUIMessages.FormatTableRenderingDialog_0);
- fDefaultRowValue = new Text(composite, SWT.READ_ONLY);
-
- int defRow = getDefaultRowSize();
-
- fDefaultRowValue.setText(String.valueOf(defRow));
- Label def = new Label(composite, SWT.NONE);
- def.setText(DebugUIMessages.FormatTableRenderingDialog_1);
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.grabExcessVerticalSpace = true;
- data.horizontalAlignment = SWT.BEGINNING;
- def.setLayoutData(data);
-
-
- Label defaultCol = new Label(composite, SWT.NONE);
- defaultCol.setText(DebugUIMessages.FormatTableRenderingDialog_2);
- fDefaultColValue = new Text(composite, SWT.READ_ONLY);
-
- int defCol = getDefaultColumnSize();
-
- fDefaultColValue.setText(String.valueOf(defCol));
- def = new Label(composite, SWT.NONE);
- def.setText(DebugUIMessages.FormatTableRenderingDialog_3);
-
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.grabExcessVerticalSpace = true;
- data.horizontalAlignment = SWT.BEGINNING;
- def.setLayoutData(data);
-
- Button restoreButton = new Button(composite, SWT.NONE);
- restoreButton.setText(DebugUIMessages.FormatTableRenderingAction_6);
- restoreButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- restoreDefaults();
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- }});
- data = new GridData();
- data.grabExcessHorizontalSpace = true;
- data.horizontalAlignment = SWT.END;
- data.horizontalSpan = 3;
- data.verticalAlignment = SWT.CENTER;
- restoreButton.setLayoutData(data);
-
- return composite;
- }
-
- protected void okPressed() {
- int idx = fColumnControl.getSelectionIndex();
- fColumnSize = fColumnSizes[idx];
- fRowSize = fRowSizes[fRowControl.getSelectionIndex()];
- super.okPressed();
- }
-
- private void populateDialog()
- {
- int currentColSize = fRendering.getAddressableUnitPerColumn();
- int currentRowSize = fRendering.getAddressableUnitPerLine();
- setCurrentRowColSizes(currentRowSize, currentColSize);
- }
-
- private int populateControl(int currentSize, int[] searchArray, Combo control) {
- int idx = 0;
- for (int i=0 ;i<searchArray.length; i++)
- {
- if (searchArray[i] == currentSize)
- {
- idx = i;
- break;
- }
- }
- control.select(idx);
- return idx;
- }
-
- private Control createPreviewPage(Composite parent, int rowSize, int colSize)
- {
- if (!isValid(rowSize, colSize))
- {
- Label label = new Label(parent, SWT.NONE);
- StringBuffer errorMsg = new StringBuffer();
- errorMsg.append(DebugUIMessages.FormatTableRenderingAction_9);
- errorMsg.append("\n"); //$NON-NLS-1$
- errorMsg.append(DebugUIMessages.FormatTableRenderingAction_11);
-
- if (colSize > rowSize)
- {
- errorMsg.append("\n"); //$NON-NLS-1$
- errorMsg.append(DebugUIMessages.FormatTableRenderingAction_13);
- }
-
- label.setText(errorMsg.toString());
-
- return label;
- }
-
- Table table = new Table(parent, SWT.BORDER);
- table.setHeaderVisible(true);
-
- int numCol = rowSize/colSize;
-
- TableColumn addressCol = new TableColumn(table, SWT.NONE);
-
- TableColumn[] columns = new TableColumn[numCol];
- for (int i=0; i<columns.length; i++)
- {
- columns[i] = new TableColumn(table, SWT.NONE);
- }
-
- StringBuffer buf = new StringBuffer();
- for (int j=0; j<colSize; j++)
- {
- buf.append("X"); //$NON-NLS-1$
- }
-
- for (int i = 0; i < 4; i++) {
- TableItem tableItem = new TableItem(table, SWT.NONE);
-
- String[] text = new String[numCol + 1];
- text[0] = DebugUIMessages.FormatTableRenderingAction_15;
- for (int j=1; j<text.length; j++)
- {
- text[j] = buf.toString();
- }
-
- tableItem.setText(text);
- }
-
- addressCol.pack();
- for (int i=0; i<columns.length; i++)
- {
- columns[i].pack();
- }
-
-
- return table;
- }
-
- private boolean isValid(int rowSize, int colSize)
- {
- if (rowSize % colSize != 0)
- return false;
-
- if (colSize > rowSize)
- return false;
-
- return true;
- }
-
- private void refreshPreviewPage() {
- fPreivewPage.dispose();
-
- int rowSize = fRowSizes[fRowControl.getSelectionIndex()];
- int colSize = fColumnSizes[fColumnControl.getSelectionIndex()];
- fPreivewPage = createPreviewPage(fPreviewPageBook, rowSize, colSize);
- fPreviewPageBook.showPage(fPreivewPage);
- }
-
- private void updateButtons() {
- int rowSize = fRowSizes[fRowControl.getSelectionIndex()];
- int colSize = fColumnSizes[fColumnControl.getSelectionIndex()];
- Button button = getButton(IDialogConstants.OK_ID);
- if (!isValid(rowSize, colSize))
- {
- button.setEnabled(false);
- fDefaultButton.setEnabled(false);
-
-
- }
- else
- {
- button.setEnabled(true);
- fDefaultButton.setEnabled(true);
- }
- }
-
- private String getRowPrefId(String modelId) {
- String rowPrefId = IDebugPreferenceConstants.PREF_ROW_SIZE + ":" + modelId; //$NON-NLS-1$
- return rowPrefId;
- }
-
- private String getColumnPrefId(String modelId) {
- String colPrefId = IDebugPreferenceConstants.PREF_COLUMN_SIZE + ":" + modelId; //$NON-NLS-1$
- return colPrefId;
- }
-
- private int getDefaultRowSize()
- {
- int size = -1;
- IPersistableDebugElement elmt = (IPersistableDebugElement)fRendering.getMemoryBlock().getAdapter(IPersistableDebugElement.class);
- if (elmt != null)
- {
- if (elmt.supportsProperty(fRendering, IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL))
- return getDefaultFromPersistableElement(IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL);
- }
-
- size = getDefaultRowSize(fRendering.getMemoryBlock().getModelIdentifier());
-
- return size;
- }
-
- private int getDefaultColumnSize()
- {
- int size = -1;
- IPersistableDebugElement elmt = (IPersistableDebugElement)fRendering.getMemoryBlock().getAdapter(IPersistableDebugElement.class);
- if (elmt != null)
- {
- if (elmt.supportsProperty(fRendering, IDebugPreferenceConstants.PREF_COL_SIZE_BY_MODEL))
- return getDefaultFromPersistableElement(IDebugPreferenceConstants.PREF_COL_SIZE_BY_MODEL);
- }
-
- size = getDefaultColumnSize(fRendering.getMemoryBlock().getModelIdentifier());
- return size;
- }
-
- private int getDefaultRowSize(String modelId)
- {
- int row = DebugUITools.getPreferenceStore().getInt(getRowPrefId(modelId));
- if (row == 0)
- {
- DebugUITools.getPreferenceStore().setValue(getRowPrefId(modelId), IDebugPreferenceConstants.PREF_ROW_SIZE_DEFAULT);
- row = DebugUITools.getPreferenceStore().getInt(getRowPrefId(modelId));
- }
-
- return row;
-
- }
-
- private int getDefaultColumnSize(String modelId)
- {
- int col = DebugUITools.getPreferenceStore().getInt(getColumnPrefId(modelId));
- if (col == 0)
- {
- // if not yet defined, initialize with default
- DebugUITools.getPreferenceStore().setValue(getColumnPrefId(modelId), IDebugPreferenceConstants.PREF_COLUMN_SIZE_DEFAULT);
- col = DebugUITools.getPreferenceStore().getInt(getColumnPrefId(modelId));
- }
- return col;
- }
-
- private void saveDefaults() {
- int columnSize = fColumnSizes[fColumnControl.getSelectionIndex()];
- int rowSize = fRowSizes[fRowControl.getSelectionIndex()];
-
- IPersistableDebugElement elmt = (IPersistableDebugElement)fRendering.getMemoryBlock().getAdapter(IPersistableDebugElement.class);
-
- if (elmt != null && elmt.supportsProperty(fRendering, IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL)
- && elmt.supportsProperty(fRendering, IDebugPreferenceConstants.PREF_COL_SIZE_BY_MODEL))
- {
- try {
- elmt.setProperty(fRendering, IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL, new Integer(rowSize));
- elmt.setProperty(fRendering, IDebugPreferenceConstants.PREF_COL_SIZE_BY_MODEL, new Integer(columnSize));
- } catch (CoreException e) {
- DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), DebugUIMessages.FormatTableRenderingDialog_4, DebugUIMessages.FormatTableRenderingDialog_5, e);
- }
- }
- else
- {
- // save preference
- // find model id
- String modelId = fRendering.getMemoryBlock().getModelIdentifier();
-
- // constrcut preference id
- String rowPrefId = getRowPrefId(modelId);
- String colPrefId = getColumnPrefId(modelId);
-
- // save setting
- IPreferenceStore prefStore = DebugUITools.getPreferenceStore();
- prefStore.setValue(rowPrefId, rowSize);
- prefStore.setValue(colPrefId, columnSize);
- }
-
- fDefaultColValue.setText(String.valueOf(getDefaultColumnSize()));
- fDefaultRowValue.setText(String.valueOf(getDefaultRowSize()));
-
- fDefaultRowValue.getParent().layout();
- }
-
- private void restoreDefaults() {
-
- // Determine the default values by using the following search order:
- // IPersistableDebugElement, workspace preference, plugin defaults
- // issue: 248486
- int defaultRowSize = getDefaultRowSize();
- int defaultColSize = getDefaultColumnSize();
-
- populateControl(defaultRowSize, fRowSizes, fRowControl);
- populateControl(defaultColSize, fColumnSizes, fColumnControl);
-
- fCurrentRowIdx = fRowControl.getSelectionIndex();
- fCurrentColIdx = fColumnControl.getSelectionIndex();
-
- refreshPreviewPage();
- updateButtons();
- }
-
- public int getColumnSize() {
- return fColumnSize;
- }
-
- public int getRowSize() {
- return fRowSize;
- }
-
- public void setCurrentRowColSizes(int row, int col)
- {
- fCurrentColIdx = populateControl(col, fColumnSizes, fColumnControl);
- fCurrentRowIdx = populateControl(row, fRowSizes, fRowControl);
- }
-
- protected Control createButtonBar(Composite parent) {
- Control ret = super.createButtonBar(parent);
- if (fDisableCancel)
- getButton(IDialogConstants.CANCEL_ID).setEnabled(false);
- updateButtons();
- return ret;
- }
-
- public void openError(String msg)
- {
- fDisableCancel = true;
- fMsg = msg;
- open();
- }
-
- private int getDefaultFromPersistableElement(String propertyId) {
- int defaultValue = -1;
- IPersistableDebugElement elmt = (IPersistableDebugElement)fRendering.getMemoryBlock().getAdapter(IPersistableDebugElement.class);
- if (elmt != null)
- {
- try {
- Object valueMB = elmt.getProperty(this, propertyId);
- if (valueMB != null && !(valueMB instanceof Integer))
- {
- IStatus status = DebugUIPlugin.newErrorStatus("Model returned invalid type on " + propertyId, null); //$NON-NLS-1$
- DebugUIPlugin.log(status);
- }
-
- if (valueMB != null)
- {
- Integer value = (Integer)valueMB;
- defaultValue = value.intValue();
- }
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- return defaultValue;
- }
- }
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java
deleted file mode 100644
index c078b7a20..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.core.model.IMemoryBlockRetrievalExtension;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.memory.AbstractMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingType;
-import org.eclipse.debug.ui.memory.IRepositionableMemoryRendering;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-
-/**
- * Go To Address Action for table rendering
- *
- * @since 3.0
- */
-public class GoToAddressAction extends Action
-{
- private IRepositionableMemoryRendering fRendering;
-
- public GoToAddressAction(IRepositionableMemoryRendering rendering)
- {
- super(DebugUIMessages.GoToAddressAction_title);
- setToolTipText(DebugUIMessages.GoToAddressAction_title);
-
- fRendering = rendering;
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".GoToAddressAction_context"); //$NON-NLS-1$
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run()
- {
- try
- {
- Shell shell= DebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
-
- // create dialog to ask for expression/address to block
- GoToAddressDialog dialog = new GoToAddressDialog(shell);
- dialog.open();
-
- int returnCode = dialog.getReturnCode();
-
- if (returnCode == Window.CANCEL)
- {
- return;
- }
-
- // get expression from dialog
- String expression = dialog.getExpression();
-
- expression = parseExpression(expression);
-
- doGoToAddress(expression);
- }
- // open error in case of any error
- catch (DebugException e)
- {
- MemoryViewUtil.openError(DebugUIMessages.GoToAddressAction_Go_to_address_failed,
- DebugUIMessages.GoToAddressAction_Go_to_address_failed, e);
- }
- catch (NumberFormatException e1)
- {
- MemoryViewUtil.openError(DebugUIMessages.GoToAddressAction_Go_to_address_failed,
- DebugUIMessages.GoToAddressAction_Address_is_invalid, null);
- }
- }
- /**
- * @param expression
- * @return
- */
- public String parseExpression(String expression) {
- expression = expression.toUpperCase();
- expression = expression.trim();
-
- if (expression.startsWith("0X")) //$NON-NLS-1$
- {
- expression = expression.substring(2);
- }
- return expression;
- }
- /**
- * @param expression
- * @throws DebugException
- */
- public void doGoToAddress(String expression) throws DebugException, NumberFormatException {
- // convert expression to address
- BigInteger address = new BigInteger(expression, 16);
-
- // look at this address and figure out if a new memory block should
- // be opened.
- IMemoryBlock mb = fRendering.getMemoryBlock();
- if (mb instanceof IMemoryBlockExtension)
- {
- IMemoryBlockExtension mbExt = (IMemoryBlockExtension)mb;
- BigInteger mbStart = mbExt.getMemoryBlockStartAddress();
- BigInteger mbEnd = mbExt.getMemoryBlockEndAddress();
-
- if (mbStart != null)
- {
- // if trying to go beyond the start address
- // of the memory block
- if (address.compareTo(mbStart) < 0)
- {
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(mbExt);
-
- // add a new memory block and then the same rendering as fRendering
- // in the same container.
- if (retrieval != null && retrieval instanceof IMemoryBlockRetrievalExtension)
- {
- addNewMemoryBlock(expression, (IMemoryBlockRetrievalExtension)retrieval);
- return;
- }
- }
- }
- if (mbEnd != null)
- {
- // if trying to go beyond the end address
- // of the memory block
- if (address.compareTo(mbEnd) > 0)
- {
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(mbExt);
-
- // add a new memory block and then the same rendering as fRendering
- // in the same container.
- if (retrieval != null && retrieval instanceof IMemoryBlockRetrievalExtension)
- {
- addNewMemoryBlock(expression, (IMemoryBlockRetrievalExtension)retrieval);
- return;
- }
- }
- }
- }
-
- // go to specified address
- fRendering.goToAddress(address);
- }
-
- private void addNewMemoryBlock(String expression, IMemoryBlockRetrievalExtension retrieval)
- {
- Object elem = DebugUITools.getDebugContext();
-
- if (!(elem instanceof IDebugElement))
- return;
-
- try {
- if (retrieval != null)
- {
- IMemoryBlockExtension mbext = retrieval.getExtendedMemoryBlock(expression, elem);
- if (mbext != null)
- {
- IMemoryBlock[] memArray = new IMemoryBlock[]{mbext};
- DebugPlugin.getDefault().getMemoryBlockManager().addMemoryBlocks(memArray);
- }
-
- IMemoryRenderingType renderingType = DebugUITools.getMemoryRenderingManager().getRenderingType(fRendering.getRenderingId());
-
- if (renderingType != null)
- {
- IMemoryRendering rendering = renderingType.createRendering();
-
- if (rendering != null && fRendering instanceof AbstractMemoryRendering)
- {
- rendering.init(((AbstractMemoryRendering)fRendering).getMemoryRenderingContainer(), mbext);
- ((AbstractMemoryRendering)fRendering).getMemoryRenderingContainer().addMemoryRendering(rendering);
- }
- }
- }
- } catch (DebugException e) {
- MemoryViewUtil.openError(DebugUIMessages.GoToAddressAction_Go_to_address_failed,
- DebugUIMessages.GoToAddressAction_Go_to_address_failed, e);
- } catch (CoreException e)
- {
- MemoryViewUtil.openError(DebugUIMessages.GoToAddressAction_Go_to_address_failed,
- DebugUIMessages.GoToAddressAction_Go_to_address_failed, e);
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressComposite.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressComposite.java
deleted file mode 100644
index 2fd4ef732..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressComposite.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-
-public class GoToAddressComposite {
-
- private Text fExpression;
- private Button fOKButton;
- private Button fCancelButton;
- private Composite fComposite;
- private Combo fGoToCombo;
- private Button fHexButton;
-
- /**
- * @param parent
- * @return
- */
- public Control createControl(Composite parent)
- {
- fComposite = new Composite(parent, SWT.NONE);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(fComposite, DebugUIPlugin.getUniqueIdentifier() + ".GoToAddressComposite_context"); //$NON-NLS-1$
- GridLayout layout = new GridLayout();
- layout.numColumns = 6;
- layout.makeColumnsEqualWidth = false;
- layout.marginHeight = 0;
- layout.marginLeft = 0;
- fComposite.setLayout(layout);
-
- fGoToCombo = new Combo(fComposite, SWT.READ_ONLY);
- fGoToCombo.add(DebugUIMessages.GoToAddressComposite_0);
- fGoToCombo.add(DebugUIMessages.GoToAddressComposite_4);
- fGoToCombo.add(DebugUIMessages.GoToAddressComposite_5);
- fGoToCombo.select(0);
-
- fExpression = new Text(fComposite, SWT.SINGLE | SWT.BORDER);
- fExpression.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- fHexButton = new Button(fComposite, SWT.CHECK);
- fHexButton.setText(DebugUIMessages.GoToAddressComposite_6);
- fHexButton.setSelection(true);
-
- fOKButton = new Button(fComposite, SWT.NONE);
- fOKButton.setText(DebugUIMessages.GoToAddressComposite_1);
-
- fCancelButton = new Button(fComposite, SWT.NONE);
- fCancelButton.setText(DebugUIMessages.GoToAddressComposite_2);
-
- return fComposite;
- }
-
- public int getHeight()
- {
- int height = fComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
- return height;
- }
-
- public Button getButton(int id)
- {
- if (id == IDialogConstants.OK_ID)
- return fOKButton;
- else if (id == IDialogConstants.CANCEL_ID)
- return fCancelButton;
- return null;
- }
-
- public String getExpressionText()
- {
- return fExpression.getText();
- }
-
- public Text getExpressionWidget()
- {
- return fExpression;
- }
-
- public boolean isGoToAddress()
- {
- return fGoToCombo.getSelectionIndex() == 0;
- }
-
- public boolean isOffset()
- {
- return fGoToCombo.getSelectionIndex() == 1;
- }
-
- public boolean isJump()
- {
- return fGoToCombo.getSelectionIndex() == 2;
- }
-
- public boolean isHex()
- {
- return fHexButton.getSelection();
- }
-
- public BigInteger getGoToAddress(BigInteger baseAddress, BigInteger selectedAddress) throws NumberFormatException
- {
- boolean add = true;
- String expression = getExpressionText();
- boolean hex = isHex();
- int radix = hex?16:10;
-
- expression = expression.trim();
-
- if (isGoToAddress())
- {
- expression = expression.toUpperCase();
- if (expression.startsWith("0X")) //$NON-NLS-1$
- {
- expression = expression.substring(2);
- radix = 16;
- }
-
- return new BigInteger(expression, radix);
- }
-
- if (expression.startsWith("+")) //$NON-NLS-1$
- {
- expression = expression.substring(1);
- }
- else if (expression.startsWith("-")) //$NON-NLS-1$
- {
- expression = expression.substring(1);
- add = false;
- }
-
- expression = expression.toUpperCase();
- if (expression.startsWith("0X")) //$NON-NLS-1$
- {
- expression = expression.substring(2);
- radix = 16;
- }
-
- BigInteger gotoAddress = new BigInteger(expression, radix);
-
- BigInteger address = baseAddress;
- if (isJump())
- address = selectedAddress;
-
- if (address == null)
- throw new NumberFormatException(DebugUIMessages.GoToAddressComposite_7);
-
- if (add)
- gotoAddress = address.add(gotoAddress);
- else
- gotoAddress = address.subtract(gotoAddress);
-
- return gotoAddress;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressDialog.java
deleted file mode 100644
index ccf8baefc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressDialog.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.util.Vector;
-
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.TrayDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @since 3.0
- */
-
-public class GoToAddressDialog extends TrayDialog implements ModifyListener{
-
- private static Vector history = new Vector();
- private Combo expressionInput;
- private String expression;
-
- /**
- * @param parentShell
- */
- public GoToAddressDialog(Shell parentShell) {
- super(parentShell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugUIConstants.PLUGIN_ID + ".GoToAddressDialog_context"); //$NON-NLS-1$
- parent.setLayout(new GridLayout());
- GridData spec2= new GridData();
- spec2.grabExcessVerticalSpace= true;
- spec2.grabExcessHorizontalSpace= true;
- spec2.horizontalAlignment= GridData.FILL;
- spec2.verticalAlignment= GridData.CENTER;
- parent.setLayoutData(spec2);
-
- Label textLabel = new Label(parent, SWT.NONE);
- textLabel.setText(DebugUIMessages.GoToAddressDialog_Address);
- GridData textLayout = new GridData();
- textLayout.widthHint = 280;
- textLabel.setLayoutData(textLayout);
-
- expressionInput = new Combo(parent, SWT.BORDER);
- GridData spec= new GridData();
- spec.grabExcessVerticalSpace= false;
- spec.grabExcessHorizontalSpace= true;
- spec.horizontalAlignment= GridData.FILL;
- spec.verticalAlignment= GridData.BEGINNING;
- spec.heightHint = 50;
- expressionInput.setLayoutData(spec);
-
- // add history
- String[] historyExpression = (String[])history.toArray(new String[history.size()]);
- for (int i=0; i<historyExpression.length; i++)
- {
- expressionInput.add(historyExpression[i]);
- }
-
- expressionInput.addModifyListener(this);
-
- return parent;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
-
- newShell.setText(DebugUIMessages.GoToAddressDialog_GoToAddress);
- }
-
- public String getExpression()
- {
- return expression;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
-
- expression = expressionInput.getText();
-
- // add to history list
- if (!history.contains(expression))
- history.insertElementAt(expression, 0);
-
- super.okPressed();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- public void modifyText(ModifyEvent e) {
-
- String input = expressionInput.getText();
-
- if (input == null || input.equals(IInternalDebugCoreConstants.EMPTY_STRING))
- {
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- }
- else
- {
- getButton(IDialogConstants.OK_ID).setEnabled(true);
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createButtonBar(org.eclipse.swt.widgets.Composite)
- */
- protected Control createButtonBar(Composite parent) {
-
- Control ret = super.createButtonBar(parent);
- getButton(IDialogConstants.OK_ID).setEnabled(false);
-
- return ret;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java
deleted file mode 100644
index 07242208b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * David Pickens - [Memory View] Endian in hex view and ASCII view doesn't work
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * @since 3.3
- */
-public class HexIntegerRendering extends AbstractIntegerRendering {
-
- public HexIntegerRendering(String renderingId)
- {
- super(renderingId);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.AbstractTableRendering#getString(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[], java.lang.String)
- */
- public String getString(String dataType, BigInteger address,
- MemoryByte[] data) {
- StringBuffer strBuffer = new StringBuffer();
- int endianess = getEndianness(data);
-
- String paddedStr = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR);
-
- if (endianess == RenderingsUtil.LITTLE_ENDIAN) {
- MemoryByte[] swapped = new MemoryByte[data.length];
- for (int i = 0; i < data.length; i++){
- swapped[data.length-i-1] = data[i];
- }
- data = swapped;
- }
-
- for (int i=0; i<data.length; i++)
- {
- if (data[i].isReadable())
- {
- strBuffer.append(new String(RenderingsUtil.convertByteToCharArray(data[i].getValue())));
- }
- else
- {
- // pad with padded string
- strBuffer.append(paddedStr);
- }
- }
-
- return strBuffer.toString().toUpperCase();
- }
-
- /**
- * @todo davidp needs to add a method comment.
- * @param data
- * @return
- */
- private int getEndianness (MemoryByte[] data) {
- // if the user has not set an endianess to the rendering
- // take default
- int endianess = getDisplayEndianess();
- if (endianess == RenderingsUtil.ENDIANESS_UNKNOWN)
- endianess = getBytesEndianess(data);
- return endianess;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.AbstractTableRendering#getBytes(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[], java.lang.String)
- */
- public byte[] getBytes(String dataType, BigInteger address,
- MemoryByte[] currentValues, String data) {
-
- int endianess = getEndianness(currentValues);
- byte[] bytes = RenderingsUtil.convertHexStringToByteArray(data, currentValues.length, getNumCharsPerByte());
-
-
- if (endianess == RenderingsUtil.LITTLE_ENDIAN) {
- byte[] swapped = new byte[bytes.length];
- for (int i = 0; i < bytes.length; i++){
- swapped[bytes.length-i-1] = bytes[i];
- }
- bytes = swapped;
- }
-
- return bytes;
- }
-
- public int getNumCharsPerByte()
- {
- return 2;
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRenderingDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRenderingDelegate.java
deleted file mode 100644
index 8ccbde884..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRenderingDelegate.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate;
-
-public class HexIntegerRenderingDelegate implements IMemoryRenderingTypeDelegate {
-
- public HexIntegerRenderingDelegate() {
- }
-
- public IMemoryRendering createRendering(String id) throws CoreException {
- return new HexIntegerRendering(id);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java
deleted file mode 100644
index cfc2efc49..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Ken Dyck - Bug 90154: [Memory View] Short Input Rejected by Hex Rendering
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * @since 3.1
- */
-public class HexRendering extends AbstractAsyncTableRendering {
-
- public HexRendering(String renderingId)
- {
- super(renderingId);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.AbstractTableRendering#getString(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[], java.lang.String)
- */
- public String getString(String dataType, BigInteger address,
- MemoryByte[] data) {
- StringBuffer strBuffer = new StringBuffer();
-
- String paddedStr = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR);
-
- for (int i=0; i<data.length; i++)
- {
- if (data[i].isReadable())
- {
- strBuffer.append(new String(RenderingsUtil.convertByteToCharArray(data[i].getValue())));
- }
- else
- {
- // pad with padded string
- strBuffer.append(paddedStr);
- }
- }
-
- return strBuffer.toString().toUpperCase();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.AbstractTableRendering#getBytes(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[], java.lang.String)
- */
- public byte[] getBytes(String dataType, BigInteger address,
- MemoryByte[] currentValues, String data) {
- byte[] bytes = RenderingsUtil.convertHexStringToByteArray(data, currentValues.length, getNumCharsPerByte());
-
- return bytes;
- }
-
- public int getNumCharsPerByte()
- {
- return 2;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRenderingTypeDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRenderingTypeDelegate.java
deleted file mode 100644
index 22ddebbd4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRenderingTypeDelegate.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate;
-
-/**
- * Delegate for creating a hex rendering.
- * @since 3.1
- */
-public class HexRenderingTypeDelegate implements IMemoryRenderingTypeDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate#createRendering(java.lang.String)
- */
- public IMemoryRendering createRendering(String id) throws CoreException {
- HexRendering rendering = new HexRendering(id);
- return rendering;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/IContentChangeComputer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/IContentChangeComputer.java
deleted file mode 100644
index 87d4b8fb5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/IContentChangeComputer.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-public interface IContentChangeComputer {
-
- public void clearCache();
-
- public void cache(Object[] elements);
-
- public Object[] compare(Object[] newElements);
-
- public boolean isEmpty();
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/IPresentationErrorListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/IPresentationErrorListener.java
deleted file mode 100644
index 667e2241b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/IPresentationErrorListener.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IStatusMonitor;
-
-public interface IPresentationErrorListener {
-
- public void handlePresentationFailure(IStatusMonitor monitor, IStatus status);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/IVirtualContentListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/IVirtualContentListener.java
deleted file mode 100644
index ee18fc831..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/IVirtualContentListener.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-public interface IVirtualContentListener {
-
- public int BUFFER_START = 0;
- public int BUFFER_END = 1;
-
- /**
- * Called when the viewer is at the beginning of its bufferred content
- */
- public void handledAtBufferStart();
-
- /**
- * Called when viewer is at the end of its bufferred content
- */
- public void handleAtBufferEnd();
-
- /**
- * @return
- */
- public int getThreshold(int bufferEndOrStart);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/LittleEndianAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/LittleEndianAction.java
deleted file mode 100644
index 9bf917eb4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/LittleEndianAction.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-
-/**
- * Show integers in little endian.
- * @since 3.0
- */
-public class LittleEndianAction implements IObjectActionDelegate {
-
- AbstractIntegerRendering fRendering;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
-
- if (fRendering == null)
- return;
-
- if (fRendering.getDisplayEndianess() != RenderingsUtil.LITTLE_ENDIAN){
- fRendering.setDisplayEndianess(RenderingsUtil.LITTLE_ENDIAN);
- fRendering.refresh();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- if (selection == null)
- return;
-
- if (selection instanceof IStructuredSelection)
- {
- Object obj = ((IStructuredSelection)selection).getFirstElement();
- if (obj == null)
- return;
-
- if (obj instanceof AbstractIntegerRendering)
- {
- fRendering = (AbstractIntegerRendering)obj;
- }
-
- int endianess = RenderingsUtil.ENDIANESS_UNKNOWN;
- if (fRendering.getDisplayEndianess() == RenderingsUtil.ENDIANESS_UNKNOWN)
- {
- MemoryByte[] selectedBytes = fRendering.getSelectedAsBytes();
-
- for (int i=0; i<selectedBytes.length; i++)
- {
- if (!selectedBytes[i].isEndianessKnown())
- {
- endianess = RenderingsUtil.ENDIANESS_UNKNOWN;
- break;
- }
- if (i==0)
- {
- endianess = selectedBytes[i].isBigEndian()?RenderingsUtil.BIG_ENDIAN:RenderingsUtil.LITTLE_ENDIAN;
- }
- else
- {
- int byteEndianess = selectedBytes[i].isBigEndian()?RenderingsUtil.BIG_ENDIAN:RenderingsUtil.LITTLE_ENDIAN;
- if (endianess != byteEndianess)
- {
- endianess = RenderingsUtil.ENDIANESS_UNKNOWN;
- break;
- }
- }
- }
- }
- else
- endianess = fRendering.getDisplayEndianess();
-
- if (endianess == RenderingsUtil.LITTLE_ENDIAN)
- action.setChecked(true);
- else
- action.setChecked(false);
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/MemorySegment.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/MemorySegment.java
deleted file mode 100644
index ddb69da43..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/MemorySegment.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.debug.core.model.MemoryByte;
-
-public class MemorySegment extends PlatformObject {
-
- private BigInteger fAddress;
- private BigInteger fEndAddress;
- private MemoryByte[] fBytes;
- private int fNumAddressableUnits;
-
- public MemorySegment(BigInteger address, MemoryByte[] bytes, int numAddressableUnits)
- {
- fAddress = address;
- fBytes = bytes;
- fNumAddressableUnits = numAddressableUnits;
- }
-
- public BigInteger getAddress() {
- return fAddress;
- }
-
- public MemoryByte[] getBytes() {
- return fBytes;
- }
-
- public int getNumAddressableUnits() {
- return fNumAddressableUnits;
- }
-
- public boolean containsAddress(BigInteger address)
- {
- if (getAddress().compareTo(address) <= 0 && getEndAddress().compareTo(address) >= 0)
- return true;
- return false;
- }
-
- public BigInteger getEndAddress()
- {
- if (fEndAddress == null)
- {
- fEndAddress = fAddress.add(BigInteger.valueOf(fNumAddressableUnits).subtract(BigInteger.ONE));
- }
- return fEndAddress;
- }
-
- /**
- * @param start - zero-based start offset
- * @param length - number of bytes to get
- * @return the bytes from start offset to the end.
- */
- public MemoryByte[] getBytes(int start, int length)
- {
- if (start < 0)
- return new MemoryByte[0];
-
- if (start + length > fBytes.length)
- return new MemoryByte[0];
-
- ArrayList ret = new ArrayList();
-
- for (int i=start; i< start+length; i++)
- {
- ret.add(fBytes[i]);
- }
- return (MemoryByte[]) ret.toArray(new MemoryByte[ret.size()]);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PendingPropertyChanges.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PendingPropertyChanges.java
deleted file mode 100644
index ce3b06406..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PendingPropertyChanges.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-
-/**
- * Stores changes in properties when the rendering is hidden.
- * These data will be used to sync up the rendering when it becomes visible again.
- *
- */
-public class PendingPropertyChanges
-{
- BigInteger fTopVisibleAddress;
- BigInteger fSelectedAddress;
- BigInteger fPageStartAddress;
- int fColumnSize = -1;
- int fRowSize = -1;
- int fPageSize = -1;
-
- public int getColumnSize() {
- return fColumnSize;
- }
-
- public void setColumnSize(int columnSize) {
- fColumnSize = columnSize;
- }
-
- public BigInteger getPageStartAddress() {
- return fPageStartAddress;
- }
-
- public void setPageStartAddress(BigInteger pageStartAddress) {
- fPageStartAddress = pageStartAddress;
- }
-
- public int getRowSize() {
- return fRowSize;
- }
-
- public void setRowSize(int rowSize) {
- fRowSize = rowSize;
- }
-
- public BigInteger getSelectedAddress() {
- return fSelectedAddress;
- }
-
- public void setSelectedAddress(BigInteger selectedAddress) {
- fSelectedAddress = selectedAddress;
- }
-
- public BigInteger getTopVisibleAddress() {
- return fTopVisibleAddress;
- }
-
- public void setTopVisibleAddress(BigInteger topVisibleAddress) {
- fTopVisibleAddress = topVisibleAddress;
- }
-
- public void setPageSize(int pageSize)
- {
- fPageSize = pageSize;
- }
-
- public int getPageSize()
- {
- return fPageSize;
- }
-
-} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java
deleted file mode 100644
index 1cb64e414..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.printing.PrintDialog;
-import org.eclipse.swt.printing.Printer;
-import org.eclipse.swt.printing.PrinterData;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.PlatformUI;
-
-
-/**
- * Print view tab toolbar action
- *
- * @since 3.0
- */
-public class PrintTableRenderingAction extends Action
-{
- private AbstractBaseTableRendering fRendering;
- private StructuredViewer fViewer;
-
- private static final String COLUMN_SEPERATOR = " "; //$NON-NLS-1$
-
- public PrintTableRenderingAction(AbstractBaseTableRendering rendering, StructuredViewer viewer)
- {
- super(DebugUIMessages.PrintViewTabAction_title);
- fRendering = rendering;
- fViewer = viewer;
- setToolTipText(DebugUIMessages.PrintViewTabAction_tooltip);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_PRINT_TOP_VIEW_TAB));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_PRINT_TOP_VIEW_TAB));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_PRINT_TOP_VIEW_TAB));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".PrintViewTabContextAction_context"); //$NON-NLS-1$
- }
-
- /*
- * draws a Table to a GC which has been initialized with a Printer.
- * startJob() and startPage() must be called before printTable(...),
- * and endPage() and endJob() must be called after printTable(...).
- */
- protected void printTable(TableItem[] itemList, GC printGC, Printer printer) {
-
-
- int numColumns = ((Table)fViewer.getControl()).getColumnCount();
- ITableLabelProvider labelProvider = (ITableLabelProvider)fViewer.getLabelProvider();
- int lineNum = 1;
-
- int charsPerByte = fRendering.getNumCharsPerByte();
- if (charsPerByte < 0)
- charsPerByte = 4;
-
- // return line number after column labels are printed
- lineNum = printColumnLabels(printGC, lineNum);
-
- //for all items in the table
- for (int i=0; i < itemList.length; i++) {
- StringBuffer tableContents = new StringBuffer();
- //print all columns for this row
- for (int j=0; j < numColumns; j++) {
- String columnText = labelProvider.getColumnText(itemList[i].getData(), j);
-
- while (columnText.length() < fRendering.getBytesPerColumn() * charsPerByte)
- {
- columnText += " "; //$NON-NLS-1$
- }
- tableContents.append(COLUMN_SEPERATOR);
- tableContents.append(columnText);
- }
- printGC.drawString(tableContents.toString(), 10, 10+(lineNum*printGC.getFontMetrics().getHeight()));
- lineNum++;
-
- // if we've run over the end of a page, start a new one
- if (20+lineNum*printGC.getFontMetrics().getHeight() > printer.getClientArea().height) {
- lineNum=1;
- printer.endPage();
- printer.startPage();
- lineNum = printColumnLabels(printGC, lineNum);
- }
- }
- }
-
- private int printColumnLabels(GC printGC, int lineNum)
- {
- StringBuffer tableContents = new StringBuffer();
- int numColumns = ((Table)fViewer.getControl()).getColumnCount();
- TableColumn columns[] = ((Table)fViewer.getControl()).getColumns();
-
- int charsPerByte = fRendering.getNumCharsPerByte();
- if (charsPerByte < 0)
- charsPerByte = 4;
-
- int addressSizeInBytes = 0;
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)fRendering.getAdapter(TableRenderingContentDescriptor.class);
- if (descriptor == null)
- {
- // special for address column
- IMemoryBlock memBlock = fRendering.getMemoryBlock();
- if (memBlock instanceof IMemoryBlockExtension)
- {
- try {
- addressSizeInBytes = ((IMemoryBlockExtension)memBlock).getAddressSize();
- } catch (DebugException e) {
- addressSizeInBytes = 0;
- }
-
- if (addressSizeInBytes <= 0)
- addressSizeInBytes = 4;
- }
- else
- {
- addressSizeInBytes = 4;
- }
- }
- else
- {
- addressSizeInBytes = descriptor.getAddressSize();
- }
-
- //get the column headers
- for (int k=0; k < numColumns; k++) {
-
- StringBuffer columnLabel = new StringBuffer(columns[k].getText());
- int numBytes = 0;
-
- if (k > 0)
- {
- numBytes = fRendering.getBytesPerColumn();
- }
- else
- {
- numBytes = addressSizeInBytes;
- }
-
- while (columnLabel.length() < numBytes * charsPerByte)
- {
- columnLabel.append(" "); //$NON-NLS-1$
- }
-
- tableContents.append(COLUMN_SEPERATOR);
- tableContents.append(columnLabel);
- }
- printGC.drawString(tableContents.toString(), 10, 10+(lineNum*printGC.getFontMetrics().getHeight()));
- lineNum++;
-
- return lineNum;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
-
- if (!(fViewer.getControl() instanceof Table))
- return;
-
- PrintDialog printDialog = new PrintDialog(DebugUIPlugin.getShell());
- PrinterData printerData = printDialog.open(); // pop up a system print dialog
- if (printerData == null) {setChecked(false); return;}
- Printer printer = new Printer(printerData);
- GC gc = new GC(printer);
- TableItem[] tableItems = ((Table)fViewer.getControl()).getItems();
-
- // start the print job and assign it a title
- printer.startJob(DebugUIMessages.PrintViewTabAction_jobtitle + fRendering.getLabel());
- printer.startPage(); // start the first page
- printTable(tableItems, gc, printer); // print all rows of the table
- printer.endPage(); // end the last page
- printer.endJob(); // end the print job
- gc.dispose();
- printer.dispose();
- setChecked(false);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ReformatAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ReformatAction.java
deleted file mode 100644
index 0324df3a5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ReformatAction.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.Action;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Resize all columns
- *
- * @since 3.0
- */
-public class ReformatAction extends Action {
-
- private AbstractBaseTableRendering fRendering;
-
- public ReformatAction(AbstractBaseTableRendering rendering)
- {
- super(DebugUIMessages.ReformatAction_title);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".ReformatAction_context"); //$NON-NLS-1$
- fRendering = rendering;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- fRendering.resizeColumnsToPreferredSize();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/RenderingsUtil.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/RenderingsUtil.java
deleted file mode 100644
index 4d25e38f7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/RenderingsUtil.java
+++ /dev/null
@@ -1,580 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-
-
-/**
- * Util functions for data conversions
- */
-public class RenderingsUtil {
-
- public static final int LITTLE_ENDIAN = 0;
- public static final int BIG_ENDIAN = 1;
- public static final int ENDIANESS_UNKNOWN = 2;
-
- /**
- * Pad byte array with zero's with the byte array's length
- * is shorter that what's expected the conversion functions.
- * @param array
- * @param size
- * @param endianess
- * @return an array of bytes
- */
- protected static byte[] fillArray(byte[] array, int size, int endianess)
- {
- if (endianess == RenderingsUtil.LITTLE_ENDIAN)
- {
- byte[] temp = new byte[size];
-
- for (int i=0; i<array.length; i++)
- {
- temp[i] = array[i];
- }
-
- // fill up the rest of the array
- for (int i=array.length; i<size; i++)
- {
- temp[i] = 0;
- }
-
- array = temp;
- return array;
- }
- byte[] temp = new byte[size];
-
- for (int i=0; i<size - array.length; i++)
- {
- temp[i] = 0;
- }
-
- int j=0;
- // fill up the rest of the array
- for (int i=size - array.length; i<size; i++)
- {
- temp[i] = array[j];
- j++;
- }
-
- array = temp;
- return array;
- }
-
- static public BigInteger convertByteArrayToUnsignedLong(byte[] array, int endianess)
- {
- if (array.length < 8)
- {
- array = fillArray(array, 8, endianess);
- }
-
- BigInteger value = new BigInteger("0"); //$NON-NLS-1$
- if (endianess == RenderingsUtil.LITTLE_ENDIAN)
- {
- for (int i=0; i< 8; i++)
- {
- byte[] temp = new byte[1];
- temp[0] = array[i];
- BigInteger b = new BigInteger(temp);
- b = b.and(new BigInteger("ff", 16)); //$NON-NLS-1$
- b = b.shiftLeft(i*8);
- value = value.or(b);
- }
- }
- else
- {
- for (int i=0; i< 8; i++)
- {
- byte[] temp = new byte[1];
- temp[0] = array[i];
- BigInteger b = new BigInteger(temp);
- b = b.and(new BigInteger("ff", 16)); //$NON-NLS-1$
- b = b.shiftLeft((7-i)*8);
- value = value.or(b);
- }
- }
- return value;
- }
-
- /**
- * Convert byte array to long.
- * @param array
- * @param endianess
- * @return result of the conversion in long
- */
- static public long convertByteArrayToLong(byte[] array, int endianess)
- {
- if (array.length < 8)
- {
- array = fillArray(array, 8, endianess);
- }
-
- if (endianess == RenderingsUtil.LITTLE_ENDIAN)
- {
- long value = 0;
- for (int i = 0; i < 8; i++) {
- long b = array[i];
- b &= 0xff;
- value |= (b << (i * 8));
- }
- return value;
- }
- long value = 0;
- for (int i=0; i< 8; i++)
- {
- long b = array[i];
- b &= 0xff;
- value |= (b<<((7-i)*8));
- }
-
- return value;
- }
-
- static public BigInteger convertByteArrayToSignedBigInt(byte[] array, int endianess)
- {
- if (array.length < 16)
- {
- array = fillArray(array, 16, endianess);
- }
-
- if (endianess == RenderingsUtil.LITTLE_ENDIAN)
- {
- // reverse bytes
- byte[] holder = new byte[16];
- int j=15;
- for (int i=0; i<16; i++, j--)
- {
- holder[i] = array[j];
- }
-
- // create BigInteger
- BigInteger value = new BigInteger(holder);
- return value;
- }
- BigInteger value = new BigInteger(array);
- return value;
- }
-
- static public BigInteger convertByteArrayToSignedBigInt(byte[] array, int endianess, int arraySize)
- {
- if (array.length < arraySize)
- {
- array = fillArray(array, arraySize, endianess);
- }
-
- if (endianess == RenderingsUtil.LITTLE_ENDIAN)
- {
- // reverse bytes
- byte[] holder = new byte[arraySize];
- int j=arraySize-1;
- for (int i=0; i<arraySize; i++, j--)
- {
- holder[i] = array[j];
- }
-
- // create BigInteger
- BigInteger value = new BigInteger(holder);
- return value;
- }
- BigInteger value = new BigInteger(array);
- return value;
- }
-
- static public BigInteger convertByteArrayToUnsignedBigInt(byte[] array, int endianess)
- {
- if (array.length < 16)
- {
- array = fillArray(array, 16, endianess);
- }
-
- BigInteger value = new BigInteger("0"); //$NON-NLS-1$
- if (endianess == RenderingsUtil.LITTLE_ENDIAN)
- {
- for (int i=0; i< 16; i++)
- {
- byte[] temp = new byte[1];
- temp[0] = array[i];
- BigInteger b = new BigInteger(temp);
- b = b.and(new BigInteger("ff", 16)); //$NON-NLS-1$
- b = b.shiftLeft(i*8);
- value = value.or(b);
- }
- }
- else
- {
- for (int i=0; i< 16; i++)
- {
- byte[] temp = new byte[1];
- temp[0] = array[i];
- BigInteger b = new BigInteger(temp);
- b = b.and(new BigInteger("ff", 16)); //$NON-NLS-1$
- b = b.shiftLeft((15-i)*8);
- value = value.or(b);
- }
- }
- return value;
- }
-
- static public BigInteger convertByteArrayToUnsignedBigInt(byte[] array, int endianess, int arraySize)
- {
- if (array.length < arraySize)
- {
- array = fillArray(array, arraySize, endianess);
- }
-
- BigInteger value = new BigInteger("0"); //$NON-NLS-1$
- if (endianess == RenderingsUtil.LITTLE_ENDIAN)
- {
- for (int i=0; i< arraySize; i++)
- {
- byte[] temp = new byte[1];
- temp[0] = array[i];
- BigInteger b = new BigInteger(temp);
- b = b.and(new BigInteger("ff", 16)); //$NON-NLS-1$
- b = b.shiftLeft(i*8);
- value = value.or(b);
- }
- }
- else
- {
- for (int i=0; i< arraySize; i++)
- {
- byte[] temp = new byte[1];
- temp[0] = array[i];
- BigInteger b = new BigInteger(temp);
- b = b.and(new BigInteger("ff", 16)); //$NON-NLS-1$
- b = b.shiftLeft((arraySize-1-i)*8);
- value = value.or(b);
- }
- }
- return value;
- }
-
- /**
- * Convert byte array to integer.
- * @param array
- * @param endianess
- * @return result of the conversion in int
- */
- static public int convertByteArrayToInt(byte[] array, int endianess)
- {
- if (array.length < 4)
- {
- array = fillArray(array, 4, endianess);
- }
-
- if (endianess == RenderingsUtil.LITTLE_ENDIAN)
- {
- int value = 0;
- for (int i = 0; i < 4; i++) {
- int b = array[i];
- b &= 0xff;
- value |= (b << (i * 8));
- }
- return value;
- }
- int value = 0;
- for (int i=0; i< 4; i++)
- {
- int b = array[i];
- b &= 0xff;
- value |= (b<<((3-i)*8));
- }
-
- return value;
- }
-
- /**
- * Convert byte array to short.
- * @param array
- * @param endianess
- * @return result of teh conversion in short
- */
- static public short convertByteArrayToShort(byte[] array, int endianess)
- {
- if (array.length < 2)
- {
- array = fillArray(array, 2, endianess);
- }
-
- if (endianess == RenderingsUtil.LITTLE_ENDIAN)
- {
- short value = 0;
- for (int i = 0; i < 2; i++) {
- short b = array[i];
- b &= 0xff;
- value |= (b << (i * 8));
- }
- return value;
- }
- short value = 0;
- for (int i=0; i< 2; i++)
- {
- short b = array[i];
- b &= 0xff;
- value |= (b<<((1-i)*8));
- }
- return value;
- }
-
- /**
- * Convert big integer to byte array.
- * @param i
- * @param endianess
- * @return result of the conversion in raw byte array
- */
- static public byte[] convertBigIntegerToByteArray(BigInteger i, int endianess)
- {
- byte buf[]=new byte[16];
-
- if (endianess == RenderingsUtil.LITTLE_ENDIAN)
- {
- for (int j=0; j<16; j++)
- {
- BigInteger x = i.shiftRight(j*8);
- buf[j] = x.byteValue();
- }
- return buf;
- }
- for (int j=15; j>=0; j--)
- {
- BigInteger x = i.shiftRight((15-j)*8);
- buf[j] = x.byteValue();
- }
- return buf;
- }
-
- static public byte[] convertSignedBigIntToByteArray(BigInteger i, int endianess, int arraySize)
- {
- byte buf[]=new byte[arraySize];
-
- if (endianess == RenderingsUtil.LITTLE_ENDIAN)
- {
- for (int j=0; j<arraySize; j++)
- {
- BigInteger x = i.shiftRight(j*8);
- buf[j] = x.byteValue();
- }
- return buf;
- }
- for (int j=arraySize-1; j>=0; j--)
- {
- BigInteger x = i.shiftRight((arraySize-1-j)*8);
- buf[j] = x.byteValue();
- }
- return buf;
- }
-
- /**
- * Convert big integer to byte array.
- * @param i
- * @param endianess
- * @return result of the conversion in raw byte array
- */
- static public byte[] convertUnsignedBigIntegerToByteArray(BigInteger i, int endianess)
- {
- byte buf[]=new byte[32];
-
- if (endianess == RenderingsUtil.LITTLE_ENDIAN)
- {
- for (int j=0; j<32; j++)
- {
- BigInteger x = i.shiftRight(j*8);
- buf[j] = x.byteValue();
- }
- return buf;
- }
- for (int j=31; j>=0; j--)
- {
- BigInteger x = i.shiftRight((31-j)*8);
- buf[j] = x.byteValue();
- }
- return buf;
- }
-
- static public byte[] convertUnsignedBigIntToByteArray(BigInteger i, int endianess, int arraySize)
- {
- byte buf[]=new byte[arraySize*2];
-
- if (endianess == RenderingsUtil.LITTLE_ENDIAN)
- {
- for (int j=0; j<arraySize*2; j++)
- {
- BigInteger x = i.shiftRight(j*8);
- buf[j] = x.byteValue();
- }
- return buf;
- }
- for (int j=(arraySize*2)-1; j>=0; j--)
- {
- BigInteger x = i.shiftRight(((arraySize*2)-1-j)*8);
- buf[j] = x.byteValue();
- }
- return buf;
- }
-
- /**
- * Convert long to byte array.
- * @param i
- * @param endianess
- * @return result of the conversion in raw byte array
- */
- static public byte[] convertLongToByteArray(long i, int endianess)
- {
- byte buf[]=new byte[8];
-
- if (endianess == RenderingsUtil.LITTLE_ENDIAN)
- {
- for (int j=0; j<8; j++)
- {
- buf[j] = new Long(i>>j*8).byteValue();
- }
- return buf;
- }
- for (int j=7; j>=0; j--)
- {
- buf[j] = new Long(i>>(7-j)*8).byteValue();
- }
- return buf;
- }
-
- /**
- * Convert integer to byte array.
- * @param i
- * @param endianess
- * @return result of the conversion in raw byte array
- */
- static public byte[] convertIntToByteArray(int i, int endianess)
- {
- byte buf[]=new byte[4];
-
- if (endianess == RenderingsUtil.LITTLE_ENDIAN)
- {
- for (int j=0; j<4; j++)
- {
- buf[j] = new Integer(i>>j*8).byteValue();
- }
- return buf;
- }
- for (int j=3; j>=0; j--)
- {
- buf[j] = new Integer(i>>(3-j)*8).byteValue();
- }
- return buf;
- }
-
- /**
- * Convert short to byte array.
- * @param i
- * @param endianess
- * @return result of the conversion in raw byte array
- */
- static public byte[] convertShortToByteArray(short i, int endianess)
- {
- byte buf[]=new byte[2];
-
- if (endianess == RenderingsUtil.LITTLE_ENDIAN)
- {
- for (short j=0; j<2; j++)
- {
- buf[j] = new Integer(i>>j*8).byteValue();
- }
- return buf;
- }
- for (short j=1; j>=0; j--)
- {
- buf[j] = new Integer(i>>(1-j)*8).byteValue();
- }
- return buf;
- }
-
- /**
- * byte array to Hex string helper
- * replaces the Integer.toHexString() which can't convert byte values properly
- * (always pads with FFFFFF)
- */
- static public String convertByteArrayToHexString(byte[] byteArray)
- {
- StringBuffer strBuffer = new StringBuffer();
- char charArray[];
-
- for (int i=0; i<byteArray.length;i ++)
- {
- charArray = RenderingsUtil.convertByteToCharArray(byteArray[i]);
- strBuffer.append(charArray);
- }
-
- return strBuffer.toString();
- }
-
- static public char[] convertByteToCharArray(byte aByte)
- {
- char charArray[] = new char[2];
- int val = aByte;
- if (val<0) val += 256;
- charArray[0] = Character.forDigit(val/16, 16);
- charArray[1] = Character.forDigit(val%16, 16);
-
- return charArray;
- }
-
- /**
- * Convert raw memory data to byte array
- * @param str
- * @param numBytes
- * @param numCharsPerByte - number of characters per byte of data
- * @return an array of byte, converted from a hex string
- * @throws NumberFormatException
- */
- public static byte[] convertHexStringToByteArray(String str, int numBytes, int numCharsPerByte) throws NumberFormatException
- {
- if (str.length() == 0)
- return null;
-
- StringBuffer buf = new StringBuffer(str);
-
- // pad string with zeros
- int requiredPadding = numBytes * numCharsPerByte - str.length();
- while (requiredPadding > 0) {
- buf.insert(0, "0"); //$NON-NLS-1$
- requiredPadding--;
- }
-
- byte[] bytes = new byte[numBytes];
- str = buf.toString();
-
- // set data in memory
- for (int i=0; i<bytes.length; i++)
- {
- // convert string to byte
- String oneByte = str.substring(i*2, i*2+2);
-
- Integer number = Integer.valueOf(oneByte, 16);
- if (number.compareTo(Integer.valueOf(Byte.toString(Byte.MAX_VALUE))) > 0)
- {
- int temp = number.intValue();
- temp = temp - 256;
-
- String tempStr = Integer.toString(temp);
-
- Byte myByte = Byte.valueOf(tempStr);
- bytes[i] = myByte.byteValue();
- }
- else
- {
- Byte myByte = Byte.valueOf(oneByte, 16);
- bytes[i] = myByte.byteValue();
- }
- }
-
- return bytes;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ResetToBaseAddressAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ResetToBaseAddressAction.java
deleted file mode 100644
index 23373ebc3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ResetToBaseAddressAction.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.lang.reflect.Method;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.memory.AbstractTableRendering;
-import org.eclipse.jface.action.Action;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Reest MemoryViewTab to the base address of a memory block
- *
- * @since 3.0
- */
-public class ResetToBaseAddressAction extends Action {
-
- private AbstractBaseTableRendering fRendering;
-
- public ResetToBaseAddressAction(AbstractBaseTableRendering rendering) {
- fRendering = rendering;
- setText(DebugUIMessages.ResetMemoryBlockAction_title);
- setToolTipText(DebugUIMessages.ResetMemoryBlockAction_tootip);
-
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_RESET_MEMORY));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_RESET_MEMORY));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_RESET_MEMORY));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".ResetBaseAddressContextAction_context"); //$NON-NLS-1$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
-
- // check if client has overrode the #reset method
- // if client has overrode #reset method, call old method
- // otherwise, call new #resetRendering method
- // This is done to ensure that client's code will continue to be executed until
- // they have migrated to the new #resetRendering API
- Class renderingClass = fRendering.getClass();
- try {
- Method method = renderingClass.getMethod("reset", new Class[]{}); //$NON-NLS-1$
- if (method.getDeclaringClass().equals(AbstractTableRendering.class))
- {
- // client has not overrode, call new method
- try {
- fRendering.resetRendering();
- } catch (DebugException e) {
- MemoryViewUtil.openError(DebugUIMessages.AbstractTableRendering_12, DebugUIMessages.AbstractTableRendering_13, e); //
- }
- return;
- }
- } catch (SecurityException e) {
- } catch (NoSuchMethodException e) {
- try {
- // if no such method, then it must be AbstractAsycTableRendering
- fRendering.resetRendering();
- } catch (DebugException e1) {
- MemoryViewUtil.openError(DebugUIMessages.AbstractTableRendering_12, DebugUIMessages.AbstractTableRendering_13, e); //
- }
- }
-
- if(fRendering instanceof AbstractTableRendering)
- {
- // call old method
- ((AbstractTableRendering)fRendering).reset();
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRendering.java
deleted file mode 100644
index 9e79fba74..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRendering.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- *
- * Represent a signed integer rendering.
- */
-public class SignedIntegerRendering extends AbstractIntegerRendering {
-
- private int fColSize;
- private BigInteger fMax;
- private BigInteger fMin;
-
- /**
- * @param memBlock
- * @param renderingId
- */
- public SignedIntegerRendering(String renderingId) {
- super(renderingId);
- }
-
- private String convertToString(byte[] byteArray, int columnSize, int endianess)
- {
- String ret;
- long result = 0;
-
- if (columnSize == 1)
- {
- result = byteArray[0];
- }
- else if (columnSize == 2)
- {
- result = RenderingsUtil.convertByteArrayToShort(byteArray, endianess);
- }
- else if (columnSize == 4)
- {
- result = RenderingsUtil.convertByteArrayToInt(byteArray, endianess);
- }
- else if (columnSize == 8)
- {
- result = RenderingsUtil.convertByteArrayToLong(byteArray, endianess);
- }
- else if (columnSize == 16)
- {
- BigInteger bigRet = RenderingsUtil.convertByteArrayToSignedBigInt(byteArray, endianess);
- return bigRet.toString();
- }
- else
- {
- BigInteger bigRet = RenderingsUtil.convertByteArrayToSignedBigInt(byteArray, endianess, columnSize);
- return bigRet.toString();
- }
-
- ret = new Long(result).toString();
-
- return ret;
- }
-
- private byte[] convertToBytes(int colSize, String newValue, int endianess)
- {
- try {
- byte[] bytes;
- if (colSize == 1)
- {
- byte x = Byte.parseByte(newValue);
- bytes = new byte[1];
- bytes[0] = x;
- }
- else if (colSize == 2)
- {
- short i = Short.parseShort(newValue);
- bytes = RenderingsUtil.convertShortToByteArray(i, endianess);
- }
- else if (colSize == 4)
- {
- int i = Integer.parseInt(newValue);
- bytes = RenderingsUtil.convertIntToByteArray(i, endianess);
- }
- else if (colSize == 8)
- {
- long i = Long.parseLong(newValue);
- bytes = RenderingsUtil.convertLongToByteArray(i, endianess);
- }
- else if (colSize == 16)
- {
- // special case for colSize == 16
- // need to represent number in Big Integer
- BigInteger i = new BigInteger(newValue);
- bytes = RenderingsUtil.convertBigIntegerToByteArray(i, endianess);
-
- return bytes;
- }
- else
- {
- BigInteger i = new BigInteger(newValue);
-
- // avoid calculating max and min over and over again
- // for the same column size
- if (fColSize != colSize)
- {
- fColSize = colSize;
- fMax = BigInteger.valueOf(2);
- fMax = fMax.pow(colSize*8-1);
- fMin = fMax.multiply(BigInteger.valueOf(-1));
- fMax = fMax.subtract(BigInteger.valueOf(1));
- }
-
- if (i.compareTo(fMax) > 0 || i.compareTo(fMin) < 0)
- throw new NumberFormatException();
-
- bytes = RenderingsUtil.convertSignedBigIntToByteArray(i, endianess, colSize);
- return bytes;
- }
-
- return bytes;
- } catch (NumberFormatException e) {
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see com.ibm.debug.extended.ui.AbstractMemoryRenderer#getString(java.lang.String, java.math.BigInteger, byte[])
- */
- public String getString(String dataType, BigInteger address, MemoryByte[] data) {
-
- boolean invalid = false;
- String paddedStr = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR);
- for (int i=0; i<data.length; i++)
- {
- if (!data[i].isReadable())
- {
- invalid = true;
- break;
- }
- }
-
- if (invalid)
- {
- StringBuffer strBuf = new StringBuffer();
- for (int i=0; i<data.length; i++)
- {
- strBuf.append(paddedStr);
- }
- return strBuf.toString();
- }
-
- int columnSize = getBytesPerColumn();
-
- // if the user has not set an endianess to the rendering
- // take default endianess from bytes
- int endianess = getDisplayEndianess();
- if (endianess == RenderingsUtil.ENDIANESS_UNKNOWN)
- endianess = getBytesEndianess(data);
-
- byte[] byteArray = new byte[data.length];
- for (int i=0; i<byteArray.length;i ++)
- {
- byteArray[i] = data[i].getValue();
- }
-
- // if endianess is unknown, do not render, just return padded string
- if (RenderingsUtil.ENDIANESS_UNKNOWN == endianess)
- {
- StringBuffer strBuf = new StringBuffer();
- for (int i=0; i<byteArray.length; i++)
- {
- strBuf.append(paddedStr);
- }
- return strBuf.toString();
- }
- return convertToString(byteArray, columnSize, endianess);
- }
-
- /* (non-Javadoc)
- * @see com.ibm.debug.extended.ui.AbstractMemoryRenderer#getBytes(java.lang.String, java.math.BigInteger, java.lang.String)
- */
- public byte[] getBytes(String dataType, BigInteger address, MemoryByte[] currentValues, String data) {
-
- int columnSize = getBytesPerColumn();
-
- // if the user has not set an endianess to the rendering
- // take default
- int endianess = getDisplayEndianess();
- if (endianess == RenderingsUtil.ENDIANESS_UNKNOWN)
- endianess = getBytesEndianess(currentValues);
-
- // if endianess is unknown, do not try to render new data to bytes
- if (endianess == RenderingsUtil.ENDIANESS_UNKNOWN)
- {
- byte[] retBytes = new byte[currentValues.length];
- for (int i=0 ;i<currentValues.length; i++)
- retBytes[i] = currentValues[i].getValue();
- return retBytes;
- }
-
- return convertToBytes(columnSize, data, endianess);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRenderingTypeDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRenderingTypeDelegate.java
deleted file mode 100644
index 9651f7ed6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRenderingTypeDelegate.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate;
-
-/**
- * Delegate for creating a signed integer rendering.
- * @since 3.1
- */
-public class SignedIntegerRenderingTypeDelegate implements
- IMemoryRenderingTypeDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate#createRendering(java.lang.String)
- */
- public IMemoryRendering createRendering(String id) throws CoreException {
- return new SignedIntegerRendering(id);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingCellModifier.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingCellModifier.java
deleted file mode 100644
index 0cdaa4b38..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingCellModifier.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.memory.AbstractTableRendering;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.swt.widgets.TableItem;
-
-/**
- * @since 3.1
- */
-public class TableRenderingCellModifier implements ICellModifier {
-
- private boolean editActionInvoked = false;
-
- private AbstractTableRendering fRendering;
-
- public TableRenderingCellModifier(AbstractTableRendering rendering) {
- fRendering = rendering;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object,
- * java.lang.String)
- */
- public boolean canModify(Object element, String property) {
- boolean canModify = true;
- try {
- if (!(element instanceof TableRenderingLine))
- return false;
-
- if (!editActionInvoked)
- return false;
-
- if (fRendering == null)
- return false;
-
- if (fRendering.getMemoryBlock().supportsValueModification() == false) {
- return false;
- }
-
- TableRenderingLine line = (TableRenderingLine) element;
- if (TableRenderingLine.P_ADDRESS.equals(property)) {
- return false;
- }
-
- // property is stored as number of addressable unit away from the
- // line address
- // to calculate offset to the memory line array, offset =
- // numberofAddressableUnit * addressableSize
- int addressableSize = getAddressableSize();
-
- int offset = Integer.valueOf(property, 16).intValue() * addressableSize;
- int end = offset + fRendering.getBytesPerColumn();
-
- for (int i = offset; i < end; i++) {
- MemoryByte oneByte = line.getByte(i);
-
- if (!oneByte.isWritable()) {
- canModify = false;
- }
- }
- return canModify;
- } catch (NumberFormatException e) {
- canModify = false;
- return canModify;
- }
- }
-
- /**
- * @return
- */
- private int getAddressableSize() {
- int addressableSize = fRendering.getAddressableSize();
- if (addressableSize < 1)
- addressableSize = 1;
- return addressableSize;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object,
- * java.lang.String)
- */
- public Object getValue(Object element, String property) {
- // give back the value of the column
-
- if (!(element instanceof TableRenderingLine))
- return null;
-
- TableRenderingLine line = (TableRenderingLine) element;
- try {
- if (TableRenderingLine.P_ADDRESS.equals(property))
- return line.getAddress();
-
- int offset = Integer.valueOf(property, 16).intValue() * getAddressableSize();
- int end = offset + fRendering.getBytesPerColumn();
-
- // Ask for label provider
- MemoryByte[] memory = line.getBytes(offset, end);
-
- if (line.isAvailable(offset, end)) {
- // ask the renderer for a string representation of the bytes
- offset = Integer.valueOf(property, 16).intValue();
-
- BigInteger address = new BigInteger(((TableRenderingLine) element).getAddress(), 16);
- address = address.add(BigInteger.valueOf(offset));
-
- return fRendering.getString(fRendering.getRenderingId(), address, memory);
- }
- // if the range is not available, just return padded string
- return getPaddedString(offset, end);
- } catch (NumberFormatException e) {
- return "00"; //$NON-NLS-1$
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object,
- * java.lang.String, java.lang.Object)
- */
- public void modify(Object element, String property, Object value) {
- TableRenderingLine line = null;
- if (!(element instanceof TableRenderingLine)) {
- line = (TableRenderingLine) ((TableItem) element).getData();
- } else {
- line = (TableRenderingLine) element;
- }
-
- // validate data
- if (!(value instanceof String))
- return;
-
- try {
- // calculate offset to update
- IMemoryBlock memoryBlk = fRendering.getMemoryBlock();
-
- int lineOffset = Integer.valueOf(property, 16).intValue();
-
- // this offset is number of addressable unit from the line address
- BigInteger offset = getOffset(memoryBlk, line.getAddress(), lineOffset);
-
- byte[] bytes = null;
-
- String oldValue = (String) getValue(line, property);
-
- if (!oldValue.equals(value)) {
-
- // property is number of addressable unit from line address
- // to calculate proper offset in the memoryViewLine's array
- // offset = numberOfAddressableUnit * addressableSize
- int offsetToLine = Integer.valueOf(property, 16).intValue() * getAddressableSize();
- int end = offsetToLine + fRendering.getBytesPerColumn();
-
- MemoryByte[] oldArray = line.getBytes(offsetToLine, end);
-
- BigInteger address = new BigInteger(line.getAddress(), 16);
- address = address.add(BigInteger.valueOf(offsetToLine));
-
- bytes = fRendering.getBytes(fRendering.getRenderingId(), address, oldArray, (String) value);
-
- if (bytes == null)
- return;
-
- if (bytes.length == 0)
- return;
-
- if (bytes.length <= oldArray.length) {
- boolean changed = false;
- // check that the bytes returned has actually changed
- for (int i = 0; i < bytes.length; i++) {
- if (bytes[i] != oldArray[i].getValue()) {
- changed = true;
- break;
- }
- }
- if (!changed)
- return;
- }
- } else {
- // return if value has not changed
- return;
- }
-
- if (memoryBlk instanceof IMemoryBlockExtension)
- ((IMemoryBlockExtension) memoryBlk).setValue(offset, bytes);
- else
- memoryBlk.setValue(offset.longValue(), bytes);
- } catch (DebugException e) {
- MemoryViewUtil.openError(DebugUIMessages.MemoryViewCellModifier_failure_title, DebugUIMessages.MemoryViewCellModifier_failed, e);
- } catch (NumberFormatException e) {
- MemoryViewUtil.openError(DebugUIMessages.MemoryViewCellModifier_failure_title, DebugUIMessages.MemoryViewCellModifier_failed + "\n" + DebugUIMessages.MemoryViewCellModifier_data_is_invalid, null); //$NON-NLS-1$
- }
-
- }
-
- private BigInteger getOffset(IMemoryBlock memory, String lineAddress, int lineOffset) throws DebugException {
-
- BigInteger lineAddr = new BigInteger(lineAddress, 16);
- BigInteger memoryAddr;
-
- if (memory instanceof IMemoryBlockExtension) {
- memoryAddr = ((IMemoryBlockExtension) memory).getBigBaseAddress();
- } else {
- memoryAddr = BigInteger.valueOf(memory.getStartAddress());
- }
-
- if (memoryAddr == null)
- memoryAddr = new BigInteger("0"); //$NON-NLS-1$
-
- return lineAddr.subtract(memoryAddr).add(BigInteger.valueOf(lineOffset));
- }
-
- /**
- * @param editActionInvoked
- * The editActionInvoked to set.
- */
- public void setEditActionInvoked(boolean editActionInvoked) {
- this.editActionInvoked = editActionInvoked;
- }
-
- /**
- * @param start
- * @param end
- * @return padded string
- */
- public String getPaddedString(int start, int end) {
- StringBuffer buf = new StringBuffer();
- String paddedStr = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR);
- for (int i = start; i < end; i++) {
- buf.append(paddedStr);
- }
- return buf.toString();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentDescriptor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentDescriptor.java
deleted file mode 100644
index 4ab4a1383..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentDescriptor.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-
-public class TableRenderingContentDescriptor{
- private AbstractBaseTableRendering fRendering;
- private int fPreBuffer; // number of lines before the top visible line
- private int fPostBuffer; // number of lines after thes last visible line
- private BigInteger fLoadAddress; // Top address to load at the table
- private int fNumLines; // number of visible lines
- private BigInteger fMemoryBlockBaseAddress; // base address of the memory block when this input is set
- private BigInteger fStartAddress;
- private BigInteger fEndAddress;
-
- private int fAddressSize = -1;
- private int fAddressableSize = -1;
-
- private boolean fAlignAddress = true;
-
- private boolean fIsDynamicLoad;
-
- public TableRenderingContentDescriptor(AbstractBaseTableRendering rendering)
- {
- fRendering = rendering;
- }
-
- public int getPostBuffer() {
- return fPostBuffer;
- }
- public int getPreBuffer() {
- return fPreBuffer;
- }
- public BigInteger getLoadAddress() {
- return fLoadAddress;
- }
-
- public IMemoryBlock getMemoryBlock()
- {
- return fRendering.getMemoryBlock();
- }
- public void setPostBuffer(int postBuffer) {
- fPostBuffer = postBuffer;
- }
- public void setPreBuffer(int preBuffer) {
- fPreBuffer = preBuffer;
- }
-
- public void setLoadAddress(BigInteger address)
- {
- fLoadAddress = address;
- }
- public BigInteger getContentBaseAddress() {
-
- if (fMemoryBlockBaseAddress == null)
- {
- try {
- updateContentBaseAddress();
- } catch (DebugException e) {
- fMemoryBlockBaseAddress = new BigInteger("0"); //$NON-NLS-1$
- }
- }
-
- return fMemoryBlockBaseAddress;
- }
-
- public void updateContentBaseAddress() throws DebugException {
- IMemoryBlock memoryBlock = fRendering.getMemoryBlock();
- if (memoryBlock instanceof IMemoryBlockExtension)
- fMemoryBlockBaseAddress = ((IMemoryBlockExtension)memoryBlock).getBigBaseAddress();
- else
- fMemoryBlockBaseAddress = BigInteger.valueOf(memoryBlock.getStartAddress());
- }
-
- /**
- * @return start address of the memory block
- */
- public BigInteger getStartAddress()
- {
- if (fStartAddress == null)
- {
- try {
- IMemoryBlock memoryBlock = fRendering.getMemoryBlock();
- if(memoryBlock instanceof IMemoryBlockExtension)
- {
- BigInteger startAddress = ((IMemoryBlockExtension)memoryBlock).getMemoryBlockStartAddress();
- if (startAddress != null)
- fStartAddress = startAddress;
- }
- } catch (DebugException e) {
- // default to 0 if we have trouble getting the start address
- fStartAddress = BigInteger.valueOf(0);
- }
-
- if (fStartAddress == null)
- fStartAddress = BigInteger.valueOf(0);
- }
- return fStartAddress;
- }
-
- /**
- * @return end address of the memory block
- */
- public BigInteger getEndAddress()
- {
- if (fEndAddress == null)
- {
- IMemoryBlock memoryBlock = fRendering.getMemoryBlock();
- if(memoryBlock instanceof IMemoryBlockExtension)
- {
- BigInteger endAddress;
- try {
- endAddress = ((IMemoryBlockExtension)memoryBlock).getMemoryBlockEndAddress();
- if (endAddress != null)
- fEndAddress = endAddress;
- } catch (DebugException e) {
- fEndAddress = null;
- }
-
- if (fEndAddress == null)
- {
- int addressSize;
- try {
- addressSize = ((IMemoryBlockExtension)memoryBlock).getAddressSize();
- } catch (DebugException e) {
- addressSize = 4;
- }
-
- endAddress = BigInteger.valueOf(2);
- endAddress = endAddress.pow(addressSize*8);
- endAddress = endAddress.subtract(BigInteger.valueOf(1));
- fEndAddress = endAddress;
- }
- }
-
- if (fEndAddress == null)
- fEndAddress = BigInteger.valueOf(Integer.MAX_VALUE);
- }
- return fEndAddress;
- }
-
- public int getNumLines()
- {
- return fNumLines;
- }
-
- public void setNumLines(int numLines)
- {
- fNumLines = numLines;
- }
-
- public AbstractBaseTableRendering getRendering()
- {
- return fRendering;
- }
-
- public int getAddressableSize() {
- return fAddressableSize;
- }
-
- public void setAddressableSize(int addressableSize) {
- fAddressableSize = addressableSize;
- }
-
- public int getAddressSize() {
- return fAddressSize;
- }
-
- public void setAddressSize(int addressSize) {
- fAddressSize = addressSize;
- }
-
- public void setDynamicLoad(boolean dynamic)
- {
- fIsDynamicLoad = dynamic;
- }
-
- public boolean isDynamicLoad()
- {
- return fIsDynamicLoad;
- }
-
- public boolean isMemoryBlockBaseAddressInitialized()
- {
- return (fMemoryBlockBaseAddress != null);
- }
-
- public boolean isAlignAddressToBoundary()
- {
- return fAlignAddress;
- }
-
- public void setAlignAddressToBoundary(boolean align)
- {
- fAlignAddress = align;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java
deleted file mode 100644
index ae9c5bf33..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
-import org.eclipse.debug.ui.memory.AbstractTableRendering;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-
-/**
- * This is an internal class for storing information about the content
- * in the table viewer.
- */
-public class TableRenderingContentInput extends PlatformObject {
-
- private IMemoryRendering fRendering;
- private int fPreBuffer; // number of lines before the top visible line
- private int fPostBuffer; // number of lines after thes last visible line
- private BigInteger fLoadAddress; // Top address to load at the table
- private int fNumLines; // number of visible lines
- private boolean fUpdateDelta; // should the content provider calculate delta info
- private BigInteger fMemoryBlockBaseAddress; // base address of the memory block when this input is set
- private BigInteger fStartAddress;
- private BigInteger fEndAddress;
-
- public TableRenderingContentInput(IMemoryRendering rendering, int preBuffer, int postBuffer, BigInteger loadAddress, int numOfLines, boolean updateDelta, BigInteger contentBaseAddress)
- {
- fRendering = rendering;
- fPreBuffer = preBuffer;
- fPostBuffer = postBuffer;
- fLoadAddress = loadAddress;
- fNumLines = numOfLines;
- fUpdateDelta = updateDelta;
-
- if (contentBaseAddress == null)
- {
- try {
- updateContentBaseAddress();
- } catch (DebugException e) {
- }
- }
- else
- {
- fMemoryBlockBaseAddress = contentBaseAddress;
- }
- }
-
- public int getPostBuffer() {
- return fPostBuffer;
- }
- public int getPreBuffer() {
- return fPreBuffer;
- }
- public BigInteger getLoadAddress() {
- return fLoadAddress;
- }
-
- public IMemoryBlock getMemoryBlock()
- {
- return fRendering.getMemoryBlock();
- }
- public void setPostBuffer(int postBuffer) {
- fPostBuffer = postBuffer;
- }
- public void setPreBuffer(int preBuffer) {
- fPreBuffer = preBuffer;
- }
- public boolean isUpdateDelta() {
- return fUpdateDelta;
- }
- public void setUpdateDelta(boolean updateDelta) {
- fUpdateDelta = updateDelta;
- }
-
- public void setLoadAddress(BigInteger address)
- {
- fLoadAddress = address;
- }
- public BigInteger getContentBaseAddress() {
-
- if (fMemoryBlockBaseAddress == null)
- {
- try {
- updateContentBaseAddress();
- } catch (DebugException e) {
- fMemoryBlockBaseAddress = new BigInteger("0"); //$NON-NLS-1$
- }
- }
-
- return fMemoryBlockBaseAddress;
- }
-
- public void updateContentBaseAddress() throws DebugException {
- IMemoryBlock memoryBlock = fRendering.getMemoryBlock();
- if (memoryBlock instanceof IMemoryBlockExtension)
- fMemoryBlockBaseAddress = ((IMemoryBlockExtension)memoryBlock).getBigBaseAddress();
- else
- fMemoryBlockBaseAddress = BigInteger.valueOf(memoryBlock.getStartAddress());
- }
-
- /**
- * @return start address of the memory block
- */
- public BigInteger getStartAddress()
- {
- if (fStartAddress == null)
- {
- try {
- IMemoryBlock memoryBlock = fRendering.getMemoryBlock();
- if(memoryBlock instanceof IMemoryBlockExtension)
- {
- BigInteger startAddress = ((IMemoryBlockExtension)memoryBlock).getMemoryBlockStartAddress();
- if (startAddress != null)
- fStartAddress = startAddress;
- }
- } catch (DebugException e) {
- // default to 0 if we have trouble getting the start address
- fStartAddress = BigInteger.valueOf(0);
- }
-
- if (fStartAddress == null)
- fStartAddress = BigInteger.valueOf(0);
- }
- return fStartAddress;
- }
-
- /**
- * @return end address of the memory block
- */
- public BigInteger getEndAddress()
- {
- if (fEndAddress == null)
- {
- IMemoryBlock memoryBlock = fRendering.getMemoryBlock();
- if(memoryBlock instanceof IMemoryBlockExtension)
- {
- BigInteger endAddress;
- try {
- endAddress = ((IMemoryBlockExtension)memoryBlock).getMemoryBlockEndAddress();
- if (endAddress != null)
- fEndAddress = endAddress;
- } catch (DebugException e) {
- fEndAddress = null;
- }
-
- if (fEndAddress == null)
- {
- int addressSize;
- try {
- addressSize = ((IMemoryBlockExtension)memoryBlock).getAddressSize();
- } catch (DebugException e) {
- addressSize = 4;
- }
-
- endAddress = BigInteger.valueOf(2);
- endAddress = endAddress.pow(addressSize*8);
- endAddress = endAddress.subtract(BigInteger.valueOf(1));
- fEndAddress = endAddress;
- }
- }
-
- if (fEndAddress == null)
- fEndAddress = BigInteger.valueOf(Integer.MAX_VALUE);
- }
- return fEndAddress;
- }
-
- public int getNumLines()
- {
- return fNumLines;
- }
-
- public void setNumLines(int numLines)
- {
- fNumLines = numLines;
- }
-
- public Object getAdapter(Class adapter) {
- if (adapter == AbstractTableRendering.class)
- {
- if (fRendering instanceof AbstractTableRendering)
- return fRendering;
- }
- if (adapter == AbstractAsyncTableRendering.class)
- {
- if (fRendering instanceof AbstractAsyncTableRendering)
- return fRendering;
- }
-
- return super.getAdapter(adapter);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java
deleted file mode 100644
index 33b229eb1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java
+++ /dev/null
@@ -1,989 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.memory.IMemoryRenderingUpdater;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.memory.AbstractTableRendering;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Content Provider used by AbstractTableRendering
- *
- * @since 3.0
- */
-public class TableRenderingContentProvider extends BasicDebugViewContentProvider {
-
- // lines currently being displayed by the table rendering
- protected Vector lineCache;
-
- // Cache to allow the content provider to comppute change information
- // Cache is taken by copying the lineCache after a suspend event
- // or change event from the the memory block.
- protected Hashtable contentCache;
-
- // cache in the form of MemoryByte
- // needed for reorganizing cache when the row size changes
- private MemoryByte[] fContentCacheInBytes;
- private String fContentCacheStartAddress;
-
- private BigInteger fBufferTopAddress;
-
- private TableRenderingContentInput fInput;
- private BigInteger fBufferEndAddress;
-
- private boolean fDynamicLoad;
-
- /**
- * @param memoryBlock
- * @param newTab
- */
- public TableRenderingContentProvider()
- {
- lineCache = new Vector();
- contentCache = new Hashtable();
- initializeDynamicLoad();
-
- DebugPlugin.getDefault().addDebugEventListener(this);
- }
-
- /**
- * @param viewer
- */
- public void setViewer(StructuredViewer viewer)
- {
- fViewer = viewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer v, Object oldInput, Object newInput) {
- try {
- if (newInput instanceof TableRenderingContentInput)
- {
- fInput = (TableRenderingContentInput)newInput;
- if (fInput.getMemoryBlock() instanceof IMemoryBlockExtension)
- loadContentForExtendedMemoryBlock();
- else
- loadContentForSimpleMemoryBlock();
-
- // tell rendering to display table if the loading is successful
- getTableRendering(fInput).displayTable();
- }
- } catch (DebugException e) {
- getTableRendering(fInput).displayError(e);
- }
- }
-
- public void dispose() {
- DebugPlugin.getDefault().removeDebugEventListener(this);
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object parent) {
-
- // if cache is empty, get memory
- if (lineCache.isEmpty()) {
-
- try {
- getMemoryFromMemoryBlock();
- } catch (DebugException e) {
- DebugUIPlugin.log(e.getStatus());
- getTableRendering(fInput).displayError(e);
- return lineCache.toArray();
- }
- }
-
- if (lineCache.isEmpty())
- return lineCache.toArray();
-
- // check to see if the row size has changed
- TableRenderingLine line = (TableRenderingLine)lineCache.get(0);
- int currentRowSize = line.getByteArray().length;
- int renderingRowSize = getTableRendering(fInput).getBytesPerLine();
-
- if (renderingRowSize != currentRowSize)
- {
- try {
- reorganizeContentCache(renderingRowSize);
- reorganizeLines(lineCache, renderingRowSize);
- } catch (DebugException e) {
- DebugUIPlugin.log(e.getStatus());
- getTableRendering(fInput).displayError(e);
- return lineCache.toArray();
- }
- }
- return lineCache.toArray();
- }
-
- private void getMemoryFromMemoryBlock() throws DebugException {
- IMemoryBlock memoryBlock = fInput.getMemoryBlock();
- if (memoryBlock instanceof IMemoryBlockExtension)
- {
- loadContentForExtendedMemoryBlock();
- getTableRendering(fInput).displayTable();
- }
- else
- {
- loadContentForSimpleMemoryBlock();
- getTableRendering(fInput).displayTable();
- }
- }
-
- /**
- * @throws DebugException
- */
- public void loadContentForSimpleMemoryBlock() throws DebugException {
- // get as much memory as the memory block can handle
- fInput.setPreBuffer(0);
- fInput.setPostBuffer(0);
- long startAddress = fInput.getMemoryBlock().getStartAddress();
- BigInteger address = BigInteger.valueOf(startAddress);
- long length = fInput.getMemoryBlock().getLength();
- long numLines = length / getTableRendering(fInput).getBytesPerLine();
- getMemoryToFitTable(address, numLines, fInput.isUpdateDelta());
- }
-
- /**
- * @throws DebugException
- */
- public void loadContentForExtendedMemoryBlock() throws DebugException {
-
- // do not load if number of lines needed is < 0
- if (fInput.getNumLines() <= 0)
- return;
-
- // calculate top buffered address
- BigInteger loadAddress = fInput.getLoadAddress();
- if (loadAddress == null)
- {
- loadAddress = new BigInteger("0"); //$NON-NLS-1$
- }
-
- BigInteger mbStart = fInput.getStartAddress();
- BigInteger mbEnd = fInput.getEndAddress();
-
- // check that the load address is within range
- if (loadAddress.compareTo(mbStart) < 0 || loadAddress.compareTo(mbEnd) > 0)
- {
- // default load address to memory block base address
- loadAddress = ((IMemoryBlockExtension)getMemoryBlock()).getBigBaseAddress();
- fInput.setLoadAddress(loadAddress);
- }
-
- // if address is still out of range, throw an exception
- if (loadAddress.compareTo(mbStart) < 0 || loadAddress.compareTo(mbEnd) > 0)
- {
- throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_0 + loadAddress.toString(16), null));
- }
-
- int addressableUnitsPerLine = getTableRendering(fInput).getAddressableUnitPerLine();
- BigInteger bufferStart = loadAddress.subtract(BigInteger.valueOf(fInput.getPreBuffer()*addressableUnitsPerLine));
- BigInteger bufferEnd = loadAddress.add(BigInteger.valueOf(fInput.getPostBuffer()*addressableUnitsPerLine));
- bufferEnd = bufferEnd.add(BigInteger.valueOf(fInput.getNumLines()*addressableUnitsPerLine));
-
- if (isDynamicLoad())
- {
- if (bufferStart.compareTo(mbStart) < 0)
- bufferStart = mbStart;
-
- if (bufferEnd.compareTo(mbEnd) > 0)
- {
- bufferEnd = mbEnd;
-
- int numLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue();
- if (numLines < fInput.getNumLines())
- {
- // re-calculate buffer start since we may not have enough lines to popoulate the view
- bufferStart = bufferEnd.subtract(BigInteger.valueOf(fInput.getNumLines()*addressableUnitsPerLine));
- bufferStart = bufferStart.subtract(BigInteger.valueOf(fInput.getPreBuffer()*addressableUnitsPerLine));
- }
-
- // if after adjusting buffer start, it goes before the memory block start
- // address, adjust it back
- if (bufferStart.compareTo(mbStart) < 0)
- bufferStart = mbStart;
- }
-
- // buffer end must be greater than buffer start
- if (bufferEnd.compareTo(bufferStart) <= 0)
- throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_1, null));
-
- int numLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue()+1;
- // get stoarage to fit the memory view tab size
- getMemoryToFitTable(bufferStart, numLines, fInput.isUpdateDelta());
- }
- else
- {
- if (bufferStart.compareTo(mbStart) < 0)
- bufferStart = mbStart;
-
- if (bufferEnd.compareTo(mbEnd) > 0)
- {
- bufferStart = mbEnd.subtract(BigInteger.valueOf((fInput.getNumLines()-1)*addressableUnitsPerLine));
- bufferEnd = mbEnd;
-
- // after adjusting buffer start, check if it's smaller than memory block's start address
- if (bufferStart.compareTo(mbStart) < 0)
- bufferStart = mbStart;
- }
-
- // buffer end must be greater than buffer start
- if (bufferEnd.compareTo(bufferStart) <= 0)
- throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_2, null));
-
- int numLines = fInput.getNumLines();
- int bufferNumLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue()+1;
-
- if (bufferNumLines < numLines)
- numLines = bufferNumLines;
-
- // get stoarage to fit the memory view tab size
- getMemoryToFitTable(bufferStart, numLines, fInput.isUpdateDelta());
- }
- }
-
- /**
- * @return the memroy block
- */
- public IMemoryBlock getMemoryBlock() {
- return fInput.getMemoryBlock();
- }
-
- /**
- * Get memory to fit table
- * @param startingAddress
- * @param numberOfLines
- * @param updateDelta
- * @throws DebugException
- */
- public void getMemoryToFitTable(BigInteger startingAddress, long numberOfLines, boolean updateDelta) throws DebugException
- {
- // do not ask for memory from memory block if the debug target
- // is already terminated
- IDebugTarget target = fInput.getMemoryBlock().getDebugTarget();
-
- if (target.isDisconnected() || target.isTerminated())
- return;
-
- boolean error = false;
- DebugException dbgEvt = null;
-
- // calculate address size
- String adjustedAddress = startingAddress.toString(16);
-
- int addressSize;
- try {
- addressSize = getAddressSize(startingAddress);
- } catch (DebugException e1) {
- dbgEvt = e1;
- error = true;
- addressSize = 4;
- }
-
- int addressLength = addressSize * IInternalDebugUIConstants.CHAR_PER_BYTE;
-
- // align to the closest boundary based on addressable size per line
- if ( getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- startingAddress = MemoryViewUtil.alignToBoundary(startingAddress, getTableRendering(fInput).getAddressableUnitPerLine());
- }
-
- IMemoryBlockExtension extMemoryBlock = null;
- MemoryByte[] memoryBuffer = null;
-
- String paddedString = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR);
-
- long reqNumBytes = 0;
- try
- {
- if (fInput.getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- reqNumBytes = getTableRendering(fInput).getBytesPerLine() * numberOfLines;
- // get memory from memory block
- extMemoryBlock = (IMemoryBlockExtension) fInput.getMemoryBlock();
-
- long reqNumberOfUnits = getTableRendering(fInput).getAddressableUnitPerLine() * numberOfLines;
-
- memoryBuffer = extMemoryBlock.getBytesFromAddress(startingAddress, reqNumberOfUnits);
-
- if(memoryBuffer == null)
- {
- DebugException e = new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.MemoryViewContentProvider_Unable_to_retrieve_content, null));
- throw e;
- }
- }
- else
- {
- // get memory from memory block
- byte[] memory = fInput.getMemoryBlock().getBytes();
-
- if (memory == null)
- {
- DebugException e = new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.MemoryViewContentProvider_Unable_to_retrieve_content, null));
- throw e;
- }
-
- int prefillNumBytes = 0;
-
- // number of bytes need to prefill
- if (!startingAddress.toString(16).endsWith("0")) //$NON-NLS-1$
- {
- adjustedAddress = startingAddress.toString(16).substring(0, adjustedAddress.length() - 1);
- adjustedAddress += "0"; //$NON-NLS-1$
- BigInteger adjustedStart = new BigInteger(adjustedAddress, 16);
- prefillNumBytes = startingAddress.subtract(adjustedStart).intValue();
- startingAddress = adjustedStart;
- }
- reqNumBytes = fInput.getMemoryBlock().getLength() + prefillNumBytes;
-
- // figure out number of dummy bytes to append
- while (reqNumBytes % getTableRendering(fInput).getBytesPerLine() != 0)
- {
- reqNumBytes ++;
- }
-
- numberOfLines = reqNumBytes / getTableRendering(fInput).getBytesPerLine();
-
- // create memory byte for IMemoryBlock
- memoryBuffer = new MemoryByte[(int)reqNumBytes];
-
- // prefill buffer to ensure double-word alignment
- for (int i=0; i<prefillNumBytes; i++)
- {
- MemoryByte tmp = new MemoryByte();
- tmp.setValue((byte)0);
- tmp.setWritable(false);
- tmp.setReadable(false);
- tmp.setEndianessKnown(false);
- memoryBuffer[i] = tmp;
- }
-
- // fill buffer with memory returned by debug adapter
- int j = prefillNumBytes; // counter for memoryBuffer
- for (int i=0; i<memory.length; i++)
- {
- MemoryByte tmp = new MemoryByte();
- tmp.setValue(memory[i]);
- tmp.setReadable(true);
- tmp.setWritable(true);
- tmp.setEndianessKnown(false);
- memoryBuffer[j] = tmp;
- j++;
- }
-
- // append to buffer to fill up the entire line
- for (int i=j; i<memoryBuffer.length; i++)
- {
- MemoryByte tmp = new MemoryByte();
- tmp.setValue((byte)0);
- tmp.setWritable(false);
- tmp.setReadable(false);
- tmp.setEndianessKnown(false);
- memoryBuffer[i] = tmp;
- }
- }
- }
- catch (DebugException e)
- {
- memoryBuffer = makeDummyContent(numberOfLines);
-
- // finish creating the content provider before throwing an event
- error = true;
- dbgEvt = e;
- }
- catch (Throwable e)
- {
- // catch all errors from this process just to be safe
- memoryBuffer = makeDummyContent(numberOfLines);
-
- // finish creating the content provider before throwing an event
- error = true;
- dbgEvt = new DebugException(DebugUIPlugin.newErrorStatus(e.getMessage(), e));
- }
-
- // if debug adapter did not return enough memory, create dummy memory
- if (memoryBuffer.length < reqNumBytes)
- {
- ArrayList newBuffer = new ArrayList();
-
- for (int i=0; i<memoryBuffer.length; i++)
- {
- newBuffer.add(memoryBuffer[i]);
- }
-
- for (int i=memoryBuffer.length; i<reqNumBytes; i++)
- {
- MemoryByte mb = new MemoryByte();
- mb.setReadable(false);
- mb.setWritable(false);
- mb.setEndianessKnown(false);
- newBuffer.add(mb);
- }
-
- memoryBuffer = (MemoryByte[])newBuffer.toArray(new MemoryByte[newBuffer.size()]);
-
- }
-
- // clear line cache
- if (!lineCache.isEmpty())
- {
- lineCache.clear();
- }
- String address = startingAddress.toString(16);
- // save address of the top of buffer
- fBufferTopAddress = startingAddress;
-
- boolean manageDelta = true;
-
- // If change information is not managed by the memory block
- // The view tab will manage it and calculate delta information
- // for its content cache.
- if (fInput.getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- manageDelta = !((IMemoryBlockExtension)fInput.getMemoryBlock()).supportsChangeManagement();
- }
-
- // put memory information into MemoryViewLine
- organizeLines(numberOfLines, updateDelta, addressLength, memoryBuffer, paddedString, address, manageDelta);
-
- if (error){
- throw dbgEvt;
- }
- }
-
- private void organizeLines(long numberOfLines, boolean updateDelta, int addressLength, MemoryByte[] memoryBuffer, String paddedString, String address, boolean manageDelta)
- {
- for (int i = 0; i < numberOfLines; i++)
- { //chop the raw memory up
- String tmpAddress = address.toUpperCase();
- if (tmpAddress.length() < addressLength)
- {
- for (int j = 0; tmpAddress.length() < addressLength; j++)
- {
- tmpAddress = "0" + tmpAddress; //$NON-NLS-1$
- }
- }
- int bytesPerLine = getTableRendering(fInput).getBytesPerLine();
- MemoryByte[] memory = new MemoryByte[bytesPerLine];
- boolean isMonitored = true;
-
- // counter for memory, starts from 0 to number of bytes per line
- int k = 0;
- // j is the counter for memArray, memory returned by debug adapter
- for (int j = i * bytesPerLine;
- j < i * bytesPerLine + bytesPerLine;
- j++)
- {
-
- byte changeFlag = memoryBuffer[j].getFlags();
- if (manageDelta)
- {
- // turn off both change and known bits to make sure that
- // the change bits returned by debug adapters do not take
- // any effect
-
- changeFlag |= MemoryByte.HISTORY_KNOWN;
- changeFlag ^= MemoryByte.HISTORY_KNOWN;
-
- changeFlag |= MemoryByte.CHANGED;
- changeFlag ^= MemoryByte.CHANGED;
- }
-
- MemoryByte newByteObj = new MemoryByte(memoryBuffer[j].getValue(), changeFlag);
- memory[k] = newByteObj;
- k++;
-
-
- if (!manageDelta)
- {
- // If the byte is marked as unknown, the line is not monitored
- if (!memoryBuffer[j].isHistoryKnown())
- {
- isMonitored = false;
- }
- }
- }
-
- TableRenderingLine newLine = new TableRenderingLine(tmpAddress, memory, lineCache.size(), paddedString);
-
- TableRenderingLine oldLine = (TableRenderingLine)contentCache.get(newLine.getAddress());
-
- if (manageDelta)
- {
- if (oldLine != null)
- newLine.isMonitored = true;
- else
- newLine.isMonitored = false;
- }
- else
- {
- // check the byte for information
- newLine.isMonitored = isMonitored;
- }
-
- // calculate delta info for the memory view line
- if (manageDelta && !getTableRendering(fInput).isDisplayingError())
- {
- if (updateDelta)
- {
- if (oldLine != null)
- {
- newLine.markDeltas(oldLine);
- }
- }
- else
- {
- if (oldLine != null)
- {
- // deltas can only be reused if the line has not been changed
- // otherwise, force a refresh
- if (newLine.isLineChanged(oldLine))
- {
- newLine.markDeltas(oldLine);
- }
- else
- {
- newLine.copyDeltas(oldLine);
- }
- }
- }
- }
- else if (manageDelta && getTableRendering(fInput).isDisplayingError())
- {
- // show as unmonitored if the view tab is previoulsy displaying error
- newLine.isMonitored = false;
- }
- lineCache.add(newLine);
-
-
- // increment row address
- BigInteger bigInt = new BigInteger(address, 16);
- fBufferEndAddress = bigInt;
- int addressableUnit = getTableRendering(fInput).getBytesPerLine()/getTableRendering(fInput).getAddressableSize();
- address = bigInt.add(BigInteger.valueOf(addressableUnit)).toString(16);
- }
- }
-
- /**
- * @param numberOfLines
- * @return an array of dummy MemoryByte
- */
- private MemoryByte[] makeDummyContent(long numberOfLines) {
- MemoryByte[] memoryBuffer;
- // make up dummy memory, needed for recovery in case the debug adapter
- // is capable of retrieving memory again
-
- int numBytes = (int)(getTableRendering(fInput).getBytesPerLine() * numberOfLines);
- memoryBuffer = new MemoryByte[numBytes];
-
- for (int i=0; i<memoryBuffer.length; i++){
- memoryBuffer[i] = new MemoryByte();
- memoryBuffer[i].setValue((byte)0);
- memoryBuffer[i].setWritable(false);
- memoryBuffer[i].setReadable(false);
- memoryBuffer[i].setEndianessKnown(false);
- }
- return memoryBuffer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.internal.views.BasicDebugViewContentProvider#doHandleDebugEvent(org.eclipse.debug.core.DebugEvent)
- */
- protected void doHandleDebugEvent(DebugEvent event) {
-
- if (getTableRendering(fInput).isVisible())
- {
- // only do this if it's visible
- // still need to clear content cache if the rendering
- // is not visible
- if (isUpdateManagedByMB())
- return;
- }
-
- // do nothing if the debug event did not come from a debug element comes from non-debug element
- if (!(event.getSource() instanceof IDebugElement))
- return;
-
- // do not try to recover if the content input has not been created
- if (fInput == null)
- return;
-
- IDebugElement src = (IDebugElement)event.getSource();
-
- // if a debug event happens from the memory block
- // invoke contentChanged to get content of the memory block updated
- if (event.getKind() == DebugEvent.CHANGE && event.getSource() == fInput.getMemoryBlock())
- {
- if (event.getDetail() == DebugEvent.STATE){
- getTableRendering(fInput).updateLabels();
- }
- else
- {
- updateContent();
- }
- }
-
- // if the suspend evnet happens from the debug target that the
- // memory block belongs to
- if (event.getKind() == DebugEvent.SUSPEND && src.getDebugTarget() == fInput.getMemoryBlock().getDebugTarget())
- {
- updateContent();
- }
-
- }
-
- /**
- * Update content of the view tab if the content of the memory block has changed
- * or if its base address has changed
- * Update will not be performed if the memory block has not been changed or
- * if the rendering is not visible
- */
- public void updateContent()
- {
- IDebugTarget dt = fInput.getMemoryBlock().getDebugTarget();
-
- // no need to update if debug target is disconnected or terminated
- if (dt.isDisconnected() || dt.isTerminated())
- {
- return;
- }
-
- takeContentSnapshot();
-
- //do not handle event if the rendering is not visible
- if (!getTableRendering(fInput).isVisible())
- return;
-
- getTableRendering(fInput).refresh();
-
- }
-
- /**
- * Take a snapshot on the content, marking the lines as monitored
- */
- public void takeContentSnapshot()
- {
- // cache content before getting new ones
- TableRenderingLine[] lines =(TableRenderingLine[]) lineCache.toArray(new TableRenderingLine[lineCache.size()]);
- fContentCacheInBytes = convertLinesToBytes(lines);
- fContentCacheStartAddress = lines[0].getAddress();
-
- if (contentCache != null)
- {
- contentCache.clear();
- }
-
- //do not handle event if the rendering is not visible
- if (!getTableRendering(fInput).isVisible())
- return;
-
- // use existing lines as cache is the rendering is not currently displaying
- // error. Otherwise, leave contentCache empty as we do not have updated
- // content.
- if (!getTableRendering(fInput).isDisplayingError())
- {
- for (int i=0; i<lines.length; i++)
- {
- contentCache.put(lines[i].getAddress(), lines[i]);
- lines[i].isMonitored = true;
- }
- }
-
- // reset all the deltas currently stored in contentCache
- // This will ensure that changes will be recomputed when user scrolls
- // up or down the memory view.
- resetDeltas();
- }
-
- /**
- * @return buffer's top address
- */
- public BigInteger getBufferTopAddress()
- {
- return fBufferTopAddress;
- }
-
- public BigInteger getBufferEndAddress()
- {
- return fBufferEndAddress;
- }
-
- /**
- * Calculate address size of the given address
- * @param address
- * @return size of address from the debuggee
- */
- public int getAddressSize(BigInteger address) throws DebugException
- {
- // calculate address size
- String adjustedAddress = address.toString(16);
-
- int addressSize = 0;
- if (fInput.getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- addressSize = ((IMemoryBlockExtension)fInput.getMemoryBlock()).getAddressSize();
- }
-
- // handle IMemoryBlock and invalid address size returned by IMemoryBlockExtension
- if (addressSize <= 0)
- {
- if (adjustedAddress.length() > 8)
- {
- addressSize = 8;
- }
- else
- {
- addressSize = 4;
- }
- }
-
- return addressSize;
- }
-
- /**
- * @return base address of memory block
- */
- public BigInteger getContentBaseAddress()
- {
- return fInput.getContentBaseAddress();
- }
-
- /**
- * Clear all delta information in the lines
- */
- public void resetDeltas()
- {
- Enumeration enumeration = contentCache.elements();
-
- while (enumeration.hasMoreElements())
- {
- TableRenderingLine line = (TableRenderingLine)enumeration.nextElement();
- line.unmarkDeltas();
- }
- }
-
- /**
- * Check if address is out of buffered range
- * @param address
- * @return true if address is out of bufferred range, false otherwise
- */
- public boolean isAddressOutOfRange(BigInteger address)
- {
- if (lineCache != null && !lineCache.isEmpty())
- {
- TableRenderingLine first = (TableRenderingLine)lineCache.firstElement();
- TableRenderingLine last = (TableRenderingLine) lineCache.lastElement();
-
- if (first == null ||last == null)
- return true;
-
- BigInteger startAddress = new BigInteger(first.getAddress(), 16);
- BigInteger lastAddress = new BigInteger(last.getAddress(), 16);
- int addressableUnit = getTableRendering(fInput).getAddressableUnitPerLine();
- lastAddress = lastAddress.add(BigInteger.valueOf(addressableUnit)).subtract(BigInteger.valueOf(1));
-
- if (startAddress.compareTo(address) <= 0 &&
- lastAddress.compareTo(address) >= 0)
- {
- return false;
- }
- return true;
- }
- return true;
- }
-
- public void clearContentCache()
- {
- fContentCacheInBytes = new MemoryByte[0];
- fContentCacheStartAddress = null;
- contentCache.clear();
- }
-
- /**
- * @return if the memory block would manage its own update.
- */
- private boolean isUpdateManagedByMB()
- {
- IMemoryBlock memoryBlock = getMemoryBlock();
-
- IMemoryRenderingUpdater managedMB = null;
- if (memoryBlock instanceof IMemoryRenderingUpdater)
- {
- managedMB = (IMemoryRenderingUpdater)memoryBlock;
- }
-
- if (managedMB == null)
- managedMB = (IMemoryRenderingUpdater)memoryBlock.getAdapter(IMemoryRenderingUpdater.class);
-
- // do not handle event if if the memory block wants to do its
- // own update
- if (managedMB != null && managedMB.supportsManagedUpdate(getTableRendering(fInput)))
- return true;
-
- return false;
- }
-
- public boolean isDynamicLoad()
- {
- return fDynamicLoad;
- }
-
- private void initializeDynamicLoad()
- {
- fDynamicLoad = DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM);
- }
-
- public void setDynamicLoad(boolean dynamicLoad)
- {
- fDynamicLoad = dynamicLoad;
- }
-
- private void reorganizeLines(Vector lines, int numBytesPerLine) throws DebugException
- {
- if (lines == null || lines.isEmpty())
- return;
-
- Object[] objs = lines.toArray();
-
- if (objs.length > 0)
- {
- TableRenderingLine[] renderingLines = (TableRenderingLine[])lines.toArray(new TableRenderingLine[lines.size()]);
- MemoryByte[] buffer = convertLinesToBytes(renderingLines);
- BigInteger lineAddress = new BigInteger(renderingLines[0].getAddress(), 16);
- int numberOfLines = buffer.length / numBytesPerLine;
- boolean updateDelta = false;
- int addressLength = getAddressSize(lineAddress) * IInternalDebugUIConstants.CHAR_PER_BYTE;
- MemoryByte[] memoryBuffer = buffer;
- String address =renderingLines[0].getAddress();
- String paddedString = DebugUITools.getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR);
-
- // set to false to preserve information delta information
- boolean manageDelta = true;
-
- // If change information is not managed by the memory block
- // The view tab will manage it and calculate delta information
- // for its content cache.
- if (fInput.getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- manageDelta = !((IMemoryBlockExtension)fInput.getMemoryBlock()).supportsChangeManagement();
- }
- lineCache.clear();
-
- organizeLines(numberOfLines, updateDelta, addressLength, memoryBuffer, paddedString, address, manageDelta);
- }
- }
-
- private void reorganizeContentCache(int bytesPerLine)
- {
- // if content cache is empty, do nothing
- if (contentCache == null || contentCache.isEmpty()
- || fContentCacheInBytes.length == 0 || fContentCacheStartAddress == null)
- return;
-
- MemoryByte[] bytes = fContentCacheInBytes;
- TableRenderingLine[] convertedLines = convertBytesToLines(bytes, bytesPerLine, new BigInteger(fContentCacheStartAddress, 16));
-
- contentCache.clear();
- for (int i=0; i<convertedLines.length; i++)
- {
- contentCache.put(convertedLines[i].getAddress(), convertedLines[i]);
- }
- }
-
- private MemoryByte[] convertLinesToBytes(TableRenderingLine[] lines)
- {
- // convert the lines back to a buffer of MemoryByte
- TableRenderingLine temp = lines[0];
- int lineLength = temp.getLength();
-
- MemoryByte[] buffer = new MemoryByte[lines.length * lineLength];
- for (int i=0; i<lines.length; i++)
- {
- TableRenderingLine line = lines[i];
- MemoryByte[] bytes = line.getBytes();
- System.arraycopy(bytes, 0, buffer, i*lineLength, lineLength);
- }
- return buffer;
- }
-
- private TableRenderingLine[] convertBytesToLines(MemoryByte[] bytes, int bytesPerLine, BigInteger startAddress)
- {
- int numOfLines = bytes.length / bytesPerLine;
- String address = startAddress.toString(16);
- int addressLength;
- try {
- addressLength = getAddressSize(startAddress) * IInternalDebugUIConstants.CHAR_PER_BYTE;
- } catch (DebugException e) {
- DebugUIPlugin.log(e);
- addressLength = 4 * IInternalDebugUIConstants.CHAR_PER_BYTE;
- }
- ArrayList lines = new ArrayList();
- String paddedString = DebugUITools.getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR);
-
- for (int i=0; i<numOfLines; i++)
- {
- MemoryByte[] temp = new MemoryByte[bytesPerLine];
- System.arraycopy(bytes, i*bytesPerLine, temp, 0, bytesPerLine);
-
- String tmpAddress = address.toUpperCase();
- if (tmpAddress.length() < addressLength)
- {
- for (int j = 0; tmpAddress.length() < addressLength; j++)
- {
- tmpAddress = "0" + tmpAddress; //$NON-NLS-1$
- }
- }
-
- TableRenderingLine newLine = new TableRenderingLine(tmpAddress, temp, lines.size(), paddedString);
- lines.add(newLine);
-
- // increment row address
- BigInteger bigInt = new BigInteger(address, 16);
- fBufferEndAddress = bigInt;
- int addressableUnit = getTableRendering(fInput).getBytesPerLine()/getTableRendering(fInput).getAddressableSize();
- address = bigInt.add(BigInteger.valueOf(addressableUnit)).toString(16);
- }
-
- return (TableRenderingLine[])lines.toArray(new TableRenderingLine[lines.size()]);
- }
-
- private AbstractTableRendering getTableRendering(TableRenderingContentInput input)
- {
- return (AbstractTableRendering)input.getAdapter(AbstractTableRendering.class);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProvider.java
deleted file mode 100644
index 009de7707..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProvider.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.memory.AbstractTableRendering;
-import org.eclipse.debug.ui.memory.IMemoryBlockTablePresentation;
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @since 3.0
- */
-public class TableRenderingLabelProvider extends AbstractTableRenderingLabelProvider implements IColorProvider {
-
- private IMemoryBlockTablePresentation fTablePresentation;
-
- /**
- * Constructor for MemoryViewLabelProvider
- */
- public TableRenderingLabelProvider() {
- super();
- }
-
- public TableRenderingLabelProvider(AbstractTableRendering rendering){
- super(rendering);
- fTablePresentation = (IMemoryBlockTablePresentation)rendering.getAdapter(IMemoryBlockTablePresentation.class);
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- */
- public void dispose() {
- if (fTablePresentation != null) {
- fTablePresentation.dispose();
- fTablePresentation = null;
- }
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
- */
- public Color getForeground(Object element) {
- if (element instanceof TableRenderingLine)
- {
- TableRenderingLine line = (TableRenderingLine)element;
-
- if (line.isMonitored) {
- return DebugUIPlugin.getPreferenceColor(IDebugUIConstants.PREF_MEMORY_HISTORY_KNOWN_COLOR);
- }
- return DebugUIPlugin.getPreferenceColor(IDebugUIConstants.PREF_MEMORY_HISTORY_UNKNOWN_COLOR);
- }
- return DebugUIPlugin.getPreferenceColor(IDebugUIConstants.PREF_MEMORY_HISTORY_KNOWN_COLOR);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object)
- */
- public Color getBackground(Object element) {
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
- */
- public String getColumnText(Object element, int columnIndex) {
-
- String label = super.getColumnText(element, columnIndex);
-
- // consult model presentation for address presentation
- if (columnIndex == 0)
- {
- if (fTablePresentation != null)
- {
- String address = ((TableRenderingLine)element).getAddress();
-
- // get address presentation
- String tempLabel = fTablePresentation.getRowLabel(fRendering.getMemoryBlock(), new BigInteger(address, 16));
-
- if (tempLabel != null)
- return tempLabel;
- }
- return label;
- }
- return label;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProviderEx.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProviderEx.java
deleted file mode 100644
index 5fe5fbdaa..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProviderEx.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.ui.memory.AbstractTableRendering;
-import org.eclipse.debug.ui.memory.MemoryRenderingElement;
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.jface.viewers.IFontProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITableColorProvider;
-import org.eclipse.jface.viewers.ITableFontProvider;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * This label provider is used by AbstractTableRendering if clients decide to
- * provide customized decorations in the rendering. Otherwise the table
- * rendering uses TableRenderingLabelProvider.
- *
- */
-public class TableRenderingLabelProviderEx extends TableRenderingLabelProvider implements ITableColorProvider, ITableFontProvider {
-
- private IFontProvider fFontProvider;
- private ILabelProvider fLabelProvider;
- private IColorProvider fColorProvider;
-
- public TableRenderingLabelProviderEx(AbstractTableRendering rendering) {
- super(rendering);
- fLabelProvider = (ILabelProvider) rendering.getAdapter(ILabelProvider.class);
- fColorProvider = (IColorProvider) rendering.getAdapter(IColorProvider.class);
- fFontProvider = (IFontProvider) rendering.getAdapter(IFontProvider.class);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- */
- public void dispose() {
- if (fFontProvider != null) {
- fFontProvider = null;
- }
- if (fColorProvider != null) {
- fColorProvider = null;
- }
- if (fLabelProvider != null) {
- fLabelProvider.dispose();
- fLabelProvider = null;
- }
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITableColorProvider#getBackground(java.lang.Object, int)
- */
- public Color getBackground(Object element, int columnIndex) {
- if (fColorProvider != null && columnIndex > 0) {
- MemoryRenderingElement renderingElement = getMemoryRenderingElement(element, columnIndex);
- if (renderingElement != null) {
- Color color = fColorProvider.getBackground(renderingElement);
- if (color != null)
- return color;
- }
- }
- return super.getBackground(element);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITableColorProvider#getForeground(java.lang.Object, int)
- */
- public Color getForeground(Object element, int columnIndex) {
- if (fColorProvider != null && columnIndex > 0) {
- MemoryRenderingElement renderingElement = getMemoryRenderingElement(element, columnIndex);
- if (renderingElement != null) {
- Color color = fColorProvider.getForeground(renderingElement);
- if (color != null)
- return color;
- }
- }
- return super.getForeground(element);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
- */
- public Image getColumnImage(Object element, int columnIndex) {
- if (fLabelProvider != null && columnIndex > 0) {
- MemoryRenderingElement renderingElement = getMemoryRenderingElement(element, columnIndex);
- if (renderingElement != null) {
- Image image = fLabelProvider.getImage(renderingElement);
- if (image != null)
- return image;
- }
- }
- return super.getColumnImage(element, columnIndex);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITableFontProvider#getFont(java.lang.Object, int)
- */
- public Font getFont(Object element, int columnIndex) {
- if (fFontProvider != null && columnIndex > 0) {
- MemoryRenderingElement renderingElement = getMemoryRenderingElement(element, columnIndex);
- if (renderingElement != null) {
- Font font = fFontProvider.getFont(renderingElement);
- if (font != null)
- return font;
- }
- }
- return null;
- }
-
- /**
- * Returns a memory rendering element corresponding to the given element
- * or <code>null</code> if none.
- *
- * @param element element to be rendered
- * @param columnIndex column index at which to render
- * @return memory rendering element or <code>null</code>
- */
- private MemoryRenderingElement getMemoryRenderingElement(Object element, int columnIndex) {
- if (element instanceof TableRenderingLine) {
- TableRenderingLine line = (TableRenderingLine) element;
- BigInteger lineAddress = new BigInteger(line.getAddress(), 16);
- int offset = (columnIndex - 1) * fRendering.getBytesPerColumn();
- if (offset < fRendering.getBytesPerLine() && (offset + fRendering.getBytesPerColumn()) <= fRendering.getBytesPerLine()) {
- return getMemoryRenderingElement(line, lineAddress, offset);
- }
- }
- return null;
- }
-
- private MemoryRenderingElement getMemoryRenderingElement(TableRenderingLine line, BigInteger lineAddress, int offset) {
- BigInteger cellAddress = lineAddress.add(BigInteger.valueOf(offset));
- MemoryByte[] bytes = line.getBytes(offset, offset
- + fRendering.getBytesPerColumn());
- // make a copy to ensure that the memory bytes are not overwritten
- // by clients
- MemoryByte[] copy = new MemoryByte[bytes.length];
- System.arraycopy(bytes, 0, copy, 0, bytes.length);
- MemoryRenderingElement renderingElement = new MemoryRenderingElement(
- fRendering, cellAddress, copy);
- return renderingElement;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLine.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLine.java
deleted file mode 100644
index 0652248c7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLine.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.debug.core.model.MemoryByte;
-
-/**
- * @since 3.0
- */
-
-public class TableRenderingLine extends PlatformObject {
- private String fAddress;
- private String fStrRep;
- private MemoryByte[] fBytes;
- private byte[] fByteArray;
- private int fTableIndex = -1;
- private String fPaddedString;
- public boolean isMonitored;
-
- public static final String P_ADDRESS = "address"; //$NON-NLS-1$
-
- // for raw hex data, it's 2 characters per byte
- private static final int numCharPerByteForHex = 2;
-
- public TableRenderingLine(String address, MemoryByte[] bytes, int tableIndex, String paddedString) {
- fAddress = address;
- fBytes = bytes;
- fTableIndex = tableIndex;
- fPaddedString = paddedString;
- }
-
- public String getAddress() {
- return fAddress;
- }
-
- public void setAddress(String address) {
- fAddress = address;
- }
-
- public MemoryByte[] getBytes()
- {
- return fBytes;
- }
-
- public MemoryByte getByte(int offset)
- {
- if (fBytes == null)
- return null;
-
- if (offset < fBytes.length) {
- return fBytes[offset];
- }
-
- return null;
- }
-
- public MemoryByte[] getBytes(int start, int end)
- {
- ArrayList ret = new ArrayList();
-
- for (int i=start; i<end; i++)
- {
- ret.add(fBytes[i]);
- }
- return (MemoryByte[]) ret.toArray(new MemoryByte[ret.size()]);
- }
-
- public String getRawMemoryString()
- {
- if (fStrRep == null)
- {
- StringBuffer buffer = new StringBuffer();
- fStrRep = RenderingsUtil.convertByteArrayToHexString(getByteArray());
- fStrRep = fStrRep.toUpperCase();
-
- buffer = buffer.append(fStrRep);
-
- // pad unavailable bytes with padded string from memory block
- String paddedString = null;
- int bufferCounter = 0;
- for (int i=0; i<fBytes.length; i++)
- {
- // if byte is invalid
- if (!fBytes[i].isReadable())
- {
- if (paddedString == null)
- {
- paddedString = fPaddedString;
-
- if (paddedString.length() > TableRenderingLine.numCharPerByteForHex)
- paddedString = paddedString.substring(0, TableRenderingLine.numCharPerByteForHex);
- }
- buffer.replace(bufferCounter, bufferCounter+TableRenderingLine.numCharPerByteForHex, paddedString);
- }
- bufferCounter += TableRenderingLine.numCharPerByteForHex;
- }
-
- fStrRep = buffer.toString();
- }
-
- return fStrRep;
- }
-
- /**
- * @param start
- * @param end
- * @return is the bytes between start and end are all valid
- */
- public boolean isAvailable(int start, int end) {
- boolean available = true;
- for (int i=start; i<end; i++)
- {
- if (!fBytes[i].isReadable())
- {
- available = false;
- break;
- }
- }
- return available;
- }
-
-
- public byte[] getByteArray()
- {
- if (fByteArray == null)
- {
- fByteArray = new byte[fBytes.length];
- for (int i=0; i<fBytes.length; i++)
- {
- fByteArray[i] = fBytes[i].getValue();
- }
- }
-
- return fByteArray;
- }
-
- public byte[] getByteArray(int start, int end)
- {
- byte[] ret = new byte[end-start];
- int j=0;
-
- for (int i=start; i<end; i++)
- {
- ret[j] = fBytes[i].getValue();
- j++;
- }
- return ret;
- }
-
- public void markDeltas(TableRenderingLine oldData)
- {
- if (oldData == null)
- return;
-
- // if address is not the same, no need to compare
- if (!oldData.getAddress().equals(this.getAddress()))
- return;
-
- // if the string representation is the same, no need to compare
- if (oldData.getRawMemoryString().equals(getRawMemoryString()))
- {
- for (int i=0; i<fBytes.length; i++)
- {
- // set history as known if we have old data for this line
- fBytes[i].setHistoryKnown(true);
- }
- return;
- }
-
- MemoryByte[] oldMemory = oldData.getBytes();
-
- if (oldMemory.length != fBytes.length)
- return;
-
- for (int i=0; i<fBytes.length; i++)
- {
- // turn on known bit
- fBytes[i].setHistoryKnown(true);
-
- if ((fBytes[i].getFlags() & MemoryByte.READABLE) != (oldMemory[i].getFlags() & MemoryByte.READABLE))
- {
- fBytes[i].setChanged(true);
- continue;
- }
-
- if (fBytes[i].isReadable() && oldMemory[i].isReadable())
- {
- if (fBytes[i].getValue() != oldMemory[i].getValue())
- {
- fBytes[i].setChanged(true);
- }
- }
- }
- }
-
- public void copyDeltas(TableRenderingLine oldData)
- {
- if (oldData == null)
- return;
-
- // if address is not the same, do not copy
- if (!oldData.getAddress().equals(this.getAddress()))
- return;
-
- // reuse delta information from old data
- MemoryByte[] oldMemory = oldData.getBytes();
-
- if (oldMemory.length != fBytes.length)
- return;
-
- for (int i=0; i<fBytes.length; i++)
- {
- fBytes[i].setFlags(oldMemory[i].getFlags());
- }
- }
-
- public boolean isLineChanged(TableRenderingLine oldData)
- {
- if (oldData == null)
- return false;
-
- // if address is not the same, no need to compare
- if (!oldData.getAddress().equals(this.getAddress()))
- return false;
-
- // if the string representation is not the same, this line has changed
- if (oldData.getRawMemoryString().equals(getRawMemoryString())) {
- return false;
- }
- return true;
- }
-
- /**
- * @param offset
- * @param endOffset
- * @return true if the specified range of memory has changed, false otherwise
- * */
-
- public boolean isRangeChange(int offset, int endOffset)
- {
- boolean allBytesKnown = true;
- boolean allBytesUnchanged = true;
-
- for (int i=offset; i<=endOffset; i++)
- {
- if (!fBytes[i].isHistoryKnown())
- allBytesKnown = false;
- if (fBytes[i].isChanged())
- allBytesUnchanged = false;
- }
-
- if (allBytesKnown && !allBytesUnchanged) {
- return true;
- }
- return false;
- }
-
- public void unmarkDeltas()
- {
- for (int i=0; i<fBytes.length; i++)
- {
- // unset the change bit
- if (fBytes[i].isChanged())
- fBytes[i].setChanged(false);
- }
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- StringBuffer buf = new StringBuffer();
- buf.append(getAddress());
-
- buf.append(": "); //$NON-NLS-1$
-
- buf.append(getRawMemoryString());
-
- return buf.toString();
- }
-
- public int getTableIndex()
- {
- return fTableIndex;
- }
-
- public int getLength()
- {
- return fBytes.length;
- }
-
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java
deleted file mode 100644
index d7c5a4096..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java
+++ /dev/null
@@ -1,484 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.internal.ui.memory.provisional.AbstractAsyncTableRendering;
-import org.eclipse.debug.internal.ui.memory.provisional.MemoryViewPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.AsynchronousTableViewer;
-import org.eclipse.debug.internal.ui.viewers.ModelNode;
-import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-
-
-public class TableRenderingModel extends AbstractVirtualContentTableModel
- implements IContentChangeComputer {
-
-
- private Hashtable fCache;
- private Vector fOrderedCache; // needed to re-organize cache
-
- private boolean fMBSupportsChangeManagement;
- private IMemoryBlock fMemoryBlock;
-
- class SupportsChangeMgmtJob extends Job {
-
- SupportsChangeMgmtJob()
- {
- super("Support Change Management"); //$NON-NLS-1$
- setSystem(true);
- }
-
- protected IStatus run(IProgressMonitor monitor) {
- IMemoryBlock mb = getMemoryBlock();
- if (mb instanceof IMemoryBlockExtension)
- {
- IMemoryBlockExtension mbExt = (IMemoryBlockExtension)mb;
- fMBSupportsChangeManagement = mbExt.supportsChangeManagement();
- }
- return Status.OK_STATUS;
- }
-
- }
-
-
- public TableRenderingModel(AsynchronousTableViewer viewer) {
- super(viewer);
- fCache = new Hashtable();
- fOrderedCache = new Vector();
- }
-
- public int indexOfKey(Object key)
- {
- if (key instanceof BigInteger)
- {
- BigInteger address = (BigInteger)key;
- Object items[] = getElements();
-
- for (int i=0; i<items.length; i++){
- if (items[i] != null && items[i] instanceof MemorySegment)
- {
- MemorySegment line = (MemorySegment)items[i];
- if (line.containsAddress(address))
- return i;
- }
- }
- }
-
- return -1;
- }
-
- public int columnOf(Object element, Object key)
- {
- if (element instanceof MemorySegment && key instanceof BigInteger)
- {
- BigInteger address = (BigInteger)key;
- MemorySegment line = (MemorySegment)element;
- if (line.containsAddress(address))
- {
- if (getAddressableUnitsPerColumn() > 0)
- {
- BigInteger offset = address.subtract(line.getAddress());
-
- // locate column
- int colAddressableUnit = getAddressableUnitsPerColumn();
- int col = ((offset.intValue()/colAddressableUnit)+1);
-
- if (col == 0)
- col = 1;
-
- return col;
- }
- }
- }
-
- return -1;
- }
-
- public Object getKey(int idx)
- {
- Object elmt = getElement(idx);
- if (elmt instanceof MemorySegment)
- {
- return ((MemorySegment)elmt).getAddress();
- }
-
- return null;
- }
-
- public Object getKey(Object element) {
- int idx = indexOfElement(element);
- if (idx >= 0)
- {
- return getKey(idx);
- }
- return null;
- }
-
- public Object getKey(int idx, int col) {
- Object element = getElement(idx);
- if (element != null && element instanceof MemorySegment)
- {
- MemorySegment segment = (MemorySegment)element;
- BigInteger rowAddress = segment.getAddress();
-
- int offset;
- if (col > 0)
- {
- // get address offset
- int addressableUnit = getAddressableUnitsPerColumn();
- offset = (col-1) * addressableUnit;
- }
- else
- {
- offset = 0;
- }
- return rowAddress.add(BigInteger.valueOf(offset));
- }
- return null;
- }
-
- private int getAddressableUnitsPerColumn()
- {
- AsynchronousTableViewer viewer = getTableViewer();
- if (viewer.getPresentationContext() instanceof MemoryViewPresentationContext)
- {
- MemoryViewPresentationContext context = (MemoryViewPresentationContext)viewer.getPresentationContext();
- if (getTableRendering(context)!= null)
- {
- return getTableRendering(context).getAddressableUnitPerColumn();
- }
- }
- return -1;
- }
-
- public void cache(Object[] elements) {
- for (int i=0; i<elements.length; i++)
- {
- Object obj = elements[i];
- if (obj instanceof MemorySegment)
- {
- cache(((MemorySegment)obj).getAddress(), obj);
- }
- }
-
- }
-
- private void cache(Object key, Object element)
- {
- fCache.put(key, element);
- fOrderedCache.add(element);
- }
-
- public Object[] compare(Object[] newElements) {
-
- if (fCache.isEmpty())
- return newElements;
-
- for (int j=0; j<newElements.length; j++)
- {
- Object obj = newElements[j];
- if (obj instanceof MemorySegment)
- {
- MemorySegment newSegment = (MemorySegment)obj;
- MemorySegment oldSegment = (MemorySegment)fCache.get(newSegment.getAddress());
-
- if (oldSegment != null)
- {
- if (oldSegment.getNumAddressableUnits() == newSegment.getNumAddressableUnits())
- {
- MemoryByte[] newBytes = newSegment.getBytes();
- MemoryByte[] oldBytes = oldSegment.getBytes();
-
- for (int i=0; i<newBytes.length; i++)
- {
- newBytes[i].setHistoryKnown(true);
-
- if (newBytes[i].isReadable() != oldBytes[i].isReadable())
- {
- newBytes[i].setChanged(true);
- continue;
- }
-
- if (newBytes[i].isReadable() && oldBytes[i].isReadable() &&
- (newBytes[i].getValue() != oldBytes[i].getValue()))
- newBytes[i].setChanged(true);
- }
- }
- }
- }
- }
- return newElements;
- }
-
- public void clearCache()
- {
- fCache.clear();
- fOrderedCache.clear();
- }
-
- public boolean isEmpty() {
- return fCache.isEmpty();
- }
-
- public void handleViewerChanged() {
- // viewer has changed, content manager needs to re-organize the cache
- rebuildCache();
- rebuildContent();
- }
-
- private void rebuildCache()
- {
- if (isEmpty())
- return;
-
- MemoryViewPresentationContext context = (MemoryViewPresentationContext)getTableViewer().getPresentationContext();
- AbstractAsyncTableRendering rendering = getTableRendering(context);
-
- if (rendering == null)
- return;
-
- ArrayList segments = new ArrayList();
- Enumeration enumeration = fOrderedCache.elements();
-
- BigInteger address = ((MemorySegment)fOrderedCache.get(0)).getAddress();
- while (enumeration.hasMoreElements())
- {
- Object element = enumeration.nextElement();
- if (element instanceof MemorySegment)
- {
-
- segments.add(element);
- }
- }
-
- MemoryByte[] bytes = convertSegmentsToBytes((MemorySegment[])segments.toArray(new MemorySegment[0]));
-
- int bytesPerLine = rendering.getBytesPerLine();
- int numAddressableUnitPerLine = rendering.getAddressableUnitPerLine();
-
- int addressableSize = rendering.getAddressableSize();
-
- clearCache();
-
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)rendering.getAdapter(TableRenderingContentDescriptor.class);
- boolean alignAddress = true;
- if (descriptor != null && !descriptor.isAlignAddressToBoundary())
- {
- alignAddress = descriptor.isAlignAddressToBoundary();
- }
-
- MemorySegment[] newSegments = convertMemoryBytesToSegments(address, bytes, bytesPerLine, numAddressableUnitPerLine, addressableSize, alignAddress);
- for (int i=0; i<newSegments.length; i++)
- {
- cache(newSegments[i].getAddress(), newSegments[i]);
- }
- }
-
- private void rebuildContent()
- {
- MemoryViewPresentationContext context = (MemoryViewPresentationContext)getTableViewer().getPresentationContext();
- AbstractAsyncTableRendering rendering = getTableRendering(context);
-
- if (rendering == null)
- return;
-
- ArrayList segments = new ArrayList();
- Object[] elements = getElements();
- for (int i=0; i<elements.length; i++)
- {
- Object element = elements[i];
- if (element instanceof MemorySegment)
- {
- segments.add(element);
- }
- }
-
- MemoryByte[] bytes = convertSegmentsToBytes((MemorySegment[])segments.toArray(new MemorySegment[segments.size()]));
-
- int bytesPerLine = rendering.getBytesPerLine();
- int numAddressableUnitPerLine = rendering.getAddressableUnitPerLine();
- BigInteger address = (BigInteger)getKey(0);
-
- int addressableSize = rendering.getAddressableSize();
-
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)rendering.getAdapter(TableRenderingContentDescriptor.class);
- boolean alignAddress = true;
- if (descriptor != null && !descriptor.isAlignAddressToBoundary())
- {
- alignAddress = descriptor.isAlignAddressToBoundary();
- }
-
- MemorySegment[] newSegments = convertMemoryBytesToSegments(address, bytes, bytesPerLine, numAddressableUnitPerLine, addressableSize, alignAddress);
- remove(getElements());
- add(newSegments);
- }
-
-
- private MemoryByte[] convertSegmentsToBytes(MemorySegment[] segments)
- {
- ArrayList toReturn = new ArrayList();
- for (int i=0; i<segments.length; i++)
- {
- MemoryByte[] temp = segments[i].getBytes();
- for (int j=0; j<temp.length; j++)
- {
- toReturn.add(temp[j]);
- }
- }
- return (MemoryByte[])toReturn.toArray(new MemoryByte[0]);
- }
-
- private MemorySegment[] convertMemoryBytesToSegments(BigInteger address, MemoryByte[] bytes, int bytesPerLine, int numAddressableUnitPerLine, int addressableSize, boolean alignAddress) {
-
- Assert.isTrue(bytesPerLine > 0);
- Assert.isTrue(numAddressableUnitPerLine > 0);
-
- ArrayList segments = new ArrayList();
- MemoryByte[] temp = bytes;
-
- if (alignAddress)
- {
- BigInteger alignedAddress = MemoryViewUtil.alignToBoundary(address, numAddressableUnitPerLine);
-
- // also check that the address is properly aligned and prepend bytes if need to
- if (!address.subtract(alignedAddress).equals(BigInteger.ZERO))
- {
- BigInteger unitsToSetBack = address.subtract(alignedAddress);
- BigInteger tempAddress = address.subtract(unitsToSetBack);
- // only do this if the resulted address >= 0
- // do not want to have negative addresses
- if (tempAddress.compareTo(BigInteger.ZERO) >= 0)
- {
- address = alignedAddress;
- int numBytesNeeded = unitsToSetBack.intValue() * addressableSize;
- temp = new MemoryByte[bytes.length + numBytesNeeded];
-
- for (int i=0; i<numBytesNeeded; i++)
- {
- temp[i] = new MemoryByte();
- temp[i].setReadable(false);
- temp[i].setWritable(false);
- temp[i].setEndianessKnown(false);
- }
-
- System.arraycopy(bytes, 0, temp, numBytesNeeded, bytes.length);
- bytes = temp;
- }
- }
- }
-
- if (bytes.length % bytesPerLine != 0)
- {
- int numBytesNeeded = bytesPerLine - (bytes.length % bytesPerLine);
- temp = new MemoryByte[bytes.length + numBytesNeeded];
- System.arraycopy(bytes, 0, temp, 0, bytes.length);
-
- for (int i=bytes.length; i<temp.length; i++)
- {
- temp[i] = new MemoryByte();
- temp[i].setReadable(false);
- temp[i].setWritable(false);
- temp[i].setEndianessKnown(false);
- }
- bytes = temp;
- }
-
- int idx = 0;
- while (idx < bytes.length && (idx + bytesPerLine)<= bytes.length)
- {
- MemoryByte[] newBytes = new MemoryByte[bytesPerLine];
- System.arraycopy(bytes, idx, newBytes, 0, bytesPerLine);
-
- MemorySegment segment = new MemorySegment(address, newBytes, numAddressableUnitPerLine);
- segments.add(segment);
-
- address = address.add(BigInteger.valueOf(numAddressableUnitPerLine));
- idx += bytesPerLine;
- }
-
- return (MemorySegment[])segments.toArray(new MemorySegment[segments.size()]);
- }
-
- private AsynchronousTableViewer getTableViewer()
- {
- return (AsynchronousTableViewer)getViewer();
- }
-
- protected void setChildren(ModelNode parentNode, List kids) {
-
- if (computeChanges())
- {
- Object[] newContent = compare(kids.toArray());
- ArrayList newList = new ArrayList();
- for (int i=0; i<newContent.length; i++)
- {
- newList.add(newContent[i]);
- }
- super.setChildren(parentNode, newList);
- }
- else
- super.setChildren(parentNode, kids);
- }
-
- private boolean computeChanges()
- {
- if (isEmpty())
- return false;
-
- if (fMBSupportsChangeManagement)
- {
- return false;
- }
-
- return true;
- }
-
- private IMemoryBlock getMemoryBlock()
- {
- return fMemoryBlock;
- }
-
-
- public void init(Object root) {
- if (root instanceof IMemoryBlock)
- {
- fMemoryBlock = (IMemoryBlock)root;
- new SupportsChangeMgmtJob().schedule();
- }
- super.init(root);
- }
-
- private AbstractAsyncTableRendering getTableRendering(MemoryViewPresentationContext context)
- {
- IMemoryRendering memRendering = context.getRendering();
- if (memRendering != null && memRendering instanceof AbstractAsyncTableRendering)
- {
- return (AbstractAsyncTableRendering)memRendering;
- }
- return null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPrefAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPrefAction.java
deleted file mode 100644
index 43a2840bf..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPrefAction.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.IPreferencePage;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jface.preference.PreferenceNode;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.actions.ActionDelegate;
-
-public class TableRenderingPrefAction extends ActionDelegate implements IViewActionDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- IPreferencePage page = new TableRenderingPreferencePage(DebugUIMessages.TableRenderingPrefAction_0);
- showPreferencePage("org.eclipse.debug.ui.tableRenderingPreferencepage", page); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- }
-
- protected void showPreferencePage(String id, IPreferencePage page) {
- final IPreferenceNode targetNode = new PreferenceNode(id, page);
-
- PreferenceManager manager = new PreferenceManager();
- manager.addToRoot(targetNode);
- final PreferenceDialog dialog = new PreferenceDialog(DebugUIPlugin.getShell(), manager);
- final boolean [] result = new boolean[] { false };
- BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), new Runnable() {
- public void run() {
- dialog.create();
- dialog.setMessage(targetNode.getLabelText());
- result[0]= (dialog.open() == Window.OK);
- }
- });
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPreferencePage.java
deleted file mode 100644
index e32593f33..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPreferencePage.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.preference.FieldEditor;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.IntegerFieldEditor;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-
-public class TableRenderingPreferencePage extends PreferencePage implements
- IPropertyChangeListener, SelectionListener{
-
- private Button fAuto;
- private Button fManual;
- private IntegerFieldEditor fPreBufferSize;
- private IntegerFieldEditor fPostBufferSize;
- private IntegerFieldEditor fPageSize;
- private Group fGroup;
- private Composite fComposite;
-
-
- public TableRenderingPreferencePage(String title) {
- super(title);
- }
-
- protected Control createContents(Composite parent) {
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugUIConstants.PLUGIN_ID + ".table_renderings_preference_page_context"); //$NON-NLS-1$
-
- fComposite = new Composite(parent, SWT.NONE);
- fComposite.setLayout(new GridLayout());
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
- fComposite.setLayoutData(data);
-
- GridData hspanData = new GridData(SWT.FILL, SWT.FILL, true, false);
- hspanData.horizontalSpan = 2;
-
- SWTFactory.createWrapLabel(fComposite, DebugUIMessages.TableRenderingPreferencePage_10, 2, 300);
-
- fAuto = new Button(fComposite, SWT.RADIO);
- fAuto.setText(DebugUIMessages.TableRenderingPreferencePage_0);
- fAuto.setLayoutData(hspanData);
-
- fGroup = new Group(fComposite, SWT.NONE);
- fGroup.setText(DebugUIMessages.TableRenderingPreferencePage_5);
- GridData groupData = new GridData(SWT.FILL, SWT.FILL, true, false);
- groupData.horizontalSpan = 2;
- fGroup.setLayoutData(groupData);
- fPreBufferSize = new IntegerFieldEditor(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PRE_BUFFER_SIZE, DebugUIMessages.TableRenderingPreferencePage_6, fGroup);
- fPreBufferSize.setPreferenceStore(getPreferenceStore());
- fPreBufferSize.load();
- fPostBufferSize = new IntegerFieldEditor(IDebugPreferenceConstants.PREF_TABLE_RENDERING_POST_BUFFER_SIZE, DebugUIMessages.TableRenderingPreferencePage_7, fGroup);
- fPostBufferSize.setPreferenceStore(getPreferenceStore());
- fPostBufferSize.load();
-
- fManual = new Button(fComposite, SWT.RADIO);
- fManual.setText(DebugUIMessages.TableRenderingPreferencePage_8);
- fManual.setLayoutData(hspanData);
-
- fPageSize = new IntegerFieldEditor(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE, DebugUIMessages.TableRenderingPreferencePage_2, fComposite);
- fPageSize.setPreferenceStore(getPreferenceStore());
- fPageSize.load();
-
- fPreBufferSize.setPropertyChangeListener(this);
- fPostBufferSize.setPropertyChangeListener(this);
- fPageSize.setPropertyChangeListener(this);
-
- fAuto.addSelectionListener(this);
- fManual.addSelectionListener(this);
-
- loadLoadingModeFromPreference();
- updateTextEditorsEnablement();
-
- return fComposite;
- }
-
- /**
- *
- */
- private void loadLoadingModeFromPreference() {
- boolean isAuto = getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM);
- fAuto.setSelection(isAuto);
- fManual.setSelection(!isAuto);
- }
-
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(FieldEditor.VALUE))
- {
- if (event.getSource().equals(fPageSize) ||
- event.getSource().equals(fPostBufferSize) ||
- event.getSource().equals(fPreBufferSize))
- {
- validatePageSize();
- }
- }
-
- }
-
- private void validatePageSize() {
- boolean autoLoad = fAuto.getSelection();
- try {
- int bufferSize = fPageSize.getIntValue();
- int preBuffer = fPreBufferSize.getIntValue();
- int postBuffer = fPostBufferSize.getIntValue();
- if (!autoLoad && bufferSize < 1)
- {
- setValid(false);
- setErrorMessage(DebugUIMessages.TableRenderingPreferencePage_3);
- }
- else if (autoLoad)
- {
- // For auto load mode, we must have have > 1 buffer size
- // otherwise, the rendering cannot be loaded dynamically
-
- if (preBuffer < 1 || postBuffer < 1)
- {
- setValid(false);
- setErrorMessage(DebugUIMessages.TableRenderingPreferencePage_9);
- }
- else
- {
- setValid(true);
- setErrorMessage(null);
- }
- }
- else
- {
- setValid(true);
- setErrorMessage(null);
-
- }
- } catch (NumberFormatException e) {
- setValid(false);
- setErrorMessage(DebugUIMessages.TableRenderingPreferencePage_4);
- }
- }
-
- protected IPreferenceStore doGetPreferenceStore() {
- return DebugUIPlugin.getDefault().getPreferenceStore();
- }
-
- public void dispose() {
- fAuto.removeSelectionListener(this);
- fManual.removeSelectionListener(this);
- fPageSize.setPropertyChangeListener(null);
- fPreBufferSize.setPropertyChangeListener(null);
- fPostBufferSize.setPropertyChangeListener(null);
- super.dispose();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- updateTextEditorsEnablement();
- }
-
- public boolean performOk() {
- boolean auto = fAuto.getSelection();
- boolean currentValue = getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM);
- if (auto != currentValue)
- getPreferenceStore().setValue(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM, auto);
-
- fPageSize.store();
- fPreBufferSize.store();
- fPostBufferSize.store();
- return super.performOk();
- }
-
- protected void performDefaults() {
-
- boolean auto = getPreferenceStore().getDefaultBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM);
- fAuto.setSelection(auto);
- fManual.setSelection(!auto);
- updateTextEditorsEnablement();
-
- fPageSize.loadDefault();
- fPreBufferSize.loadDefault();
- fPostBufferSize.loadDefault();
- super.performDefaults();
- }
-
- /**
- *
- */
- private void updateTextEditorsEnablement() {
- boolean auto = fAuto.getSelection();
- fPreBufferSize.setEnabled(auto, fGroup);
- fPostBufferSize.setEnabled(auto, fGroup);
- fPageSize.setEnabled(!auto, fComposite);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java
deleted file mode 100644
index 0f17551fe..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IWorkbenchPropertyPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PropertyPage;
-
-public class TableRenderingPropertiesPage extends PropertyPage implements
- IWorkbenchPropertyPage {
-
- public TableRenderingPropertiesPage() {
- super();
- }
-
- protected Control createContents(Composite parent) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugUIConstants.PLUGIN_ID + ".TableRenderingPropertiesPage_context"); //$NON-NLS-1$
- noDefaultAndApplyButton();
- Composite composite = new Composite(parent, SWT.NONE);
- if (getElement() instanceof AbstractBaseTableRendering)
- {
- AbstractBaseTableRendering rendering = (AbstractBaseTableRendering)getElement();
- GridLayout compositeLayout = new GridLayout();
- compositeLayout.numColumns = 2;
- compositeLayout.makeColumnsEqualWidth = false;
- composite.setLayout(compositeLayout);
-
- GridData comositeSpec= new GridData();
- comositeSpec.grabExcessVerticalSpace= true;
- comositeSpec.grabExcessHorizontalSpace= true;
- comositeSpec.horizontalAlignment= GridData.FILL;
- comositeSpec.verticalAlignment= GridData.CENTER;
- composite.setLayoutData(comositeSpec);
-
- String label = rendering.getLabel();
- if (label.startsWith("&&")) //$NON-NLS-1$
- label = label.replaceFirst("&&", "&"); //$NON-NLS-1$//$NON-NLS-2$
- addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_1, label);
-
- MemoryByte[] bytes = rendering.getSelectedAsBytes();
- if (bytes.length > 0) {
-
- if (rendering.getSelectedAddress() != null)
- {
- String selectedAddress = "0x" + rendering.getSelectedAddress().toString(16).toUpperCase(); //$NON-NLS-1$
- StringBuffer content = new StringBuffer(selectedAddress);
- addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_2, content.toString());
- }
-
- String length = String.valueOf(rendering.getAddressableUnitPerColumn()) + " " + DebugUIMessages.TableRenderingPropertiesPage_3; //$NON-NLS-1$
- addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_4, length);
-
- String selectedContent = rendering.getSelectedAsString();
- addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_5, selectedContent);
-
- int addressableSize = rendering.getAddressableSize() * 8;
- addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_6, String.valueOf(addressableSize) + " " + DebugUIMessages.TableRenderingPropertiesPage_8); //$NON-NLS-1$
-
- boolean endianessKnown = bytes[0].isEndianessKnown();
- int endianess = RenderingsUtil.ENDIANESS_UNKNOWN;
- if (endianessKnown)
- endianess = bytes[0].isBigEndian()?RenderingsUtil.BIG_ENDIAN:RenderingsUtil.LITTLE_ENDIAN;
-
- boolean allBytesKnown = bytes[0].isHistoryKnown();
- boolean allBytesUnchanged = bytes[0].isChanged()?false:true;
-
- boolean allBytesReadable = bytes[0].isReadable();
- boolean allBytesWritable = bytes[0].isWritable();
-
- if (bytes.length > 1)
- {
- for (int i=1; i<bytes.length; i++)
- {
- if (endianessKnown)
- {
- int byteEndianess = bytes[i].isBigEndian()?RenderingsUtil.BIG_ENDIAN:RenderingsUtil.LITTLE_ENDIAN;
- if (endianess != RenderingsUtil.ENDIANESS_UNKNOWN && endianess != byteEndianess)
- endianess = RenderingsUtil.ENDIANESS_UNKNOWN;
- }
-
- if (!bytes[i].isHistoryKnown())
- allBytesKnown = false;
- if (bytes[i].isChanged())
- allBytesUnchanged = false;
-
- if (!bytes[i].isReadable())
- allBytesReadable = false;
-
- if (!bytes[i].isWritable())
- allBytesWritable = false;
- }
- }
-
- boolean isChanged = allBytesKnown && !allBytesUnchanged;
- if (allBytesKnown)
- addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_9, String.valueOf(isChanged));
- else
- addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_10, DebugUIMessages.TableRenderingPropertiesPage_11);
-
- String dataEndian = DebugUIMessages.TableRenderingPropertiesPage_12;
- if (endianessKnown)
- {
- if (endianess == RenderingsUtil.BIG_ENDIAN)
- dataEndian = DebugUIMessages.TableRenderingPropertiesPage_13;
- else if (endianess == RenderingsUtil.LITTLE_ENDIAN)
- dataEndian = DebugUIMessages.TableRenderingPropertiesPage_14;
- else
- dataEndian = DebugUIMessages.TableRenderingPropertiesPage_15;
- }
- addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_16, dataEndian);
-
-
- if (rendering instanceof AbstractIntegerRendering)
- {
-
- AbstractIntegerRendering intRendering = (AbstractIntegerRendering)rendering;
- String displayEndian = DebugUIMessages.TableRenderingPropertiesPage_17;
- endianess = intRendering.getDisplayEndianess();
-
- if (endianess == RenderingsUtil.BIG_ENDIAN)
- displayEndian = DebugUIMessages.TableRenderingPropertiesPage_18;
- else if (endianess == RenderingsUtil.LITTLE_ENDIAN)
- displayEndian = DebugUIMessages.TableRenderingPropertiesPage_19;
- else
- {
- if (endianessKnown)
- displayEndian = dataEndian;
- else
- displayEndian = DebugUIMessages.TableRenderingPropertiesPage_20;
- }
- addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_21, displayEndian);
- }
- addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_22, String.valueOf(allBytesReadable));
- addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_23, String.valueOf(allBytesWritable));
- }
- else
- {
- String selectedAddress = "0x" + rendering.getSelectedAddress().toString(16).toUpperCase(); //$NON-NLS-1$
- addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_25, selectedAddress);
-
- int unitsPerLine = rendering.getAddressableUnitPerLine();
- addProperty(composite, DebugUIMessages.TableRenderingPropertiesPage_26, String.valueOf(unitsPerLine));
- }
- }
-
- return composite;
- }
-
- private void addProperty(Composite composite, String labelStr, String contentStr)
- {
- Label label = new Label(composite, SWT.NONE);
- label.setText(labelStr);
- Label text = new Label(composite, SWT.WRAP );
- text.setText(contentStr);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRendering.java
deleted file mode 100644
index 2d126c515..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRendering.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import java.math.BigInteger;
-
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Represent unsigned integer rendering
- */
-public class UnsignedIntegerRendering extends AbstractIntegerRendering {
-
- /**
- * @param memBlock
- * @param renderingId
- */
- public UnsignedIntegerRendering(String renderingId) {
- super(renderingId);
- }
-
- private String convertToString(byte[] byteArray, int columnSize, int endianess)
- {
- String ret;
- long result = 0;
-
- if (columnSize == 1)
- {
- result = byteArray[0];
- result &= 0xff;
- }
- else if (columnSize == 2)
- {
- result = RenderingsUtil.convertByteArrayToInt(byteArray, endianess);
- }
- else if (columnSize == 4)
- {
- result = RenderingsUtil.convertByteArrayToLong(byteArray, endianess);
- }
- else if (columnSize == 8)
- {
- BigInteger value = RenderingsUtil.convertByteArrayToUnsignedLong(byteArray, endianess);
- return value.toString();
- }
- else if (columnSize == 16)
- {
- BigInteger bigRet = RenderingsUtil.convertByteArrayToUnsignedBigInt(byteArray, endianess);
- return bigRet.toString();
- }
- else
- {
- BigInteger bigRet = RenderingsUtil.convertByteArrayToUnsignedBigInt(byteArray, endianess, columnSize);
- return bigRet.toString();
- }
-
- ret = new Long(result).toString();
-
- return ret;
- }
-
- private byte[] convertToBytes(int colSize, String newValue, int endianess)
- {
- try {
- byte[] bytes;
- if (colSize == 1)
- {
- short i = Short.parseShort(newValue);
- bytes = RenderingsUtil.convertShortToByteArray(i, endianess);
- bytes = extractBytes(bytes, endianess, colSize);
- }
- // unsigned integer
- else if (colSize == 2)
- {
- int i = Integer.parseInt(newValue);
- bytes = RenderingsUtil.convertIntToByteArray(i, endianess);
- bytes = extractBytes(bytes, endianess, colSize);
- }
- else if (colSize == 4)
- {
- long i = Long.parseLong(newValue);
- bytes = RenderingsUtil.convertLongToByteArray(i, endianess);
- bytes = extractBytes(bytes, endianess, colSize);
- }
- else if (colSize == 8)
- {
- BigInteger i = new BigInteger(newValue);
- bytes = RenderingsUtil.convertBigIntegerToByteArray(i, endianess);
- bytes = extractBytes(bytes, endianess, colSize);
- }
- else if (colSize == 16)
- {
- BigInteger i = new BigInteger(newValue);
- bytes = RenderingsUtil.convertUnsignedBigIntegerToByteArray(i, endianess);
- bytes = extractBytes(bytes, endianess, colSize);
-
- return bytes;
- }
- else
- {
- BigInteger i = new BigInteger(newValue);
- bytes = RenderingsUtil.convertUnsignedBigIntToByteArray(i, endianess, colSize);
- bytes = extractBytes(bytes, endianess, colSize);
- return bytes;
- }
-
- return bytes;
- } catch (NumberFormatException e) {
- throw e;
- }
- }
-
- /* (non-Javadoc)
- * @see com.ibm.debug.extended.ui.AbstractMemoryRenderer#getString(java.lang.String, java.math.BigInteger, byte[])
- */
- public String getString(String dataType, BigInteger address, MemoryByte[] data) {
-
- String paddedStr = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR);
- boolean invalid = false;
- for (int i=0; i<data.length; i++)
- {
- if (!data[i].isReadable())
- {
- invalid = true;
- break;
- }
- }
-
- if (invalid)
- {
- StringBuffer strBuf = new StringBuffer();
- for (int i=0; i<data.length; i++)
- {
- strBuf.append(paddedStr);
- }
- return strBuf.toString();
- }
-
- int columnSize = getBytesPerColumn();
- int endianess = getDisplayEndianess();
- if (endianess == RenderingsUtil.ENDIANESS_UNKNOWN)
- endianess = getBytesEndianess(data);
-
- byte[] byteArray = new byte[data.length];
- for (int i=0; i<byteArray.length;i ++)
- {
- byteArray[i] = data[i].getValue();
- }
-
- // if endianess is unknown, do not render, just return padded string
- if (RenderingsUtil.ENDIANESS_UNKNOWN == endianess)
- {
- StringBuffer strBuf = new StringBuffer();
- for (int i=0; i<byteArray.length; i++)
- {
- strBuf.append(paddedStr);
- }
- return strBuf.toString();
- }
-
- return convertToString(byteArray, columnSize, endianess);
- }
-
- /* (non-Javadoc)
- * @see com.ibm.debug.extended.ui.AbstractMemoryRenderer#getBytes(java.lang.String, java.math.BigInteger, java.lang.String)
- */
- public byte[] getBytes(String dataType, BigInteger address, MemoryByte[] currentValues, String data) {
-
- int columnSize = getBytesPerColumn();
- int endianess = getDisplayEndianess();
- if (endianess == RenderingsUtil.ENDIANESS_UNKNOWN)
- endianess = getBytesEndianess(currentValues);
-
- // if endianess is unknown, do not try to render new data to bytes
- if (endianess == RenderingsUtil.ENDIANESS_UNKNOWN)
- {
- byte[] retBytes = new byte[currentValues.length];
- for (int i=0 ;i<currentValues.length; i++)
- retBytes[i] = currentValues[i].getValue();
- return retBytes;
- }
-
- return convertToBytes(columnSize, data, endianess);
- }
-
- private byte[] extractBytes(byte[] bytes, int endianess, int colSize) {
-
- if (colSize > bytes.length)
- throw new NumberFormatException();
-
- // take the least significant 'colSize' bytes out of the bytes array
- // if it's big endian, it's the last 'colSize' bytes
- if (endianess == RenderingsUtil.BIG_ENDIAN)
- {
- // check most significan bytes... if data has to be represented
- // using more than 'colSize' number of bytes, this
- // number is invalid, throw number format exception
- for (int i=0; i<colSize; i++)
- {
- if (bytes[i] != 0)
- throw new NumberFormatException();
- }
-
- byte[] copy = new byte[colSize];
- for (int j=0, k=bytes.length-colSize; j<copy.length && k<bytes.length; j++, k++)
- {
- copy[j] = bytes[k];
- }
- bytes = copy;
- }
- // if it's little endian, it's the first 'colSize' bytes
- else
- {
- // check most significan bytes... if data has to be represented
- // using more than 'colSize' number of bytes, this
- // number is invalid, throw number format exception
- for (int i=colSize; i<bytes.length; i++)
- {
- if (bytes[i] != 0)
- throw new NumberFormatException();
- }
-
- byte[] copy = new byte[colSize];
- for (int j=0; j<copy.length; j++)
- {
- copy[j] = bytes[j];
- }
- bytes = copy;
- }
- return bytes;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRenderingTypeDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRenderingTypeDelegate.java
deleted file mode 100644
index fccbe93a5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRenderingTypeDelegate.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.memory.renderings;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.ui.memory.IMemoryRendering;
-import org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate;
-
-/**
- * Delegate for creating an unsigned integer rendering
- * @since 3.1
- */
-public class UnsignedIntegerRenderingTypeDelegate implements
- IMemoryRenderingTypeDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate#createRendering(java.lang.String)
- */
- public IMemoryRendering createRendering(String id) throws CoreException {
- return new UnsignedIntegerRendering(id);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/IHelpContextIdProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/IHelpContextIdProvider.java
deleted file mode 100644
index 4575073f0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/IHelpContextIdProvider.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.internal.ui.views.modules;
-
-
-
-/**
- * A help context id provider allows clients to customize F1 help content from a
- * debug view. When the view input is changed, the view asks the input for
- * an adapter for IHelpContexIdProvider. If a provider is returned, the provider
- * will be consulted to replace the default context help id for a given control. If a provider
- * is not returned, then the view will use the default help context id.
- *
- * This is provided until Bug 216834 is fixed.
- *
- */
-public interface IHelpContextIdProvider {
-
- /**
- * Return the help context id that should be used in place of the given help context id.
- * @param helpId the help context id to override
- * @return the help context id that should be used in place of the given help context id
- * or <code>null</code> if default is to be used
- */
- public String getHelpContextId(String helpId);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java
deleted file mode 100644
index 2a98515d5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004, 2008 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- * Wind River Systems - Pawel Piech - Added Modules view (bug 211158)
- * IBM - Added the abiliity to update view label, context help and the orientation
- * action upon input change
-***********************************************************************/
-package org.eclipse.debug.internal.ui.views.modules;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.variables.ToggleDetailPaneAction;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.internal.ui.views.variables.VariablesView;
-import org.eclipse.debug.internal.ui.views.variables.details.AvailableDetailPanesAction;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Displays modules and symbols with a detail area.
- */
-public class ModulesView extends VariablesView {
-
- /**
- * @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.MODULES_VIEW;
- }
-
- /**
- * @see org.eclipse.debug.ui.AbstractDebugView#configureToolBar(org.eclipse.jface.action.IToolBarManager)
- */
- protected void configureToolBar(IToolBarManager tbm) {
- tbm.add(new Separator(this.getClass().getName()));
- tbm.add(new Separator(IDebugUIConstants.RENDER_GROUP));
- tbm.add(getAction("CollapseAll")); //$NON-NLS-1$
- tbm.add( new Separator( IDebugUIConstants.MODULES_GROUP ) );
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
- protected void fillContextMenu( IMenuManager menu ) {
- menu.add( new Separator( IDebugUIConstants.EMPTY_MODULES_GROUP ) );
- menu.add( new Separator( IDebugUIConstants.MODULES_GROUP ) );
- menu.add(getAction(VARIABLES_FIND_ELEMENT_ACTION));
- menu.add(new Separator());
- IAction action = new AvailableDetailPanesAction(this);
- if (isDetailPaneVisible() && action.isEnabled()) {
- menu.add(action);
- }
- menu.add(new Separator(IDebugUIConstants.EMPTY_RENDER_GROUP));
- menu.add(new Separator(IDebugUIConstants.EMPTY_NAVIGATION_GROUP));
- menu.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) );
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getDetailPanePreferenceKey()
- */
- protected String getDetailPanePreferenceKey() {
- return IDebugPreferenceConstants.MODULES_DETAIL_PANE_ORIENTATION;
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getToggleActionLabel()
- */
- protected String getToggleActionLabel() {
-
- if (getViewer() != null)
- {
- Object viewerInput = getViewer().getInput();
- if (viewerInput != null)
- {
- String name = getViewName(viewerInput);
- if (name != null)
- {
- String label = NLS.bind(ModulesViewMessages.ModulesView_1, name);
- return label;
- }
- }
- }
-
- return ModulesViewMessages.ModulesView_0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getPresentationContextId()
- */
- protected String getPresentationContextId() {
- return IDebugUIConstants.ID_MODULE_VIEW;
- }
-
- protected void setViewerInput(Object context) {
- super.setViewerInput(context);
-
- // update view label when viewer input is changed
- updateViewLabels(context);
-
- // update orientation action based on input
- updateOrientationAction(context);
-
- // update context help hook when viewer input is changed
- updateContextHelp(context);
- }
-
- private void updateContextHelp(Object context) {
- if (context instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) context;
- if (adaptable.getAdapter(IHelpContextIdProvider.class) != null) {
- IHelpContextIdProvider provider = (IHelpContextIdProvider) adaptable
- .getAdapter(IHelpContextIdProvider.class);
- String helpId = provider.getHelpContextId(IDebugHelpContextIds.MODULES_VIEW);
- if (helpId != null) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl().getParent(), helpId);
- return;
- }
- }
- }
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl().getParent(), IDebugHelpContextIds.MODULES_VIEW);
- }
-
- private void updateViewLabels(Object context)
- {
- String viewName = getViewName(context);
-
- // only update label if the name has changed
- if (!getPartName().equals(viewName))
- setPartName(viewName);
-
- // only update image if the image has changed
- Image image = getViewImage(context);
- if (!getTitleImage().equals(image))
- setTitleImage(image);
- }
-
- /**
- * @param context
- */
- private String getViewName(Object context) {
- if (context instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) context;
- if (adaptable.getAdapter(ILabelProvider.class) != null) {
- ILabelProvider provider = (ILabelProvider) adaptable
- .getAdapter(ILabelProvider.class);
- String label = provider.getText(this);
- if (label != null)
- return label;
- }
- }
- return ModulesViewMessages.ModulesView_2;
- }
-
- private Image getViewImage(Object context)
- {
- if (context instanceof IAdaptable) {
- IAdaptable adaptable = (IAdaptable) context;
- if (adaptable.getAdapter(ILabelProvider.class) != null) {
- ILabelProvider provider = (ILabelProvider) adaptable
- .getAdapter(ILabelProvider.class);
- Image image = provider.getImage(this);
- if (image != null)
- return image;
- }
- }
- return DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_CVIEW_MODULES_VIEW);
- }
-
- private void updateOrientationAction(Object context)
- {
- ToggleDetailPaneAction action = getToggleDetailPaneAction(IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_HIDDEN);
- if (action != null)
- {
- String label = NLS.bind(ModulesViewMessages.ModulesView_1, getViewName(context));
- action.setText(label);
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesViewMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesViewMessages.java
deleted file mode 100644
index 6930c44f4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesViewMessages.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004, 2008 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- * IBM Corporation - Bug 90318
- * Wind River Systems - Pawel Piech - Added Modules view (bug 211158)
- ***********************************************************************/
-package org.eclipse.debug.internal.ui.views.modules;
-
-import org.eclipse.osgi.util.NLS;
-
-public class ModulesViewMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.views.modules.ModulesViewMessages";//$NON-NLS-1$
-
- public static String ModulesView_0;
-
- public static String ModulesView_1;
-
- public static String ModulesView_2;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, ModulesViewMessages.class);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesViewMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesViewMessages.properties
deleted file mode 100644
index c35d020fd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesViewMessages.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-#########################################################################
-# Copyright (c) 2004, 2008 QNX Software Systems and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# QNX Software Systems - Initial API and implementation
-# Wind River Systems - Pawel Piech - Added Modules view (bug 211158)
-##########################################################################
-ModulesView_0=Modules View Only
-
-ModulesView_1={0} View Only
-ModulesView_2=Modules
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersView.java
deleted file mode 100644
index acee47c8e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersView.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004, 2005 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
-***********************************************************************/
-package org.eclipse.debug.internal.ui.views.registers;
-
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.internal.ui.views.variables.VariablesView;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.Separator;
-
-/**
- * Displays registers and their values with a detail area.
- */
-public class RegistersView extends VariablesView {
-
- /**
- * @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.REGISTERS_VIEW;
- }
-
- /**
- * @see org.eclipse.debug.ui.AbstractDebugView#configureToolBar(org.eclipse.jface.action.IToolBarManager)
- */
- protected void configureToolBar(IToolBarManager tbm) {
- super.configureToolBar(tbm);
- tbm.add(new Separator(IDebugUIConstants.EMPTY_REGISTER_GROUP));
- tbm.add(new Separator(IDebugUIConstants.REGISTER_GROUP));
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getDetailPanePreferenceKey()
- */
- protected String getDetailPanePreferenceKey() {
- return IDebugPreferenceConstants.REGISTERS_DETAIL_PANE_ORIENTATION;
- }
-
- /**
- * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getToggleActionLabel()
- */
- protected String getToggleActionLabel() {
- return RegistersViewMessages.RegistersView_0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getPresentationContextId()
- */
- protected String getPresentationContextId() {
- return IDebugUIConstants.ID_REGISTER_VIEW;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersViewMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersViewMessages.java
deleted file mode 100644
index fee501218..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersViewMessages.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2004, 2005 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
- * IBM Corporation - Bug 90318
- ***********************************************************************/
-package org.eclipse.debug.internal.ui.views.registers;
-
-import org.eclipse.osgi.util.NLS;
-
-public class RegistersViewMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.views.registers.RegistersViewMessages";//$NON-NLS-1$
-
- public static String RegistersView_0;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, RegistersViewMessages.class);
- }
-} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersViewMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersViewMessages.properties
deleted file mode 100644
index d1c175f2c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersViewMessages.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-#########################################################################
-# Copyright (c) 2004, 2005 QNX Software Systems and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# QNX Software Systems - Initial API and implementation
-##########################################################################
-RegistersView_0=Registers View Only
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java
deleted file mode 100644
index 62644e211..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILogicalStructureType;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Drop down action that displays available logical structures for a selected
- * variable or expression.
- */
-public class AvailableLogicalStructuresAction extends Action implements IMenuCreator {
-
- private VariablesView fView;
- private Menu fMenu;
- private IValue fValue;
- private ILogicalStructureType[] fTypes;
-
- public AvailableLogicalStructuresAction(VariablesView view) {
- setView(view);
- setToolTipText(VariablesViewMessages.AvailableLogicalStructuresAction_0);
- setText(VariablesViewMessages.AvailableLogicalStructuresAction_1);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.VARIABLES_SELECT_LOGICAL_STRUCTURE);
- setEnabled(false);
- setMenuCreator(this);
- init();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- }
-
- protected VariablesView getView() {
- return fView;
- }
-
- protected void setView(VariablesView view) {
- fView = view;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#dispose()
- */
- public void dispose() {
- if (fMenu != null) {
- fMenu.dispose();
- }
- fView= null;
- fValue = null;
- fTypes = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
- */
- public Menu getMenu(Control parent) {
- return null;
- }
-
- protected void addActionToMenu(Menu parent, Action action) {
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(parent, -1);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
- */
- public Menu getMenu(Menu parent) {
- if (fMenu != null) {
- fMenu.dispose();
- }
-
- fMenu= new Menu(parent);
- ILogicalStructureType[] types = getTypes();
- ILogicalStructureType enabledType = DebugPlugin.getDefaultStructureType(types);
- if (types != null && types.length > 0) {
- for (int i = 0; i < types.length; i++) {
- ILogicalStructureType type= types[i];
- Action action = new SelectLogicalStructureAction(getView(), type, getValue(), types);
- action.setChecked(enabledType == type);
- StringBuffer label= new StringBuffer();
- //add the numerical accelerator
- if (i < 9) {
- label.append('&');
- label.append(i + 1);
- label.append(' ');
- }
- label.append(action.getText());
- action.setText(label.toString());
- addActionToMenu(fMenu, action);
- }
- }
- return fMenu;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void init() {
- setValue(null);
- setTypes(null);
- if (getView().isShowLogicalStructure()) {
- ISelection s = getView().getViewer().getSelection();
- if (s instanceof IStructuredSelection) {
- IStructuredSelection selection = (IStructuredSelection) s;
- if (selection.size() == 1) {
- Object obj = selection.getFirstElement();
- IValue value = null;
- if (obj instanceof IVariable) {
- IVariable var = (IVariable) obj;
- try {
- value = var.getValue();
- } catch (DebugException e) {
- }
- } else if (obj instanceof IExpression) {
- IExpression expression = (IExpression)obj;
- value = expression.getValue();
- }
- if (value != null) {
- ILogicalStructureType[] types = DebugPlugin.getLogicalStructureTypes(value);
- if (types.length > 0) {
- setTypes(types);
- setValue(value);
- setEnabled(true);
- return;
- }
- }
- }
- }
- }
- setEnabled(false);
- }
-
- protected ILogicalStructureType[] getTypes() {
- return fTypes;
- }
-
- private void setTypes(ILogicalStructureType[] types) {
- fTypes = types;
- }
-
- protected IValue getValue() {
- return fValue;
- }
-
- private void setValue(IValue value) {
- fValue = value;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedValuePartition.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedValuePartition.java
deleted file mode 100644
index 68b16ba0d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedValuePartition.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IIndexedValue;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-
-/**
- * A parition (subrange) of values of an indexed value
- */
-public class IndexedValuePartition implements IIndexedValue {
-
- // the starting offset of this parition, into the associated collection
- private int fOffset;
-
- // the length of this partition
- private int fLength;
-
- // the indexed value
- private IIndexedValue fValue;
-
- /**
- * Creates a parition for an indexed value.
- *
- * @param value indexed value
- * @param offset beginning offset of this partition (into the value)
- * @param length the length of this parition
- */
- public IndexedValuePartition(IIndexedValue value, int offset, int length) {
- fValue = value;
- fOffset = offset;
- fLength = length;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IIndexedValue#getSize()
- */
- public int getSize() {
- return fLength;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IIndexedValue#getVariable(int)
- */
- public IVariable getVariable(int offset) throws DebugException {
- return fValue.getVariable(offset);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValue#getReferenceTypeName()
- */
- public String getReferenceTypeName() throws DebugException {
- return fValue.getReferenceTypeName();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValue#getValueString()
- */
- public String getValueString() {
- return IInternalDebugCoreConstants.EMPTY_STRING;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValue#getVariables()
- */
- public IVariable[] getVariables() throws DebugException {
- return getVariables(fOffset, fLength);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValue#hasVariables()
- */
- public boolean hasVariables() {
- return fLength > 0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValue#isAllocated()
- */
- public boolean isAllocated() throws DebugException {
- return fValue.isAllocated();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
- */
- public IDebugTarget getDebugTarget() {
- return fValue.getDebugTarget();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
- */
- public ILaunch getLaunch() {
- return fValue.getLaunch();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
- */
- public String getModelIdentifier() {
- return fValue.getModelIdentifier();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- return fValue.getAdapter(adapter);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IIndexedValue#getVariables(int, int)
- */
- public IVariable[] getVariables(int offset, int length) throws DebugException {
- return fValue.getVariables(offset, length);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IIndexedValue#getInitialOffset()
- */
- public int getInitialOffset() {
- return fOffset;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedVariablePartition.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedVariablePartition.java
deleted file mode 100644
index 037ded8a7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedVariablePartition.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IIndexedValue;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * A variable containing a subset/range of values from an indexed value
- * (<code>IIndexedValue</code>).
- */
-public class IndexedVariablePartition extends PlatformObject implements IVariable {
-
- // the starting offset of this partition, into the associated collection
- private int fOffset;
-
- // the length of this partition
- private int fLength;
-
- // the root variable or expression containing the indexed value
- private IDebugElement fOriginalVariable;
-
- // the indexed value
- private IIndexedValue fOriginalValue;
-
- // sub-range of values
- private IIndexedValue fValuePartition;
-
- private String fName = null;
-
- /**
- * Creates a partition for an indexed value.
- *
- * @param variable variable or expression containing the indexed value
- * @param value indexed value
- * @param offset beginning offset of this partition (into the value)
- * @param length the length of this partition
- */
- public IndexedVariablePartition(IDebugElement variable, IIndexedValue value, int offset, int length) {
- fOriginalVariable = variable;
- fOriginalValue = value;
- fOffset = offset;
- fLength = length;
- fValuePartition = new IndexedValuePartition(value, offset, length);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IVariable#getValue()
- */
- public IValue getValue() {
- return fValuePartition;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IVariable#getName()
- */
- public String getName() {
- if (fName == null) {
- StringBuffer buf = new StringBuffer();
- buf.append("["); //$NON-NLS-1$
- buf.append(fOffset);
- buf.append("..."); //$NON-NLS-1$
- buf.append(fOffset + fLength - 1);
- buf.append("]"); //$NON-NLS-1$
- fName = buf.toString();
- }
- return fName;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IVariable#getReferenceTypeName()
- */
- public String getReferenceTypeName() throws DebugException {
- if (fOriginalVariable instanceof IVariable) {
- IVariable variable = (IVariable) fOriginalVariable;
- return variable.getReferenceTypeName();
- }
- return IInternalDebugCoreConstants.EMPTY_STRING;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IVariable#hasValueChanged()
- */
- public boolean hasValueChanged() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
- */
- public String getModelIdentifier() {
- return fOriginalValue.getModelIdentifier();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
- */
- public IDebugTarget getDebugTarget() {
- return fOriginalValue.getDebugTarget();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
- */
- public ILaunch getLaunch() {
- return fOriginalValue.getLaunch();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#setValue(java.lang.String)
- */
- public void setValue(String expression) throws DebugException {
- throw new DebugException(new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "Value modification not supported for indexed partitions.", null)); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#setValue(org.eclipse.debug.core.model.IValue)
- */
- public void setValue(IValue value) throws DebugException {
- throw new DebugException(new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "Value modification not supported for indexed partitions.", null)); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#supportsValueModification()
- */
- public boolean supportsValueModification() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#verifyValue(java.lang.String)
- */
- public boolean verifyValue(String expression) {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.IValueModification#verifyValue(org.eclipse.debug.core.model.IValue)
- */
- public boolean verifyValue(IValue value) {
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if (obj instanceof IndexedVariablePartition) {
- IndexedVariablePartition partition = (IndexedVariablePartition)obj;
- return fOriginalVariable.equals(partition.fOriginalVariable) &&
- fOffset == partition.fOffset && fLength == partition.fLength;
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return fOriginalVariable.hashCode() + fOffset;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/LogicalStructureCache.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/LogicalStructureCache.java
deleted file mode 100644
index dd72ccc30..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/LogicalStructureCache.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.ILogicalStructureType;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-
-/**
- * Cache that stores evaluated logical structure values to replace raw values. Cache
- * should be cleared when a RESUME or TERMINATE event is fired so the structure can be
- * reevaluated for new values.
- *
- * @since 3.3
- *
- */
-public class LogicalStructureCache {
-
- /**
- * Maps a ILogicalStructureType to the cache for that type
- */
- private Map fCacheForType = new HashMap();
-
- /**
- * Returns the logical value to replace the given value using the specified logical structure.
- * The value will be retrieved from the cache if possible, or evaluated if not.
- *
- * @param type the logical structure type used to evaluate the logical value
- * @param value the raw value to replace with a logical structure
- * @return the logical value replacing the raw value or <code>null</code> if there is a problem
- */
- public IValue getLogicalStructure(ILogicalStructureType type, IValue value) throws CoreException {
- synchronized (fCacheForType) {
- LogicalStructureTypeCache cache = getCacheForType(type);
- return cache.getLogicalStructure(value);
- }
- }
-
- /**
- * Clears the cache of all evaluated values.
- */
- public void clear(){
- synchronized (fCacheForType) {
- fCacheForType.clear();
- }
- }
-
- /**
- * Helper method that returns the cache associated with the given logical structure type.
- * If there is not cache associated, one is created.
- *
- * @param type the logical structure type to get the cache for
- * @return the cache associated with the logical structure type
- */
- protected LogicalStructureTypeCache getCacheForType(ILogicalStructureType type){
- LogicalStructureTypeCache cache = (LogicalStructureTypeCache)fCacheForType.get(type);
- if (cache == null){
- cache = new LogicalStructureTypeCache(type);
- fCacheForType.put(type, cache);
- }
- return cache;
- }
-
- /**
- * Inner class that caches the known and pending values for a given logical
- * structure type.
- */
- class LogicalStructureTypeCache{
-
- private ILogicalStructureType fType;
-
- /**
- * Maps a raw IValue to its calculated logical IValue
- */
- private Map fKnownValues = new HashMap();
-
- /**
- * Set of raw IValues that logical values are currently being evaluated for.
- */
- private Set fPendingValues = new HashSet();
-
- public LogicalStructureTypeCache(ILogicalStructureType type){
- fType = type;
- }
-
- /**
- * Returns the logical structure value for the given raw value. If the value has been evaluated
- * the cached value is returned, otherwise the thread waits until the value is evaluated.
- *
- * @param value the raw value
- * @return the logical value
- * @exception CoreException if an error occurs computing the value
- */
- public IValue getLogicalStructure(IValue value) throws CoreException {
- // Check if the value has already been evaluated
- synchronized (fKnownValues) {
- IValue logical = (IValue)fKnownValues.get(value);
- if (logical != null){
- return logical;
- }
- }
- // Check if the logical structure is currently being evaluated
- synchronized (fPendingValues) {
- if (fPendingValues.contains(value)){
- try {
- fPendingValues.wait();
- return getLogicalStructure(value);
- } catch (InterruptedException e) {
- throw new CoreException(new Status(IStatus.CANCEL, DebugUIPlugin.getUniqueIdentifier(),
- VariablesViewMessages.LogicalStructureCache_0, e));
- }
- } else {
- fPendingValues.add(value);
- }
- }
- // Start the evaluation to get the logical structure
- try {
- IValue result = fType.getLogicalStructure(value);
- synchronized (fKnownValues) {
- fKnownValues.put(value, result);
- }
- synchronized (fPendingValues) {
- fPendingValues.remove(value);
- fPendingValues.notifyAll();
- }
- return result;
- } catch (CoreException e) {
- synchronized (fPendingValues) {
- fPendingValues.remove(value);
- fPendingValues.notifyAll();
- }
- throw e;
- }
- }
-
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java
deleted file mode 100644
index 80bc7b284..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILogicalStructureType;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.custom.BusyIndicator;
-
-/**
- * Action to set the logical structure to display for a variable (enables/disables
- * logical structure types for the same variable).
- */
-public class SelectLogicalStructureAction extends Action {
-
- private VariablesView fView;
- private ILogicalStructureType fType;
- private ILogicalStructureType[] fAvailableTypes;
-
- /**
- *
- * @param view Variables view
- * @param type the type that this action will turn on/off
- * @param value the value for which logical structures are to be chosen
- * @param availableTypes the set of logical structure types that are being offered
- * to the user in addition to the type controlled by this action
- */
- public SelectLogicalStructureAction(VariablesView view, ILogicalStructureType type, IValue value, ILogicalStructureType[] availableTypes) {
- super(type.getDescription(value), IAction.AS_CHECK_BOX);
- setView(view);
- fAvailableTypes= availableTypes;
- fType= type;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- valueChanged();
- }
-
- private void valueChanged() {
- if (!getView().isAvailable()) {
- return;
- }
- BusyIndicator.showWhile(getView().getViewer().getControl().getDisplay(), new Runnable() {
- public void run() {
- // Checking this action sets the type to fType, unchecking it sets the type
- // to null ("none selected")
- ILogicalStructureType type= null;
- if (isChecked()) {
- type= fType;
- }
- DebugPlugin.setDefaultStructureType(fAvailableTypes, type);
- getView().getViewer().refresh();
- }
- });
- }
-
- protected VariablesView getView() {
- return fView;
- }
-
- protected void setView(VariablesView view) {
- fView = view;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectionDragAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectionDragAdapter.java
deleted file mode 100644
index f565712a9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectionDragAdapter.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River - Pawel Piech - Initial Implementation - Drag/Drop to Expressions View (Bug 184057)
- * IBM Corporation - further implementation and documentation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
-import org.eclipse.jface.util.LocalSelectionTransfer;
-import org.eclipse.jface.util.TransferDragSourceListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.dnd.DragSourceAdapter;
-import org.eclipse.swt.dnd.DragSourceEvent;
-import org.eclipse.swt.dnd.Transfer;
-
-/**
- * Drag adapter for the variables view and expressions view. Allows selected variables and
- * expressions to be dragged.
- *
- * @see org.eclipse.debug.internal.ui.views.expression.ExpressionDropAdapter
- * @since 3.4
- */
-public class SelectionDragAdapter extends DragSourceAdapter implements TransferDragSourceListener {
-
- /**
- * The associated viewer for the adapter
- */
- private TreeModelViewer fViewer;
-
- /**
- * Constructor, takes the viewer that contains the selection provider
- * @param view the associated view, <b>must</b> implement <code>ISelectionProvider</code>
- */
- public SelectionDragAdapter(TreeModelViewer viewer) {
- Assert.isNotNull(viewer);
- fViewer = viewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.TransferDragSourceListener#getTransfer()
- */
- public Transfer getTransfer() {
- return LocalSelectionTransfer.getTransfer();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.dnd.DragSourceAdapter#dragStart(org.eclipse.swt.dnd.DragSourceEvent)
- */
- public void dragStart(DragSourceEvent event) {
- ISelection selection = fViewer.getSelection();
- LocalSelectionTransfer.getTransfer().setSelection(selection);
- LocalSelectionTransfer.getTransfer().setSelectionSetTime(event.time & 0xFFFFFFFFL);
- event.doit = !selection.isEmpty();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.dnd.DragSourceAdapter#dragSetData(org.eclipse.swt.dnd.DragSourceEvent)
- */
- public void dragSetData(DragSourceEvent event) {
- // For consistency set the data to the selection even though
- // the selection is provided by the LocalSelectionTransfer
- // to the drop target adapter.
- event.data = LocalSelectionTransfer.getTransfer().getSelection();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.dnd.DragSourceAdapter#dragFinished(org.eclipse.swt.dnd.DragSourceEvent)
- */
- public void dragFinished(DragSourceEvent event) {
- LocalSelectionTransfer.getTransfer().setSelection(null);
- LocalSelectionTransfer.getTransfer().setSelectionSetTime(0);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleLogicalStructureAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleLogicalStructureAction.java
deleted file mode 100644
index dca133d1f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleLogicalStructureAction.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables;
-
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Action to toggle the use of contributed variables content providers on and off.
- * When on, all registered variables content providers for the current debug model
- * are used. When off, the default content provider (that shows all children)
- * is used for all debug models.
- */
-public class ToggleLogicalStructureAction extends Action {
-
- private VariablesView fView;
-
- public ToggleLogicalStructureAction(VariablesView view) {
- super(null, IAction.AS_CHECK_BOX);
- setView(view);
- setToolTipText(VariablesViewMessages.ToggleObjectBrowsersAction_1);
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_SHOW_LOGICAL_STRUCTURE));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_SHOW_LOGICAL_STRUCTURE));
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_SHOW_LOGICAL_STRUCTURE));
- setId(DebugUIPlugin.getUniqueIdentifier() + ".ToggleObjectBrowsersAction"); //$NON-NLS-1$
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.VARIABLES_CONTENT_PROVIDERS_ACTION);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- if (!getView().isAvailable()) {
- return;
- }
- getView().setShowLogicalStructure(isChecked());
- BusyIndicator.showWhile(getView().getViewer().getControl().getDisplay(), new Runnable() {
- public void run() {
- getView().getViewer().refresh();
- }
- });
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#setChecked(boolean)
- */
- public void setChecked(boolean value) {
- super.setChecked(value);
- }
-
- protected VariablesView getView() {
- return fView;
- }
-
- protected void setView(VariablesView view) {
- fView = view;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleShowColumnsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleShowColumnsAction.java
deleted file mode 100644
index 7dee94008..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleShowColumnsAction.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * Action to toggle the use of contributed variables content providers on and off.
- * When on, all registered variables content providers for the current debug model
- * are used. When off, the default content provider (that shows all children)
- * is used for all debug models.
- */
-public class ToggleShowColumnsAction extends Action implements IUpdate {
-
- private TreeModelViewer fViewer;
-
- public ToggleShowColumnsAction(TreeModelViewer viewew) {
- super(VariablesViewMessages.ToggleShowColumnsAction_0, IAction.AS_CHECK_BOX);
- fViewer = viewew;
- setToolTipText(VariablesViewMessages.ToggleShowColumnsAction_1);
- setImageDescriptor(DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_OBJS_COMMON_TAB));
- setId(DebugUIPlugin.getUniqueIdentifier() + ".ToggleShowColumsAction"); //$NON-NLS-1$
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.SHOW_COLUMNS_ACTION);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- if (fViewer.getControl().isDisposed()) {
- return;
- }
- BusyIndicator.showWhile(fViewer.getControl().getDisplay(), new Runnable() {
- public void run() {
- fViewer.setShowColumns(isChecked());
- }
- });
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
- public void update() {
- setEnabled(fViewer.canToggleColumns());
- setChecked(fViewer.isShowColumns());
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariableViewToggleAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariableViewToggleAction.java
deleted file mode 100644
index fee97c166..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariableViewToggleAction.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables;
-
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugView;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
-/**
- *
- */
-public abstract class VariableViewToggleAction implements IViewActionDelegate, IActionDelegate2 {
-
- private IViewPart fView;
- private IAction fAction;
-
- public VariableViewToggleAction() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- fView = view;
- boolean checked = getPreferenceValue(view);
- fAction.setChecked(checked);
- run(fAction);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- fAction = action;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#dispose()
- */
- public void dispose() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- IPreferenceStore store = getPreferenceStore();
- String key = getView().getSite().getId() + "." + getPreferenceKey(); //$NON-NLS-1$
- store.setValue(key, action.isChecked());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
- protected IPreferenceStore getPreferenceStore() {
- return DebugUIPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * Returns the value of this filters preference (on/off) for the given
- * view.
- *
- * @param part
- * @return boolean
- */
- protected boolean getPreferenceValue(IViewPart part) {
- String baseKey = getPreferenceKey();
- String viewKey = part.getSite().getId();
- String compositeKey = viewKey + "." + baseKey; //$NON-NLS-1$
- IPreferenceStore store = getPreferenceStore();
- boolean value = false;
- if (store.contains(compositeKey)) {
- value = store.getBoolean(compositeKey);
- } else {
- value = store.getBoolean(baseKey);
- }
- return value;
- }
-
- /**
- * Returns the key for this action's preference
- *
- * @return String
- */
- protected abstract String getPreferenceKey();
-
- protected IViewPart getView() {
- return fView;
- }
-
- protected StructuredViewer getStructuredViewer() {
- IDebugView view = (IDebugView)getView().getAdapter(IDebugView.class);
- if (view != null) {
- Viewer viewer = view.getViewer();
- if (viewer instanceof StructuredViewer) {
- return (StructuredViewer)viewer;
- }
- }
- return null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
deleted file mode 100644
index 8023624a9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
+++ /dev/null
@@ -1,1218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * QNX Software Systems - Mikhail Khodjaiants - Registers View (Bug 53640)
- * Wind River - Pawel Piech - Drag/Drop to Expressions View (Bug 184057)
- * Wind River - Pawel Piech - Busy status while updates in progress (Bug 206822)
- * Wind River - Pawel Piech - NPE when closing the Variables view (Bug 213719)
- * Wind River - Pawel Piech - Fix viewer input race condition (Bug 234908)
- * Wind River - Anton Leherbauer - Fix selection provider (Bug 254442)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.LazyModelPresentation;
-import org.eclipse.debug.internal.ui.VariablesViewModelPresentation;
-import org.eclipse.debug.internal.ui.actions.CollapseAllAction;
-import org.eclipse.debug.internal.ui.actions.ConfigureColumnsAction;
-import org.eclipse.debug.internal.ui.actions.variables.ChangeVariableValueAction;
-import org.eclipse.debug.internal.ui.actions.variables.ShowTypesAction;
-import org.eclipse.debug.internal.ui.actions.variables.ToggleDetailPaneAction;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.internal.ui.viewers.model.VirtualFindAction;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDeltaVisitor;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputRequestor;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.ViewerInputService;
-import org.eclipse.debug.internal.ui.views.DebugModelPresentationContext;
-import org.eclipse.debug.internal.ui.views.IDebugExceptionHandler;
-import org.eclipse.debug.internal.ui.views.variables.details.AvailableDetailPanesAction;
-import org.eclipse.debug.internal.ui.views.variables.details.DetailPaneProxy;
-import org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer2;
-import org.eclipse.debug.ui.AbstractDebugView;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.commands.ActionHandler;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.LocalSelectionTransfer;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-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.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IPerspectiveListener;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.WorkbenchException;
-import org.eclipse.ui.XMLMemento;
-import org.eclipse.ui.handlers.CollapseAllHandler;
-import org.eclipse.ui.handlers.IHandlerService;
-import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
-import org.eclipse.ui.progress.UIJob;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * This view shows variables and their values for a particular stack frame
- */
-public class VariablesView extends AbstractDebugView implements IDebugContextListener,
- IPropertyChangeListener, IDebugExceptionHandler,
- IPerspectiveListener, IModelChangedListener,
- IViewerUpdateListener, IDetailPaneContainer2 {
-
- /**
- * Selection provider wrapping an exchangeable active selection provider.
- * Sends out a selection changed event when the active selection provider changes.
- * Forwards all selection changed events of the active selection provider.
- */
- private static class SelectionProviderWrapper implements ISelectionProvider {
- private final ListenerList fListenerList = new ListenerList(ListenerList.IDENTITY);
- private final ISelectionChangedListener fListener = new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- fireSelectionChanged(event);
- }
- };
- private ISelectionProvider fActiveProvider;
-
- private SelectionProviderWrapper(ISelectionProvider provider) {
- setActiveProvider(provider);
- }
-
- private void setActiveProvider(ISelectionProvider provider) {
- if (fActiveProvider == provider || this == provider) {
- return;
- }
- if (fActiveProvider != null) {
- fActiveProvider.removeSelectionChangedListener(fListener);
- }
- if (provider != null) {
- provider.addSelectionChangedListener(fListener);
- }
- fActiveProvider = provider;
- fireSelectionChanged(new SelectionChangedEvent(this, getSelection()));
- }
-
- private void dispose() {
- fListenerList.clear();
- setActiveProvider(null);
- }
-
- private void fireSelectionChanged(SelectionChangedEvent event) {
- Object[] listeners = fListenerList.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- ISelectionChangedListener listener = (ISelectionChangedListener) listeners[i];
- listener.selectionChanged(event);
- }
- }
-
- /*
- * @see org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
- */
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- fListenerList.add(listener);
- }
-
- /*
- * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
- */
- public ISelection getSelection() {
- if (fActiveProvider != null) {
- return fActiveProvider.getSelection();
- }
- return StructuredSelection.EMPTY;
- }
-
- /*
- * @see org.eclipse.jface.viewers.ISelectionProvider#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
- */
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- fListenerList.remove(listener);
- }
-
- /*
- * @see org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection)
- */
- public void setSelection(ISelection selection) {
- if (fActiveProvider != null) {
- fActiveProvider.setSelection(selection);
- }
- }
- }
-
- /**
- * The model presentation used as the label provider for the tree viewer,
- * and also as the detail information provider for the detail pane.
- */
- private VariablesViewModelPresentation fModelPresentation;
-
- /**
- * The UI construct that provides a sliding sash between the variables tree
- * and the detail pane.
- */
- private SashForm fSashForm;
-
- /**
- * The detail pane that displays detailed information about the current selection
- * @since 3.3
- */
- private DetailPaneProxy fDetailPane;
-
- /**
- * Stores whether the tree viewer was the last control to have focus in the
- * view. Used to give focus to the correct component if the user leaves the view.
- * @since 3.3
- */
- private boolean fTreeHasFocus = true;
-
- /**
- * Various listeners used to update the enabled state of actions and also to
- * populate the detail pane.
- */
- private ISelectionChangedListener fTreeSelectionChangedListener;
-
- /**
- * Listener added to the control of the detail pane, allows view to keep track of which
- * part last had focus, the tree or the detail pane.
- */
- private Listener fDetailPaneActivatedListener;
-
- /**
- * Viewer input service used to translate active debug context to viewer input.
- */
- private ViewerInputService fInputService;
-
- /**
- * Viewer input requester used to update the viewer once the viewer input has been
- * resolved.
- */
- private IViewerInputRequestor fRequester = new IViewerInputRequestor() {
- public void viewerInputComplete(IViewerInputUpdate update) {
- if (!update.isCanceled()) {
- viewerInputUpdateComplete(update);
- }
- }
- };
-
- /**
- * These are used to initialize and persist the position of the sash that
- * separates the tree viewer from the detail pane.
- */
- private static final int[] DEFAULT_SASH_WEIGHTS = {13, 6};
- private int[] fLastSashWeights;
- private boolean fToggledDetailOnce;
- private String fCurrentDetailPaneOrientation = IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_HIDDEN;
- private ToggleDetailPaneAction[] fToggleDetailPaneActions;
- private ConfigureColumnsAction fConfigureColumnsAction;
-
- protected String PREF_STATE_MEMENTO = "pref_state_memento."; //$NON-NLS-1$
-
- public static final String LOGICAL_STRUCTURE_TYPE_PREFIX = "VAR_LS_"; //$NON-NLS-1$
-
- /**
- * Presentation context property.
- * TODO: make API
- * @since 3.3
- */
- public static final String PRESENTATION_SHOW_LOGICAL_STRUCTURES = "PRESENTATION_SHOW_LOGICAL_STRUCTURES"; //$NON-NLS-1$
-
- /**
- * the preference name for the view part of the sash form
- * @since 3.2
- */
- protected static final String SASH_VIEW_PART = DebugUIPlugin.getUniqueIdentifier() + ".SASH_VIEW_PART"; //$NON-NLS-1$
- /**
- * the preference name for the details part of the sash form
- * @since 3.2
- */
- protected static final String SASH_DETAILS_PART = DebugUIPlugin.getUniqueIdentifier() + ".SASH_DETAILS_PART"; //$NON-NLS-1$
-
- /**
- * Key for "Find..." action.
- */
- protected static final String VARIABLES_FIND_ELEMENT_ACTION = FIND_ACTION + ".Variables"; //$NON-NLS-1$
-
- /**
- * Key for "Select All" action.
- */
- protected static final String VARIABLES_SELECT_ALL_ACTION = SELECT_ALL_ACTION + ".Variables"; //$NON-NLS-1$
-
- /**
- * Key for "Select All" action.
- */
- protected static final String VARIABLES_COPY_ACTION = COPY_ACTION + ".Variables"; //$NON-NLS-1$
-
- /**
- * Visits deltas to determine if details should be displayed
- */
- class Visitor implements IModelDeltaVisitor {
- /**
- * Whether to trigger details display.
- *
- * @since 3.3
- */
- private boolean fTriggerDetails = false;
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IModelDeltaVisitor#visit(org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta, int)
- */
- public boolean visit(IModelDelta delta, int depth) {
- if ((delta.getFlags() & IModelDelta.CONTENT) > 0) {
- fTriggerDetails = true;
- return false;
- }
- return true;
- }
-
- public void reset() {
- fTriggerDetails = false;
- }
-
- public boolean isTriggerDetails() {
- return fTriggerDetails;
- }
-
- }
- /**
- * Delta visitor
- */
- private Visitor fVisitor = new Visitor();
-
- /**
- * Job to update details in the UI thread.
- */
- private Job fTriggerDetailsJob = new UIJob("trigger details") { //$NON-NLS-1$
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if (monitor.isCanceled()) {
- return Status.CANCEL_STATUS;
- }
- refreshDetailPaneContents();
- return Status.OK_STATUS;
- }
- };
-
- /**
- * Selection provider registered with the view site.
- */
- private SelectionProviderWrapper fSelectionProvider;
-
- /**
- * Remove myself as a selection listener
- * and preference change listener.
- *
- * @see IWorkbenchPart#dispose()
- */
- public void dispose() {
-
- DebugUITools.getDebugContextManager().getContextService(getSite().getWorkbenchWindow()).removeDebugContextListener(this);
- getSite().getWorkbenchWindow().removePerspectiveListener(this);
- DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
- JFaceResources.getFontRegistry().removeListener(this);
- TreeModelViewer viewer = getVariablesViewer();
- if (viewer != null) {
- viewer.removeModelChangedListener(this);
- viewer.removeViewerUpdateListener(this);
- }
- if (fDetailPane != null) fDetailPane.dispose();
- fInputService.dispose();
- fSelectionProvider.dispose();
- super.dispose();
- }
-
- /**
- * Called when the viewer input update is completed. Unlike
- * {@link #setViewerInput(Object)}, it allows overriding classes
- * to examine the context for which the update was calculated.
- *
- * @param update Completed viewer input update.
- */
- protected void viewerInputUpdateComplete(IViewerInputUpdate update) {
- setViewerInput(update.getInputElement());
- updateAction(VARIABLES_FIND_ELEMENT_ACTION);
- updateAction(FIND_ACTION);
- }
-
- /**
- * Sets the input to the viewer
- * @param context the object context
- */
- protected void setViewerInput(Object context) {
- if (context == null) {
- // Clear the detail pane
- fDetailPane.display(null);
- }
-
- Object current = getViewer().getInput();
-
- if (current == null && context == null) {
- return;
- }
-
- if (current != null && current.equals(context)) {
- return;
- }
-
- showViewer();
- getViewer().setInput(context);
- }
-
- /**
- * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- String propertyName= event.getProperty();
- if (propertyName.equals(IDebugUIConstants.PREF_CHANGED_DEBUG_ELEMENT_COLOR) ||
- propertyName.equals(IDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND) ||
- propertyName.equals(IDebugUIConstants.PREF_VARIABLE_TEXT_FONT)) {
- getViewer().refresh();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#createViewer(Composite)
- */
- public Viewer createViewer(Composite parent) {
-
- fTriggerDetailsJob.setSystem(true);
-
- // create the sash form that will contain the tree viewer & text viewer
- fSashForm = new SashForm(parent, SWT.NONE);
-
- fModelPresentation = new VariablesViewModelPresentation();
- DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
- JFaceResources.getFontRegistry().addListener(this);
-
- TreeModelViewer variablesViewer = createTreeViewer(fSashForm);
- fInputService = new ViewerInputService(variablesViewer, fRequester);
-
- fSashForm.setMaximizedControl(variablesViewer.getControl());
-
- fSelectionProvider = new SelectionProviderWrapper(variablesViewer);
- getSite().setSelectionProvider(fSelectionProvider);
-
- fDetailPane = new DetailPaneProxy(this);
- fDetailPane.display(null); // Bring up the default pane so the user doesn't see an empty composite
-
- createOrientationActions(variablesViewer);
- IPreferenceStore prefStore = DebugUIPlugin.getDefault().getPreferenceStore();
- String orientation = prefStore.getString(getDetailPanePreferenceKey());
- for (int i = 0; i < fToggleDetailPaneActions.length; i++) {
- fToggleDetailPaneActions[i].setChecked(fToggleDetailPaneActions[i].getOrientation().equals(orientation));
- }
- setDetailPaneOrientation(orientation);
- IMemento memento = getMemento();
- if (memento != null) {
- variablesViewer.initState(memento);
- }
-
- variablesViewer.addModelChangedListener(this);
- variablesViewer.addViewerUpdateListener(this);
-
- initDragAndDrop(variablesViewer);
-
- return variablesViewer;
- }
-
- /**
- * Initializes the drag and/or drop adapters for this view. Called from createViewer().
- *
- * @param viewer the viewer to add drag/drop support to.
- * @since 3.4
- */
- protected void initDragAndDrop(TreeModelViewer viewer) {
- // Drag only
- viewer.addDragSupport(DND.DROP_COPY, new Transfer[] {LocalSelectionTransfer.getTransfer()}, new SelectionDragAdapter(viewer));
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewPart#init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento)
- */
- public void init(IViewSite site, IMemento memento) throws PartInitException {
- super.init(site, memento);
- PREF_STATE_MEMENTO = PREF_STATE_MEMENTO + site.getId();
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- String string = store.getString(PREF_STATE_MEMENTO);
- if(string.length() > 0) {
- ByteArrayInputStream bin = new ByteArrayInputStream(string.getBytes());
- InputStreamReader reader = new InputStreamReader(bin);
- try {
- XMLMemento stateMemento = XMLMemento.createReadRoot(reader);
- setMemento(stateMemento);
- } catch (WorkbenchException e) {
- } finally {
- try {
- reader.close();
- bin.close();
- } catch (IOException e){}
- }
- }
- IMemento mem = getMemento();
- // check the weights to makes sure they are valid -- bug 154025
- setLastSashWeights(DEFAULT_SASH_WEIGHTS);
- if (mem != null) {
- Integer sw = mem.getInteger(SASH_VIEW_PART);
- if(sw != null) {
- int view = sw.intValue();
- sw = mem.getInteger(SASH_DETAILS_PART);
- if(sw != null) {
- int details = sw.intValue();
- if(view > -1 & details > -1) {
- setLastSashWeights(new int[] {view, details});
- }
- }
- }
- }
- site.getWorkbenchWindow().addPerspectiveListener(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.PageBookView#partDeactivated(org.eclipse.ui.IWorkbenchPart)
- */
- public void partDeactivated(IWorkbenchPart part) {
- String id = part.getSite().getId();
- if (id.equals(getSite().getId())) {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- OutputStreamWriter writer = new OutputStreamWriter(bout);
-
- try {
- XMLMemento memento = XMLMemento.createWriteRoot("VariablesViewMemento"); //$NON-NLS-1$
- saveViewerState(memento);
- memento.save(writer);
-
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- String xmlString = bout.toString();
- store.putValue(PREF_STATE_MEMENTO, xmlString);
- } catch (IOException e) {
- } finally {
- try {
- writer.close();
- bout.close();
- } catch (IOException e) {
- }
- }
- }
- super.partDeactivated(part);
- }
-
- /**
- * Saves the current state of the viewer
- * @param memento the memento to write the viewer state into
- */
- public void saveViewerState(IMemento memento) {
- if (fSashForm != null && !fSashForm.isDisposed()) {
- int[] weights = fSashForm.getWeights();
- memento.putInteger(SASH_VIEW_PART, weights[0]);
- memento.putInteger(SASH_DETAILS_PART, weights[1]);
- }
- getVariablesViewer().saveState(memento);
- }
-
- /**
- * @return the pref key for the variables view details pane
- */
- protected String getDetailPanePreferenceKey() {
- return IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_ORIENTATION;
- }
-
- /**
- * Create and return the main tree viewer that displays variable.
- */
- protected TreeModelViewer createTreeViewer(Composite parent) {
-
- int style = getViewerStyle();
- final TreeModelViewer variablesViewer = new TreeModelViewer(parent, style,
- new DebugModelPresentationContext(getPresentationContextId(), fModelPresentation));
-
- variablesViewer.getControl().addFocusListener(new FocusAdapter() {
- public void focusGained(FocusEvent e) {
- fTreeHasFocus = true;
- fSelectionProvider.setActiveProvider(variablesViewer);
- setAction(SELECT_ALL_ACTION, getAction(VARIABLES_SELECT_ALL_ACTION));
- setAction(COPY_ACTION, getAction(VARIABLES_COPY_ACTION));
- setAction(FIND_ACTION, getAction(VARIABLES_FIND_ELEMENT_ACTION));
- getViewSite().getActionBars().updateActionBars();
- }
-
- public void focusLost(FocusEvent e){
- fSelectionProvider.setActiveProvider(null);
- setAction(SELECT_ALL_ACTION, null);
- setAction(COPY_ACTION,null);
- setAction(FIND_ACTION, null);
- getViewSite().getActionBars().updateActionBars();
- }
- });
- variablesViewer.getPresentationContext().addPropertyChangeListener(
- new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (IPresentationContext.PROPERTY_COLUMNS.equals(event.getProperty())) {
- IAction action = getAction("ShowTypeNames"); //$NON-NLS-1$
- if (action != null) {
- action.setEnabled(event.getNewValue() == null);
- }
- }
- }
- });
-
- variablesViewer.addPostSelectionChangedListener(getTreeSelectionChangedListener());
- DebugUITools.getDebugContextManager().getContextService(getSite().getWorkbenchWindow()).addDebugContextListener(this);
- return variablesViewer;
- }
-
- /**
- * Returns the presentation context id for this view.
- *
- * @return context id
- */
- protected String getPresentationContextId() {
- return IDebugUIConstants.ID_VARIABLE_VIEW;
- }
-
- /**
- * Returns the style bits for the viewer.
- *
- * @return SWT style
- */
- protected int getViewerStyle() {
- return SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.VIRTUAL | SWT.FULL_SELECTION;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.VARIABLE_VIEW;
- }
-
- /**
- * Set the orientation of the details pane so that is one of:
- * - underneath the main tree view
- * - to the right of the main tree view
- * - not visible
- */
- public void setDetailPaneOrientation(String orientation) {
- if (orientation.equals(fCurrentDetailPaneOrientation)) {
- return;
- }
- if (orientation.equals(IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_HIDDEN)) {
- hideDetailPane();
- } else {
- int vertOrHoriz = orientation.equals(IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_UNDERNEATH) ? SWT.VERTICAL : SWT.HORIZONTAL;
- fSashForm.setOrientation(vertOrHoriz);
- if (IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_HIDDEN.equals(fCurrentDetailPaneOrientation)) {
- showDetailPane();
- }
- }
- fCurrentDetailPaneOrientation = orientation;
- DebugUIPlugin.getDefault().getPreferenceStore().setValue(getDetailPanePreferenceKey(), orientation);
- }
-
- /**
- * Hides the details pane
- */
- private void hideDetailPane() {
- if (fToggledDetailOnce) {
- setLastSashWeights(fSashForm.getWeights());
- }
- fSashForm.setMaximizedControl(getViewer().getControl());
- }
-
- /**
- * Shows the details pane
- */
- private void showDetailPane() {
- fSashForm.setMaximizedControl(null);
- fSashForm.setWeights(getLastSashWeights());
- refreshDetailPaneContents();
- revealTreeSelection();
- fToggledDetailOnce = true;
- }
-
- /**
- * Make sure the currently selected item in the tree is visible.
- */
- protected void revealTreeSelection() {
- StructuredViewer viewer = (StructuredViewer) getViewer();
- if (viewer != null) {
- ISelection selection = viewer.getSelection();
- if (selection instanceof IStructuredSelection) {
- Object selected = ((IStructuredSelection)selection).getFirstElement();
- if (selected != null) {
- viewer.reveal(selected);
- }
- }
- }
- }
-
- /**
- * Return the relative weights that were in effect the last time both panes were
- * visible in the sash form, or the default weights if:
- * <ul>
- * <li> both panes have not yet been made visible</li>
- * <li> one of the values persisted before is an invalid value</li>
- * </ul>
- */
- protected int[] getLastSashWeights() {
- if (fLastSashWeights == null) {
- fLastSashWeights = DEFAULT_SASH_WEIGHTS;
- }
- //check the weights to makes sure they are valid -- bug 154025
- else if(fLastSashWeights[0] < 0 || fLastSashWeights[1] < 0) {
- fLastSashWeights = DEFAULT_SASH_WEIGHTS;
- }
- return fLastSashWeights;
- }
-
- /**
- * Set the current relative weights of the controls in the sash form, so that
- * the sash form can be reset to this layout at a later time.
- */
- protected void setLastSashWeights(int[] weights) {
- fLastSashWeights = weights;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#createActions()
- */
- protected void createActions() {
- IAction action = new ShowTypesAction(this);
- setAction("ShowTypeNames",action); //$NON-NLS-1$
-
- action = new ToggleLogicalStructureAction(this);
- setAction("ToggleContentProviders", action); //$NON-NLS-1$
-
- action = new CollapseAllAction((TreeViewer)getViewer());
- setAction("CollapseAll", action); //$NON-NLS-1$
- IHandlerService hs = (IHandlerService) getSite().getService(IHandlerService.class);
- if (hs != null) {
- hs.activateHandler(CollapseAllHandler.COMMAND_ID, new ActionHandler(action));
- }
-
- action = new ChangeVariableValueAction(this);
- action.setEnabled(false);
- setAction("ChangeVariableValue", action); //$NON-NLS-1$
-
- action= new VirtualFindAction(getVariablesViewer());
- setAction(VARIABLES_FIND_ELEMENT_ACTION, action);
- }
-
- /* (non-Javadoc)
- *
- * Save the copy action so we can restore it on focus lost/gain
- *
- * @see org.eclipse.debug.ui.AbstractDebugView#createContextMenu(org.eclipse.swt.widgets.Control)
- */
- protected void createContextMenu(Control menuControl) {
- super.createContextMenu(menuControl);
- setAction(VARIABLES_COPY_ACTION, getAction(COPY_ACTION));
- }
-
- /**
- * Creates the actions that allow the orientation of the detail pane to be changed.
- *
- * @param viewer
- */
- private void createOrientationActions(TreeModelViewer viewer) {
- IActionBars actionBars = getViewSite().getActionBars();
- IMenuManager viewMenu = actionBars.getMenuManager();
-
- fToggleDetailPaneActions = new ToggleDetailPaneAction[3];
- fToggleDetailPaneActions[0] = new ToggleDetailPaneAction(this, IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_UNDERNEATH, null);
- fToggleDetailPaneActions[1] = new ToggleDetailPaneAction(this, IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_RIGHT, null);
- fToggleDetailPaneActions[2] = new ToggleDetailPaneAction(this, IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_HIDDEN, getToggleActionLabel());
- viewMenu.add(new Separator());
- final MenuManager layoutSubMenu = new MenuManager(VariablesViewMessages.VariablesView_40);
- layoutSubMenu.setRemoveAllWhenShown(true);
- layoutSubMenu.add(fToggleDetailPaneActions[0]);
- layoutSubMenu.add(fToggleDetailPaneActions[1]);
- layoutSubMenu.add(fToggleDetailPaneActions[2]);
- viewMenu.add(layoutSubMenu);
- viewMenu.add(new Separator());
-
- fConfigureColumnsAction = new ConfigureColumnsAction(viewer);
- setAction("ToggleColmns", new ToggleShowColumnsAction(viewer)); //$NON-NLS-1$
-
- layoutSubMenu.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- layoutSubMenu.add(fToggleDetailPaneActions[0]);
- layoutSubMenu.add(fToggleDetailPaneActions[1]);
- layoutSubMenu.add(fToggleDetailPaneActions[2]);
- IAction action = getAction("ToggleColmns"); //$NON-NLS-1$
- ((IUpdate)action).update();
- if (action.isEnabled()) {
- layoutSubMenu.add(action);
- }
- fConfigureColumnsAction.update();
- if (fConfigureColumnsAction.isEnabled()) {
- layoutSubMenu.add(fConfigureColumnsAction);
- }
- }
- });
- }
-
- /**
- * Returns the label to use for the action that toggles the view layout to be the tree viewer only (detail pane is hidden).
- * Should be of the style '[view name] View Only'.
- *
- * @return action label for toggling the view layout to tree viewer only
- */
- protected String getToggleActionLabel(){
- return VariablesViewMessages.VariablesView_41;
- }
-
- /**
- * Configures the toolBar.
- *
- * @param tbm The toolbar that will be configured
- */
- protected void configureToolBar(IToolBarManager tbm) {
- tbm.add(new Separator(this.getClass().getName()));
- tbm.add(new Separator(IDebugUIConstants.RENDER_GROUP));
- tbm.add(getAction("ShowTypeNames")); //$NON-NLS-1$
- tbm.add(getAction("ToggleContentProviders")); //$NON-NLS-1$
- tbm.add(getAction("CollapseAll")); //$NON-NLS-1$
- }
-
- /**
- * Adds items to the tree viewer's context menu including any extension defined
- * actions.
- *
- * @param menu The menu to add the item to.
- */
- protected void fillContextMenu(IMenuManager menu) {
-
- menu.add(new Separator(IDebugUIConstants.EMPTY_VARIABLE_GROUP));
- menu.add(new Separator(IDebugUIConstants.VARIABLE_GROUP));
- menu.add(getAction(VARIABLES_FIND_ELEMENT_ACTION));
- menu.add(getAction("ChangeVariableValue")); //$NON-NLS-1$
- menu.add(new Separator());
- IAction action = new AvailableLogicalStructuresAction(this);
- if (action.isEnabled()) {
- menu.add(action);
- }
- action = new AvailableDetailPanesAction(this);
- if (isDetailPaneVisible() && action.isEnabled()) {
- menu.add(action);
- }
- menu.add(new Separator(IDebugUIConstants.EMPTY_RENDER_GROUP));
- menu.add(new Separator(IDebugUIConstants.EMPTY_NAVIGATION_GROUP));
- menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
-
- /**
- * Lazily instantiate and return a selection listener that populates the detail pane,
- * but only if the detail is currently visible.
- */
- protected ISelectionChangedListener getTreeSelectionChangedListener() {
- if (fTreeSelectionChangedListener == null) {
- fTreeSelectionChangedListener = new ISelectionChangedListener() {
- public void selectionChanged(final SelectionChangedEvent event) {
- if (event.getSelectionProvider().equals(getViewer())) {
- clearStatusLine();
- // if the detail pane is not visible, don't waste time retrieving details
- if (fSashForm.getMaximizedControl() == getViewer().getControl()) {
- return;
- }
- refreshDetailPaneContents();
- treeSelectionChanged(event);
- }
- }
- };
- }
- return fTreeSelectionChangedListener;
- }
-
- /**
- * Selection in the variable tree changed. Perform any updates.
- *
- * @param event
- */
- protected void treeSelectionChanged(SelectionChangedEvent event) {}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getCurrentPaneID()
- */
- public String getCurrentPaneID() {
- return fDetailPane.getCurrentPaneID();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getCurrentSelection()
- */
- public IStructuredSelection getCurrentSelection() {
- if (getViewer() != null){
- return (IStructuredSelection)getViewer().getSelection();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getParentComposite()
- */
- public Composite getParentComposite() {
- return fSashForm;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getWorkbenchPartSite()
- */
- public IWorkbenchPartSite getWorkbenchPartSite() {
- return getSite();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#refreshDetailPaneContents()
- */
- public void refreshDetailPaneContents() {
- fDetailPane.display(getCurrentSelection());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#paneChanged(java.lang.String)
- */
- public void paneChanged(String newPaneID) {
- if (fDetailPaneActivatedListener == null){
- fDetailPaneActivatedListener = new Listener() {
- public void handleEvent(Event event) {
- fTreeHasFocus = false;
- }
- };
- }
- fDetailPane.getCurrentControl().addListener(SWT.Activate, fDetailPaneActivatedListener);
- }
-
- /**
- * @return the model presentation to be used for this view
- */
- protected IDebugModelPresentation getModelPresentation() {
- if (fModelPresentation == null) {
- fModelPresentation = new VariablesViewModelPresentation();
- }
- return fModelPresentation;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.WorkbenchPart#getAdapter(Class)
- */
- public Object getAdapter(Class required) {
- if (IDebugModelPresentation.class.equals(required)) {
- return getModelPresentation();
- }
- else if (fDetailPane != null){
- Object adapter = fDetailPane.getAdapter(required);
- if (adapter != null) return adapter;
- }
- return super.getAdapter(required);
- }
-
- /**
- * If possible, calls the update method of the action associated with the given ID.
- *
- * @param actionId the ID of the action to update
- */
- protected void updateAction(String actionId) {
- IAction action= getAction(actionId);
- if (action instanceof IUpdate) {
- ((IUpdate) action).update();
- }
- }
-
- /**
- * @return whether the detail pane is visible to the user
- */
- protected boolean isDetailPaneVisible() {
- return !fToggleDetailPaneActions[2].isChecked();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#getDefaultControl()
- */
- protected Control getDefaultControl() {
- return fSashForm;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.IDebugExceptionHandler#handleException(org.eclipse.debug.core.DebugException)
- */
- public void handleException(DebugException e) {
- showMessage(e.getMessage());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener#contextEvent(org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent)
- */
- public void debugContextChanged(DebugContextEvent event) {
- if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
- contextActivated(event.getContext());
- }
- }
-
- /**
- * Updates actions and sets the viewer input when a context is activated.
- * @param selection
- */
- protected void contextActivated(ISelection selection) {
- if (!isAvailable() || !isVisible()) {
- return;
- }
- if (selection instanceof IStructuredSelection) {
- Object source = ((IStructuredSelection)selection).getFirstElement();
- fInputService.resolveViewerInput(source);
- }
- }
-
- /**
- * Delegate to the <code>DOUBLE_CLICK_ACTION</code>,
- * if any.
- *
- * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(DoubleClickEvent)
- */
- public void doubleClick(DoubleClickEvent event) {
- IAction action = getAction(DOUBLE_CLICK_ACTION);
- if (action != null && action.isEnabled()) {
- action.run();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDebugView#getPresentation(String)
- */
- public IDebugModelPresentation getPresentation(String id) {
- if (getViewer() instanceof StructuredViewer) {
- IDebugModelPresentation lp = getModelPresentation();
- if (lp instanceof DelegatingModelPresentation) {
- return ((DelegatingModelPresentation)lp).getPresentation(id);
- }
- if (lp instanceof LazyModelPresentation) {
- if (((LazyModelPresentation)lp).getDebugModelIdentifier().equals(id)) {
- return lp;
- }
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDetailSite#isMainViewerAvailable()
- */
- public boolean isMainViewerAvailable() {
- return isAvailable();
- }
-
- /**
- * @return the presentation context of the viewer
- */
- protected IPresentationContext getPresentationContext() {
- return getVariablesViewer().getPresentationContext();
- }
-
- /**
- * Sets whether logical structures are being displayed
- */
- public void setShowLogicalStructure(boolean flag) {
- getPresentationContext().setProperty(PRESENTATION_SHOW_LOGICAL_STRUCTURES, Boolean.valueOf(flag));
- }
-
- /**
- * Returns whether logical structures are being displayed
- */
- public boolean isShowLogicalStructure() {
- Boolean show = (Boolean) getPresentationContext().getProperty(PRESENTATION_SHOW_LOGICAL_STRUCTURES);
- return show != null && show.booleanValue();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#becomesHidden()
- */
- protected void becomesHidden() {
- fInputService.resolveViewerInput(null);
- super.becomesHidden();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractDebugView#becomesVisible()
- */
- protected void becomesVisible() {
- super.becomesVisible();
- ISelection selection = DebugUITools.getDebugContextManager().getContextService(getSite().getWorkbenchWindow()).getActiveContext();
- contextActivated(selection);
- }
-
- /**
- * @return the tree model viewer displaying variables
- */
- protected TreeModelViewer getVariablesViewer() {
- return (TreeModelViewer) getViewer();
- }
-
- /**
- * Clears the status line of all messages and errors
- */
- protected void clearStatusLine() {
- IStatusLineManager manager = getViewSite().getActionBars().getStatusLineManager();
- manager.setErrorMessage(null);
- manager.setMessage(null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveListener#perspectiveActivated(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor)
- */
- public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) {}
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPerspectiveListener#perspectiveChanged(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor, java.lang.String)
- */
- public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) {
- if(changeId.equals(IWorkbenchPage.CHANGE_RESET)) {
- setLastSashWeights(DEFAULT_SASH_WEIGHTS);
- fSashForm.setWeights(DEFAULT_SASH_WEIGHTS);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.provisional.IModelChangedListener#modelChanged(org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta)
- */
- public void modelChanged(IModelDelta delta, IModelProxy proxy) {
- fVisitor.reset();
- delta.accept(fVisitor);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#updateComplete(org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor)
- */
- public void updateComplete(IViewerUpdate update) {
- IStatus status = update.getStatus();
- if (!update.isCanceled()) {
- if (status != null && !status.isOK()) {
- showMessage(status.getMessage());
- } else {
- showViewer();
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#updateStarted(org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor)
- */
- public void updateStarted(IViewerUpdate update) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#viewerUpdatesBegin()
- */
- public synchronized void viewerUpdatesBegin() {
- fTriggerDetailsJob.cancel();
- IWorkbenchSiteProgressService progressService =
- (IWorkbenchSiteProgressService)getSite().getAdapter(IWorkbenchSiteProgressService.class);
- if (progressService != null) {
- progressService.incrementBusy();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#viewerUpdatesComplete()
- */
- public synchronized void viewerUpdatesComplete() {
- if (fVisitor.isTriggerDetails()) {
- fTriggerDetailsJob.schedule();
- }
- IWorkbenchSiteProgressService progressService =
- (IWorkbenchSiteProgressService)getSite().getAdapter(IWorkbenchSiteProgressService.class);
- if (progressService != null) {
- progressService.decrementBusy();
- }
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchPart#setFocus()
- */
- public void setFocus() {
- boolean success = false;
- if (!fTreeHasFocus && fDetailPane != null){
- success = fDetailPane.setFocus();
- }
- // Unless the detail pane successfully set focus to a control, set focus to the variables tree
- if (!success && getViewer() != null){
- getViewer().getControl().setFocus();
- }
- }
-
- protected ToggleDetailPaneAction getToggleDetailPaneAction(String orientation)
- {
- for (int i=0; i<fToggleDetailPaneActions.length; i++)
- if (fToggleDetailPaneActions[i].getOrientation().equals(orientation))
- return fToggleDetailPaneActions[i];
-
- return null;
- }
-
- /*
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer2#setSelectionProvider(org.eclipse.jface.viewers.ISelectionProvider)
- */
- public void setSelectionProvider(ISelectionProvider provider) {
- // Workaround for legacy detail pane implementations (bug 254442)
- // set selection provider wrapper again in case it got overridden by detail pane
- getSite().setSelectionProvider(fSelectionProvider);
- // change active provider
- fSelectionProvider.setActiveProvider(provider);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesViewMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesViewMessages.java
deleted file mode 100644
index a04213500..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesViewMessages.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables;
-
-import org.eclipse.osgi.util.NLS;
-
-public class VariablesViewMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.views.variables.VariablesViewMessages";//$NON-NLS-1$
-
- public static String DetailPaneMaxLengthDialog_0;
- public static String DetailPaneMaxLengthDialog_1;
- public static String DetailPaneMaxLengthDialog_2;
- public static String DetailPaneMaxLengthDialog_3;
- public static String LogicalStructureCache_0;
- public static String ToggleObjectBrowsersAction_1;
- public static String VariablesView_41;
- public static String ExpressionView_4;
-
- public static String AvailableLogicalStructuresAction_0;
- public static String AvailableLogicalStructuresAction_1;
-
- static {
- // load message values from bundle file
- NLS.initializeMessages(BUNDLE_NAME, VariablesViewMessages.class);
- }
-
- public static String VariablesView_40;
-
- public static String ToggleShowColumnsAction_0;
-
- public static String ToggleShowColumnsAction_1;
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesViewMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesViewMessages.properties
deleted file mode 100644
index ce19e10cd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesViewMessages.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2009 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-ToggleObjectBrowsersAction_1=Show Logical Structure
-ToggleShowColumnsAction_0=&Show Columns
-ToggleShowColumnsAction_1=Show Columns
-VariablesView_41=Variables Only
-VariablesView_40=&Layout
-ExpressionView_4=Expressions View Only
-
-AvailableLogicalStructuresAction_0=Select From Available Logical Structures
-AvailableLogicalStructuresAction_1=&Show Structure As
-DetailPaneMaxLengthDialog_0=Configure Details Pane
-DetailPaneMaxLengthDialog_1=&Maximum characters to display in details pane (0 = unlimited):
-DetailPaneMaxLengthDialog_2=Integer must be non-negative
-DetailPaneMaxLengthDialog_3=Enter an integer
-LogicalStructureCache_0=Logical structure canceled
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesViewResourceBundleMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesViewResourceBundleMessages.properties
deleted file mode 100644
index 8238898e0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesViewResourceBundleMessages.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-find_replace_action_label=&Find/Replace...
-find_replace_action_tooltip=Find/Replace
-find_replace_action_image=
-find_replace_action_description=Find/Replace
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AbstractDetailPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AbstractDetailPane.java
deleted file mode 100644
index 51394aa3d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AbstractDetailPane.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River - Anton Leherbauer - Fix selection provider (Bug 254442)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables.details;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.debug.ui.IDetailPane;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * Abstract class that holds common methods used by implementors of IDetailPane.
- *
- * @see DefaultDetailPane
- * @since 3.3
- */
-public abstract class AbstractDetailPane implements IDetailPane {
-
- /**
- * The <code>IWorkbenchPartSite</code> that the details area (and the
- * variables view) belongs to.
- */
- private IWorkbenchPartSite fWorkbenchPartSite;
-
- /**
- * Map of actions. Keys are strings, values
- * are <code>IAction</code>.
- */
- private Map fActionMap = new HashMap();
-
- /**
- * Collection to track actions that should be updated when selection occurs.
- */
- private List fSelectionActions = new ArrayList();
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDetailPane#init(org.eclipse.ui.IWorkbenchPartSite)
- */
- public void init(IWorkbenchPartSite workbench) {
- fWorkbenchPartSite = workbench;
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDetailPane#dispose()
- */
- public void dispose() {
- fActionMap.clear();
- fSelectionActions.clear();
- }
-
- /**
- * Adds an action to the Map storing actions. Removes it if action is null.
- *
- * @param actionID The ID of the action, used as the key in the Map
- * @param action The action associated with the ID
- */
- protected void setAction(String actionID, IAction action) {
- if (action == null) {
- fActionMap.remove(actionID);
- } else {
- fActionMap.put(actionID, action);
- }
- }
-
- /**
- * Adds the given action to the global action handler for the ViewSite.
- * A call to <code>updateActionBars()</code> must be called after changes
- * to propagate changes through the workbench.
- *
- * @param actionID The ID of the action
- * @param action The action to be set globally
- */
- protected void setGlobalAction(String actionID, IAction action){
- getViewSite().getActionBars().setGlobalActionHandler(actionID, action);
- }
-
- /**
- * Adds the given action to the list of actions that will be updated when
- * <code>updateSelectionDependentActions()</code> is called. If the string
- * is null it will not be added to the list.
- *
- * @param actionID The ID of the action which should be updated
- */
- protected void setSelectionDependantAction(String actionID){
- if (actionID != null) fSelectionActions.add(actionID);
- }
-
- /**
- * Gets the action out of the map, casts it to an <code>IAction</code>
- *
- * @param actionID The ID of the action to find
- * @return The action associated with the ID or null if none is found.
- */
- protected IAction getAction(String actionID) {
- return (IAction) fActionMap.get(actionID);
- }
-
- /**
- * Calls the update method of the action with the given action ID.
- * The action must exist in the action map and must be an instance of
- * </code>IUpdate</code>
- *
- * @param actionId The ID of the action to update
- */
- protected void updateAction(String actionId) {
- IAction action= getAction(actionId);
- if (action instanceof IUpdate) {
- ((IUpdate) action).update();
- }
- }
-
- /**
- * Iterates through the list of selection dependent actions and
- * updates them. Use <code>setSelectionDependentAction(String actionID)</code>
- * to add an action to the list. The action must have been added to the known
- * actions map by calling <code>setAction(String actionID, IAction action)</code>
- * before it can be updated by this method.
- */
- protected void updateSelectionDependentActions() {
- Iterator iterator= fSelectionActions.iterator();
- while (iterator.hasNext()) {
- updateAction((String)iterator.next());
- }
- }
-
- /**
- * Gets the view site for this view. May be null if this detail pane
- * is not part of a view.
- *
- * @return The site for this view or <code>null</code>
- */
- protected IViewSite getViewSite(){
- if (fWorkbenchPartSite == null){
- return null;
- } else {
- return (IViewSite) fWorkbenchPartSite.getPart().getSite();
- }
- }
-
- /**
- * Gets the workbench part site for this view. May be null if this detail pane
- * is not part of a view.
- *
- * @return The workbench part site or <code>null</code>
- */
- protected IWorkbenchPartSite getWorkbenchPartSite() {
- return fWorkbenchPartSite;
- }
-
- /**
- * Returns whether this detail pane is being displayed in a view with a workbench part site.
- *
- * @return whether this detail pane is being displayed in a view with a workbench part site.
- */
- protected boolean isInView(){
- return fWorkbenchPartSite != null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AvailableDetailPanesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AvailableDetailPanesAction.java
deleted file mode 100644
index eb0700285..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AvailableDetailPanesAction.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables.details;
-
-
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Drop down action that displays the available detail panes for a selection.
- *
- * @since 3.3
- * @see IDetailPaneContainer
- */
-public class AvailableDetailPanesAction extends Action implements IMenuCreator {
-
- private Menu fMenu;
- private Set fAvailableIDs;
- private IDetailPaneContainer fDetailPaneContainer;
-
- /**
- * Each entry in the menu will be of this type. It represents one possible detail pane
- * that the user can select. If the user selects it, the display is changed to use that
- * detail pane and the preferred detail pane map in the pane manager is updated.
- *
- * @see DetailPaneManager
- * @since 3.3
- */
- private class SetDetailPaneAction extends Action {
-
- private String fPaneID;
- private Set fPossiblePaneIDs;
-
- public SetDetailPaneAction(String name, String paneID, Set possiblePaneIDs){
- super(name,AS_RADIO_BUTTON);
- fPaneID = paneID;
- fPossiblePaneIDs = possiblePaneIDs;
- }
-
- public void run() {
- // Don't change panes unless the user is selecting a different pane than the one currently displayed
- if (isChecked() && !fDetailPaneContainer.getCurrentPaneID().equals(fPaneID)){
- DetailPaneManager.getDefault().setPreferredDetailPane(fPossiblePaneIDs, fPaneID);
- fDetailPaneContainer.refreshDetailPaneContents();
- }
- }
-
- }
-
- public AvailableDetailPanesAction(IDetailPaneContainer detailPaneContainer) {
- fDetailPaneContainer = detailPaneContainer;
- setText(DetailMessages.AvailableDetailPanesAction_0);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.VARIABLES_SELECT_DETAIL_PANE);
-
- setEnabled(false);
- setMenuCreator(this);
- init();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#dispose()
- */
- public void dispose() {
- if (fMenu != null) {
- fMenu.dispose();
- }
- fAvailableIDs.clear();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
- */
- public Menu getMenu(Control parent) {
- return null;
- }
-
- protected void addActionToMenu(Menu parent, IAction action) {
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(parent, -1);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
- */
- public Menu getMenu(Menu parent) {
- if (fMenu != null) {
- fMenu.dispose();
- }
-
- fMenu= new Menu(parent);
-
- Iterator iter = fAvailableIDs.iterator();
- int i = 0;
- while (iter.hasNext()) {
- String currentID = (String) iter.next();
-
- StringBuffer name = new StringBuffer();
- //add the numerical accelerator
- i++;
- if (i < 9) {
- name.append('&');
- name.append(i);
- name.append(' ');
- }
-
- String typeName = DetailPaneManager.getDefault().getNameFromID(currentID);
- if (typeName != null && typeName.length() > 0){
- name.append(typeName);
- } else {
- name.append(currentID);
- }
-
- IAction action = new SetDetailPaneAction(name.toString(),currentID,fAvailableIDs);
-
- if (currentID.equals(fDetailPaneContainer.getCurrentPaneID())){
- action.setChecked(true);
- }
-
- addActionToMenu(fMenu, action);
- }
-
- return fMenu;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void init() {
- fAvailableIDs = DetailPaneManager.getDefault().getAvailablePaneIDs(fDetailPaneContainer.getCurrentSelection());
- if (fAvailableIDs.size() > 1){
- setEnabled(true);
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java
deleted file mode 100644
index 7b55abc0c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java
+++ /dev/null
@@ -1,984 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * QNX Software Systems - Mikhail Khodjaiants - Registers View (Bug 53640)
- * Wind River - Anton Leherbauer - Fix selection provider (Bug 254442)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables.details;
-
-import java.util.Iterator;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.commands.operations.IUndoContext;
-
-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.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.LazyModelPresentation;
-import org.eclipse.debug.internal.ui.VariablesViewModelPresentation;
-import org.eclipse.debug.internal.ui.actions.variables.details.DetailPaneAssignValueAction;
-import org.eclipse.debug.internal.ui.actions.variables.details.DetailPaneMaxLengthAction;
-import org.eclipse.debug.internal.ui.actions.variables.details.DetailPaneWordWrapAction;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.internal.ui.views.variables.IndexedValuePartition;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.IDebugView;
-import org.eclipse.debug.ui.IDetailPane2;
-import org.eclipse.debug.ui.IValueDetailListener;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.action.StatusLineContributionItem;
-import org.eclipse.jface.commands.ActionHandler;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.IFindReplaceTarget;
-import org.eclipse.jface.text.ITextOperationTarget;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.IUndoManager;
-import org.eclipse.jface.text.IUndoManagerExtension;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-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.swt.SWT;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchCommandConstants;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.console.actions.TextViewerAction;
-import org.eclipse.ui.handlers.IHandlerActivation;
-import org.eclipse.ui.handlers.IHandlerService;
-import org.eclipse.ui.operations.OperationHistoryActionHandler;
-import org.eclipse.ui.operations.RedoActionHandler;
-import org.eclipse.ui.operations.UndoActionHandler;
-import org.eclipse.ui.progress.WorkbenchJob;
-
-import org.eclipse.ui.texteditor.FindReplaceAction;
-import org.eclipse.ui.texteditor.IAbstractTextEditorHelpContextIds;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * This detail pane uses a source viewer to display detailed information about the current
- * selection. It incorporates a large number of actions into its context menu. It is the
- * default detail pane.
- *
- * @see DefaultDetailPaneFactory
- * @since 3.3
- *
- */
-public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane2, IAdaptable, IPropertyChangeListener{
-
- /**
- * These are the IDs for the actions in the context menu
- */
- protected static final String DETAIL_COPY_ACTION = ActionFactory.COPY.getId() + ".SourceDetailPane"; //$NON-NLS-1$
- protected static final String DETAIL_SELECT_ALL_ACTION = IDebugView.SELECT_ALL_ACTION + ".SourceDetailPane"; //$NON-NLS-1$
- protected static final String DETAIL_PASTE_ACTION = ActionFactory.PASTE.getId();
- protected static final String DETAIL_CUT_ACTION = ActionFactory.CUT.getId();
-
- protected static final String DETAIL_FIND_REPLACE_TEXT_ACTION = "FindReplaceText"; //$NON-NLS-1$
- protected static final String DETAIL_CONTENT_ASSIST_ACTION = "ContentAssist"; //$NON-NLS-1$
- protected static final String DETAIL_ASSIGN_VALUE_ACTION = "AssignValue"; //$NON-NLS-1$
-
- protected static final String DETAIL_WORD_WRAP_ACTION = IDebugPreferenceConstants.PREF_DETAIL_PANE_WORD_WRAP;
- protected static final String DETAIL_MAX_LENGTH_ACTION = "MaxLength"; //$NON-NLS-1$
-
- /**
- * The ID, name and description of this pane are stored in constants so that the class
- * does not have to be instantiated to access them.
- */
- public static final String ID = DetailMessages.DefaultDetailPane_0;
- public static final String NAME = DetailMessages.DefaultDetailPane_1;
- public static final String DESCRIPTION = DetailMessages.DefaultDetailPane_57;
-
- /**
- * Data structure for the position label value.
- */
- private static class PositionLabelValue {
-
- public int fValue;
-
- public String toString() {
- return String.valueOf(fValue);
- }
- }
-
- /**
- * Internal interface for a cursor listener. I.e. aggregation
- * of mouse and key listener.
- * @since 3.0
- */
- interface ICursorListener extends MouseListener, KeyListener {
- }
-
- /**
- * Job to compute the details for a selection
- */
- class DetailJob extends Job implements IValueDetailListener {
-
- private IStructuredSelection fElements;
- private IDebugModelPresentation fModel;
- private boolean fFirst = true;
- // whether a result was collected
- private boolean fComputed = false;
- private IProgressMonitor fMonitor;
-
- public DetailJob(IStructuredSelection elements, IDebugModelPresentation model) {
- super("compute variable details"); //$NON-NLS-1$
- setSystem(true);
- fElements = elements;
- fModel = model;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected IStatus run(IProgressMonitor monitor) {
- fMonitor = monitor;
- Iterator iterator = fElements.iterator();
- String message = null;
- while (iterator.hasNext()) {
- if (monitor.isCanceled()) {
- break;
- }
- Object element = iterator.next();
- IValue val = null;
- if (element instanceof IVariable) {
- try {
- val = ((IVariable)element).getValue();
- } catch (DebugException e) {
- detailComputed(null, e.getStatus().getMessage());
- }
- } else if (element instanceof IExpression) {
- val = ((IExpression)element).getValue();
- }
- // When selecting a index partition, clear the pane
- if (val instanceof IndexedValuePartition) {
- detailComputed(null, IInternalDebugCoreConstants.EMPTY_STRING);
- val = null;
- }
- if (element instanceof String) {
- message = (String) element;
- }
- if (val != null && !monitor.isCanceled()) {
- fModel.computeDetail(val, this);
- synchronized (this) {
- try {
- // wait for a max of 30 seconds for result, then cancel
- wait(30000);
- if (!fComputed) {
- fMonitor.setCanceled(true);
- }
- } catch (InterruptedException e) {
- break;
- }
- }
- }
- }
- // If no details were computed for the selected variable, clear the pane
- // or use the message, if the variable was a java.lang.String
- if (!fComputed){
- if (message == null) {
- detailComputed(null,IInternalDebugCoreConstants.EMPTY_STRING);
- } else {
- detailComputed(null, message);
- }
- }
- return Status.OK_STATUS;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#canceling()
- */
- protected void canceling() {
- super.canceling();
- synchronized (this) {
- notifyAll();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IValueDetailListener#detailComputed(org.eclipse.debug.core.model.IValue, java.lang.String)
- */
- public void detailComputed(IValue value, final String result) {
- synchronized (this) {
- fComputed = true;
- }
- String valueString = result;
- if (valueString == null){
- try{
- valueString = value.getValueString();
- } catch (DebugException e){
- valueString = e.getMessage();
- }
- }
- final String detail = (valueString != null) ? valueString : DetailMessages.DefaultDetailPane_3;
- if (!fMonitor.isCanceled()) {
- WorkbenchJob append = new WorkbenchJob("append details") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if (!fMonitor.isCanceled()) {
- String insert = detail;
- int length = 0;
- if (!fFirst) {
- length = getDetailDocument().getLength();
- }
- if (length > 0) {
- insert = "\n" + result; //$NON-NLS-1$
- }
- try {
- int max = DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugUIConstants.PREF_MAX_DETAIL_LENGTH);
- if (max > 0 && insert.length() > max) {
- insert = insert.substring(0, max) + "..."; //$NON-NLS-1$
- }
- if (fFirst) {
- getDetailDocument().set(insert);
- fFirst = false;
- } else {
- getDetailDocument().replace(length, 0,insert);
- }
- } catch (BadLocationException e) {
- DebugUIPlugin.log(e);
- }
- }
- return Status.OK_STATUS;
- }
- };
- append.setSystem(true);
- append.schedule();
- }
- synchronized (this) {
- notifyAll();
- }
-
- }
-
- }
-
- /**
- * The model presentation used to produce the string details for a
- * selected variable.
- */
- private VariablesViewModelPresentation fModelPresentation;
- private String fDebugModelIdentifier;
-
- /**
- * Controls the status line while the details area has focus.
- * Displays the current cursor position in the text (line:character).
- */
- private StatusLineContributionItem fStatusLineItem;
-
- /**
- * The source viewer in which the computed string detail
- * of selected variables will be displayed.
- */
- private SourceViewer fSourceViewer;
-
- /**
- * The last selection displayed in the source viewer.
- */
- private IStructuredSelection fLastDisplayed = null;
-
- /**
- * Variables used to create the detailed information for a selection
- */
- private IDocument fDetailDocument;
- private DetailJob fDetailJob = null;
- private final String fPositionLabelPattern = DetailMessages.DefaultDetailPane_56;
- private final PositionLabelValue fLineLabel = new PositionLabelValue();
- private final PositionLabelValue fColumnLabel = new PositionLabelValue();
- private final Object[] fPositionLabelPatternArguments = new Object[] {
- fLineLabel, fColumnLabel };
- private ICursorListener fCursorListener;
-
- /**
- * Handler activation object so that we can use the global content assist command
- * and properly deactivate it later.
- */
- private IHandlerActivation fContentAssistActivation;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDetailPane#createControl(org.eclipse.swt.widgets.Composite)
- */
- public Control createControl(Composite parent) {
-
- fModelPresentation = new VariablesViewModelPresentation();
-
- createSourceViewer(parent);
-
- if (isInView()){
- createViewSpecificComponents();
- createActions();
- DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
- JFaceResources.getFontRegistry().addListener(this);
- }
-
- return fSourceViewer.getControl();
- }
-
- /**
- * Creates the source viewer in the given parent composite
- *
- * @param parent Parent composite to create the source viewer in
- */
- private void createSourceViewer(Composite parent) {
-
- // Create & configure a SourceViewer
- fSourceViewer = new SourceViewer(parent, null, SWT.V_SCROLL | SWT.H_SCROLL);
- fSourceViewer.setDocument(getDetailDocument());
- fSourceViewer.getTextWidget().setFont(JFaceResources.getFont(IDebugUIConstants.PREF_DETAIL_PANE_FONT));
- fSourceViewer.getTextWidget().setWordWrap(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DETAIL_PANE_WORD_WRAP));
- fSourceViewer.setEditable(false);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(fSourceViewer.getTextWidget(), IDebugHelpContextIds.DETAIL_PANE);
- Control control = fSourceViewer.getControl();
- GridData gd = new GridData(GridData.FILL_BOTH);
- control.setLayoutData(gd);
- }
-
- /**
- * Creates listeners and other components that should only be added to the
- * source viewer when this detail pane is inside a view.
- */
- private void createViewSpecificComponents(){
-
- // Add a document listener so actions get updated when the document changes
- getDetailDocument().addDocumentListener(new IDocumentListener() {
- public void documentAboutToBeChanged(DocumentEvent event) {}
- public void documentChanged(DocumentEvent event) {
- updateSelectionDependentActions();
- }
- });
-
- // Add the selection listener so selection dependent actions get updated.
- fSourceViewer.getSelectionProvider().addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateSelectionDependentActions();
- }
- });
-
- // Add a focus listener to update actions when details area gains focus
- fSourceViewer.getControl().addFocusListener(new FocusAdapter() {
- public void focusGained(FocusEvent e) {
- setGlobalAction(IDebugView.SELECT_ALL_ACTION, getAction(DETAIL_SELECT_ALL_ACTION));
- setGlobalAction(IDebugView.CUT_ACTION, getAction(DETAIL_CUT_ACTION));
- setGlobalAction(IDebugView.COPY_ACTION, getAction(DETAIL_COPY_ACTION));
- setGlobalAction(IDebugView.PASTE_ACTION, getAction(DETAIL_PASTE_ACTION));
- setGlobalAction(IDebugView.FIND_ACTION, getAction(DETAIL_FIND_REPLACE_TEXT_ACTION));
- IAction action = getAction(DETAIL_ASSIGN_VALUE_ACTION);
- setGlobalAction(action.getActionDefinitionId(), action);
- action = getAction(DETAIL_CONTENT_ASSIST_ACTION);
- setGlobalAction(action.getActionDefinitionId(),action);
-
- getViewSite().getActionBars().updateActionBars();
-
- updateAction(DETAIL_FIND_REPLACE_TEXT_ACTION);
-
- }
-
- public void focusLost(FocusEvent e) {
- setGlobalAction(IDebugView.SELECT_ALL_ACTION, null);
- setGlobalAction(IDebugView.CUT_ACTION, null);
- setGlobalAction(IDebugView.COPY_ACTION, null);
- setGlobalAction(IDebugView.PASTE_ACTION, null);
- setGlobalAction(IDebugView.FIND_ACTION, null);
- setGlobalAction(getAction(DETAIL_ASSIGN_VALUE_ACTION).getActionDefinitionId(), null);
- setGlobalAction(getAction(DETAIL_CONTENT_ASSIST_ACTION).getActionDefinitionId(), null);
-
- getViewSite().getActionBars().updateActionBars();
-
- }
- });
-
- // Create a status line item displaying the current cursor location
- fStatusLineItem = new StatusLineContributionItem("ModeContributionItem"); //$NON-NLS-1$
- IStatusLineManager manager= getViewSite().getActionBars().getStatusLineManager();
- manager.add(fStatusLineItem);
- fSourceViewer.getTextWidget().addMouseListener(getCursorListener());
- fSourceViewer.getTextWidget().addKeyListener(getCursorListener());
-
- // Add a context menu to the detail area
- createDetailContextMenu(fSourceViewer.getTextWidget());
-
- }
-
- /**
- * Creates the actions to add to the context menu
- */
- private void createActions() {
- TextViewerAction textAction= new TextViewerAction(fSourceViewer, ISourceViewer.CONTENTASSIST_PROPOSALS);
- textAction.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
- textAction.configureAction(DetailMessages.DefaultDetailPane_Co_ntent_Assist_3, IInternalDebugCoreConstants.EMPTY_STRING,IInternalDebugCoreConstants.EMPTY_STRING);
- textAction.setImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_ELCL_CONTENT_ASSIST));
- textAction.setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_CONTENT_ASSIST));
- textAction.setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_DLCL_CONTENT_ASSIST));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(textAction, IDebugHelpContextIds.DETAIL_PANE_CONTENT_ASSIST_ACTION);
- ActionHandler actionHandler = new ActionHandler(textAction);
- IHandlerService handlerService = (IHandlerService) getViewSite().getService(IHandlerService.class);
- fContentAssistActivation = handlerService.activateHandler(textAction.getActionDefinitionId(), actionHandler);
- setAction(DETAIL_CONTENT_ASSIST_ACTION, textAction);
-
- textAction= new TextViewerAction(fSourceViewer, ITextOperationTarget.SELECT_ALL);
- textAction.configureAction(DetailMessages.DefaultDetailPane_Select__All_5, IInternalDebugCoreConstants.EMPTY_STRING,IInternalDebugCoreConstants.EMPTY_STRING);
- textAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_SELECT_ALL);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(textAction, IDebugHelpContextIds.DETAIL_PANE_SELECT_ALL_ACTION);
- setAction(DETAIL_SELECT_ALL_ACTION, textAction);
-
- textAction= new TextViewerAction(fSourceViewer, ITextOperationTarget.COPY);
- textAction.configureAction(DetailMessages.DefaultDetailPane__Copy_8, IInternalDebugCoreConstants.EMPTY_STRING,IInternalDebugCoreConstants.EMPTY_STRING);
- textAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_COPY);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(textAction, IDebugHelpContextIds.DETAIL_PANE_COPY_ACTION);
- setAction(DETAIL_COPY_ACTION, textAction);
-
- textAction= new TextViewerAction(fSourceViewer, ITextOperationTarget.CUT);
- textAction.configureAction(DetailMessages.DefaultDetailPane_Cu_t_11, IInternalDebugCoreConstants.EMPTY_STRING,IInternalDebugCoreConstants.EMPTY_STRING);
- textAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_CUT);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(textAction, IDebugHelpContextIds.DETAIL_PANE_CUT_ACTION);
- setAction(DETAIL_CUT_ACTION, textAction);
-
- textAction= new TextViewerAction(fSourceViewer, ITextOperationTarget.PASTE);
- textAction.configureAction(DetailMessages.DefaultDetailPane__Paste_14, IInternalDebugCoreConstants.EMPTY_STRING,IInternalDebugCoreConstants.EMPTY_STRING);
- textAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_PASTE);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(textAction, IDebugHelpContextIds.DETAIL_PANE_PASTE_ACTION);
- setAction(ActionFactory.PASTE.getId(), textAction);
-
- setSelectionDependantAction(DETAIL_COPY_ACTION);
- setSelectionDependantAction(DETAIL_CUT_ACTION);
- setSelectionDependantAction(DETAIL_PASTE_ACTION);
-
- // TODO: Still using "old" resource access, find/replace won't work in popup dialogs
- ResourceBundle bundle= ResourceBundle.getBundle("org.eclipse.debug.internal.ui.views.variables.VariablesViewResourceBundleMessages"); //$NON-NLS-1$
- IAction action = new FindReplaceAction(bundle, "find_replace_action_", getWorkbenchPartSite().getShell(), new FindReplaceTargetWrapper(fSourceViewer.getFindReplaceTarget())); //$NON-NLS-1$
- action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IDebugHelpContextIds.DETAIL_PANE_FIND_REPLACE_ACTION);
- setAction(DETAIL_FIND_REPLACE_TEXT_ACTION, action);
-
- updateSelectionDependentActions();
-
- action = new DetailPaneWordWrapAction(fSourceViewer);
- setAction(DETAIL_WORD_WRAP_ACTION, action);
-
- action = new DetailPaneMaxLengthAction(fSourceViewer.getControl().getShell());
- setAction(DETAIL_MAX_LENGTH_ACTION,action);
-
- action = new DetailPaneAssignValueAction(fSourceViewer,getViewSite());
- setAction(DETAIL_ASSIGN_VALUE_ACTION, action);
- }
-
- /**
- * Create the context menu particular to the detail pane. Note that anyone
- * wishing to contribute an action to this menu must use
- * <code>IDebugUIConstants.VARIABLE_VIEW_DETAIL_ID</code> as the
- * <code>targetID</code> in the extension XML.
- */
- protected void createDetailContextMenu(Control menuControl) {
- MenuManager menuMgr= new MenuManager();
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- fillDetailContextMenu(mgr);
- }
- });
- Menu menu= menuMgr.createContextMenu(menuControl);
- menuControl.setMenu(menu);
-
- getViewSite().registerContextMenu(IDebugUIConstants.VARIABLE_VIEW_DETAIL_ID, menuMgr, fSourceViewer.getSelectionProvider());
-
- }
-
- /**
- * Adds items to the detail pane's context menu including any extension defined
- * actions.
- *
- * @param menu The menu to add the item to.
- */
- protected void fillDetailContextMenu(IMenuManager menu) {
-
- menu.add(new Separator(IDebugUIConstants.VARIABLE_GROUP));
- if (isInView()){
- menu.add(getAction(DETAIL_ASSIGN_VALUE_ACTION));
- menu.add(getAction(DETAIL_CONTENT_ASSIST_ACTION));
- }
- menu.add(new Separator());
- menu.add(getAction(DETAIL_CUT_ACTION));
- menu.add(getAction(DETAIL_COPY_ACTION));
- menu.add(getAction(DETAIL_PASTE_ACTION));
- menu.add(getAction(DETAIL_SELECT_ALL_ACTION));
- menu.add(new Separator("FIND")); //$NON-NLS-1$
- if (isInView()){
- menu.add(getAction(DETAIL_FIND_REPLACE_TEXT_ACTION));
- }
- menu.add(new Separator());
- menu.add(getAction(DETAIL_WORD_WRAP_ACTION));
- menu.add(getAction(DETAIL_MAX_LENGTH_ACTION));
- menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDetailPane#display(org.eclipse.jface.viewers.IStructuredSelection)
- */
- public void display(IStructuredSelection selection) {
-
- if (selection == null){
- clearSourceViewer();
- return;
- }
-
- fLastDisplayed = selection;
- if (isInView()){
- fSourceViewer.setEditable(true);
- }
-
- if (selection.isEmpty()){
- clearSourceViewer();
- return;
- }
-
- Object firstElement = selection.getFirstElement();
- if (firstElement != null && firstElement instanceof IDebugElement) {
- String modelID = ((IDebugElement)firstElement).getModelIdentifier();
- setDebugModel(modelID);
- }
-
- if (isInView()){
- IAction assignAction = getAction(DETAIL_ASSIGN_VALUE_ACTION);
- if (assignAction instanceof DetailPaneAssignValueAction){
- ((DetailPaneAssignValueAction)assignAction).updateCurrentVariable(selection);
- }
- }
-
- synchronized (this) {
- if (fDetailJob != null) {
- fDetailJob.cancel();
- }
- fDetailJob = new DetailJob(selection,fModelPresentation);
- fDetailJob.schedule();
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDetailPane#setFocus()
- */
- public boolean setFocus(){
- if (fSourceViewer != null){
- fSourceViewer.getTextWidget().setFocus();
- return true;
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.AbstractDetailPane#dispose()
- */
- public void dispose(){
- if (fDetailJob != null) fDetailJob.cancel();
- if (fModelPresentation != null) fModelPresentation.dispose();
- fDebugModelIdentifier = null; // Setting this to null makes sure the source viewer is reconfigured with the model presentation after disposal
- if (fSourceViewer != null && fSourceViewer.getControl() != null) fSourceViewer.getControl().dispose();
-
- if (isInView()){
- IAction action = getAction(DETAIL_ASSIGN_VALUE_ACTION);
- if (action != null){
- ((DetailPaneAssignValueAction)action).dispose();
- }
- if (fContentAssistActivation != null){
- IHandlerService service = (IHandlerService) getViewSite().getService(IHandlerService.class);
- service.deactivateHandler(fContentAssistActivation);
- fContentAssistActivation = null;
- }
-
- disposeUndoRedoAction(ITextEditorActionConstants.UNDO);
- disposeUndoRedoAction(ITextEditorActionConstants.REDO);
-
- getViewSite().getActionBars().getStatusLineManager().remove(fStatusLineItem);
-
- DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
- JFaceResources.getFontRegistry().removeListener(this);
- }
-
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDetailPane#getDescription()
- */
- public String getDescription() {
- return DESCRIPTION;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDetailPane#getID()
- */
- public String getID() {
- return ID;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDetailPane#getName()
- */
- public String getName() {
- return NAME;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class required) {
- if (IFindReplaceTarget.class.equals(required)) {
- return fSourceViewer.getFindReplaceTarget();
- }
- if (ITextViewer.class.equals(required)) {
- return fSourceViewer;
- }
- return null;
- }
-
- /**
- * Lazily instantiate and return a Document for the detail pane text viewer.
- */
- protected IDocument getDetailDocument() {
- if (fDetailDocument == null) {
- fDetailDocument = new Document();
- }
- return fDetailDocument;
- }
-
- /**
- * Clears the source viewer, removes all text.
- */
- protected void clearSourceViewer(){
- if (fDetailJob != null) {
- fDetailJob.cancel();
- }
- fLastDisplayed = null;
- fDetailDocument.set(IInternalDebugCoreConstants.EMPTY_STRING);
- fSourceViewer.setEditable(false);
- }
-
- /**
- * Configures the details viewer for the debug model
- * currently being displayed
- */
- protected void configureDetailsViewer() {
- LazyModelPresentation mp = (LazyModelPresentation)fModelPresentation.getPresentation(getDebugModel());
- SourceViewerConfiguration svc = null;
- if (mp != null) {
- try {
- svc = mp.newDetailsViewerConfiguration();
- } catch (CoreException e) {
- DebugUIPlugin.errorDialog(fSourceViewer.getControl().getShell(), DetailMessages.DefaultDetailPane_Error_1, DetailMessages.DefaultDetailPane_2, e);
- }
- }
-
- if (svc == null) {
- svc = new SourceViewerConfiguration();
- fSourceViewer.setEditable(false);
- }
- fSourceViewer.unconfigure();
- fSourceViewer.configure(svc);
- //update actions that depend on the configuration of the source viewer
-
- if (isInView()){
- updateAction(DETAIL_ASSIGN_VALUE_ACTION);
- updateAction(DETAIL_CONTENT_ASSIST_ACTION);
- }
-
- if (isInView()){
- createUndoRedoActions();
- }
- }
-
- /**
- * @return The formatted string describing cursor position
- */
- protected String getCursorPosition() {
-
- if (fSourceViewer == null) {
- return IInternalDebugCoreConstants.EMPTY_STRING;
- }
-
- StyledText styledText= fSourceViewer.getTextWidget();
- int caret= styledText.getCaretOffset();
- IDocument document= fSourceViewer.getDocument();
-
- if (document == null) {
- return IInternalDebugCoreConstants.EMPTY_STRING;
- }
-
- try {
-
- int line= document.getLineOfOffset(caret);
-
- int lineOffset= document.getLineOffset(line);
- int tabWidth= styledText.getTabs();
- int column= 0;
- for (int i= lineOffset; i < caret; i++)
- if ('\t' == document.getChar(i)) {
- column += tabWidth - (tabWidth == 0 ? 0 : column % tabWidth);
- } else {
- column++;
- }
-
- fLineLabel.fValue= line + 1;
- fColumnLabel.fValue= column + 1;
- return MessageFormat.format(fPositionLabelPattern, fPositionLabelPatternArguments);
-
- } catch (BadLocationException x) {
- return IInternalDebugCoreConstants.EMPTY_STRING;
- }
- }
-
- /**
- * Returns this view's "cursor" listener to be installed on the view's
- * associated details viewer. This listener is listening to key and mouse button events.
- * It triggers the updating of the status line.
- *
- * @return the listener
- */
- private ICursorListener getCursorListener() {
- if (fCursorListener == null) {
- fCursorListener= new ICursorListener() {
-
- public void keyPressed(KeyEvent e) {
- fStatusLineItem.setText(getCursorPosition());
- }
-
- public void keyReleased(KeyEvent e) {
- }
-
- public void mouseDoubleClick(MouseEvent e) {
- }
-
- public void mouseDown(MouseEvent e) {
- }
-
- public void mouseUp(MouseEvent e) {
- fStatusLineItem.setText(getCursorPosition());
- }
- };
- }
- return fCursorListener;
- }
-
- /**
- * Returns the identifier of the debug model being displayed
- * in this view, or <code>null</code> if none.
- *
- * @return debug model identifier
- */
- protected String getDebugModel() {
- return fDebugModelIdentifier;
- }
-
- /**
- * Sets the identifier of the debug model being displayed
- * in this view, or <code>null</code> if none.
- *
- * @param id debug model identifier of the type of debug
- * elements being displayed in this view
- */
- protected void setDebugModel(String id) {
- if (id != fDebugModelIdentifier) {
- fDebugModelIdentifier = id;
- configureDetailsViewer();
- }
- }
-
- /**
- * Creates this editor's undo/re-do actions.
- * <p>
- * Subclasses may override or extend.</p>
- *
- * @since 3.2
- */
- protected void createUndoRedoActions() {
- disposeUndoRedoAction(ITextEditorActionConstants.UNDO);
- disposeUndoRedoAction(ITextEditorActionConstants.REDO);
- IUndoContext undoContext= getUndoContext();
- if (undoContext != null) {
- // Use actions provided by global undo/re-do
-
- // Create the undo action
- OperationHistoryActionHandler undoAction= new UndoActionHandler(getViewSite(), undoContext);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(undoAction, IAbstractTextEditorHelpContextIds.UNDO_ACTION);
- undoAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_UNDO);
- setAction(ITextEditorActionConstants.UNDO, undoAction);
- setGlobalAction(ITextEditorActionConstants.UNDO, undoAction);
-
- // Create the re-do action.
- OperationHistoryActionHandler redoAction= new RedoActionHandler(getViewSite(), undoContext);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(redoAction, IAbstractTextEditorHelpContextIds.REDO_ACTION);
- redoAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_REDO);
- setAction(ITextEditorActionConstants.REDO, redoAction);
- setGlobalAction(ITextEditorActionConstants.REDO, redoAction);
-
- getViewSite().getActionBars().updateActionBars();
- }
- }
-
- /**
- * Disposes of the action with the specified ID
- *
- * @param actionId the ID of the action to disposed
- */
- protected void disposeUndoRedoAction(String actionId) {
- OperationHistoryActionHandler action = (OperationHistoryActionHandler) getAction(actionId);
- if (action != null) {
- action.dispose();
- setAction(actionId, null);
- }
- }
-
- /**
- * Returns this editor's viewer's undo manager undo context.
- *
- * @return the undo context or <code>null</code> if not available
- * @since 3.2
- */
- private IUndoContext getUndoContext() {
- IUndoManager undoManager= fSourceViewer.getUndoManager();
- if (undoManager instanceof IUndoManagerExtension)
- return ((IUndoManagerExtension)undoManager).getUndoContext();
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- String propertyName= event.getProperty();
- if (propertyName.equals(IDebugUIConstants.PREF_DETAIL_PANE_FONT)) {
- fSourceViewer.getTextWidget().setFont(JFaceResources.getFont(IDebugUIConstants.PREF_DETAIL_PANE_FONT));
- } else if (propertyName.equals(IDebugUIConstants.PREF_MAX_DETAIL_LENGTH)) {
- display(fLastDisplayed);
- } else if (propertyName.equals(IDebugPreferenceConstants.PREF_DETAIL_PANE_WORD_WRAP)) {
- fSourceViewer.getTextWidget().setWordWrap(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DETAIL_PANE_WORD_WRAP));
- getAction(DETAIL_WORD_WRAP_ACTION).setChecked(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DETAIL_PANE_WORD_WRAP));
- }
-
- }
-
- /**
- * Wrapper class that wraps around an IFindReplaceTarget. Allows the detail pane to scroll
- * to text selected by the find/replace action. The source viewer treats the text as a single
- * line, even when the text is wrapped onto several lines so the viewer will not scroll properly
- * on it's own. See bug 178106.
- */
- class FindReplaceTargetWrapper implements IFindReplaceTarget{
-
- private IFindReplaceTarget fTarget;
-
- /**
- * Constructor
- *
- * @param target find/replace target this class will wrap around.
- */
- public FindReplaceTargetWrapper(IFindReplaceTarget target){
- fTarget = target;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.IFindReplaceTarget#canPerformFind()
- */
- public boolean canPerformFind() {
- return fTarget.canPerformFind();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.IFindReplaceTarget#findAndSelect(int, java.lang.String, boolean, boolean, boolean)
- */
- public int findAndSelect(int widgetOffset, String findString, boolean searchForward, boolean caseSensitive, boolean wholeWord) {
- int position = fTarget.findAndSelect(widgetOffset, findString, searchForward, caseSensitive, wholeWord);
- // Explicitly tell the widget to show the selection because the viewer thinks the text is all on one line, even if wrapping is turned on.
- if (fSourceViewer != null){
- StyledText text = fSourceViewer.getTextWidget();
- if(text != null && !text.isDisposed()) {
- text.showSelection();
- }
- }
- return position;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.IFindReplaceTarget#getSelection()
- */
- public Point getSelection() {
- return fTarget.getSelection();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.IFindReplaceTarget#getSelectionText()
- */
- public String getSelectionText() {
- return fTarget.getSelectionText();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.IFindReplaceTarget#isEditable()
- */
- public boolean isEditable() {
- return fTarget.isEditable();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.text.IFindReplaceTarget#replaceSelection(java.lang.String)
- */
- public void replaceSelection(String text) {
- fTarget.replaceSelection(text);
- }
- }
-
- /*
- * @see org.eclipse.debug.ui.IDetailPane2#getSelectionProvider()
- */
- public ISelectionProvider getSelectionProvider() {
- return fSourceViewer.getSelectionProvider();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPaneFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPaneFactory.java
deleted file mode 100644
index eb3c88e17..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPaneFactory.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables.details;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.debug.ui.IDetailPane;
-import org.eclipse.debug.ui.IDetailPaneFactory;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * The default detail pane factory is contributed to the <code>org.eclipse.debug.ui.detailPaneFactories</code>
- * extension without an enablement expression so it is always loaded. For any given selection (even
- * null or empty selections), the factory can produce a <code>SourceDetailsPane</code>
- *
- * @see SourceDetailPane
- * @since 3.3
- */
-public class DefaultDetailPaneFactory implements IDetailPaneFactory {
-
- public static final String DEFAULT_DETAIL_PANE_ID = DefaultDetailPane.ID;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.IDetailsFactory#createDetailsArea(java.lang.String)
- */
- public IDetailPane createDetailPane(String id) {
- return new DefaultDetailPane();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.IDetailsFactory#getDetailsTypes(org.eclipse.jface.viewers.IStructuredSelection)
- */
- public Set getDetailPaneTypes(IStructuredSelection selection) {
- Set possibleIDs = new HashSet(1);
- possibleIDs.add(DefaultDetailPane.ID);
- return possibleIDs;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IDetailPaneFactory#getDefaultDetailPane(java.util.Set, org.eclipse.jface.viewers.IStructuredSelection)
- */
- public String getDefaultDetailPane(IStructuredSelection selection) {
- // Return null so that any contributed detail pane can override the default
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.IDetailsFactory#getName(java.lang.String)
- */
- public String getDetailPaneName(String id) {
- if (id.equals(DefaultDetailPane.ID)){
- return DefaultDetailPane.NAME;
- }
- return null;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.IDetailsFactory#getDescription(java.lang.String)
- */
- public String getDetailPaneDescription(String id) {
- if (id.equals(DefaultDetailPane.ID)){
- return DefaultDetailPane.DESCRIPTION;
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailMessages.java
deleted file mode 100644
index bd7b921b8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailMessages.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables.details;
-
-import org.eclipse.osgi.util.NLS;
-
-public class DetailMessages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.debug.internal.ui.views.variables.details.DetailMessages"; //$NON-NLS-1$
- public static String AvailableDetailPanesAction_0;
- public static String DefaultDetailPane__Copy_8;
- public static String DefaultDetailPane__Paste_14;
- public static String DefaultDetailPane_0;
- public static String DefaultDetailPane_1;
- public static String DefaultDetailPane_2;
- public static String DefaultDetailPane_3;
- public static String DefaultDetailPane_56;
- public static String DefaultDetailPane_57;
- public static String DefaultDetailPane_Co_ntent_Assist_3;
- public static String DefaultDetailPane_Cu_t_11;
- public static String DefaultDetailPane_Error_1;
- public static String DefaultDetailPane_Select__All_5;
- public static String DetailPaneProxy_0;
- public static String DetailPaneProxy_1;
- public static String DetailPaneProxy_2;
- public static String DetailPaneProxy_3;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, DetailMessages.class);
- }
-
- private DetailMessages() {
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailMessages.properties
deleted file mode 100644
index 3653abaa1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailMessages.properties
+++ /dev/null
@@ -1,28 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-AvailableDetailPanesAction_0=Show &Details As
-DefaultDetailPane_0=DefaultDetailPane
-DefaultDetailPane_1=Default Viewer
-DefaultDetailPane_56={0} : {1}
-DefaultDetailPane_57=A detail pane that is based on a source viewer. Displays as text and has actions for assigning values, content assist and text modifications.
-DefaultDetailPane_Co_ntent_Assist_3=Co&ntent Assist
-DefaultDetailPane_Select__All_5=Select &All
-DefaultDetailPane__Copy_8=&Copy
-DefaultDetailPane_Cu_t_11=Cu&t
-DefaultDetailPane__Paste_14=&Paste
-DefaultDetailPane_Error_1=Error
-DefaultDetailPane_2=Unable to configure source viewer detail pane
-DefaultDetailPane_3=null
-DetailPaneProxy_0=Problem displaying detail pane, see log for details.
-DetailPaneProxy_1=No details to display for the current selection.
-DetailPaneProxy_2=The detail pane with ID {0} did not create and return a control.
-DetailPaneProxy_3=Could not create the detail pane with ID {0}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java
deleted file mode 100644
index cc57ef781..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java
+++ /dev/null
@@ -1,510 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables.details;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.Map.Entry;
-
-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.ExpressionTagNames;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.internal.core.IConfigurationElementConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.IDetailPane;
-import org.eclipse.debug.ui.IDetailPaneFactory;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * Organizes the detail factories contributed through the extension point and keeps
- * track of the detail panes the factories produce. Accessed as a singleton through
- * the <code>getDefault()</code> method.
- *
- * @see IDetailPaneFactory
- * @see IDetailPane
- * @since 3.3
- */
-public class DetailPaneManager {
-
- /**
- * Acts as a proxy between the detail pane manager and the factories contributed
- * to the extension point. Only loads information from the plug-in xml and only
- * instantiates the specified factory if required (lazy loading).
- */
- private class DetailPaneFactoryExtension implements IDetailPaneFactory{
-
- private IConfigurationElement fConfigElement;
- private IDetailPaneFactory fFactory;
- private Expression fEnablementExpression;
-
- public DetailPaneFactoryExtension(IConfigurationElement configElement){
- fConfigElement = configElement;
- }
-
- /**
- * Instantiates the factory and asks it to produce the IDetailPane for
- * the given ID
- */
- public IDetailPane createDetailPane(String paneID){
- if (getFactory() != null){
- return getFactory().createDetailPane(paneID);
- }
- return null;
- }
-
- /**
- * Instantiates the factory and asks it for the set of detail pane
- * IDs that the factory can produce for the given selection.
- */
- public Set getDetailPaneTypes(IStructuredSelection selection){
- if (getFactory() != null){
- return getFactory().getDetailPaneTypes(selection);
- }
- return new HashSet(0);
- }
-
- /**
- * Instantiates the factory and asks it for the detail pane ID
- * that the factory considers the default for the given selection.
- */
- public String getDefaultDetailPane(IStructuredSelection selection) {
- if (getFactory() != null){
- return getFactory().getDefaultDetailPane(selection);
- }
- return null;
- }
-
- /**
- * Instantiates the factory and asks it to produce the name of the detail pane
- * for the given ID.
- */
- public String getDetailPaneName(String paneID) {
- if (getFactory() != null){
- return getFactory().getDetailPaneName(paneID);
- }
- return null;
- }
-
- /**
- * Instantiates the factory and asks it to produce the description of the
- * detail pane for the given ID.
- */
- public String getDetailPaneDescription(String paneID) {
- if (getFactory() != null){
- return getFactory().getDetailPaneDescription(paneID);
- }
- return null;
- }
-
- /**
- * Returns the instantiated factory specified by the class property.
- */
- private IDetailPaneFactory getFactory(){
- if (fFactory != null) return fFactory;
- try{
- Object obj = fConfigElement.createExecutableExtension(IConfigurationElementConstants.CLASS);
- if(obj instanceof IDetailPaneFactory) {
- fFactory = (IDetailPaneFactory)obj;
- } else {
- throw new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR, "org.eclipse.debug.ui.detailFactories extension failed to load a detail factory because the specified class does not implement org.eclipse.debug.ui.IDetailPaneFactory. Class specified was: " + obj, null)); //$NON-NLS-1$
- }
- } catch (CoreException e){
- DebugUIPlugin.log(e.getStatus());
- fFactory = null;
- }
- return fFactory;
- }
-
- /**
- * Checks if the enablement expression for the factory evaluates to true for the
- * given selection.
- */
- public boolean isEnabled(IStructuredSelection selection) {
- boolean enabled = false;
- // Only the default factory should be enabled for null selections
- if (selection == null || selection.isEmpty()){
- return "org.eclipse.debug.ui.defaultDetailPaneFactory".equals(fConfigElement.getAttribute(IConfigurationElementConstants.ID)); //$NON-NLS-1$
- }
- Expression expression = getEnablementExpression();
- if (expression != null) {
- List list = selection.toList();
- IEvaluationContext context = new EvaluationContext(null, list);
- context.addVariable("selection", list); //$NON-NLS-1$
- enabled = evalEnablementExpression(context, expression);
- } else {
- enabled = true;
- }
- return enabled;
- }
-
- /**
- * Evaluate the given expression within the given context and return
- * the result. Returns <code>true</code> iff result is either TRUE or NOT_LOADED.
- * This allows optimistic inclusion of shortcuts before plug-ins are loaded.
- * Returns <code>false</code> if expression is <code>null</code>.
- *
- * @param exp the enablement expression to evaluate or <code>null</code>
- * @param context the context of the evaluation. Usually, the
- * user's selection.
- * @return the result of evaluating the expression
- */
- private boolean evalEnablementExpression(IEvaluationContext context, Expression exp) {
- try{
- if (exp != null){
- EvaluationResult result = exp.evaluate(context);
- if (result == EvaluationResult.TRUE || result == EvaluationResult.NOT_LOADED){
- return true;
- }
- }
- } catch (CoreException e){
- DebugUIPlugin.log(e.getStatus());
- }
- return false;
- }
-
- /**
- * Returns an expression that represents the enablement logic for the
- * detail pane factory or <code>null</code> if none.
- *
- * @return an evaluatable expression or <code>null</code>
- */
- private Expression getEnablementExpression(){
- // all of this stuff is optional, so...tedious testing is required
- if (fEnablementExpression == null) {
- try{
- IConfigurationElement[] elements = fConfigElement.getChildren(ExpressionTagNames.ENABLEMENT);
- IConfigurationElement enablement = elements.length > 0 ? elements[0] : null;
- if (enablement != null) {
- fEnablementExpression = ExpressionConverter.getDefault().perform(enablement);
- }
- } catch (CoreException e){
- DebugUIPlugin.log(e.getStatus());
- fEnablementExpression = null;
- }
- }
- return fEnablementExpression;
- }
-
- }
-
- /**
- * There should only ever be once instance of this manager for the workbench.
- */
- private static DetailPaneManager fgSingleton;
-
- /**
- * Maps the IDs of types of detail panes to the factory that can create them.
- * There can currently only be one factory for a given type of details pane.
- */
- private Map fFactoriesByPaneID;
-
- /**
- * Maps a Set of detail pane id's to the one detail pane id that is preferred.
- */
- private Map fPreferredDetailPanes;
-
- /**
- * The set of all factories that have been loaded from the extension point.
- */
- private Collection fKnownFactories;
-
- /**
- * Preference key for storing the preferred detail panes map.
- * @see {@link #storePreferredDetailsAreas()}
- * @see {@link #loadPreferredDetailsAreas()}
- */
- public static final String PREF_DETAIL_AREAS = "preferredDetailPanes"; //$NON-NLS-1$
-
- private DetailPaneManager(){
- fFactoriesByPaneID = new HashMap();
- }
-
- public static DetailPaneManager getDefault(){
- if (fgSingleton == null) fgSingleton = new DetailPaneManager();
- return fgSingleton;
- }
-
- /**
- * Returns the ID of the preferred detail pane for the given selection.
- *
- * @param selection The selection to display in the detail pane
- * @return The ID of the preferred detail pane or null
- */
- public String getPreferredPaneFromSelection(IStructuredSelection selection){
- Collection possibleFactories = getEnabledFactories(selection);
- Set possiblePaneIDs = getPossiblePaneIDs(possibleFactories, selection);
- return chooseDetailsAreaIDInSet(possiblePaneIDs, possibleFactories, selection);
- }
-
- /**
- * Returns the set of all possible detail panes the can display the given
- * selection.
- *
- * @param selection The selection to display in the detail pane
- * @return The set of IDs of all possible detail panes for the given selection
- */
- public Set getAvailablePaneIDs(IStructuredSelection selection){
- Collection possibleFactories = getEnabledFactories(selection);
- return getPossiblePaneIDs(possibleFactories, selection);
- }
-
- /**
- * Given the ID of a details pane, this method will try to find the factory
- * that creates it and return an instantiation of that area.
- * <p>
- * This method will not call the init() method of the IDetailsPane.
- * </p>
- *
- * @param ID The ID of the requested pane
- * @return The instantiated pane or null
- */
- public IDetailPane getDetailPaneFromID(String ID){
- IDetailPaneFactory factory = (IDetailPaneFactory)fFactoriesByPaneID.get(ID);
- if (factory != null){
- return factory.createDetailPane(ID);
- }
- return null;
- }
-
- /**
- * Given the ID of a details pane, this method will try to find the factory
- * that creates it and ask it for the name of the details pane.
- *
- * @param ID The ID of the requested pane
- * @return The name of the details pane or null
- */
- public String getNameFromID(String ID){
- IDetailPaneFactory factory = (IDetailPaneFactory)fFactoriesByPaneID.get(ID);
- if (factory != null){
- return factory.getDetailPaneName(ID);
- }
- return null;
- }
-
- /**
- * Given the ID of a details pane, this method will try to find the factory
- * that creates it and ask it for the description of the details pane.
- *
- * @param ID The ID of the requested pane
- * @return The description of the details pane or null
- */
- public String getDescriptionFromID(String ID){
- IDetailPaneFactory factory = (IDetailPaneFactory)fFactoriesByPaneID.get(ID);
- if (factory != null){
- return factory.getDetailPaneDescription(ID);
- }
- return null;
- }
-
-
- /**
- * Returns the set of IDetailPaneFactories (they will be DetailPaneFactoryDelegates) that were
- * contributed to the extension point and are enabled for the given selection
- * (enabled if the factory does not have an enablement expression or if the
- * enablement expression evaluates to true).
- *
- * @return The factories enabled for the selection or an empty collection.
- */
- private Collection getEnabledFactories(IStructuredSelection selection){
- Collection factoriesForSelection = new ArrayList();
- if (fKnownFactories == null) initializeDetailFactories();
- Iterator iter = fKnownFactories.iterator();
- while (iter.hasNext()) {
- IDetailPaneFactory currentFactory = (IDetailPaneFactory) iter.next();
- if (currentFactory instanceof DetailPaneFactoryExtension){
- if (((DetailPaneFactoryExtension)currentFactory).isEnabled(selection)){
- factoriesForSelection.add(currentFactory);
- }
- }
- }
- return factoriesForSelection;
- }
-
- /**
- * Produces the set of IDs for all possible detail panes that can be used to display
- * the given selection.
- *
- * @param factoriesToQuery The collection of factories to check
- * @param selection The selection to be displayed
- * @return Set of pane IDs or an empty set
- */
- private Set getPossiblePaneIDs(Collection factoriesToQuery, IStructuredSelection selection){
- Set idsForSelection = new LinkedHashSet();
- Iterator factoryIter = factoriesToQuery.iterator();
- while (factoryIter.hasNext()) {
- IDetailPaneFactory currentFactory = (IDetailPaneFactory) factoryIter.next();
- Iterator detailAreaTypes = currentFactory.getDetailPaneTypes(selection).iterator();
- while (detailAreaTypes.hasNext()) {
- String currentAreaTypeID = (String) detailAreaTypes.next();
- fFactoriesByPaneID.put(currentAreaTypeID, currentFactory);
- idsForSelection.add(currentAreaTypeID);
- }
- }
- return idsForSelection;
- }
-
- /**
- * Given a set of possible detail pane IDs, this method will determine which pane is
- * preferred and should be used to display the selection. This method chooses a pane
- * by storing previous choices and can be set using a context menu.
- *
- * @param possiblePaneIDs The set of possible detail pane IDs
- * @return The preferred detail pane ID or null
- */
- private String chooseDetailsAreaIDInSet(Set possiblePaneIDs, Collection enabledFactories, IStructuredSelection selection){
- if (possiblePaneIDs == null || possiblePaneIDs.isEmpty()){
- return null;
- }
-
- String preferredID = getUserPreferredDetailPane(possiblePaneIDs);
-
- if (preferredID == null){
- // If there is no preferred pane already set, check the factories to see there is a default pane
- Iterator factoryIterator = enabledFactories.iterator();
- while (preferredID == null && factoryIterator.hasNext()) {
- IDetailPaneFactory currentFactory = (IDetailPaneFactory) factoryIterator.next();
- preferredID = currentFactory.getDefaultDetailPane(selection);
- }
- // If the factories don't have a default, try to choose the DefaultDetailPane
- if (preferredID == null){
- Iterator paneIterator = possiblePaneIDs.iterator();
- // If the DefaultDetailPane is not in the set, just use the first in the set
- preferredID = (String)paneIterator.next();
- while (paneIterator.hasNext() && preferredID != DefaultDetailPaneFactory.DEFAULT_DETAIL_PANE_ID) {
- String currentID = (String) paneIterator.next();
- if (currentID.equals(DefaultDetailPaneFactory.DEFAULT_DETAIL_PANE_ID)){
- preferredID = currentID;
- }
- }
- }
- setPreferredDetailPane(possiblePaneIDs, preferredID);
- }
-
- return preferredID;
- }
-
- /**
- * Initializes the collection of known factories from extension point contributions.
- */
- private synchronized void initializeDetailFactories(){
- if (fKnownFactories == null){
- fKnownFactories = new ArrayList();
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_DETAIL_FACTORIES);
- IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
- DetailPaneFactoryExtension delegate = null;
- for(int i = 0; i < infos.length; i++) {
- delegate = new DetailPaneFactoryExtension(infos[i]);
- fKnownFactories.add(delegate);
- }
- }
- }
-
- /**
- * Returns the preferred pane ID from the given set if the mapping has been set.
- *
- * @param possibleDetailsAreaIDs Set of possible pane IDs
- * @return The preferred ID or null
- */
- public String getUserPreferredDetailPane(Set possibleDetailsAreaIDs){
- if (fPreferredDetailPanes == null){
- loadPreferredDetailsAreas();
- }
- return (String)fPreferredDetailPanes.get(possibleDetailsAreaIDs);
-
- }
-
- /**
- * Adds or updates the mapping to set which pane ID is preferred for a certain
- * set of possible IDs.
- *
- * @param possibleDetailsAreaIDs The set of possible IDs
- * @param preferredDetailsAreaID The preferred ID in the set.
- */
- public void setPreferredDetailPane(Set possibleDetailsAreaIDs, String preferredDetailsAreaID){
- if (possibleDetailsAreaIDs == null) return;
- if (fPreferredDetailPanes == null){
- loadPreferredDetailsAreas();
- }
- String currentKey = (String)fPreferredDetailPanes.get(possibleDetailsAreaIDs);
- if (currentKey == null || !currentKey.equals(preferredDetailsAreaID)){
- fPreferredDetailPanes.put(possibleDetailsAreaIDs, preferredDetailsAreaID);
- storePreferredDetailsAreas();
- }
-
- }
-
- /**
- * Stores the map of preferred detail pane IDs to the preference store in the format:
- *
- * Key1A,Key1B:Value1|Key2A,Key2B,Key2C:Value2|
- *
- * Where the sub keys (Key1A, Key1B, etc.) are the elements of the set used at the
- * key in the mapping and the values are the associated String value in the mapping.
- */
- private void storePreferredDetailsAreas() {
- StringBuffer buffer= new StringBuffer();
- Iterator iter = fPreferredDetailPanes.entrySet().iterator();
- while (iter.hasNext()) {
- Entry entry = (Entry) iter.next();
- Iterator setIter = ((Set)entry.getKey()).iterator();
- while (setIter.hasNext()) {
- String currentID = (String) setIter.next();
- buffer.append(currentID);
- buffer.append(',');
- }
- buffer.deleteCharAt(buffer.length()-1);
- buffer.append(':');
- buffer.append(entry.getValue());
- buffer.append('|');
- }
- DebugUIPlugin.getDefault().getPluginPreferences().setValue(PREF_DETAIL_AREAS, buffer.toString());
- }
-
- /**
- * Loads the map of preferred detail pane IDs from the preference store.
- *
- * @see DetailPaneManager#storePreferredDetailsArea()
- */
- private void loadPreferredDetailsAreas() {
- fPreferredDetailPanes = new HashMap();
- String preferenceValue = DebugUIPlugin.getDefault().getPluginPreferences().getString(PREF_DETAIL_AREAS);
- StringTokenizer entryTokenizer = new StringTokenizer(preferenceValue,"|"); //$NON-NLS-1$
- while (entryTokenizer.hasMoreTokens()){
- String token = entryTokenizer.nextToken();
- int valueStart = token.indexOf(':');
- StringTokenizer keyTokenizer = new StringTokenizer(token.substring(0,valueStart),","); //$NON-NLS-1$
- Set keys = new LinkedHashSet();
- while (keyTokenizer.hasMoreTokens()){
- keys.add(keyTokenizer.nextToken());
- }
- fPreferredDetailPanes.put(keys, token.substring(valueStart+1));
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneProxy.java
deleted file mode 100644
index 251e5c628..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneProxy.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River - Anton Leherbauer - Fix selection provider (Bug 254442)
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables.details;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDetailPane;
-import org.eclipse.debug.ui.IDetailPane2;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IWorkbenchPartSite;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Acts as a proxy between a view and a detail pane. Controls how information is displayed
- * in the details pane in a view. Currently used by the variables, registers and expression
- * views as well as the inspect popup dialog. The different types of detail panes use the
- * detailPaneFactories extension and must implement <code>IDetailPane</code>. This class acts
- * as a proxy to the current detail pane, each time the detail pane type changes, this class
- * disposes of the old pane and creates the new one. Uses a <code>DetailPaneManager</code> to
- * organize and find the panes to display.
- *
- * @see IDetailPane
- * @see DetailPaneManager
- * @since 3.3
- */
-public class DetailPaneProxy {
-
- /**
- * The IDetailPane currently being used to display detailed information.
- */
- private IDetailPane fCurrentPane;
-
- /**
- * The UI control that the current detail pane is using to display details.
- */
- private Control fCurrentControl;
-
- /**
- * Detail pane container that the detail panes will be added to.
- */
- private IDetailPaneContainer fParentContainer;
-
- /**
- * Constructor that sets up the detail pane for a view. Note that no default pane
- * is created, so a control will not be created until <code>display</code> is called.
- *
- * @param parent the detail pane container that is holding this detail pane
- */
- public DetailPaneProxy(IDetailPaneContainer parent) {
- fParentContainer = parent;
- }
-
- /**
- * Displays the given selection in the preferred detail pane for that type of selection.
- * Informs the parent container if the type of detail pane changes.
- * If a null or empty selection is passed and a current pane exists, that view will be cleared.
- * If a null or empty selection is passed and no pane exists, the default view is created.
- *
- * @param selection The selection to display detailed information for
- */
- public void display(IStructuredSelection selection){
-
- if ((selection == null || selection.isEmpty()) && fCurrentPane != null){
- fCurrentPane.display(selection);
- return;
- }
-
- String preferredPaneID = DetailPaneManager.getDefault().getPreferredPaneFromSelection(selection);
-
- // Don't change anything if the preferred pane is the current pane
- if (fCurrentPane != null && preferredPaneID != null && preferredPaneID.equals(fCurrentPane.getID())){
- fCurrentPane.display(selection);
- return;
- }
-
- setupPane(preferredPaneID, selection);
-
- // Inform the container that a new detail pane is being used
- fParentContainer.paneChanged(preferredPaneID);
-
- }
-
- /**
- * Tells the current detail pane (if one exists) that it is gaining focus.
- *
- * @return true if the current pane successfully set focus to a control, false otherwise
- */
- public boolean setFocus(){
- if (fCurrentPane != null){
- return fCurrentPane.setFocus();
- }
- return false;
- }
-
- /**
- * Disposes of the current pane.
- */
- public void dispose(){
- if (fCurrentPane != null) fCurrentPane.dispose();
- if (fCurrentControl != null && !fCurrentControl.isDisposed()) fCurrentControl.dispose();
- }
-
- /**
- * Checks if the current pane supports the <code>IAdaptable</code> framework
- * and if so, calls its <code>getAdapter()</code> method.
- * @param required
- * @return
- */
- public Object getAdapter(Class required){
- if (fCurrentPane != null && fCurrentPane instanceof IAdaptable){
- return ((IAdaptable)fCurrentPane).getAdapter(required);
- }
- else{
- return null;
- }
- }
-
- public Control getCurrentControl(){
- return fCurrentControl;
- }
-
- public String getCurrentPaneID(){
- if (fCurrentPane != null){
- return fCurrentPane.getID();
- }
- return null;
- }
-
- /**
- * Finds or creates an initialized detail pane with the given ID. Asks the detail
- * pane to create the control and display the selection.
- *
- * @param paneID the ID of the pane to display in
- * @param selection the selection to display
- */
- private void setupPane(String paneID, IStructuredSelection selection) {
- if (fCurrentPane != null) fCurrentPane.dispose();
- if (fCurrentControl != null && !fCurrentControl.isDisposed()) fCurrentControl.dispose();
- fCurrentPane = null;
- if (paneID != null){
- fCurrentPane = DetailPaneManager.getDefault().getDetailPaneFromID(paneID);
- if (fCurrentPane != null){
- final IWorkbenchPartSite workbenchPartSite = fParentContainer.getWorkbenchPartSite();
- fCurrentPane.init(workbenchPartSite);
- fCurrentControl = fCurrentPane.createControl(fParentContainer.getParentComposite());
- if (fCurrentControl != null){
- fParentContainer.getParentComposite().layout(true);
- fCurrentPane.display(selection);
- if (fParentContainer instanceof IDetailPaneContainer2) {
- fCurrentControl.addFocusListener(new FocusAdapter() {
- public void focusGained(FocusEvent e) {
- updateSelectionProvider(true);
- }
- public void focusLost(FocusEvent e) {
- updateSelectionProvider(false);
- }
- });
- }
- } else{
- createErrorLabel(DetailMessages.DetailPaneProxy_0);
- DebugUIPlugin.log(new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), MessageFormat.format(DetailMessages.DetailPaneProxy_2, new String[]{fCurrentPane.getID()}))));
- }
- } else {
- createErrorLabel(DetailMessages.DetailPaneProxy_0);
- DebugUIPlugin.log(new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), MessageFormat.format(DetailMessages.DetailPaneProxy_3, new String[]{paneID}))));
- }
- } else {
- createErrorLabel(DetailMessages.DetailPaneProxy_1);
- }
- }
-
- /**
- * Update the selection provider of the current detail pane in the container.
- *
- * @param hasFocus whether the detail pane control has the focus
- */
- protected void updateSelectionProvider(boolean hasFocus) {
- if (fParentContainer instanceof IDetailPaneContainer2) {
- final IDetailPaneContainer2 container2 = (IDetailPaneContainer2) fParentContainer;
- if (fCurrentPane instanceof IDetailPane2) {
- final ISelectionProvider provider= hasFocus ? ((IDetailPane2) fCurrentPane).getSelectionProvider() : null;
- container2.setSelectionProvider(provider);
- } else {
- // Workaround for legacy detail pane implementations (bug 254442)
- // Forward the site's selection provider to container
- IWorkbenchPartSite site = container2.getWorkbenchPartSite();
- if (site != null) {
- container2.setSelectionProvider(site.getSelectionProvider());
- }
- }
- }
- }
-
- /**
- * Creates a label in the detail pane area with the given message.
- *
- * @param message The message to display
- */
- private void createErrorLabel(String message){
- if (fCurrentPane != null) fCurrentPane.dispose();
- if (fCurrentControl != null && !fCurrentControl.isDisposed()) fCurrentControl.dispose();
- Label errorLabel = new Label(fParentContainer.getParentComposite(),SWT.LEFT);
- errorLabel.setText(message);
- errorLabel.setLayoutData(new GridData(GridData.FILL_BOTH));
- fCurrentControl = errorLabel;
- fParentContainer.getParentComposite().layout();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/IDetailPaneContainer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/IDetailPaneContainer.java
deleted file mode 100644
index 0c5f5cb49..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/IDetailPaneContainer.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables.details;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPartSite;
-
-/**
- * Interface for UI elements that contain detail panes. Provides access to
- * information about the current detail pane and allows the container to be
- * informed of changes.
- *
- * @since 3.3
- * @see AvailableDetailPanesAction
- * @see DetailPaneProxy
- */
-public interface IDetailPaneContainer {
-
- /**
- * Returns the string ID of the detail pane currently being displayed.
- *
- * @return the ID of the current detail pane
- */
- public String getCurrentPaneID();
-
- /**
- * Returns the selection to be displayed in the detail pane.
- *
- * @return the selection to be displayed in the detail pane.
- */
- public IStructuredSelection getCurrentSelection();
-
- /**
- * Returns the composite that detail panes will be added to.
- *
- * @return the composite that detail panes will be added to
- */
- public Composite getParentComposite();
-
- /**
- * Returns the workbench part site that the detail pane is in or <code>null</code>
- * if the detail pane is not in a workbench part site.
- *
- * @return the workbench part site the detail pane is in or <code>null</code>
- */
- public IWorkbenchPartSite getWorkbenchPartSite();
-
- /**
- * Refreshes the current detail pane with the current selection.
- */
- public void refreshDetailPaneContents();
-
- /**
- * Informs the container that the type of detail pane being used has changed.
- *
- * @param newPaneID ID of the new detail pane
- */
- public void paneChanged(String newPaneID);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/IDetailPaneContainer2.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/IDetailPaneContainer2.java
deleted file mode 100644
index 22177df57..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/IDetailPaneContainer2.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems, Inc. and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.views.variables.details;
-
-import org.eclipse.jface.viewers.ISelectionProvider;
-
-/**
- * A detail pane container which allows to set the selection provider of the detail pane.
- *
- * @since 3.5
- */
-public interface IDetailPaneContainer2 extends IDetailPaneContainer {
-
- /**
- * Set the selection provider of the detail pane. Allows the container to
- * forward the selection provider events to the container's workbench site.
- *
- * @param provider the selection provider or <code>null</code>
- */
- public void setSelectionProvider(ISelectionProvider provider);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java
deleted file mode 100644
index 438180c23..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.views.breakpoints.OtherBreakpointCategory;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-
-/**
- * Common function for breakpoint organizer delegates.
- * <p>
- * Clients implementing <code>IBreakpointOrganizerDelegate</code> must subclass this class.
- * </p>
- * @since 3.1
- */
-public abstract class AbstractBreakpointOrganizerDelegate implements IBreakpointOrganizerDelegate {
-
- // property change listeners
- private ListenerList fListeners = new ListenerList();
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#addBreakpoint(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
- */
- public void addBreakpoint(IBreakpoint breakpoint, IAdaptable category) {
- // do noting, not supported by default
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener) {
- fListeners.add(listener);
- }
-
- /* (non-Javadoc)
- *
- * Subclasses that override should return super.canAdd(...) when they are not able to add
- * the breakpoint.
- *
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#canAdd(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
- */
- public boolean canAdd(IBreakpoint breakpoint, IAdaptable category) {
- return category instanceof OtherBreakpointCategory;
- }
-
- /* (non-Javadoc)
- *
- * Subclasses that override should return super.canRemove(...) when they are not able to remove
- * the breakpoint.
- *
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#canRemove(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
- */
- public boolean canRemove(IBreakpoint breakpoint, IAdaptable category) {
- return category instanceof OtherBreakpointCategory;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#dispose()
- */
- public void dispose() {
- fListeners = new ListenerList();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#removeBreakpoint(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
- */
- public void removeBreakpoint(IBreakpoint breakpoint, IAdaptable category) {
- // do nothing, not supported by default
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener) {
- fListeners.remove(listener);
- }
-
- /**
- * Fires a property change notification for the given category.
- *
- * @param category category that has changed
- */
- protected void fireCategoryChanged(IAdaptable category) {
- if (fListeners.isEmpty()) {
- return;
- }
- final PropertyChangeEvent event = new PropertyChangeEvent(this, P_CATEGORY_CHANGED, category, null);
- Object[] listeners = fListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final IPropertyChangeListener listener = (IPropertyChangeListener) listeners[i];
- ISafeRunnable runnable = new ISafeRunnable() {
- public void handleException(Throwable exception) {
- DebugUIPlugin.log(exception);
- }
- public void run() throws Exception {
- listener.propertyChange(event);
- }
- };
- SafeRunner.run(runnable);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories()
- */
- public IAdaptable[] getCategories() {
- return null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java
deleted file mode 100644
index a0eb8f5b5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java
+++ /dev/null
@@ -1,998 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
-import org.eclipse.debug.internal.ui.LazyModelPresentation;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.TextViewer;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IPartListener2;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartReference;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.part.IPage;
-import org.eclipse.ui.part.MessagePage;
-import org.eclipse.ui.part.Page;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.part.PageBookView;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * Common function for views related to debugging. Clients implementing
- * views for a debugger should subclass this class. Common function
- * includes:
- * <ul>
- * <li>Debug view adapter implementation - <code>IDebugView</code></li>
- * <li>Action registry - actions can be stored in this view
- * with a key. Actions that implement <code>IUpdate</code>
- * are updated when <code>updateActions()</code> is
- * called.</li>
- * <li>Hooks the context menu associated with this view's
- * underlying viewer and registers the menu with this
- * view's site, such that other plug-ins may contribute.</li>
- * <li>Hooks a key press listener, and invokes the
- * <code>REMOVE_ACTION</code> when the delete key
- * is pressed.</li>
- * <li>Hooks a double-click listener, and invokes the
- * <code>DOUBLE_CLICK_ACTION</code> when the mouse
- * is double-clicked.</li>
- * <li>Provides a mechanism for displaying an error message
- * in the view, via the <code>PageBookView</code> mechanism.
- * By default, a page book is created with a page showing
- * this view's viewer. A message page is also created
- * and shown when <code>showMessage(String)</code> is
- * called.</li>
- * <li>Notification when this view becomes visible and becomes
- * hidden via <code>becomesVisible()</code> and <code>becomesHidden()</code>.</li>
- * <li>Linking of a help context id via <code>getHelpContextId().</code></li>
- * </ul>
- * <p>
- * This class may be sub-classed.
- * </p>
- * @since 2.0
- */
-
-public abstract class AbstractDebugView extends PageBookView implements IDebugView, IDoubleClickListener {
-
- /**
- * Underlying viewer that displays the contents of
- * this view.
- */
- private Viewer fViewer = null;
-
- /**
- * This view's message page.
- */
- private MessagePage fMessagePage = null;
-
- /**
- * Map of actions. Keys are strings, values
- * are <code>IAction</code>.
- */
- private Map fActionMap = null;
-
- /**
- * Map of actions. Keys are strings, values
- * are <code>IAction</code>.
- */
- private List fUpdateables = null;
-
- /**
- * The collection of menu managers that are
- * relevant for this view.
- */
- private List fContextMenuManagers;
-
- /**
- * The memento that was used to persist the state of this view.
- * May be <code>null</code>.
- */
- private IMemento fMemento;
-
- /**
- * Whether this view is currently visible.
- */
- private boolean fIsVisible = false;
-
- /**
- * The part listener for this view, used to notify this view when it
- * becomes visible and hidden. Set to <code>null</code> when this view isn't
- * currently listening to part changes.
- */
- private DebugViewPartListener fPartListener= null;
-
- /**
- * A message was requested to be displayed before the view was fully
- * created. The message is cached until it can be properly displayed.
- */
- private String fEarlyMessage= null;
-
- private static Set fgGlobalActionIds;
- static {
- fgGlobalActionIds = new HashSet();
- fgGlobalActionIds.add(SELECT_ALL_ACTION);
- fgGlobalActionIds.add(COPY_ACTION);
- fgGlobalActionIds.add(CUT_ACTION);
- fgGlobalActionIds.add(PASTE_ACTION);
- fgGlobalActionIds.add(FIND_ACTION);
- fgGlobalActionIds.add(ActionFactory.UNDO.getId());
- fgGlobalActionIds.add(ActionFactory.REDO.getId());
- }
-
- /**
- * Part listener that disables updating when the view is not visible and
- * re-enables updating when the view appears.
- */
- private class DebugViewPartListener implements IPartListener2 {
- /**
- *
- * @see org.eclipse.ui.IPartListener2#partVisible(IWorkbenchPartReference)
- */
- public void partVisible(IWorkbenchPartReference ref) {
- IWorkbenchPart part= ref.getPart(false);
- if (part == AbstractDebugView.this) {
- fIsVisible = true;
- becomesVisible();
- }
- }
- /**
- * @see org.eclipse.ui.IPartListener2#partHidden(IWorkbenchPartReference)
- */
- public void partHidden(IWorkbenchPartReference ref) {
- IWorkbenchPart part= ref.getPart(false);
- if (part == AbstractDebugView.this) {
- fIsVisible = false;
- becomesHidden();
- }
- }
- /**
- * @see org.eclipse.ui.IPartListener2#partActivated(IWorkbenchPartReference)
- */
- public void partActivated(IWorkbenchPartReference ref) {
- }
-
- /**
- * @see org.eclipse.ui.IPartListener2#partBroughtToTop(IWorkbenchPartReference)
- */
- public void partBroughtToTop(IWorkbenchPartReference ref) {
- }
-
- /**
- * @see org.eclipse.ui.IPartListener2#partClosed(IWorkbenchPartReference)
- */
- public void partClosed(IWorkbenchPartReference ref) {
- }
-
- /**
- * @see org.eclipse.ui.IPartListener2#partDeactivated(IWorkbenchPartReference)
- */
- public void partDeactivated(IWorkbenchPartReference ref) {
- }
-
- /**
- * @see org.eclipse.ui.IPartListener2#partOpened(IWorkbenchPartReference)
- */
- public void partOpened(IWorkbenchPartReference ref) {
- }
-
- /**
- * @see org.eclipse.ui.IPartListener2#partInputChanged(IWorkbenchPartReference)
- */
- public void partInputChanged(IWorkbenchPartReference ref){
- }
-
- }
-
- /**
- * Constructs a new debug view.
- */
- public AbstractDebugView() {
- fActionMap = new HashMap(5);
- fUpdateables= new ArrayList(3);
- }
-
- /**
- * Debug views implement the debug view adapter which
- * provides access to a view's underlying viewer and
- * debug model presentation for a specific debug model.
- *
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- * @see IDebugView
- */
- public Object getAdapter(Class adapter) {
- if (adapter == IDebugView.class) {
- return this;
- }
- if (adapter == IDebugModelPresentation.class) {
- StructuredViewer viewer = getStructuredViewer();
- if (viewer != null) {
- IBaseLabelProvider labelProvider = viewer.getLabelProvider();
- if (labelProvider instanceof IDebugModelPresentation) {
- return labelProvider;
- }
- }
- }
- return super.getAdapter(adapter);
- }
-
- /**
- * A page in this view's page book that contains this
- * view's viewer.
- */
- class ViewerPage extends Page {
- /**
- * @see IPage#createControl(Composite)
- */
- public void createControl(Composite parent) {
- Viewer viewer = createViewer(parent);
- setViewer(viewer);
- }
-
- /**
- * @see IPage#getControl()
- */
- public Control getControl() {
- return getDefaultControl();
- }
-
- /**
- * @see IPage#setFocus()
- */
- public void setFocus() {
- Viewer viewer= getViewer();
- if (viewer != null) {
- Control c = viewer.getControl();
- if (!c.isFocusControl()) {
- c.setFocus();
- }
- }
- }
-
-}
-
- /**
- * Creates this view's underlying viewer and actions.
- * Hooks a pop-up menu to the underlying viewer's control,
- * as well as a key listener. When the delete key is pressed,
- * the <code>REMOVE_ACTION</code> is invoked. Hooks help to
- * this view. Subclasses must implement the following methods
- * which are called in the following order when a view is
- * created:<ul>
- * <li><code>createViewer(Composite)</code> - the context
- * menu is hooked to the viewer's control.</li>
- * <li><code>createActions()</code></li>
- * <li><code>configureToolBar(IToolBarManager)</code></li>
- * <li><code>getHelpContextId()</code></li>
- * </ul>
- * @see IWorkbenchPart#createPartControl(Composite)
- * @see AbstractDebugView#createPartControl(Composite)
- * @see AbstractDebugView#createActions()
- * @see AbstractDebugView#configureToolBar(IToolBarManager)
- * @see AbstractDebugView#getHelpContextId()
- * @see AbstractDebugView#fillContextMenu(IMenuManager)
- */
- public void createPartControl(Composite parent) {
- registerPartListener();
- super.createPartControl(parent);
- createActions();
- initializeToolBar();
- Viewer viewer = getViewer();
- if (viewer != null) {
- createContextMenu(viewer.getControl());
- }
- String helpId = getHelpContextId();
- if (helpId != null) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, helpId);
- }
- if (viewer != null) {
- getViewer().getControl().addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- handleKeyPressed(e);
- }
- });
- if (getViewer() instanceof StructuredViewer) {
- ((StructuredViewer)getViewer()).addDoubleClickListener(this);
- }
- }
- // create the message page
- setMessagePage(new MessagePage());
- getMessagePage().createControl(getPageBook());
- initPage(getMessagePage());
-
- if (fEarlyMessage != null) { //bug 28127
- showMessage(fEarlyMessage);
- fEarlyMessage= null;
- }
- }
-
- /**
- * The default page for a debug view is its viewer.
- *
- * @see PageBookView#createDefaultPage(PageBook)
- */
- protected IPage createDefaultPage(PageBook book) {
- ViewerPage page = new ViewerPage();
- page.createControl(book);
- initPage(page);
- return page;
- }
-
- /**
- * Creates and returns this view's underlying viewer.
- * The viewer's control will automatically be hooked
- * to display a pop-up menu that other plug-ins may
- * contribute to. Subclasses must override this method.
- *
- * @param parent the parent control
- */
- protected abstract Viewer createViewer(Composite parent);
-
- /**
- * Creates this view's actions. Subclasses must
- * override this method, which is called after
- * <code>createViewer(Composite)</code>
- */
- protected abstract void createActions();
-
- /**
- * Returns this view's help context id, which is hooked
- * to this view on creation.
- *
- * @return help context id
- */
- protected abstract String getHelpContextId();
-
- /**
- * @see IWorkbenchPart#dispose()
- */
- public void dispose() {
- saveAllCheckedActionStates();
- deregisterPartListener();
- if (getViewer() instanceof StructuredViewer) {
- ((StructuredViewer)getViewer()).removeDoubleClickListener(this);
- }
- setViewer(null);
- fActionMap.clear();
- super.dispose();
- }
-
- /**
- * Saves the checked state for all actions contributed to the toolbar
- * manager that function as a toggle action. The states are saved in
- * the Debug UI plugin's preference store.
- *
- * @since 2.1
- */
- protected void saveAllCheckedActionStates() {
- IToolBarManager tbm= getViewSite().getActionBars().getToolBarManager();
- IContributionItem[] items= tbm.getItems();
- for (int i = 0; i < items.length; i++) {
- IContributionItem iContributionItem = items[i];
- if (iContributionItem instanceof ActionContributionItem) {
- ActionContributionItem item= (ActionContributionItem)iContributionItem;
- IAction action= item.getAction();
- if (action.getStyle() == IAction.AS_CHECK_BOX && action.isEnabled()) {
- saveCheckedActionState(action);
- }
- }
- }
- }
-
- /**
- * Save the checked state of the specified action in the Debug UI plugin's
- * preference store. The specified action is expected to be enabled and
- * support the style <code>IAction.AS_CHECK_BOX</code>.
- *
- * @param action the enabled, toggle action whose checked state will be
- * saved in preferences
- * @since 2.1
- */
- protected void saveCheckedActionState(IAction action) {
- String prefKey = generatePreferenceKey(action);
- IPreferenceStore prefStore = getPreferenceStore();
- prefStore.setValue(prefKey, action.isChecked());
- }
-
- /**
- * Generate a String that can be used as a key into a preference store based
- * on the specified action. The resulting String will be unique across
- * views.
- *
- * @return a String suitable for use as a preference store key for the given
- * action
- * @since 2.1
- */
- protected String generatePreferenceKey(IAction action) {
- return getViewSite().getId() + '+' + action.getId();
- }
-
- /**
- * Convenience method to return the preference store for the Debug UI
- * plug-in.
- *
- * @return the preference store for the Debug UI plug-in
- * @since 2.1
- */
- protected IPreferenceStore getPreferenceStore() {
- return DebugUIPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * @see IDebugView#getViewer()
- */
- public Viewer getViewer() {
- return fViewer;
- }
-
- /**
- * Returns this view's viewer as a structured viewer,
- * or <code>null</code> if none.
- *
- * @return this view's viewer as a structured viewer
- * or <code>null</code>
- */
- protected StructuredViewer getStructuredViewer() {
- if (getViewer() instanceof StructuredViewer) {
- return (StructuredViewer)getViewer();
- }
- return null;
- }
-
- /**
- * Returns this view's viewer as a text viewer,
- * or <code>null</code> if none.
- *
- * @return this view's viewer as a text viewer
- * or <code>null</code>
- */
- protected TextViewer getTextViewer() {
- if (getViewer() instanceof TextViewer) {
- return (TextViewer)getViewer();
- }
- return null;
- }
-
- /**
- * @see IDebugView#getPresentation(String)
- */
- public IDebugModelPresentation getPresentation(String id) {
- if (getViewer() instanceof StructuredViewer) {
- IBaseLabelProvider lp = ((StructuredViewer)getViewer()).getLabelProvider();
- if (lp instanceof DelegatingModelPresentation) {
- return ((DelegatingModelPresentation)lp).getPresentation(id);
- }
- if (lp instanceof LazyModelPresentation) {
- if (((LazyModelPresentation)lp).getDebugModelIdentifier().equals(id)) {
- return (IDebugModelPresentation)lp;
- }
- }
- }
- return null;
- }
-
- /**
- * Creates a pop-up menu on the given control. The menu
- * is registered with this view's site, such that other
- * plug-ins may contribute to the menu. Subclasses should
- * call this method, specifying the menu control as the
- * control used in their viewer (for example, tree viewer).
- * Subclasses must implement the method
- * <code>#fillContextMenu(IMenuManager)</code> which will
- * be called each time the context menu is realized.
- *
- * @param menuControl the control with which the pop-up
- * menu will be associated with.
- */
- protected void createContextMenu(Control menuControl) {
- MenuManager menuMgr= new MenuManager("#PopUp"); //$NON-NLS-1$
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- fillContextMenu(mgr);
- }
- });
- Menu menu= menuMgr.createContextMenu(menuControl);
- menuControl.setMenu(menu);
-
- // register the context menu such that other plug-ins may contribute to it
- if (getSite() != null) {
- getSite().registerContextMenu(menuMgr, getViewer());
- }
- addContextMenuManager(menuMgr);
- }
-
- /**
- * @see IDebugView#getContextMenuManager()
- *
- * @deprecated @see AbstractDebugView.getContextMenuManagers()
- */
- public IMenuManager getContextMenuManager() {
- if (fContextMenuManagers != null) {
- fContextMenuManagers.get(fContextMenuManagers.size() - 1);
- }
- return null;
- }
-
- /**
- * Returns the context menu managers relevant to this view.
- *
- * @return the context menu managers relevant to this view
- * @since 2.1
- */
- public List getContextMenuManagers() {
- return fContextMenuManagers;
- }
-
- /**
- * Subclasses must override this method to fill the context
- * menu each time it is realized.
- *
- * @param menu the context menu
- */
- protected abstract void fillContextMenu(IMenuManager menu);
-
- /**
- * Configures this view's toolbar. Subclasses implement
- * <code>#configureToolBar(IToolBarManager)</code> to
- * contribute actions to the toolbar.
- * <p>
- * To properly initialize toggle actions that are contributed
- * to this view, state is restored for toggle actions that have
- * a persisted state in the Debug UI plugin's preferences. As well, any
- * toggle actions that have an initial state of 'checked' are invoked. The
- * actions' states are restored and the actions are invoked in a runnable,
- * after the view is created.
- * </p>
- */
- protected void initializeToolBar() {
- final IToolBarManager tbm= getViewSite().getActionBars().getToolBarManager();
- configureToolBar(tbm);
- getViewSite().getActionBars().updateActionBars();
-
- // This is done in a runnable to be run after this view's pane
- // is created
- Runnable r = new Runnable() {
- public void run() {
- if (!isAvailable()) {
- return;
- }
- IContributionItem[] items = tbm.getItems();
- if (items != null) {
- for (int i = 0; i < items.length; i++) {
- if (items[i] instanceof ActionContributionItem) {
- IAction action = ((ActionContributionItem)items[i]).getAction();
- if (action.getStyle() == IAction.AS_CHECK_BOX) {
- initActionState(action);
- if (action.isChecked()) {
- action.run();
- }
- }
- }
- }
- setMemento(null);
- }
- updateObjects();
- }
- };
- asyncExec(r);
- }
-
- /**
- * Restores the persisted checked state of the specified action that was
- * stored in preferences. If the action is disabled, its persisted state
- * is not restored (because a disabled action cannot be run).
- *
- * @param action the action whose checked state will be restored
- * @since 2.1
- */
- protected void initActionState(IAction action) {
- String id = action.getId();
- if (id != null && action.isEnabled()) {
- String prefKey = generatePreferenceKey(action);
- boolean checked = getPreferenceStore().getBoolean(prefKey);
- action.setChecked(checked);
- }
- }
-
- /**
- * @see IViewPart#init(IViewSite, IMemento)
- */
- public void init(IViewSite site, IMemento memento) throws PartInitException {
- super.init(site, memento);
- //store the memento to be used when this view is created.
- setMemento(memento);
- }
-
- /**
- * Sets the viewer for this view.
- *
- * @param viewer viewer
- * @since 3.1
- */
- protected void setViewer(Viewer viewer) {
- fViewer = viewer;
- }
-
- /**
- * Subclasses implement this menu to contribute actions
- * to the toolbar. This method is called after
- * <code>createActions()</code>.
- *
- * @param tbm the tool bar manager for this view's site
- * @see #createViewer(Composite)
- */
- protected abstract void configureToolBar(IToolBarManager tbm);
-
- /**
- * @see IDebugView#setAction(String, IAction)
- */
- public void setAction(String actionID, IAction action) {
- if (action == null) {
- Object removedAction= fActionMap.remove(actionID);
- fUpdateables.remove(removedAction);
- } else {
- fActionMap.put(actionID, action);
- if (action instanceof IUpdate) {
- fUpdateables.add(action);
- }
- }
- if (fgGlobalActionIds.contains(actionID)) {
- IActionBars actionBars = getViewSite().getActionBars();
- actionBars.setGlobalActionHandler(actionID, action);
- }
- }
-
- /**
- * @see IDebugView#getAction(String)
- */
- public IAction getAction(String actionID) {
- return (IAction) fActionMap.get(actionID);
- }
-
- /**
- * Updates all the registered updatables.
- */
- public void updateObjects() {
- Iterator actions = fUpdateables.iterator();
- while (actions.hasNext()) {
- ((IUpdate)actions.next()).update();
- }
- }
-
- /**
- * Handles key events in viewer. Invokes
- * <ol>
- * <li><code>REMOVE_ACTION</code> when the delete
- * key is pressed</li>
- */
- protected void handleKeyPressed(KeyEvent event) {
- if (event.character == SWT.DEL && event.stateMask == 0) {
- IAction action = getAction(REMOVE_ACTION);
- if (action != null && action.isEnabled()) {
- action.run();
- }
- }
- }
-
- /**
- * Delegate to the <code>DOUBLE_CLICK_ACTION</code>,
- * if any.
- *
- * @see IDoubleClickListener#doubleClick(DoubleClickEvent)
- */
- public void doubleClick(DoubleClickEvent event) {
- IAction action = getAction(DOUBLE_CLICK_ACTION);
- if (action != null && !event.getSelection().isEmpty() && action.isEnabled()) {
- action.run();
- }
- }
-
- /**
- * Registers the given runnable with the display
- * associated with this view's control, if any.
- *
- * @see org.eclipse.swt.widgets.Display#asyncExec(java.lang.Runnable)
- */
- public void asyncExec(Runnable r) {
- if (isAvailable()) {
- getControl().getDisplay().asyncExec(r);
- }
- }
-
- /**
- * Returns the control for this view, or <code>null</code> if none.
- *
- * @return the control for this view, or <code>null</code> if none
- * @since 3.0
- */
- protected Control getControl() {
- return getViewer().getControl();
- }
-
- /**
- * Registers the given runnable with the display
- * associated with this view's control, if any.
- *
- * @see org.eclipse.swt.widgets.Display#syncExec(java.lang.Runnable)
- */
- public void syncExec(Runnable r) {
- if (isAvailable()) {
- getControl().getDisplay().syncExec(r);
- }
- }
-
- /**
- * Returns the memento that contains the persisted state of
- * the view. May be <code>null</code>.
- */
- protected IMemento getMemento() {
- return fMemento;
- }
-
- /**
- * Sets the memento that contains the persisted state of the
- * view.
- */
- protected void setMemento(IMemento memento) {
- fMemento = memento;
- }
-
- /**
- * Returns the specified view in this view's page
- * or <code>null</code> if none.
- *
- * @param id view identifier
- * @return view part
- */
- protected IViewPart findView(String id) {
- IWorkbenchPage page = getSite().getPage();
- IViewPart view = null;
- if (page != null) {
- view = page.findView(id);
- }
- return view;
- }
-
- /**
- * @see PageBookView#isImportant(IWorkbenchPart)
- */
- protected boolean isImportant(IWorkbenchPart part) {
- return false;
- }
-
- /**
- * @see PageBookView#doCreatePage(IWorkbenchPart)
- */
- protected PageRec doCreatePage(IWorkbenchPart part) {
- return null;
- }
-
- /**
- * @see PageBookView#doDestroyPage(org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.part.PageBookView.PageRec)
- */
- protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) {
- }
-
- /**
- * @see PageBookView#getBootstrapPart()
- */
- protected IWorkbenchPart getBootstrapPart() {
- return null;
- }
-
- /**
- * Returns the default control for this view. By default,
- * this view's viewer's control is returned. Subclasses
- * should override if required - for example, if this
- * view has its viewer nested inside other controls.
- *
- * @return this view's default control.
- */
- protected Control getDefaultControl() {
- Viewer viewer = getViewer();
- if (viewer != null) {
- return viewer.getControl();
- }
- return null;
- }
-
- /**
- * Sets this view's message page
- *
- * @param page message page
- */
- private void setMessagePage(MessagePage page) {
- fMessagePage = page;
- }
-
- /**
- * Returns this view's message page
- *
- * @return message page
- */
- protected MessagePage getMessagePage() {
- return fMessagePage;
- }
-
- /**
- * Shows the given message in this view's message'
- * page. Makes the message page the visible page.
- *
- * @param message the message to display
- */
- public void showMessage(String message) {
- if (getPageBook().isDisposed()) {
- return;
- }
- if (getMessagePage() == null) {
- //not fully created yet
- fEarlyMessage= message;
- return;
- }
- getMessagePage().setMessage(message);
- getPageBook().showPage(getMessagePage().getControl());
- }
-
- /**
- * Shows this view's viewer page.
- */
- public void showViewer() {
- if (getPageBook().isDisposed()) {
- return;
- }
- getPageBook().showPage(getDefaultPage().getControl());
- }
-
- /**
- * Returns whether this view's viewer is
- * currently available.
- *
- * @return whether this view's viewer is
- * currently available
- */
- public boolean isAvailable() {
- return !(getViewer() == null || getViewer().getControl() == null || getViewer().getControl().isDisposed());
- }
- /**
- * @see IDebugView#add(IUpdate)
- */
- public void add(IUpdate updatable) {
- if (!fUpdateables.contains(updatable)) {
- fUpdateables.add(updatable);
- }
- }
-
- /**
- * @see IDebugView#remove(IUpdate)
- */
- public void remove(IUpdate updatable) {
- fUpdateables.remove(updatable);
- }
-
- /**
- * Adds a context menu manager that is relevant to this view.
- * @param contextMenuManager The contextMenuManager to add
- *
- * @since 2.1
- */
- public void addContextMenuManager(IMenuManager contextMenuManager) {
- if (fContextMenuManagers == null) {
- fContextMenuManagers= new ArrayList();
- }
- fContextMenuManagers.add(contextMenuManager);
- }
-
- /**
- * Notification this view is now visible.
- *
- * @since 2.1
- */
- protected void becomesVisible() {
- }
-
- /**
- * Notification this view is now hidden.
- *
- * @since 2.1
- */
- protected void becomesHidden() {
- }
-
- /**
- * Returns whether this view is currently visible.
- *
- * @return whether this view is currently visible
- * @since 2.1
- */
- public boolean isVisible() {
- return fIsVisible;
- }
-
- /**
- * Creates and registers a part listener with this event handler's page,
- * if one does not already exist.
- *
- * @since 2.1
- */
- protected void registerPartListener() {
- if (fPartListener == null) {
- fPartListener= new DebugViewPartListener();
- getSite().getPage().addPartListener(fPartListener);
- }
- }
-
- /**
- * Unregisters and disposes this event handler's part listener.
- *
- * @since 2.1
- */
- protected void deregisterPartListener() {
- if (fPartListener != null) {
- getSite().getPage().removePartListener(fPartListener);
- fPartListener = null;
- }
- }
-
- /**
- * Returns a map of the current attribute settings in the model
- * presentation in this view associated with the given debug model.
- *
- * @return a map of the current attribute settings in the model
- * presentation in this view associated with the given debug model
- * @since 3.0
- */
- public Map getPresentationAttributes(String modelId) {
- IDebugModelPresentation presentation = getPresentation(modelId);
- if (presentation instanceof DelegatingModelPresentation) {
- return ((DelegatingModelPresentation)presentation).getAttributeMap();
- } else if (presentation instanceof LazyModelPresentation) {
- return ((LazyModelPresentation)presentation).getAttributeMap();
- }
- return new HashMap();
- }
-}
-
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTab.java
deleted file mode 100644
index 051ebd3ad..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTab.java
+++ /dev/null
@@ -1,445 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.progress.WorkbenchJob;
-
-/**
- * Common function for launch configuration tabs.
- * <p>
- * Clients may subclass this class.
- * </p>
- * @see ILaunchConfigurationTab
- * @since 2.0
- */
-public abstract class AbstractLaunchConfigurationTab implements ILaunchConfigurationTab {
-
- /**
- * The control for this page, or <code>null</code>
- */
- private Control fControl;
-
- /**
- * The launch configuration dialog this tab is
- * contained in.
- */
- private ILaunchConfigurationDialog fLaunchConfigurationDialog;
-
- /**
- * Current error message, or <code>null</code>
- */
- private String fErrorMessage;
-
- /**
- * Current message, or <code>null</code>
- */
- private String fMessage;
-
- /**
- * Whether this tab needs to apply changes. This attribute is initialized to
- * <code>true</code> to be backwards compatible. If clients want to take advantage
- * of such a feature, they should set the flag to false, and check it before
- * applying changes to the launch configuration working copy.
- *
- * @since 2.1
- */
- private boolean fDirty = true;
-
- /**
- * Job to update the tab after a delay. Used to delay updates while
- * the user is typing.
- */
- private Job fRereshJob;
-
- /**
- * Returns the dialog this tab is contained in, or
- * <code>null</code> if not yet set.
- *
- * @return launch configuration dialog, or <code>null</code>
- */
- protected ILaunchConfigurationDialog getLaunchConfigurationDialog() {
- return fLaunchConfigurationDialog;
- }
-
- /**
- * Updates the buttons and message in this page's launch
- * configuration dialog.
- */
- protected void updateLaunchConfigurationDialog() {
- if (getLaunchConfigurationDialog() != null) {
- //order is important here due to the call to
- //refresh the tab viewer in updateButtons()
- //which ensures that the messages are up to date
- getLaunchConfigurationDialog().updateButtons();
- getLaunchConfigurationDialog().updateMessage();
- }
- }
-
- /**
- * @see ILaunchConfigurationTab#getControl()
- */
- public Control getControl() {
- return fControl;
- }
-
- /**
- * Sets the control to be displayed in this tab.
- *
- * @param control the control for this tab
- */
- protected void setControl(Control control) {
- fControl = control;
- }
-
- /**
- * @see ILaunchConfigurationTab#getErrorMessage()
- */
- public String getErrorMessage() {
- return fErrorMessage;
- }
-
- /**
- * @see ILaunchConfigurationTab#getMessage()
- */
- public String getMessage() {
- return fMessage;
- }
-
- /**
- * By default, do nothing.
- *
- * @see ILaunchConfigurationTab#launched(ILaunch)
- * @deprecated
- */
- public void launched(ILaunch launch) {
- }
-
- /**
- * @see ILaunchConfigurationTab#setLaunchConfigurationDialog(ILaunchConfigurationDialog)
- */
- public void setLaunchConfigurationDialog(ILaunchConfigurationDialog dialog) {
- fLaunchConfigurationDialog = dialog;
- }
-
- /**
- * Sets this page's error message, possibly <code>null</code>.
- *
- * @param errorMessage the error message or <code>null</code>
- */
- protected void setErrorMessage(String errorMessage) {
- fErrorMessage = errorMessage;
- }
-
- /**
- * Sets this page's message, possibly <code>null</code>.
- *
- * @param message the message or <code>null</code>
- */
- protected void setMessage(String message) {
- fMessage = message;
- }
-
- /**
- * Convenience method to return the launch manager.
- *
- * @return the launch manager
- */
- protected ILaunchManager getLaunchManager() {
- return DebugPlugin.getDefault().getLaunchManager();
- }
-
- /**
- * By default, do nothing.
- *
- * @see ILaunchConfigurationTab#dispose()
- */
- public void dispose() {
- }
-
- /**
- * Returns the shell this tab is contained in, or <code>null</code>.
- *
- * @return the shell this tab is contained in, or <code>null</code>
- */
- protected Shell getShell() {
- Control control = getControl();
- if (control != null) {
- return control.getShell();
- }
- return null;
- }
-
- /**
- * Creates and returns a new push button with the given
- * label and/or image.
- *
- * @param parent parent control
- * @param label button label or <code>null</code>
- * @param image image of <code>null</code>
- *
- * @return a new push button
- */
- protected Button createPushButton(Composite parent, String label, Image image) {
- return SWTFactory.createPushButton(parent, label, image);
- }
-
- /**
- * Creates and returns a new radio button with the given
- * label and/or image.
- *
- * @param parent parent control
- * @param label button label or <code>null</code>
- *
- * @return a new radio button
- */
- protected Button createRadioButton(Composite parent, String label) {
- return SWTFactory.createRadioButton(parent, label);
- }
-
- /**
- * Creates and returns a new check button with the given
- * label.
- *
- * @param parent the parent composite
- * @param label the button label
- * @return a new check button
- * @since 3.0
- */
- protected Button createCheckButton(Composite parent, String label) {
- return SWTFactory.createCheckButton(parent, label, null, false, 1);
- }
-
- /**
- * @see ILaunchConfigurationTab#canSave()
- */
- public boolean canSave() {
- return true;
- }
-
- /**
- * @see ILaunchConfigurationTab#isValid(ILaunchConfiguration)
- */
- public boolean isValid(ILaunchConfiguration launchConfig) {
- return true;
- }
-
- /**
- * Creates vertical space in the parent <code>Composite</code>
- * @param comp the parent to add the vertical space to
- * @param colSpan the number of line of vertical space to add
- */
- protected void createVerticalSpacer(Composite comp, int colSpan) {
- SWTFactory.createVerticalSpacer(comp, colSpan);
- }
-
- /**
- * Create a horizontal separator.
- *
- * @param comp parent widget
- * @param colSpan number of columns to span
- * @since 3.0
- */
- protected void createSeparator(Composite comp, int colSpan) {
- Label label = new Label(comp, SWT.SEPARATOR | SWT.HORIZONTAL);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = colSpan;
- label.setLayoutData(gd);
- }
-
- /**
- * @see ILaunchConfigurationTab#getImage()
- */
- public Image getImage() {
- return null;
- }
-
- /**
- * Returns this tab's unique identifier or <code>null</code> if none.
- * By default, <code>null</code> is returned. Subclasses should override
- * as necessary.
- * <p>
- * Tab identifiers allow contributed tabs to be ordered relative to one
- * another.
- * </p>
- * @return tab id or <code>null</code>
- * @since 3.3
- */
- public String getId() {
- return null;
- }
-
- /**
- * Convenience method to set a boolean attribute of on a launch
- * configuration. If the value being set is the default, the attribute's
- * value is set to <code>null</code>.
- *
- * @param attribute attribute identifier
- * @param configuration the configuration on which to set the attribute
- * @param value the value of the attribute
- * @param defaultValue the default value of the attribute
- * @since 2.1
- */
- protected void setAttribute(String attribute, ILaunchConfigurationWorkingCopy configuration, boolean value, boolean defaultValue) {
- if (value == defaultValue) {
- configuration.setAttribute(attribute, (String)null);
- } else {
- configuration.setAttribute(attribute, value);
- }
- }
-
-
-
- /**
- * Returns if this tab has pending changes that need to be saved.
- *
- * It is up to clients to set/reset and consult this attribute as required.
- * By default, a tab is initialized to dirty for backwards compatibility.
- *
- * @return whether this tab is dirty
- * @since 2.1
- */
- protected boolean isDirty() {
- return fDirty;
- }
-
- /**
- * Sets the dirty state of the tab. Setting this flag allows clients to
- * explicitly say whether this tab has pending changes or not.
- *
- * It is up to clients to set/reset and consult this attribute as required.
- * By default, a tab is initialized to dirty for backwards compatibility.
- *
- * @param dirty what to set the dirty flag to
- * @since 2.1
- */
- protected void setDirty(boolean dirty) {
- fDirty = dirty;
- }
-
- /**
- * This method was added to the <code>ILaunchConfigurationTab</code> interface
- * in the 3.0 release to allow tabs to distinguish between a tab being activated
- * and a tab group be initialized for the first time, from a selected launch
- * configuration. To maintain backwards compatible behavior, the default
- * implementation provided, calls this tab's <code>initializeFrom</code> method.
- * Tabs should override this method as required.
- * <p>
- * The launch tab framework was originally designed to take care of inter tab
- * communication by applying attributes from the active tab to the launch configuration
- * being edited, when a tab is exited, and by initializing a tab when activated.
- * The addition of the methods <code>activated</code> and <code>deactivated</code>
- * allow tabs to determine the appropriate course of action.
- * </p>
- *
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- * @since 3.0
- */
- public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
- initializeFrom(workingCopy);
- }
-
- /**
- * This method was added to the <code>ILaunchConfigurationTab</code> interface
- * in the 3.0 release to allow tabs to distinguish between a tab being deactivated
- * and saving its attributes to a launch configuration. To maintain backwards
- * compatible behavior, the default implementation provided, calls this tab's
- * <code>performApply</code> method. Tabs should override this method as required.
- * <p>
- * The launch tab framework was originally designed to take care of inter tab
- * communication by applying attributes from the active tab to the launch configuration
- * being edited, when a tab is exited, and by initializing a tab when activated.
- * The addition of the methods <code>activated</code> and <code>deactivated</code>
- * allow tabs to determine the appropriate course of action.
- * </p>
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- * @since 3.0
- */
- public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
- performApply(workingCopy);
- }
-
- /**
- * Returns the job to update the launch configuration dialog.
- *
- * @return update job
- */
- private Job getUpdateJob() {
- if (fRereshJob == null) {
- fRereshJob = createUpdateJob();
- fRereshJob.setSystem(true);
- }
- return fRereshJob;
- }
-
- /**
- * Schedules the update job to run for this tab based on this tab's delay.
- *
- * @since 3.6
- */
- protected void scheduleUpdateJob() {
- Job job = getUpdateJob();
- job.cancel(); // cancel existing job
- job.schedule(getUpdateJobDelay());
- }
-
- /**
- * Creates and returns a job used to update the launch configuration dialog
- * for this tab. Subclasses may override.
- *
- * @return job to update the launch dialog for this tab
- * @since 3.6
- */
- protected Job createUpdateJob() {
- return new WorkbenchJob(getControl().getDisplay(), "Update LCD") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if (!getControl().isDisposed()) {
- updateLaunchConfigurationDialog();
- }
- return Status.OK_STATUS;
- }
- public boolean shouldRun() {
- return !getControl().isDisposed();
- }
- };
- }
-
- /**
- * Return the time delay that should be used when scheduling the
- * update job. Subclasses may override.
- *
- * @return a time delay in milliseconds before the job should run
- * @since 3.6
- */
- protected long getUpdateJobDelay() {
- return 200;
- }
-
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTabGroup.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTabGroup.java
deleted file mode 100644
index defae2d5a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTabGroup.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-
-/**
- * Common function for launch configuration tab groups.
- * Generally, a launch configuration tab group will subclass
- * this class, and define a method to create and set the tabs
- * in that group.
- * <p>
- * Clients may subclass this class.
- * </p>
- * @see ILaunchConfigurationTabGroup
- * @since 2.0
- */
-public abstract class AbstractLaunchConfigurationTabGroup implements ILaunchConfigurationTabGroup {
-
- /**
- * The tabs in this tab group, or <code>null</code> if not yet instantiated.
- */
- protected ILaunchConfigurationTab[] fTabs = null;
-
- /**
- * @see ILaunchConfigurationTabGroup#getTabs()
- */
- public ILaunchConfigurationTab[] getTabs() {
- return fTabs;
- }
-
- /**
- * Sets the tabs in this group
- *
- * @param tabs the tabs in this group
- */
- protected void setTabs(ILaunchConfigurationTab[] tabs) {
- fTabs = tabs;
- }
-
- /**
- * By default, dispose all the tabs in this group.
- *
- * @see ILaunchConfigurationTabGroup#dispose()
- */
- public void dispose() {
- ILaunchConfigurationTab[] tabs = getTabs();
- if (tabs != null) {
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].dispose();
- }
- }
- }
-
- /**
- * By default, delegate to all of the tabs in this group.
- *
- * @see ILaunchConfigurationTabGroup#setDefaults(ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- ILaunchConfigurationTab[] tabs = getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].setDefaults(configuration);
- }
- }
-
- /**
- * By default, delegate to all of the tabs in this group.
- *
- * @see ILaunchConfigurationTabGroup#initializeFrom(ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- ILaunchConfigurationTab[] tabs = getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].initializeFrom(configuration);
- }
- }
-
- /**
- * By default, delegate to all of the tabs in this group.
- *
- * @see ILaunchConfigurationTabGroup#performApply(ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- ILaunchConfigurationTab[] tabs = getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].performApply(configuration);
- }
- }
-
- /**
- * By default, delegate to all of the tabs in this group.
- *
- * @see ILaunchConfigurationTabGroup#launched(ILaunch)
- * @deprecated
- */
- public void launched(ILaunch launch) {
- ILaunchConfigurationTab[] tabs = getTabs();
- for (int i = 0; i < tabs.length; i++) {
- tabs[i].launched(launch);
- }
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/BreakpointTypeCategory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/BreakpointTypeCategory.java
deleted file mode 100644
index 32e60a036..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/BreakpointTypeCategory.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-
-/**
- * Default implementation for a breakpoint type category.
- * <p>
- * Clients providing breakpoint type category adapters may instantiate
- * and subclass this class.
- * </p>
- * @since 3.1
- */
-public class BreakpointTypeCategory extends PlatformObject implements IBreakpointTypeCategory, IWorkbenchAdapter {
-
- private String fName;
- private ImageDescriptor fImageDescriptor = DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_OBJS_BREAKPOINT_TYPE);
-
- /**
- * Constructs a type category for the given type name.
- *
- * @param name breakpoint type name
- */
- public BreakpointTypeCategory(String name) {
- fName = name;
- }
-
- /**
- * Constructs a type category for the given type name with the given
- * image.
- *
- * @param name breakpoint type name
- * @param descriptor image descriptor
- */
- public BreakpointTypeCategory(String name, ImageDescriptor descriptor) {
- fName = name;
- if (descriptor != null) {
- fImageDescriptor = descriptor;
- }
- }
-
- /**
- * Returns the name of this category's breakpoint type.
- *
- * @return the name of this category's breakpoint type
- */
- protected String getName() {
- return fName;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object object) {
- if (object instanceof BreakpointTypeCategory) {
- BreakpointTypeCategory type = (BreakpointTypeCategory) object;
- return type.getName().equals(getName());
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return getName().hashCode();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
- */
- public Object[] getChildren(Object o) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- return fImageDescriptor;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
- */
- public String getLabel(Object o) {
- return getName();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
- */
- public Object getParent(Object o) {
- return null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java
deleted file mode 100644
index e43740958..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java
+++ /dev/null
@@ -1,935 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.variables.VariablesPlugin;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.ide.IDEEncoding;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.views.navigator.ResourceComparator;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Launch configuration tab used to specify the location a launch configuration
- * is stored in, whether it should appear in the favorites list, and perspective
- * switching behavior for an associated launch.
- * <p>
- * Clients may instantiate this class.
- * </p>
- * @since 2.0
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class CommonTab extends AbstractLaunchConfigurationTab {
-
- /**
- * Constant representing the id of the {@link IDialogSettings} location for the {@link ContainerSelectionDialog} used
- * on this tab
- *
- * @since 3.6
- */
- private final String SHARED_LAUNCH_CONFIGURATON_DIALOG = IDebugUIConstants.PLUGIN_ID + ".SHARED_LAUNCH_CONFIGURATON_DIALOG"; //$NON-NLS-1$
- private final String WORKSPACE_SELECTION_DIALOG = IDebugUIConstants.PLUGIN_ID + ".WORKSPACE_SELECTION_DIALOG"; //$NON-NLS-1$
-
- /**
- * This attribute exists solely for the purpose of making sure that invalid shared locations
- * can be revertible. This attribute is not saveable and will never appear in a saved
- * launch configuration.
- * @since 3.3
- */
- private static final String BAD_CONTAINER = "bad_container_name"; //$NON-NLS-1$
-
- // Local/shared UI widgets
- private Button fLocalRadioButton;
- private Button fSharedRadioButton;
- private Text fSharedLocationText;
- private Button fSharedLocationButton;
- private Button fLaunchInBackgroundButton;
- private Button fDefaultEncodingButton;
- private Button fAltEncodingButton;
- private Combo fEncodingCombo;
- private Button fConsoleOutput;
- private Button fFileOutput;
- private Button fFileBrowse;
- private Text fFileText;
- private Button fVariables;
- private Button fAppend;
- private Button fWorkspaceBrowse;
-
- /**
- * Check box list for specifying favorites
- */
- private CheckboxTableViewer fFavoritesTable;
-
- /**
- * Modify listener that simply updates the owning launch configuration dialog.
- */
- private ModifyListener fBasicModifyListener = new ModifyListener() {
- public void modifyText(ModifyEvent evt) {
- updateLaunchConfigurationDialog();
- }
- };
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- Composite comp = new Composite(parent, SWT.NONE);
- setControl(comp);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_COMMON_TAB);
- comp.setLayout(new GridLayout(2, true));
- comp.setFont(parent.getFont());
-
- createSharedConfigComponent(comp);
- createFavoritesComponent(comp);
- createEncodingComponent(comp);
- createOutputCaptureComponent(comp);
- createLaunchInBackgroundComponent(comp);
- }
-
- /**
- * @return the {@link IDialogSettings} to pass into the {@link ContainerSelectionDialog}
- * @since 3.6
- */
- IDialogSettings getDialogBoundsSettings(String id) {
- IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(id);
- if (section == null) {
- section = settings.addNewSection(id);
- }
- return section;
- }
-
- /**
- * Creates the favorites control
- * @param parent the parent composite to add this one to
- * @since 3.2
- */
- private void createFavoritesComponent(Composite parent) {
- Group favComp = SWTFactory.createGroup(parent, LaunchConfigurationsMessages.CommonTab_Display_in_favorites_menu__10, 1, 1, GridData.FILL_BOTH);
- fFavoritesTable = CheckboxTableViewer.newCheckList(favComp, SWT.CHECK | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
- Control table = fFavoritesTable.getControl();
- GridData gd = new GridData(GridData.FILL_BOTH);
- table.setLayoutData(gd);
- table.setFont(parent.getFont());
- fFavoritesTable.setContentProvider(new FavoritesContentProvider());
- fFavoritesTable.setLabelProvider(new FavoritesLabelProvider());
- fFavoritesTable.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- updateLaunchConfigurationDialog();
- }
- });
- }
-
- /**
- * Creates the shared config component
- * @param parent the parent composite to add this component to
- * @since 3.2
- */
- private void createSharedConfigComponent(Composite parent) {
- Group group = SWTFactory.createGroup(parent, LaunchConfigurationsMessages.CommonTab_0, 3, 2, GridData.FILL_HORIZONTAL);
- Composite comp = SWTFactory.createComposite(group, parent.getFont(), 3, 3, GridData.FILL_BOTH, 0, 0);
- fLocalRadioButton = createRadioButton(comp, LaunchConfigurationsMessages.CommonTab_L_ocal_3);
- GridData gd = new GridData();
- gd.horizontalSpan = 3;
- fLocalRadioButton.setLayoutData(gd);
- fSharedRadioButton = createRadioButton(comp, LaunchConfigurationsMessages.CommonTab_S_hared_4);
- fSharedRadioButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleSharedRadioButtonSelected();
- }
- });
- fSharedLocationText = SWTFactory.createSingleText(comp, 1);
- fSharedLocationText.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
- e.result = LaunchConfigurationsMessages.CommonTab_S_hared_4;
- }
- });
- fSharedLocationText.addModifyListener(fBasicModifyListener);
- fSharedLocationButton = createPushButton(comp, LaunchConfigurationsMessages.CommonTab__Browse_6, null);
- fSharedLocationButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleSharedLocationButtonSelected();
- }
- });
-
- fLocalRadioButton.setSelection(true);
- setSharedEnabled(false);
- }
-
- /**
- * Creates the component set for the capture output composite
- * @param parent the parent to add this component to
- */
- private void createOutputCaptureComponent(Composite parent) {
- Group group = SWTFactory.createGroup(parent, LaunchConfigurationsMessages.CommonTab_4, 5, 2, GridData.FILL_HORIZONTAL);
- Composite comp = SWTFactory.createComposite(group, 5, 5, GridData.FILL_BOTH);
- GridLayout ld = (GridLayout)comp.getLayout();
- ld.marginWidth = 1;
- ld.marginHeight = 1;
- fConsoleOutput = createCheckButton(comp, LaunchConfigurationsMessages.CommonTab_5);
- GridData gd = new GridData(SWT.BEGINNING, SWT.NORMAL, true, false);
- gd.horizontalSpan = 5;
- fConsoleOutput.setLayoutData(gd);
- fConsoleOutput.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
-
- fFileOutput = createCheckButton(comp, LaunchConfigurationsMessages.CommonTab_6);
- fFileOutput.setLayoutData(new GridData(SWT.BEGINNING, SWT.NORMAL, false, false));
- fFileOutput.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- enableOuputCaptureWidgets(fFileOutput.getSelection());
- updateLaunchConfigurationDialog();
- }
- });
- fFileText = SWTFactory.createSingleText(comp, 4);
- fFileText.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
- e.result = LaunchConfigurationsMessages.CommonTab_6;
- }
- });
- fFileText.addModifyListener(fBasicModifyListener);
-
- Composite bcomp = SWTFactory.createComposite(comp, 3, 5, GridData.HORIZONTAL_ALIGN_END);
- ld = (GridLayout)bcomp.getLayout();
- ld.marginHeight = 1;
- ld.marginWidth = 0;
- fWorkspaceBrowse = createPushButton(bcomp, LaunchConfigurationsMessages.CommonTab_12, null);
- fWorkspaceBrowse.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
- dialog.setTitle(LaunchConfigurationsMessages.CommonTab_13);
- dialog.setMessage(LaunchConfigurationsMessages.CommonTab_14);
- dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
- dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
- dialog.setDialogBoundsSettings(getDialogBoundsSettings(WORKSPACE_SELECTION_DIALOG), Dialog.DIALOG_PERSISTSIZE);
- if (dialog.open() == IDialogConstants.OK_ID) {
- IResource resource = (IResource) dialog.getFirstResult();
- if(resource != null) {
- String arg = resource.getFullPath().toString();
- String fileLoc = VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression("workspace_loc", arg); //$NON-NLS-1$
- fFileText.setText(fileLoc);
- }
- }
- }
- });
- fFileBrowse = createPushButton(bcomp, LaunchConfigurationsMessages.CommonTab_7, null);
- fFileBrowse.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- String filePath = fFileText.getText();
- FileDialog dialog = new FileDialog(getShell(), SWT.SAVE);
- filePath = dialog.open();
- if (filePath != null) {
- fFileText.setText(filePath);
- }
- }
- });
- fVariables = createPushButton(bcomp, LaunchConfigurationsMessages.CommonTab_9, null);
- fVariables.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
- dialog.open();
- String variable = dialog.getVariableExpression();
- if (variable != null) {
- fFileText.insert(variable);
- }
- }
- public void widgetDefaultSelected(SelectionEvent e) {}
- });
- fAppend = createCheckButton(comp, LaunchConfigurationsMessages.CommonTab_11);
- gd = new GridData(SWT.LEFT, SWT.TOP, true, false);
- gd.horizontalSpan = 4;
- fAppend.setLayoutData(gd);
- fAppend.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
- }
-
- /**
- * Enables or disables the output capture widgets based on the the specified enablement
- * @param enable if the output capture widgets should be enabled or not
- * @since 3.2
- */
- private void enableOuputCaptureWidgets(boolean enable) {
- fFileText.setEnabled(enable);
- fFileBrowse.setEnabled(enable);
- fWorkspaceBrowse.setEnabled(enable);
- fVariables.setEnabled(enable);
- fAppend.setEnabled(enable);
- }
-
- /**
- * Returns the default encoding for the specified config
- * @param config
- * @return the default encoding
- *
- * @since 3.4
- */
- private String getDefaultEncoding(ILaunchConfiguration config) {
- try {
- IResource[] resources = config.getMappedResources();
- if(resources != null && resources.length > 0) {
- IResource res = resources[0];
- if(res instanceof IFile) {
- return ((IFile)res).getCharset();
- }
- else if(res instanceof IContainer) {
- return ((IContainer)res).getDefaultCharset();
- }
- }
- }
- catch(CoreException ce) {
- DebugUIPlugin.log(ce);
- }
- return ResourcesPlugin.getEncoding();
- }
-
- /**
- * Creates the encoding component
- * @param parent the parent to add this composite to
- */
- private void createEncodingComponent(Composite parent) {
- Group group = SWTFactory.createGroup(parent, LaunchConfigurationsMessages.CommonTab_1, 2, 1, GridData.FILL_BOTH);
-
- fDefaultEncodingButton = createRadioButton(group, IInternalDebugCoreConstants.EMPTY_STRING);
- GridData gd = new GridData(SWT.BEGINNING, SWT.NORMAL, true, false);
- gd.horizontalSpan = 2;
- fDefaultEncodingButton.setLayoutData(gd);
-
- fAltEncodingButton = createRadioButton(group, LaunchConfigurationsMessages.CommonTab_3);
- fAltEncodingButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- fEncodingCombo = new Combo(group, SWT.READ_ONLY);
- fEncodingCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- fEncodingCombo.setFont(parent.getFont());
- List allEncodings = IDEEncoding.getIDEEncodings();
- String[] encodingArray = (String[]) allEncodings.toArray(new String[0]);
- fEncodingCombo.setItems(encodingArray);
- if (encodingArray.length > 0) {
- fEncodingCombo.select(0);
- }
- fEncodingCombo.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
- e.result = LaunchConfigurationsMessages.CommonTab_3;
- }
- });
- SelectionListener listener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if(e.getSource() instanceof Button) {
- Button button = (Button)e.getSource();
- if(button.getSelection()) {
- updateLaunchConfigurationDialog();
- fEncodingCombo.setEnabled(fAltEncodingButton.getSelection() == true);
- }
- }
- else {
- updateLaunchConfigurationDialog();
- }
- }
- };
- fAltEncodingButton.addSelectionListener(listener);
- fDefaultEncodingButton.addSelectionListener(listener);
- fEncodingCombo.addSelectionListener(listener);
- }
-
- /**
- * Creates the controls needed to edit the launch in background
- * attribute of an external tool
- *
- * @param parent the composite to create the controls in
- */
- protected void createLaunchInBackgroundComponent(Composite parent) {
- fLaunchInBackgroundButton = createCheckButton(parent, LaunchConfigurationsMessages.CommonTab_10);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 2;
- fLaunchInBackgroundButton.setLayoutData(data);
- fLaunchInBackgroundButton.setFont(parent.getFont());
- fLaunchInBackgroundButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
- }
-
- /**
- * handles the shared radio button being selected
- */
- private void handleSharedRadioButtonSelected() {
- setSharedEnabled(isShared());
- updateLaunchConfigurationDialog();
- }
-
- /**
- * Sets the widgets for specifying that a launch configuration is to be shared to the enable value
- * @param enable the enabled value for
- */
- private void setSharedEnabled(boolean enable) {
- fSharedLocationText.setEnabled(enable);
- fSharedLocationButton.setEnabled(enable);
- }
-
- private String getDefaultSharedConfigLocation(ILaunchConfiguration config) {
- String path = IInternalDebugCoreConstants.EMPTY_STRING;
- try {
- IResource[] res = config.getMappedResources();
- if(res != null) {
- IProject proj;
- for (int i = 0; i < res.length; i++) {
- proj = res[i].getProject();
- if(proj != null && proj.isAccessible()) {
- return proj.getFullPath().toOSString();
- }
- }
- }
- }
- catch (CoreException e) {DebugUIPlugin.log(e);}
- return path;
- }
-
- /**
- * if the shared radio button is selected, indicating that the launch configuration is to be shared
- * @return true if the radio button is selected, false otherwise
- */
- private boolean isShared() {
- return fSharedRadioButton.getSelection();
- }
-
- /**
- * Handles the shared location button being selected
- */
- private void handleSharedLocationButtonSelected() {
- String currentContainerString = fSharedLocationText.getText();
- IContainer currentContainer = getContainer(currentContainerString);
- ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(),
- currentContainer,
- false,
- LaunchConfigurationsMessages.CommonTab_Select_a_location_for_the_launch_configuration_13);
- dialog.showClosedProjects(false);
- dialog.setDialogBoundsSettings(getDialogBoundsSettings(SHARED_LAUNCH_CONFIGURATON_DIALOG), Dialog.DIALOG_PERSISTSIZE);
- dialog.open();
- Object[] results = dialog.getResult();
- if ((results != null) && (results.length > 0) && (results[0] instanceof IPath)) {
- IPath path = (IPath)results[0];
- String containerName = path.toOSString();
- fSharedLocationText.setText(containerName);
- }
- }
-
- /**
- * gets the container form the specified path
- * @param path the path to get the container from
- * @return the container for the specified path or null if one cannot be determined
- */
- private IContainer getContainer(String path) {
- Path containerPath = new Path(path);
- return (IContainer) getWorkspaceRoot().findMember(containerPath);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- boolean isShared = !configuration.isLocal();
- fSharedRadioButton.setSelection(isShared);
- fLocalRadioButton.setSelection(!isShared);
- setSharedEnabled(isShared);
- fSharedLocationText.setText(getDefaultSharedConfigLocation(configuration));
- if(isShared) {
- String containerName = IInternalDebugCoreConstants.EMPTY_STRING;
- IFile file = configuration.getFile();
- if (file != null) {
- IContainer parent = file.getParent();
- if (parent != null) {
- containerName = parent.getFullPath().toOSString();
- }
- }
- fSharedLocationText.setText(containerName);
- }
- updateFavoritesFromConfig(configuration);
- updateLaunchInBackground(configuration);
- updateEncoding(configuration);
- updateConsoleOutput(configuration);
- }
-
- /**
- * Updates the console output form the local configuration
- * @param configuration the local configuration
- */
- private void updateConsoleOutput(ILaunchConfiguration configuration) {
- boolean outputToConsole = true;
- String outputFile = null;
- boolean append = false;
-
- try {
- outputToConsole = configuration.getAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_CONSOLE, true);
- outputFile = configuration.getAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_FILE, (String)null);
- append = configuration.getAttribute(IDebugUIConstants.ATTR_APPEND_TO_FILE, false);
- } catch (CoreException e) {
- }
-
- fConsoleOutput.setSelection(outputToConsole);
- fAppend.setSelection(append);
- boolean haveOutputFile= outputFile != null;
- if (haveOutputFile) {
- fFileText.setText(outputFile);
- }
- fFileOutput.setSelection(haveOutputFile);
- enableOuputCaptureWidgets(haveOutputFile);
- }
-
- /**
- * Updates the launch on background check button
- * @param configuration the local launch configuration
- */
- protected void updateLaunchInBackground(ILaunchConfiguration configuration) {
- fLaunchInBackgroundButton.setSelection(isLaunchInBackground(configuration));
- }
-
- /**
- * Updates the encoding
- * @param configuration the local configuration
- */
- private void updateEncoding(ILaunchConfiguration configuration) {
- String encoding = null;
- try {
- encoding = configuration.getAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING, (String)null);
- } catch (CoreException e) {
- }
- String defaultEncoding = getDefaultEncoding(configuration);
- fDefaultEncodingButton.setText(MessageFormat.format(LaunchConfigurationsMessages.CommonTab_2, new String[]{defaultEncoding}));
- fDefaultEncodingButton.pack();
- if (encoding != null) {
- fAltEncodingButton.setSelection(true);
- fDefaultEncodingButton.setSelection(false);
- fEncodingCombo.setText(encoding);
- fEncodingCombo.setEnabled(true);
- } else {
- fDefaultEncodingButton.setSelection(true);
- fAltEncodingButton.setSelection(false);
- fEncodingCombo.setEnabled(false);
- }
- }
-
- /**
- * Returns whether the given configuration should be launched in the background.
- *
- * @param configuration the configuration
- * @return whether the configuration is configured to launch in the background
- */
- public static boolean isLaunchInBackground(ILaunchConfiguration configuration) {
- boolean launchInBackground= true;
- try {
- launchInBackground= configuration.getAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, true);
- } catch (CoreException ce) {
- DebugUIPlugin.log(ce);
- }
- return launchInBackground;
- }
-
- /**
- * Updates the favorites selections from the local configuration
- * @param config the local configuration
- */
- private void updateFavoritesFromConfig(ILaunchConfiguration config) {
- fFavoritesTable.setInput(config);
- fFavoritesTable.setCheckedElements(new Object[]{});
- try {
- List groups = config.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, new ArrayList());
- if (groups.isEmpty()) {
- // check old attributes for backwards compatible
- if (config.getAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, false)) {
- groups.add(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP);
- }
- if (config.getAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, false)) {
- groups.add(IDebugUIConstants.ID_RUN_LAUNCH_GROUP);
- }
- }
- if (!groups.isEmpty()) {
- List list = new ArrayList();
- Iterator iterator = groups.iterator();
- while (iterator.hasNext()) {
- String id = (String)iterator.next();
- LaunchGroupExtension extension = getLaunchConfigurationManager().getLaunchGroup(id);
- if (extension != null) {
- list.add(extension);
- }
- }
- fFavoritesTable.setCheckedElements(list.toArray());
- }
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
-
- /**
- * Updates the configuration form the local shared config working copy
- * @param config the local shared config working copy
- */
- private void updateConfigFromLocalShared(ILaunchConfigurationWorkingCopy config) {
- if (isShared()) {
- String containerPathString = fSharedLocationText.getText();
- IContainer container = getContainer(containerPathString);
- if(container == null) {
- //we need to force an attribute to allow the invalid container path to be revertable
- config.setAttribute(BAD_CONTAINER, containerPathString);
- }
- else {
- config.setContainer(container);
- }
- } else {
- config.setContainer(null);
- }
- }
-
- /**
- * Convenience accessor
- */
- protected LaunchConfigurationManager getLaunchConfigurationManager() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager();
- }
-
- /**
- * Update the favorite settings.
- *
- * NOTE: set to <code>null</code> instead of <code>false</code> for backwards compatibility
- * when comparing if content is equal, since 'false' is default
- * and will be missing for older configurations.
- */
- private void updateConfigFromFavorites(ILaunchConfigurationWorkingCopy config) {
- try {
- Object[] checked = fFavoritesTable.getCheckedElements();
- boolean debug = config.getAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, false);
- boolean run = config.getAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, false);
- if (debug || run) {
- // old attributes
- List groups = new ArrayList();
- int num = 0;
- if (debug) {
- groups.add(getLaunchConfigurationManager().getLaunchGroup(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP));
- num++;
- }
- if (run) {
- num++;
- groups.add(getLaunchConfigurationManager().getLaunchGroup(IDebugUIConstants.ID_RUN_LAUNCH_GROUP));
- }
- // see if there are any changes
- if (num == checked.length) {
- boolean different = false;
- for (int i = 0; i < checked.length; i++) {
- if (!groups.contains(checked[i])) {
- different = true;
- break;
- }
- }
- if (!different) {
- return;
- }
- }
- }
- config.setAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, (String)null);
- config.setAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, (String)null);
- List groups = null;
- for (int i = 0; i < checked.length; i++) {
- LaunchGroupExtension group = (LaunchGroupExtension)checked[i];
- if (groups == null) {
- groups = new ArrayList();
- }
- groups.add(group.getIdentifier());
- }
- config.setAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, groups);
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
-
- /**
- * Convenience method for getting the workspace root.
- */
- private IWorkspaceRoot getWorkspaceRoot() {
- return ResourcesPlugin.getWorkspace().getRoot();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public boolean isValid(ILaunchConfiguration config) {
- setMessage(null);
- setErrorMessage(null);
-
- return validateLocalShared() && validateRedirectFile() && validateEncoding();
- }
-
- /**
- * validates the encoding selection
- * @return true if the validate encoding is allowable, false otherwise
- */
- private boolean validateEncoding() {
- if (fAltEncodingButton.getSelection()) {
- if (fEncodingCombo.getSelectionIndex() == -1) {
- setErrorMessage(LaunchConfigurationsMessages.CommonTab_No_Encoding_Selected);
- return false;
- }
- }
- return true;
- }
-
- /**
- * Validates if the redirect file is valid
- * @return true if the filename is not zero, false otherwise
- */
- private boolean validateRedirectFile() {
- if(fFileOutput.getSelection()) {
- int len = fFileText.getText().trim().length();
- if (len == 0) {
- setErrorMessage(LaunchConfigurationsMessages.CommonTab_8);
- return false;
- }
- }
- return true;
- }
-
- /**
- * validates the local shared config file location
- * @return true if the local shared file exists, false otherwise
- */
- private boolean validateLocalShared() {
- if (isShared()) {
- String path = fSharedLocationText.getText().trim();
- IContainer container = getContainer(path);
- if (container == null || container.equals(ResourcesPlugin.getWorkspace().getRoot())) {
- setErrorMessage(LaunchConfigurationsMessages.CommonTab_Invalid_shared_configuration_location_14);
- return false;
- } else if (!container.getProject().isOpen()) {
- setErrorMessage(LaunchConfigurationsMessages.CommonTab_Cannot_save_launch_configuration_in_a_closed_project__1);
- return false;
- }
- }
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy config) {
- config.setContainer(null);
- setAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, config, true, true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- updateConfigFromLocalShared(configuration);
- updateConfigFromFavorites(configuration);
- setAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, configuration, fLaunchInBackgroundButton.getSelection(), true);
- String encoding = null;
- if(fAltEncodingButton.getSelection()) {
- encoding = fEncodingCombo.getText();
- }
- configuration.setAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING, encoding);
- boolean captureOutput = false;
- if (fConsoleOutput.getSelection()) {
- captureOutput = true;
- configuration.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_CONSOLE, (String)null);
- } else {
- configuration.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_CONSOLE, false);
- }
- if (fFileOutput.getSelection()) {
- captureOutput = true;
- String file = fFileText.getText();
- configuration.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_FILE, file);
- if(fAppend.getSelection()) {
- configuration.setAttribute(IDebugUIConstants.ATTR_APPEND_TO_FILE, true);
- } else {
- configuration.setAttribute(IDebugUIConstants.ATTR_APPEND_TO_FILE, (String)null);
- }
- } else {
- configuration.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_FILE, (String)null);
- }
-
- if (!captureOutput) {
- configuration.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, false);
- } else {
- configuration.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, (String)null);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return LaunchConfigurationsMessages.CommonTab__Common_15;
- }
-
- /**
- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId()
- *
- * @since 3.3
- */
- public String getId() {
- return "org.eclipse.debug.ui.commonTab"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#canSave()
- */
- public boolean canSave() {
- return validateLocalShared();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
- */
- public Image getImage() {
- return DebugUITools.getImage(IInternalDebugUIConstants.IMG_OBJS_COMMON_TAB);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void activated(ILaunchConfigurationWorkingCopy workingCopy) {}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {}
-
- /**
- * Content provider for the favorites table
- */
- class FavoritesContentProvider implements IStructuredContentProvider {
-
- public Object[] getElements(Object inputElement) {
- ILaunchGroup[] groups = DebugUITools.getLaunchGroups();
- List possibleGroups = new ArrayList();
- ILaunchConfiguration configuration = (ILaunchConfiguration)inputElement;
- for (int i = 0; i < groups.length; i++) {
- ILaunchGroup extension = groups[i];
- LaunchHistory history = getLaunchConfigurationManager().getLaunchHistory(extension.getIdentifier());
- if (history != null && history.accepts(configuration)) {
- possibleGroups.add(extension);
- }
- }
- return possibleGroups.toArray();
- }
-
- public void dispose() {}
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
-
- }
-
- /**
- * Provides the labels for the favorites table
- *
- */
- class FavoritesLabelProvider implements ITableLabelProvider {
-
- private Map fImages = new HashMap();
-
- public Image getColumnImage(Object element, int columnIndex) {
- Image image = (Image)fImages.get(element);
- if (image == null) {
- ImageDescriptor descriptor = ((LaunchGroupExtension)element).getImageDescriptor();
- if (descriptor != null) {
- image = descriptor.createImage();
- fImages.put(element, image);
- }
- }
- return image;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- String label = ((LaunchGroupExtension)element).getLabel();
- return DebugUIPlugin.removeAccelerators(label);
- }
-
- public void addListener(ILabelProviderListener listener) {}
-
- public void dispose() {
- Iterator images = fImages.values().iterator();
- while (images.hasNext()) {
- Image image = (Image)images.next();
- image.dispose();
- }
- }
-
- public boolean isLabelProperty(Object element, String property) {return false;}
-
- public void removeListener(ILabelProviderListener listener) {}
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugElementWorkbenchAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugElementWorkbenchAdapter.java
deleted file mode 100644
index fed8d2b4c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugElementWorkbenchAdapter.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import org.eclipse.debug.internal.ui.views.launch.DebugElementHelper;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.ui.model.IWorkbenchAdapter2;
-
-/**
- * Common function for debug element workbench adapters.
- * <p>
- * Clients may subclass this class to provide custom adapters for elements in a debug
- * model. The debug platform provides <code>IWorkbenchAdapters</code> for the standard debug
- * elements. Clients may override the default content in the debug view by providing an
- * <code>IWorkbenchAdapter</code> or <code>IDeferredWorkbenchAdapter</code> for a debug
- * element.
- * </p>
- * @since 3.1
- * @deprecated Custom content in the debug views is no longer supported by
- * {@link IWorkbenchAdapter}. Custom content is currently supported
- * by a provisional internal viewer framework.
- */
-public abstract class DebugElementWorkbenchAdapter implements IWorkbenchAdapter, IWorkbenchAdapter2 {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
- */
- public ImageDescriptor getImageDescriptor(Object object) {
- return DebugElementHelper.getImageDescriptor(object);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
- */
- public String getLabel(Object o) {
- return DebugElementHelper.getLabel(o);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter2#getForeground(java.lang.Object)
- */
- public RGB getForeground(Object element) {
- return DebugElementHelper.getForeground(element);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter2#getBackground(java.lang.Object)
- */
- public RGB getBackground(Object element) {
- return DebugElementHelper.getBackground(element);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.model.IWorkbenchAdapter2#getFont(java.lang.Object)
- */
- public FontData getFont(Object element) {
- return DebugElementHelper.getFont(element);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java
deleted file mode 100644
index 124bd972f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import com.ibm.icu.text.MessageFormat;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.views.DebugUIViewsMessages;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.PopupDialog;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.handlers.IHandlerActivation;
-import org.eclipse.ui.handlers.IHandlerService;
-import org.eclipse.ui.keys.IBindingService;
-
-/**
- * A <code>PopupDialog</code> that is automatically positioned relative
- * to a specified anchor point. The popup can be dismissed in the same
- * manor as all popup dialogs, but additionally allows clients the option
- * of specifying a command id that can be used to persist the contents of
- * the dialog.
- * <p>
- * Clients may subclass this.
- * @since 3.2
- */
-public abstract class DebugPopup extends PopupDialog {
-
- private Point fAnchor;
-
- private IHandlerActivation fActivation;
-
- private IHandlerService fHandlerService;
-
- private String fCommandId;
-
- private boolean fPersisted = false;
-
- /**
- * Constructs a new popup dialog of type <code>PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE</code>
- * @param parent The parent shell
- * @param anchor point at which to anchor the popup dialog in Display coordinate space.
- * Since 3.3, <code>null</code> can be specified to use a default anchor point
- * @param commandId The command id to be used for persistence of
- * the dialog, or <code>null</code>
- */
- public DebugPopup(Shell parent, Point anchor, String commandId) {
- super(parent, PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE, true, false, true, true, false, null, null);
- fAnchor = anchor;
- fCommandId = commandId;
- }
-
- /**
- * Returns the text to be shown in the popups's information area.
- * May return <code>null</code>.
- * <p>
- * By default, if this dialog has a persistence command associated with it,
- * the text displayed is of the form "Press {key-sequence} to {action}". The
- * action text is specified by the method <code>getActionText()</code>.
- * </p>
- * @return The text to be shown in the popup's information area or <code>null</code>
- */
- protected String getInfoText() {
- if (getCommandId() != null && getActionText() != null) {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IBindingService bindingService = (IBindingService) workbench.getAdapter(IBindingService.class);
- String formattedBinding = bindingService.getBestActiveBindingFormattedFor(getCommandId());
-
- String infoText = null;
- if (formattedBinding != null) {
- infoText = MessageFormat.format(DebugUIViewsMessages.InspectPopupDialog_1, new String[] { formattedBinding, getActionText()});
- }
- return infoText;
- }
- return null;
- }
-
- /**
- * Returns the text to be shown as the action performed when this dialog's
- * persist command is invoked, or <code>null</code>.
- * <p>
- * Subclasses should override as necessary.
- * </p>
- * @return the text to be shown as the action performed when this dialog's
- * persist command is invoked
- */
- protected String getActionText() {
- return null;
- }
-
- /**
- * Returns the command id to be used for persisting the contents of the
- * dialog. If the contents should not be persisted, this method should
- * return null.
- *
- * @return The command id to be used for persisting the contents of the
- * dialog or <code>null</code>
- */
- protected String getCommandId() {
- return fCommandId;
- }
-
- /**
- * Persists the contents of the dialog. Subclasses should override as required,
- * but also call super.persist().
- */
- protected void persist() {
- fPersisted = true;
- }
-
- /**
- * Returns whether the command handler was invoked to persist this popup's result.
- *
- * @return whether the command handler was invoked to persist this popup's result
- */
- protected boolean wasPersisted() {
- return fPersisted;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.dialogs.PopupDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected abstract Control createDialogArea(Composite parent);
-
-
- /**
- * Returns the initial location to use for the shell based upon the
- * current selection in the viewer. Bottom is preferred to top, and
- * right is preferred to left, therefore if possible the popup will
- * be located below and to the right of the selection.
- *
- * @param initialSize
- * the initial size of the shell, as returned by
- * <code>getInitialSize</code>.
- * @return the initial location of the shell
- */
- protected Point getInitialLocation(Point initialSize) {
- if (fAnchor == null) {
- return super.getInitialLocation(initialSize);
- }
- Point point = fAnchor;
- Rectangle monitor = getShell().getMonitor().getClientArea();
- if (monitor.width < point.x + initialSize.x) {
- point.x = Math.max(0, point.x - initialSize.x);
- }
- if (monitor.height < point.y + initialSize.y) {
- point.y = Math.max(0, point.y - initialSize.y);
- }
- return point;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.dialogs.PopupDialog#getDialogSettings()
- */
- protected IDialogSettings getDialogSettings() {
- IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
- return settings;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.PopupDialog#open()
- */
- public int open() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- String commandId = getCommandId();
- if (commandId != null) {
- IHandler fCloseHandler = new AbstractHandler() {
- public Object execute(ExecutionEvent event) throws ExecutionException {
- persist();
- close();
- return null;
- }
- };
-
- fHandlerService = (IHandlerService) workbench.getAdapter(IHandlerService.class);
- fActivation = fHandlerService.activateHandler(commandId, fCloseHandler);
- }
-
- String infoText = getInfoText();
- if (infoText != null)
- setInfoText(infoText);
-
- return super.open();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.PopupDialog#close()
- */
- public boolean close() {
- if (fActivation != null)
- fHandlerService.deactivateHandler(fActivation);
-
- return super.close();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java
deleted file mode 100644
index e7cac3bb7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java
+++ /dev/null
@@ -1,895 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-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.ILaunchDelegate;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.ISourceLocator;
-import org.eclipse.debug.internal.core.IConfigurationElementConstants;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.DefaultLabelProvider;
-import org.eclipse.debug.internal.ui.DelegatingModelPresentation;
-import org.eclipse.debug.internal.ui.LazyModelPresentation;
-import org.eclipse.debug.internal.ui.contexts.DebugContextManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension;
-import org.eclipse.debug.internal.ui.memory.MemoryRenderingManager;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupFacility;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupUIUtils;
-import org.eclipse.debug.internal.ui.stringsubstitution.SelectedResourceManager;
-import org.eclipse.debug.ui.contexts.IDebugContextManager;
-import org.eclipse.debug.ui.memory.IMemoryRenderingManager;
-import org.eclipse.debug.ui.sourcelookup.ISourceContainerBrowser;
-import org.eclipse.debug.ui.sourcelookup.ISourceLookupResult;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.console.IConsole;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * This class provides utilities for clients of the debug UI.
- * <p>
- * Images retrieved from this facility should not be disposed.
- * The images will be disposed when this plug-in is shutdown.
- * </p>
- * @noinstantiate This class is not intended to be instantiated by clients.
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class DebugUITools {
-
- /**
- * Returns the shared image managed under the given key, or <code>null</code>
- * if none.
- * <p>
- * Note that clients <b>MUST NOT</b> dispose the image returned by this method.
- * </p>
- * <p>
- * See <code>IDebugUIConstants</code> for available images.
- * </p>
- *
- * @param key the image key
- * @return the image, or <code>null</code> if none
- * @see IDebugUIConstants
- */
- public static Image getImage(String key) {
- return DebugPluginImages.getImage(key);
- }
-
- /**
- * Returns the shared image descriptor managed under the given key, or
- * <code>null</code> if none.
- * <p>
- * See <code>IDebugUIConstants</code> for available image descriptors.
- * </p>
- *
- * @param key the image descriptor key
- * @return the image descriptor, or <code>null</code> if none
- * @see IDebugUIConstants
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- return DebugPluginImages.getImageDescriptor(key);
- }
-
- /**
- * Returns the default image descriptor for the given element
- * or <code>null</code> if none is defined.
- */
- public static ImageDescriptor getDefaultImageDescriptor(Object element) {
- String imageKey= getDefaultImageKey(element);
- if (imageKey == null) {
- return null;
- }
- return DebugPluginImages.getImageDescriptor(imageKey);
- }
-
- private static String getDefaultImageKey(Object element) {
- return ((DefaultLabelProvider)DebugUIPlugin.getDefaultLabelProvider()).getImageKey(element);
- }
-
- /**
- * Returns the preference store for the debug UI plug-in.
- *
- * @return preference store
- */
- public static IPreferenceStore getPreferenceStore() {
- return DebugUIPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * Returns a new debug model presentation that delegates to
- * appropriate debug models.
- * <p>
- * It is the client's responsibility dispose the presentation.
- * </p>
- *
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- * @return a debug model presentation
- * @since 2.0
- */
- public static IDebugModelPresentation newDebugModelPresentation() {
- return new DelegatingModelPresentation();
- }
-
- /**
- * Returns a new debug model presentation for specified
- * debug model, or <code>null</code> if a presentation does
- * not exist.
- * <p>
- * It is the client's responsibility dispose the presentation.
- * </p>
- *
- * @param identifier debug model identifier
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
- * @return a debug model presentation, or <code>null</code>
- * @since 2.0
- */
- public static IDebugModelPresentation newDebugModelPresentation(String identifier) {
- IExtensionPoint point= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.ID_DEBUG_MODEL_PRESENTATION);
- if (point != null) {
- IExtension[] extensions= point.getExtensions();
- for (int i= 0; i < extensions.length; i++) {
- IExtension extension= extensions[i];
- IConfigurationElement[] configElements= extension.getConfigurationElements();
- for (int j= 0; j < configElements.length; j++) {
- IConfigurationElement elt= configElements[j];
- String id= elt.getAttribute("id"); //$NON-NLS-1$
- if (id != null && id.equals(identifier)) {
- return new LazyModelPresentation(elt);
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the currently selected element in the
- * debug view of the current workbench page,
- * or <code>null</code> if there is no current
- * debug context.
- * <p>
- * This method used to return <code>null</code> when called from a non-UI thread,
- * but since 3.1, this methods also works when called from a non-UI thread.
- * </p>
- * @return the currently selected debug context, or <code>null</code>
- * @since 2.0
- */
- public static IAdaptable getDebugContext() {
- IWorkbenchWindow activeWindow = SelectedResourceManager.getDefault().getActiveWindow();
- if (activeWindow != null) {
- ISelection activeContext = DebugUITools.getDebugContextManager().getContextService(activeWindow).getActiveContext();
- if (activeContext instanceof IStructuredSelection) {
- IStructuredSelection selection = (IStructuredSelection) activeContext;
- if (!selection.isEmpty()) {
- Object firstElement = selection.getFirstElement();
- if (firstElement instanceof IAdaptable) {
- return (IAdaptable) firstElement;
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the currently selected resource in the active workbench window,
- * or <code>null</code> if none. If an editor is active, the resource adapter
- * associated with the editor is returned, if any.
- *
- * @return selected resource or <code>null</code>
- * @since 3.0
- */
- public static IResource getSelectedResource() {
- return SelectedResourceManager.getDefault().getSelectedResource();
- }
-
- /**
- * Returns the process associated with the current debug context.
- * If there is no debug context currently, the most recently
- * launched process is returned. If there is no current process
- * <code>null</code> is returned.
- *
- * @return the current process, or <code>null</code>
- * @since 2.0
- */
- public static IProcess getCurrentProcess() {
- IAdaptable context = getDebugContext();
- if (context == null) {
- ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
- if (launches.length > 0) {
- context = launches[launches.length - 1];
- }
- }
-
- if (context instanceof IDebugElement) {
- return ((IDebugElement)context).getDebugTarget().getProcess();
- }
-
- if (context instanceof IProcess) {
- return (IProcess)context;
- }
-
- if (context instanceof ILaunch) {
- ILaunch launch= (ILaunch)context;
- IDebugTarget target= launch.getDebugTarget();
- if (target != null) {
- IProcess process = target.getProcess();
- if (process != null) {
- return process;
- }
- }
- IProcess[] ps = launch.getProcesses();
- if (ps.length > 0) {
- return ps[ps.length - 1];
- }
- }
-
- if (context != null) {
- return (IProcess) context.getAdapter(IProcess.class);
- }
-
- return null;
- }
-
- /**
- * Open the launch configuration dialog with the specified initial selection.
- * The selection may be <code>null</code>, or contain any mix of
- * <code>ILaunchConfiguration</code> or <code>ILaunchConfigurationType</code>
- * elements.
- * <p>
- * Before opening a new dialog, this method checks if there is an existing open
- * launch configuration dialog. If there is, this dialog is used with the
- * specified selection. If there is no existing dialog, a new one is created.
- * </p>
- * <p>
- * Note that if an existing dialog is reused, the <code>mode</code> argument is ignored
- * and the existing dialog keeps its original mode.
- * </p>
- *
- * @param shell the parent shell for the launch configuration dialog
- * @param selection the initial selection for the dialog
- * @param mode the mode (run or debug) in which to open the launch configuration dialog.
- * This should be one of the constants defined in <code>ILaunchManager</code>.
- * @return the return code from opening the launch configuration dialog -
- * one of <code>Window.OK</code> or <code>Window.CANCEL</code>. <code>Window.CANCEL</code>
- * is returned if an invalid launch group identifier is provided.
- * @see ILaunchGroup
- * @since 2.0
- * @deprecated use openLaunchConfigurationDialogOnGroup(Shell, IStructuredSelection, String)
- * to specify the launch group that the dialog should be opened on. This method will open
- * on the launch group with the specified mode and a <code>null</code> category
- */
- public static int openLaunchConfigurationDialog(Shell shell, IStructuredSelection selection, String mode) {
- ILaunchGroup[] groups = getLaunchGroups();
- for (int i = 0; i < groups.length; i++) {
- ILaunchGroup group = groups[i];
- if (group.getMode().equals(mode) && group.getCategory() == null) {
- return openLaunchConfigurationDialogOnGroup(shell, selection, group.getIdentifier());
- }
- }
- return Window.CANCEL;
- }
-
- /**
- * Open the launch configuration dialog with the specified initial selection.
- * The selection may be <code>null</code>, or contain any mix of
- * <code>ILaunchConfiguration</code> or <code>ILaunchConfigurationType</code>
- * elements.
- * <p>
- * Before opening a new dialog, this method checks if there is an existing open
- * launch configuration dialog. If there is, this dialog is used with the
- * specified selection. If there is no existing dialog, a new one is created.
- * </p>
- * <p>
- * Note that if an existing dialog is reused, the <code>mode</code> argument is ignored
- * and the existing dialog keeps its original mode.
- * </p>
- *
- * @param shell the parent shell for the launch configuration dialog
- * @param selection the initial selection for the dialog
- * @param groupIdentifier the identifier of the launch group to display (corresponds to
- * the identifier of a launch group extension)
- * @return The return code from opening the launch configuration dialog -
- * one of <code>Window.OK</code> or <code>Window.CANCEL</code>. <code>Window.CANCEL</code>
- * is returned if an invalid launch group identifier is provided.
- * @see ILaunchGroup
- * @since 2.1
- */
- public static int openLaunchConfigurationDialogOnGroup(Shell shell, IStructuredSelection selection, String groupIdentifier) {
- return openLaunchConfigurationDialogOnGroup(shell, selection, groupIdentifier, null);
- }
-
- /**
- * Open the launch configuration dialog with the specified initial selection.
- * The selection may be <code>null</code>, or contain any mix of
- * <code>ILaunchConfiguration</code> or <code>ILaunchConfigurationType</code>
- * elements.
- * <p>
- * Before opening a new dialog, this method checks if there is an existing open
- * launch configuration dialog. If there is, this dialog is used with the
- * specified selection. If there is no existing dialog, a new one is created.
- * </p>
- * <p>
- * Note that if an existing dialog is reused, the <code>mode</code> argument is ignored
- * and the existing dialog keeps its original mode.
- * </p>
- * <p>
- * If a status is specified, a status handler is consulted to handle the
- * status. The status handler is passed the instance of the launch
- * configuration dialog that is opened. This gives the status handler an
- * opportunity to perform error handling/initialization as required.
- * </p>
- * @param shell the parent shell for the launch configuration dialog
- * @param selection the initial selection for the dialog
- * @param groupIdentifier the identifier of the launch group to display (corresponds to
- * the identifier of a launch group extension)
- * @param status the status to display in the dialog, or <code>null</code>
- * if none
- * @return the return code from opening the launch configuration dialog -
- * one of <code>Window.OK</code> or <code>Window.CANCEL</code>. <code>Window.CANCEL</code>
- * is returned if an invalid launch group identifier is provided.
- * @see org.eclipse.debug.core.IStatusHandler
- * @see ILaunchGroup
- * @since 2.1
- */
- public static int openLaunchConfigurationDialogOnGroup(final Shell shell, final IStructuredSelection selection, final String groupIdentifier, final IStatus status) {
- final int[] result = new int[1];
- Runnable r = new Runnable() {
- /**
- * @see java.lang.Runnable#run()
- */
- public void run() {
- LaunchConfigurationsDialog dialog = (LaunchConfigurationsDialog) LaunchConfigurationsDialog.getCurrentlyVisibleLaunchConfigurationDialog();
- if (dialog != null) {
- dialog.setInitialSelection(selection);
- dialog.doInitialTreeSelection();
- if (status != null) {
- dialog.handleStatus(status);
- }
- result[0] = Window.OK;
- } else {
- LaunchGroupExtension ext = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(groupIdentifier);
- if(ext != null) {
- dialog = new LaunchConfigurationsDialog(shell, ext);
- dialog.setOpenMode(LaunchConfigurationsDialog.LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION);
- dialog.setInitialSelection(selection);
- dialog.setInitialStatus(status);
- result[0] = dialog.open();
- }
- else {
- result[0] = Window.CANCEL;
- }
- }
- }
- };
- BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), r);
- return result[0];
- }
-
- /**
- * Open the launch configuration properties dialog on the specified launch
- * configuration.
- *
- * @param shell the parent shell for the launch configuration dialog
- * @param configuration the configuration to display
- * @param groupIdentifier group identifier of the launch group the launch configuration
- * belongs to
- * @return the return code from opening the launch configuration dialog -
- * one of <code>Window.OK</code> or <code>Window.CANCEL</code>. <code>Window.CANCEL</code>
- * is returned if an invalid launch group identifier is provided.
- * @see ILaunchGroup
- * @since 2.1
- */
- public static int openLaunchConfigurationPropertiesDialog(Shell shell, ILaunchConfiguration configuration, String groupIdentifier) {
- return openLaunchConfigurationPropertiesDialog(shell, configuration, groupIdentifier, null);
- }
-
- /**
- * Open the launch configuration properties dialog on the specified launch
- * configuration.
- *
- * @param shell the parent shell for the launch configuration dialog
- * @param configuration the configuration to display
- * @param groupIdentifier group identifier of the launch group the launch configuration
- * belongs to
- * @param status the status to display, or <code>null</code> if none
- * @return the return code from opening the launch configuration dialog -
- * one of <code>Window.OK</code> or <code>Window.CANCEL</code>. <code>Window.CANCEL</code>
- * is returned if an invalid launch group identifier is provided.
- * @see ILaunchGroup
- * @since 3.0
- */
- public static int openLaunchConfigurationPropertiesDialog(Shell shell, ILaunchConfiguration configuration, String groupIdentifier, IStatus status) {
- LaunchGroupExtension group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(groupIdentifier);
- if (group != null) {
- LaunchConfigurationPropertiesDialog dialog = new LaunchConfigurationPropertiesDialog(shell, configuration, group);
- dialog.setInitialStatus(status);
- return dialog.open();
- }
-
- return Window.CANCEL;
- }
-
- /**
- * Open the launch configuration dialog on the specified launch
- * configuration. The dialog displays the tabs for a single configuration
- * only (a tree of launch configuration is not displayed), and provides a
- * launch (run or debug) button.
- * <p>
- * If a status is specified, a status handler is consulted to handle the
- * status. The status handler is passed the instance of the launch
- * configuration dialog that is opened. This gives the status handler an
- * opportunity to perform error handling/initialization as required.
- * </p>
- * @param shell the parent shell for the launch configuration dialog
- * @param configuration the configuration to display
- * @param groupIdentifier group identifier of the launch group the launch configuration
- * belongs to
- * @param status the status to display, or <code>null</code> if none
- * @return the return code from opening the launch configuration dialog -
- * one of <code>Window.OK</code> or <code>Window.CANCEL</code>. <code>Window.CANCEL</code>
- * is returned if an invalid launch group identifier is provided.
- * @see ILaunchGroup
- * @since 2.1
- */
- public static int openLaunchConfigurationDialog(Shell shell, ILaunchConfiguration configuration, String groupIdentifier, IStatus status) {
- LaunchGroupExtension group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(groupIdentifier);
- if (group != null) {
- LaunchConfigurationDialog dialog = new LaunchConfigurationDialog(shell, configuration, group);
- dialog.setInitialStatus(status);
- return dialog.open();
- }
-
- return Window.CANCEL;
- }
-
- /**
- * Saves all dirty editors and builds the workspace according to current
- * preference settings, and returns whether a launch should proceed.
- * <p>
- * The following preferences effect whether dirty editors are saved,
- * and/or if the user is prompted to save dirty editors:<ul>
- * <li>PREF_NEVER_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH</li>
- * <li>PREF_PROMPT_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH</li>
- * <li>PREF_AUTOSAVE_DIRTY_EDITORS_BEFORE_LAUNCH</li>
- * </ul>
- * The following preference effects whether a build is performed before
- * launching (if required):<ul>
- * <li>PREF_BUILD_BEFORE_LAUNCH</li>
- * </ul>
- * </p>
- *
- * @return whether a launch should proceed
- * @since 2.0
- * @deprecated Saving has been moved to the launch delegate <code>LaunchConfigurationDelegate</code> to allow for scoped saving
- * of resources that are only involved in the current launch, no longer the entire workspace
- */
- public static boolean saveAndBuildBeforeLaunch() {
- return DebugUIPlugin.saveAndBuild();
- }
-
- /**
- * Saves all dirty editors according to current
- * preference settings, and returns whether a launch should proceed.
- * <p>
- * The following preferences effect whether dirty editors are saved,
- * and/or if the user is prompted to save dirty editors:<ul>
- * <li>PREF_NEVER_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH</li>
- * <li>PREF_PROMPT_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH</li>
- * <li>PREF_AUTOSAVE_DIRTY_EDITORS_BEFORE_LAUNCH</li>
- * </ul>
- * </p>
- *
- * @return whether a launch should proceed
- * @since 2.1
- * @deprecated Saving has been moved to the launch delegate <code>LaunchConfigurationDelegate</code> to allow for scoped saving
- * of resources that are only involved in the current launch, no longer the entire workspace
- */
- public static boolean saveBeforeLaunch() {
- return DebugUIPlugin.preLaunchSave();
- }
-
- /**
- * Saves and builds the workspace according to current preference settings, and
- * launches the given launch configuration in the specified mode.
- * <p>
- * This method must be called in the UI thread.
- * </p>
- * @param configuration the configuration to launch
- * @param mode launch mode - run or debug
- * @since 2.1
- */
- public static void launch(final ILaunchConfiguration configuration, final String mode) {
- boolean launchInBackground= true;
- try {
- launchInBackground= configuration.getAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, true);
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- if (launchInBackground) {
- DebugUIPlugin.launchInBackground(configuration, mode);
- } else {
- DebugUIPlugin.launchInForeground(configuration, mode);
- }
- }
-
-
-
- /**
- * Builds the workspace according to current preference settings, and launches
- * the given configuration in the specified mode, returning the resulting launch
- * object.
- * <p>
- * The following preference effects whether a build is performed before
- * launching (if required):<ul>
- * <li>PREF_BUILD_BEFORE_LAUNCH</li>
- * </ul>
- * </p>
- *
- * @param configuration the configuration to launch
- * @param mode the mode to launch in
- * @param monitor progress monitor
- * @return the resulting launch object
- * @throws CoreException if building or launching fails
- * @since 2.1
- */
- public static ILaunch buildAndLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
- return DebugUIPlugin.buildAndLaunch(configuration, mode, monitor);
- }
-
- /**
- * Returns the perspective to switch to when a configuration of the given type
- * is launched in the given mode, or <code>null</code> if no switch should take
- * place.
- *
- * In 3.3 this method is equivalent to calling <code>getLaunchPerspective(ILaunchConfigurationType type, Set modes, ILaunchDelegate delegate)</code>,
- * with the 'mode' parameter comprising a single element set and passing <code>null</code> as the launch delegate.
- *
- * @param type launch configuration type
- * @param mode launch mode identifier
- * @return perspective identifier or <code>null</code>
- * @since 3.0
- */
- public static String getLaunchPerspective(ILaunchConfigurationType type, String mode) {
- return DebugUIPlugin.getDefault().getPerspectiveManager().getLaunchPerspective(type, mode);
- }
-
- /**
- * Returns the perspective id to switch to when a configuration of the given type launched with the specified delegate
- * is launched in the given mode set, or <code>null</code> if no switch should occurr.
- * @param type the configuration type
- * @param delegate the launch delegate
- * @param modes the set of modes
- * @return the perspective id or <code>null</code> if no switch should occur
- *
- * @since 3.3
- */
- public static String getLaunchPerspective(ILaunchConfigurationType type, ILaunchDelegate delegate, Set modes) {
- return DebugUIPlugin.getDefault().getPerspectiveManager().getLaunchPerspective(type, modes, delegate);
- }
-
- /**
- * Sets the perspective to switch to when a configuration of the given type
- * is launched in the given mode. <code>PERSPECTIVE_NONE</code> indicates no
- * perspective switch should take place. <code>PERSPECTIVE_DEFAULT</code> indicates
- * a default perspective switch should take place, as defined by the associated
- * launch tab group extension.
- *
- * In 3.3 this method is equivalent to calling <code>setLaunchPerspective(ILaunchConfigurationType type, Set modes, ILaunchDelegate delegate, String perspectiveid)</code>,
- * with the parameter 'mode' used in the set modes, and null passed as the delegate
- *
- * @param type launch configuration type
- * @param mode launch mode identifier
- * @param perspective identifier, <code>PERSPECTIVE_NONE</code>, or
- * <code>PERSPECTIVE_DEFAULT</code>
- * @since 3.0
- */
- public static void setLaunchPerspective(ILaunchConfigurationType type, String mode, String perspective) {
- DebugUIPlugin.getDefault().getPerspectiveManager().setLaunchPerspective(type, mode, perspective);
- }
-
- /**
- * Sets the perspective to switch to when a configuration of the specified type and launched using the
- * specified launch delegate is launched in the specified modeset. <code>PERSPECTIVE_NONE</code> indicates no
- * perspective switch should take place.
- *
- * Passing <code>null</code> for the launch delegate is quivalent to using the default perspective for the specified
- * type.
- * @param type the configuration type
- * @param delegate the launch delegate
- * @param modes the set of modes
- * @param perspectiveid identifier or <code>PERSPECTIVE_NONE</code>
- *
- * @since 3.3
- */
- public static void setLaunchPerspective(ILaunchConfigurationType type, ILaunchDelegate delegate, Set modes, String perspectiveid) {
- DebugUIPlugin.getDefault().getPerspectiveManager().setLaunchPerspective(type, modes, delegate, perspectiveid);
- }
-
- /**
- * Returns whether the given launch configuration is private. Generally,
- * private launch configurations should not be displayed to the user. The
- * private status of a launch configuration is determined by the
- * <code>IDebugUIConstants.ATTR_PRIVATE</code> attribute.
- *
- * @param configuration launch configuration
- * @return whether the given launch configuration is private
- * @since 3.0
- */
- public static boolean isPrivate(ILaunchConfiguration configuration) {
- return !LaunchConfigurationManager.isVisible(configuration);
- }
-
- /**
- * Sets whether step filters should be applied to step commands. This
- * setting is a global option applied to all registered debug targets.
- * <p>
- * Since 3.3, this is equivalent to calling <code>DebugPlugin.setUseStepFilters(boolean)</code>.
- * </p>
- * @param useStepFilters whether step filters should be applied to step
- * commands
- * @since 3.0
- * @see org.eclipse.debug.core.model.IStepFilters
- */
- public static void setUseStepFilters(boolean useStepFilters) {
- DebugPlugin.setUseStepFilters(useStepFilters);
- }
-
- /**
- * Returns whether step filters are applied to step commands.
- * <p>
- * Since 3.3, this is equivalent to calling <code>DebugPlugin.isUseStepFilters()</code>.
- * </p>
- * @return whether step filters are applied to step commands
- * @since 3.0
- * @see org.eclipse.debug.core.model.IStepFilters
- */
- public static boolean isUseStepFilters() {
- return DebugPlugin.isUseStepFilters();
- }
-
- /**
- * Returns the console associated with the given process, or
- * <code>null</code> if none.
- *
- * @param process a process
- * @return console associated with the given process, or
- * <code>null</code> if none
- * @since 3.0
- */
- public static IConsole getConsole(IProcess process) {
- return DebugUIPlugin.getDefault().getProcessConsoleManager().getConsole(process);
- }
-
- /**
- * Returns the console associated with the given debug element, or
- * <code>null</code> if none.
- *
- * @param element a debug model element
- * @return console associated with the given element, or
- * <code>null</code> if none
- * @since 3.0
- */
- public static IConsole getConsole(IDebugElement element) {
- IProcess process = element.getDebugTarget().getProcess();
- if (process != null) {
- return getConsole(process);
- }
- return null;
- }
-
- /**
- * Returns all registered launch group extensions.
- *
- * @return all registered launch group extensions
- * @since 3.0
- */
- public static ILaunchGroup[] getLaunchGroups() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroups();
- }
-
- /**
- * Returns the last configuration that was launched for specified launch group or
- * <code>null</code>, if there is not one. This method does not provide any form of
- * filtering on the returned launch configurations.
- *
- * @param groupId the unique identifier of a launch group
- * @return the last launched configuration for the specified group or <code>null</code>.
- * @see DebugUITools#getLaunchGroups()
- * @since 3.3
- */
- public static ILaunchConfiguration getLastLaunch(String groupId) {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLastLaunch(groupId);
- }
-
- /**
- * Returns the launch group that the given launch configuration belongs
- * to, for the specified mode, or <code>null</code> if none.
- *
- * @param configuration
- * @param mode
- * @return the launch group the given launch configuration belongs to, for
- * the specified mode, or <code>null</code> if none
- * @since 3.0
- */
- public static ILaunchGroup getLaunchGroup(ILaunchConfiguration configuration, String mode) {
- try {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(configuration.getType(), mode);
- }
- catch(CoreException ce) {
- return null;
- }
- }
-
- /**
- * Performs source lookup on the given artifact and returns the result.
- * Optionally, a source locator may be specified.
- *
- * @param artifact object for which source is to be resolved
- * @param locator the source locator to use, or <code>null</code>. When <code>null</code>
- * a source locator is determined from the artifact, if possible. If the artifact
- * is a debug element, the source locator from its associated launch is used.
- * @return a source lookup result
- * @since 3.1
- */
- public static ISourceLookupResult lookupSource(Object artifact, ISourceLocator locator) {
- return SourceLookupFacility.getDefault().lookup(artifact, locator);
- }
-
- /**
- * Displays the given source lookup result in an editor in the given workbench
- * page. Has no effect if the result has an unknown editor id or editor input.
- * The editor is opened, positioned, and annotated.
- * <p>
- * Honors user preference for editors re-use.
- * </p>
- * @param result source lookup result to display
- * @param page the page to display the result in
- * @since 3.1
- */
- public static void displaySource(ISourceLookupResult result, IWorkbenchPage page) {
- SourceLookupFacility.getDefault().display(result, page);
- }
-
- /**
- * Returns the memory rendering manager.
- *
- * @return the memory rendering manager
- * @since 3.1
- */
- public static IMemoryRenderingManager getMemoryRenderingManager() {
- return MemoryRenderingManager.getDefault();
- }
-
- /**
- * Returns the image associated with the specified type of source container
- * or <code>null</code> if none.
- *
- * @param id unique identifier for a source container type
- * @return image associated with the specified type of source container
- * or <code>null</code> if none
- * @since 3.2
- * @see org.eclipse.debug.core.sourcelookup.ISourceContainerType
- */
- public static Image getSourceContainerImage(String id){
- return SourceLookupUIUtils.getSourceContainerImage(id);
- }
-
- /**
- * Returns a new source container browser for the specified type of source container
- * or <code>null</code> if a browser has not been registered.
- *
- * @param id unique identifier for a source container type
- * @return source container browser or <code>null</code> if none
- * @since 3.2
- * @see org.eclipse.debug.ui.sourcelookup.ISourceContainerBrowser
- */
- public static ISourceContainerBrowser getSourceContainerBrowser(String id) {
- return SourceLookupUIUtils.getSourceContainerBrowser(id);
- }
-
- /**
- * Returns the color associated with the specified preference identifier or
- * <code>null</code> if none.
- *
- * @param id preference identifier of the color
- * @return the color associated with the specified preference identifier
- * or <code>null</code> if none
- * @since 3.2
- * @see IDebugUIConstants
- */
- public static Color getPreferenceColor(String id) {
- return DebugUIPlugin.getPreferenceColor(id);
- }
-
- /**
- * Returns the debug context manager.
- *
- * @return debug context manager
- * @since 3.3
- */
- public static IDebugContextManager getDebugContextManager() {
- return DebugContextManager.getDefault();
- }
-
- /**
- * Return the debug context for the given executionEvent or <code>null</code> if none.
- *
- * @param event The execution event that contains the application context
- * @return the current debug context, or <code>null</code>.
- *
- * @since 3.5
- */
- public static ISelection getDebugContextForEvent(ExecutionEvent event) {
- Object o = HandlerUtil.getVariable(event, IConfigurationElementConstants.DEBUG_CONTEXT);
- if (o instanceof ISelection) {
- return (ISelection) o;
- }
- return null;
- }
-
- /**
- * Return the debug context for the given executionEvent.
- *
- * @param event The execution event that contains the application context
- * @return the debug context. Will not return <code>null</code>.
- * @throws ExecutionException If the current selection variable is not found.
- *
- * @since 3.5
- */
- public static ISelection getDebugContextForEventChecked(ExecutionEvent event)
- throws ExecutionException {
- Object o = HandlerUtil.getVariableChecked(event, IConfigurationElementConstants.DEBUG_CONTEXT);
- if (!(o instanceof ISelection)) {
- throw new ExecutionException("Incorrect type for " //$NON-NLS-1$
- + IConfigurationElementConstants.DEBUG_CONTEXT
- + " found while executing " //$NON-NLS-1$
- + event.getCommand().getId()
- + ", expected " + ISelection.class.getName() //$NON-NLS-1$
- + " found " + o.getClass().getName()); //$NON-NLS-1$
- }
- return (ISelection) o;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DeferredDebugElementWorkbenchAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DeferredDebugElementWorkbenchAdapter.java
deleted file mode 100644
index c3083bf8b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DeferredDebugElementWorkbenchAdapter.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
-import org.eclipse.ui.progress.IElementCollector;
-
-
-/**
- * Common function for a deferred workbench adapter for a debug element.
- * <p>
- * Clients may subclass this class to provide custom adapters for elements in a debug
- * model. The debug platform provides <code>IDeferredWorkbenchAdapters</code> for the standard debug
- * elements. Clients may override the default content in the debug view by providing an
- * <code>IWorkbenchAdapter</code> or <code>IDeferredWorkbenchAdapter</code> for a debug
- * element.
- * </p>
- * @since 3.1
- * @deprecated deferred custom content in the debug views is no longer supported by
- * {@link IDeferredWorkbenchAdapter}. Deferred custom content is currently supported
- * by a provisional internal viewer framework.
- */
-public abstract class DeferredDebugElementWorkbenchAdapter extends DebugElementWorkbenchAdapter implements IDeferredWorkbenchAdapter {
-
- /**
- * An empty collection of children
- */
- protected static final Object[] EMPTY = new Object[0];
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#isContainer()
- */
- public boolean isContainer() {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#getRule(java.lang.Object)
- */
- public ISchedulingRule getRule(Object object) {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#fetchDeferredChildren(java.lang.Object, org.eclipse.ui.progress.IElementCollector, org.eclipse.core.runtime.IProgressMonitor)
- */
- public void fetchDeferredChildren(Object object, IElementCollector collector, IProgressMonitor monitor) {
- if (monitor.isCanceled()) {
- return;
- }
- Object[] children = getChildren(object);
- if (monitor.isCanceled()) {
- return;
- }
- if (children.length > 0) {
- collector.add(children, monitor);
- }
- collector.done();
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
deleted file mode 100644
index ab22caf07..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
+++ /dev/null
@@ -1,685 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 Keith Seitz and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Keith Seitz (keiths@redhat.com) - initial implementation
- * IBM Corporation - integration and code cleanup
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeMap;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.AbstractDebugCheckboxSelectionDialog;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.MultipleInputDialog;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.launchConfigurations.EnvironmentVariable;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsMessages;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-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.ScrollBar;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.PlatformUI;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Launch configuration tab for configuring the environment passed
- * into Runtime.exec(...) when a config is launched.
- * <p>
- * This class may be instantiated.
- * </p>
- * @since 3.0
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class EnvironmentTab extends AbstractLaunchConfigurationTab {
-
- protected TableViewer environmentTable;
- protected String[] envTableColumnHeaders = {
- LaunchConfigurationsMessages.EnvironmentTab_Variable_1,
- LaunchConfigurationsMessages.EnvironmentTab_Value_2,
- };
- private static final String NAME_LABEL= LaunchConfigurationsMessages.EnvironmentTab_8;
- private static final String VALUE_LABEL= LaunchConfigurationsMessages.EnvironmentTab_9;
- protected static final String P_VARIABLE = "variable"; //$NON-NLS-1$
- protected static final String P_VALUE = "value"; //$NON-NLS-1$
- protected Button envAddButton;
- protected Button envEditButton;
- protected Button envRemoveButton;
- protected Button appendEnvironment;
- protected Button replaceEnvironment;
- protected Button envSelectButton;
-
- /**
- * Content provider for the environment table
- */
- protected class EnvironmentVariableContentProvider implements IStructuredContentProvider {
- public Object[] getElements(Object inputElement) {
- EnvironmentVariable[] elements = new EnvironmentVariable[0];
- ILaunchConfiguration config = (ILaunchConfiguration) inputElement;
- Map m;
- try {
- m = config.getAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, (Map) null);
- } catch (CoreException e) {
- DebugUIPlugin.log(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IStatus.ERROR, "Error reading configuration", e)); //$NON-NLS-1$
- return elements;
- }
- if (m != null && !m.isEmpty()) {
- elements = new EnvironmentVariable[m.size()];
- String[] varNames = new String[m.size()];
- m.keySet().toArray(varNames);
- for (int i = 0; i < m.size(); i++) {
- elements[i] = new EnvironmentVariable(varNames[i], (String) m.get(varNames[i]));
- }
- }
- return elements;
- }
- public void dispose() {
- }
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (newInput == null){
- return;
- }
- if (viewer instanceof TableViewer){
- TableViewer tableViewer= (TableViewer) viewer;
- if (tableViewer.getTable().isDisposed()) {
- return;
- }
- tableViewer.setComparator(new ViewerComparator() {
- public int compare(Viewer iviewer, Object e1, Object e2) {
- if (e1 == null) {
- return -1;
- } else if (e2 == null) {
- return 1;
- } else {
- return ((EnvironmentVariable)e1).getName().compareToIgnoreCase(((EnvironmentVariable)e2).getName());
- }
- }
- });
- }
- }
- }
-
- /**
- * Label provider for the environment table
- */
- public class EnvironmentVariableLabelProvider extends LabelProvider implements ITableLabelProvider {
- public String getColumnText(Object element, int columnIndex) {
- String result = null;
- if (element != null) {
- EnvironmentVariable var = (EnvironmentVariable) element;
- switch (columnIndex) {
- case 0: // variable
- result = var.getName();
- break;
- case 1: // value
- result = var.getValue();
- break;
- }
- }
- return result;
- }
- public Image getColumnImage(Object element, int columnIndex) {
- if (columnIndex == 0) {
- return DebugPluginImages.getImage(IDebugUIConstants.IMG_OBJS_ENV_VAR);
- }
- return null;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- // Create main composite
- Composite mainComposite = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_HORIZONTAL);
- setControl(mainComposite);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_ENVIRONMENT_TAB);
-
- createEnvironmentTable(mainComposite);
- createTableButtons(mainComposite);
- createAppendReplace(mainComposite);
-
- Dialog.applyDialogFont(mainComposite);
- }
-
- /**
- * Creates and configures the widgets which allow the user to
- * choose whether the specified environment should be appended
- * to the native environment or if it should completely replace it.
- * @param parent the composite in which the widgets should be created
- */
- protected void createAppendReplace(Composite parent) {
- Composite comp = SWTFactory.createComposite(parent, 1, 2, GridData.FILL_HORIZONTAL);
- appendEnvironment= createRadioButton(comp, LaunchConfigurationsMessages.EnvironmentTab_16);
- appendEnvironment.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
- replaceEnvironment= createRadioButton(comp, LaunchConfigurationsMessages.EnvironmentTab_17);
- }
-
- /**
- * Updates the enablement of the append/replace widgets. The
- * widgets should disable when there are no environment variables specified.
- */
- protected void updateAppendReplace() {
- boolean enable= environmentTable.getTable().getItemCount() > 0;
- appendEnvironment.setEnabled(enable);
- replaceEnvironment.setEnabled(enable);
- }
-
- /**
- * Creates and configures the table that displayed the key/value
- * pairs that comprise the environment.
- * @param parent the composite in which the table should be created
- */
- protected void createEnvironmentTable(Composite parent) {
- Font font = parent.getFont();
- // Create label, add it to the parent to align the right side buttons with the top of the table
- SWTFactory.createLabel(parent, LaunchConfigurationsMessages.EnvironmentTab_Environment_variables_to_set__3, 2);
- // Create table composite
- Composite tableComposite = SWTFactory.createComposite(parent, font, 1, 1, GridData.FILL_BOTH, 0, 0);
- // Create table
- environmentTable = new TableViewer(tableComposite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
- Table table = environmentTable.getTable();
- table.setLayout(new GridLayout());
- table.setLayoutData(new GridData(GridData.FILL_BOTH));
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- table.setFont(font);
- environmentTable.setContentProvider(new EnvironmentVariableContentProvider());
- environmentTable.setLabelProvider(new EnvironmentVariableLabelProvider());
- environmentTable.setColumnProperties(new String[] {P_VARIABLE, P_VALUE});
- environmentTable.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- handleTableSelectionChanged(event);
- }
- });
- environmentTable.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- if (!environmentTable.getSelection().isEmpty()) {
- handleEnvEditButtonSelected();
- }
- }
- });
- // Create columns
- final TableColumn tc1 = new TableColumn(table, SWT.NONE, 0);
- tc1.setText(envTableColumnHeaders[0]);
- final TableColumn tc2 = new TableColumn(table, SWT.NONE, 1);
- tc2.setText(envTableColumnHeaders[1]);
- final Table tref = table;
- final Composite comp = tableComposite;
- tableComposite.addControlListener(new ControlAdapter() {
- public void controlResized(ControlEvent e) {
- Rectangle area = comp.getClientArea();
- Point size = tref.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- ScrollBar vBar = tref.getVerticalBar();
- int width = area.width - tref.computeTrim(0,0,0,0).width - 2;
- if (size.y > area.height + tref.getHeaderHeight()) {
- Point vBarSize = vBar.getSize();
- width -= vBarSize.x;
- }
- Point oldSize = tref.getSize();
- if (oldSize.x > area.width) {
- tc1.setWidth(width/2-1);
- tc2.setWidth(width - tc1.getWidth());
- tref.setSize(area.width, area.height);
- } else {
- tref.setSize(area.width, area.height);
- tc1.setWidth(width/2-1);
- tc2.setWidth(width - tc1.getWidth());
- }
- }
- });
- }
-
- /**
- * Responds to a selection changed event in the environment table
- * @param event the selection change event
- */
- protected void handleTableSelectionChanged(SelectionChangedEvent event) {
- int size = ((IStructuredSelection)event.getSelection()).size();
- envEditButton.setEnabled(size == 1);
- envRemoveButton.setEnabled(size > 0);
- }
-
- /**
- * Creates the add/edit/remove buttons for the environment table
- * @param parent the composite in which the buttons should be created
- */
- protected void createTableButtons(Composite parent) {
- // Create button composite
- Composite buttonComposite = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_END, 0, 0);
-
- // Create buttons
- envAddButton = createPushButton(buttonComposite, LaunchConfigurationsMessages.EnvironmentTab_New_4, null);
- envAddButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- handleEnvAddButtonSelected();
- }
- });
- envSelectButton = createPushButton(buttonComposite, LaunchConfigurationsMessages.EnvironmentTab_18, null);
- envSelectButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- handleEnvSelectButtonSelected();
- }
- });
- envEditButton = createPushButton(buttonComposite, LaunchConfigurationsMessages.EnvironmentTab_Edit_5, null);
- envEditButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- handleEnvEditButtonSelected();
- }
- });
- envEditButton.setEnabled(false);
- envRemoveButton = createPushButton(buttonComposite, LaunchConfigurationsMessages.EnvironmentTab_Remove_6, null);
- envRemoveButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- handleEnvRemoveButtonSelected();
- }
- });
- envRemoveButton.setEnabled(false);
- }
-
- /**
- * Adds a new environment variable to the table.
- */
- protected void handleEnvAddButtonSelected() {
- MultipleInputDialog dialog = new MultipleInputDialog(getShell(), LaunchConfigurationsMessages.EnvironmentTab_22);
- dialog.addTextField(NAME_LABEL, null, false);
- dialog.addVariablesField(VALUE_LABEL, null, true);
-
- if (dialog.open() != Window.OK) {
- return;
- }
-
- String name = dialog.getStringValue(NAME_LABEL);
- String value = dialog.getStringValue(VALUE_LABEL);
-
- if (name != null && value != null && name.length() > 0 && value.length() >0) {
- addVariable(new EnvironmentVariable(name.trim(), value.trim()));
- updateAppendReplace();
- }
- }
-
- /**
- * Attempts to add the given variable. Returns whether the variable
- * was added or not (as when the user answers not to overwrite an
- * existing variable).
- * @param variable the variable to add
- * @return whether the variable was added
- */
- protected boolean addVariable(EnvironmentVariable variable) {
- String name= variable.getName();
- TableItem[] items = environmentTable.getTable().getItems();
- for (int i = 0; i < items.length; i++) {
- EnvironmentVariable existingVariable = (EnvironmentVariable) items[i].getData();
- if (existingVariable.getName().equals(name)) {
- boolean overWrite= MessageDialog.openQuestion(getShell(), LaunchConfigurationsMessages.EnvironmentTab_12, MessageFormat.format(LaunchConfigurationsMessages.EnvironmentTab_13, new String[] {name})); //
- if (!overWrite) {
- return false;
- }
- environmentTable.remove(existingVariable);
- break;
- }
- }
- environmentTable.add(variable);
- updateLaunchConfigurationDialog();
- return true;
- }
-
- /**
- * Displays a dialog that allows user to select native environment variables
- * to add to the table.
- */
- private void handleEnvSelectButtonSelected() {
- //get Environment Variables from the OS
- Map envVariables = getNativeEnvironment();
-
- //get Environment Variables from the table
- TableItem[] items = environmentTable.getTable().getItems();
- for (int i = 0; i < items.length; i++) {
- EnvironmentVariable var = (EnvironmentVariable) items[i].getData();
- envVariables.remove(var.getName());
- }
-
- NativeEnvironmentSelectionDialog dialog = new NativeEnvironmentSelectionDialog(getShell(), envVariables);
- dialog.setTitle(LaunchConfigurationsMessages.EnvironmentTab_20);
-
- int button = dialog.open();
- if (button == Window.OK) {
- Object[] selected = dialog.getResult();
- for (int i = 0; i < selected.length; i++) {
- environmentTable.add(selected[i]);
- }
- }
-
- updateAppendReplace();
- updateLaunchConfigurationDialog();
- }
-
- /**
- * Gets native environment variable from the LaunchManager. Creates EnvironmentVariable objects.
- * @return Map of name - EnvironmentVariable pairs based on native environment.
- */
- private Map getNativeEnvironment() {
- Map stringVars = DebugPlugin.getDefault().getLaunchManager().getNativeEnvironmentCasePreserved();
- HashMap vars = new HashMap();
- for (Iterator i = stringVars.keySet().iterator(); i.hasNext(); ) {
- String key = (String) i.next();
- String value = (String) stringVars.get(key);
- vars.put(key, new EnvironmentVariable(key, value));
- }
- return vars;
- }
-
- /**
- * Creates an editor for the value of the selected environment variable.
- */
- private void handleEnvEditButtonSelected() {
- IStructuredSelection sel= (IStructuredSelection) environmentTable.getSelection();
- EnvironmentVariable var= (EnvironmentVariable) sel.getFirstElement();
- if (var == null) {
- return;
- }
- String originalName= var.getName();
- String value= var.getValue();
- MultipleInputDialog dialog= new MultipleInputDialog(getShell(), LaunchConfigurationsMessages.EnvironmentTab_11);
- dialog.addTextField(NAME_LABEL, originalName, false);
- dialog.addVariablesField(VALUE_LABEL, value, true);
-
- if (dialog.open() != Window.OK) {
- return;
- }
- String name= dialog.getStringValue(NAME_LABEL);
- value= dialog.getStringValue(VALUE_LABEL);
- if (!originalName.equals(name)) {
- if (addVariable(new EnvironmentVariable(name, value))) {
- environmentTable.remove(var);
- }
- } else {
- var.setValue(value);
- environmentTable.update(var, null);
- updateLaunchConfigurationDialog();
- }
- }
-
- /**
- * Removes the selected environment variable from the table.
- */
- private void handleEnvRemoveButtonSelected() {
- IStructuredSelection sel = (IStructuredSelection) environmentTable.getSelection();
- environmentTable.getControl().setRedraw(false);
- for (Iterator i = sel.iterator(); i.hasNext(); ) {
- EnvironmentVariable var = (EnvironmentVariable) i.next();
- environmentTable.remove(var);
- }
- environmentTable.getControl().setRedraw(true);
- updateAppendReplace();
- updateLaunchConfigurationDialog();
- }
-
- /**
- * Updates the environment table for the given launch configuration
- * @param configuration
- */
- protected void updateEnvironment(ILaunchConfiguration configuration) {
- environmentTable.setInput(configuration);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- configuration.removeAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- boolean append= true;
- try {
- append = configuration.getAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, true);
- } catch (CoreException e) {
- DebugUIPlugin.log(e.getStatus());
- }
- if (append) {
- appendEnvironment.setSelection(true);
- replaceEnvironment.setSelection(false);
- } else {
- replaceEnvironment.setSelection(true);
- appendEnvironment.setSelection(false);
- }
- updateEnvironment(configuration);
- updateAppendReplace();
- }
-
- /**
- * Stores the environment in the given configuration
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- // Convert the table's items into a Map so that this can be saved in the
- // configuration's attributes.
- TableItem[] items = environmentTable.getTable().getItems();
- Map map = new HashMap(items.length);
- for (int i = 0; i < items.length; i++)
- {
- EnvironmentVariable var = (EnvironmentVariable) items[i].getData();
- map.put(var.getName(), var.getValue());
- }
- if (map.size() == 0) {
- configuration.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, (Map) null);
- } else {
- configuration.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, map);
- }
-
- if(appendEnvironment.getSelection()) {
- ILaunchConfiguration orig = configuration.getOriginal();
- boolean hasTrueValue = false;
- if(orig != null) {
- try {
- hasTrueValue = orig.hasAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES) &&
- orig.getAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, true);
- } catch (CoreException e) {
- DebugUIPlugin.log(e.getStatus());
- }
- }
- if (hasTrueValue) {
- configuration.setAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, true);
- } else {
- configuration.removeAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES);
- }
- } else {
- configuration.setAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, false);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return LaunchConfigurationsMessages.EnvironmentTab_Environment_7;
- }
-
- /**
- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId()
- *
- * @since 3.3
- */
- public String getId() {
- return "org.eclipse.debug.ui.environmentTab"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
- */
- public Image getImage() {
- return DebugPluginImages.getImage(IDebugUIConstants.IMG_OBJS_ENVIRONMENT);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
- // do nothing when activated
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
- // do nothing when de-activated
- }
-
- /**
- * This dialog allows users to select one or more known native environment variables from a list.
- */
- private class NativeEnvironmentSelectionDialog extends AbstractDebugCheckboxSelectionDialog {
-
- private Object fInput;
-
- public NativeEnvironmentSelectionDialog(Shell parentShell, Object input) {
- super(parentShell);
- fInput = input;
- setShellStyle(getShellStyle() | SWT.RESIZE);
- setShowSelectAllButtons(true);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
- */
- protected String getDialogSettingsId() {
- return IDebugUIConstants.PLUGIN_ID + ".ENVIRONMENT_TAB.NATIVE_ENVIROMENT_DIALOG"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
- */
- protected String getHelpContextId() {
- return IDebugHelpContextIds.SELECT_NATIVE_ENVIRONMENT_DIALOG;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
- */
- protected Object getViewerInput() {
- return fInput;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
- */
- protected String getViewerLabel() {
- return LaunchConfigurationsMessages.EnvironmentTab_19;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getLabelProvider()
- */
- protected IBaseLabelProvider getLabelProvider() {
- return new ILabelProvider() {
- public Image getImage(Object element) {
- return DebugPluginImages.getImage(IDebugUIConstants.IMG_OBJS_ENVIRONMENT);
- }
- public String getText(Object element) {
- EnvironmentVariable var = (EnvironmentVariable) element;
- return MessageFormat.format(LaunchConfigurationsMessages.EnvironmentTab_7, new String[] {var.getName(), var.getValue()});
- }
- public void addListener(ILabelProviderListener listener) {
- }
- public void dispose() {
- }
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
- public void removeListener(ILabelProviderListener listener) {
- }
- };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getContentProvider()
- */
- protected IContentProvider getContentProvider() {
- return new IStructuredContentProvider() {
- public Object[] getElements(Object inputElement) {
- EnvironmentVariable[] elements = null;
- if (inputElement instanceof HashMap) {
- Comparator comparator = new Comparator() {
- public int compare(Object o1, Object o2) {
- String s1 = (String)o1;
- String s2 = (String)o2;
- return s1.compareTo(s2);
- }
- };
- TreeMap envVars = new TreeMap(comparator);
- envVars.putAll((Map)inputElement);
- elements = new EnvironmentVariable[envVars.size()];
- int index = 0;
- for (Iterator iterator = envVars.keySet().iterator(); iterator.hasNext(); index++) {
- Object key = iterator.next();
- elements[index] = (EnvironmentVariable) envVars.get(key);
- }
- }
- return elements;
- }
- public void dispose() {
- }
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- };
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegate.java
deleted file mode 100644
index c0422fe4e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegate.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.util.IPropertyChangeListener;
-
-/**
- * A breakpoint organizer is used to categorize breakpoints and provides
- * change notification when categorization has changed. Categories are represented
- * as arbitrary adaptable objects. For example, projects could be used to
- * categorize breakpoints. Images and labels for categories are generated
- * via workbench adapters.
- * <p>
- * Organizers may optionally support breakpoint recategorization.
- * </p>
- * <p>
- * Following is example plug-in XML for contributing a breakpoint organizer.
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.breakpointOrganizers"&gt;
- * &lt;breakpointOrganizer
- * class="com.example.BreakpointOrganizer"
- * id="com.example.BreakpointOrganizer"
- * label="Example Organizer"
- * icon="icons/full/obj16/example_org.gif"/&gt;
- * &lt;/extension&gt;
- * </pre>
- * The attributes are specified as follows:
- * <ul>
- * <li><code>class</code> Fully qualified name of a Java class that implements
- * {@link IBreakpointOrganizerDelegate}.</li>
- * <li><code>id</code> Unique identifier for this breakpoint organizer.</li>
- * <li><code>label</code> Label for this organizer which is suitable for
- * presentation to the user.</li>
- * <li><code>icon</code> Optional path to an icon which can be shown for this
- * organizer</li>
- * </ul>
- * </p>
- * <p>
- * Clients contributing a breakpoint organizer are intended to implement
- * this interface.
- * </p>
- * @since 3.1
- */
-public interface IBreakpointOrganizerDelegate {
-
- /**
- * Change event id when a category's breakpoints have changed.
- * The <code>oldValue</code> of the <code>PropertyChangeEvent</code> will be the
- * category that has changed, and the source of the event will the the
- * breakpoint organizer. Breakpoints in the category will be
- * recategorized when this event is fired.
- *
- * @see IPropertyChangeListener
- */
- public static final String P_CATEGORY_CHANGED = DebugUIPlugin.getUniqueIdentifier() + ".P_CATEGORY_CHANGED"; //$NON-NLS-1$
-
- /**
- * Returns objects representing the categories of the specified
- * breakpoint or <code>null</code> if this organizer cannot classify
- * the breakpoint. Categories must return <code>true</code> when sent
- * the message <code>equals(Object)</code> with an equivalent category
- * as an argument.
- *
- * @param breakpoint breakpoint to classify
- * @return categories of the given breakpoint or <code>null</code>
- */
- public IAdaptable[] getCategories(IBreakpoint breakpoint);
-
- /**
- * Adds the specified listener. Has no effect if an identical listener is
- * already registered.
- *
- * @param listener listener to add
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener);
-
- /**
- * Removes the specified listener. Has no effect if an identical listener
- * is not already registered.
- *
- * @param listener listener to remove
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener);
-
- /**
- * Adds the specified breakpoint to the given category. Only called
- * if <code>canAdd(...)</code> returns <code>true</code> for the given
- * breakpoint and category.
- *
- * @param breakpoint breakpoint to recategorize
- * @param category the breakpoint's new category
- */
- public void addBreakpoint(IBreakpoint breakpoint, IAdaptable category);
-
- /**
- * Removes the specified breakpoint from the given category. Only
- * called if <code>canRemove(...)</code> returns <code>true</code> for
- * the given breakpoint and category.
- *
- * @param breakpoint breakpoint to recategorize
- * @param category the category the breakpoint is remove from
- */
- public void removeBreakpoint(IBreakpoint breakpoint, IAdaptable category);
-
- /**
- * Returns whether the given breakpoint can be categorized in the
- * specified category.
- *
- * @param breakpoint breakpoint to recatogorize
- * @param category the category to add the breakpoint to
- * @return whether the given breakpoint can be categorized in the
- * specified category
- */
- public boolean canAdd(IBreakpoint breakpoint, IAdaptable category);
-
- /**
- * Returns whether the given breakpoint can be removed from the given
- * category.
- *
- * @param breakpoint breakpoint to recategorize
- * @param category the category to remove the breakpoint from
- * @return whether the given breakpoint can be removed from the given
- * category
- */
- public boolean canRemove(IBreakpoint breakpoint, IAdaptable category);
-
- /**
- * Returns all categories managed by this organizer, or <code>null</code>.
- * When <code>null</code> is returned, the breakpoints view only displays
- * categories that contain breakpoints. When a collection of categories
- * is returned the breakpoints will display all of the categories, some of
- * which may be empty.
- *
- * @return all categories managed by this organizer, or <code>null</code>
- */
- public IAdaptable[] getCategories();
-
- /**
- * Disposes this breakpoint organizer.
- */
- public void dispose();
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegateExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegateExtension.java
deleted file mode 100644
index 9bff24a27..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointOrganizerDelegateExtension.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.model.IBreakpoint;
-
-/**
- * Optional enhancements to the {@link IBreakpointOrganizerDelegate} interface.
- * Supports operations on more than one breakpoint at a time.
- * <p>
- * Clients contributing a breakpoint organizer may optionally implement this
- * interface when implementing {@link IBreakpointOrganizerDelegate}.
- * </p>
- * @since 3.3
- */
-public interface IBreakpointOrganizerDelegateExtension extends IBreakpointOrganizerDelegate {
-
- /**
- * Adds the specified breakpoints to the given category. Only called
- * if <code>canAdd(...)</code> returns <code>true</code> for the given
- * breakpoints and category.
- *
- * @param breakpoints breakpoints add
- * @param category the breakpoints' new category
- */
- public void addBreakpoints(IBreakpoint[] breakpoints, IAdaptable category);
-
- /**
- * Removes the specified breakpoints from the given category. Only
- * called if <code>canRemove(...)</code> returns <code>true</code> for
- * the given breakpoints and category.
- *
- * @param breakpoints breakpoints to remove
- * @param category the category the breakpoint is remove from
- */
- public void removeBreakpoints(IBreakpoint[] breakpoints, IAdaptable category);
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointTypeCategory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointTypeCategory.java
deleted file mode 100644
index ddb1ea8a3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IBreakpointTypeCategory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import org.eclipse.core.runtime.IAdaptable;
-
-/**
- * Represents a breakpoint's type to support organization of breakpoints
- * by type in the breakpoints view. A default breakpoint type adapter
- * is provided for breakpoints by the debug platform, but clients may override
- * the default adapter by providing their own adapter for breakpoints.
- * <p>
- * A breakpoint type category is an adaptable that must provide an
- * <code>IWorkbenchAdapter</code> such that it can be rendered in the
- * breakpoints view.
- * </p>
- * <p>
- * Implementations should ensure that <code>equals</code> and <code>hashCode</code>
- * are implemented properly to reflect the equality of type categories.
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see org.eclipse.debug.ui.BreakpointTypeCategory
- * @since 3.1
- */
-public interface IBreakpointTypeCategory extends IAdaptable {
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugEditorPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugEditorPresentation.java
deleted file mode 100644
index dcef24c81..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugEditorPresentation.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * A debug model presentation may implement this interface to override
- * standard editor positioning and annotations associated with
- * source code display for stack frames.
- *
- * @since 3.0
- */
-public interface IDebugEditorPresentation {
- /**
- * Positions and adds annotations to the given editor for the specified
- * stack frame and returns whether any annotations were added. When
- * <code>true</code> is returned, a call will be made to remove annotations
- * when the source selection is cleared for the stack frame. When
- * <code>false</code> is returned, the debugger will position and add
- * standard annotations to the editor, and a corresponding call to remove
- * annotations will not be made. This method is called when the debugger is
- * has opened an editor to display source for the given stack frame.
- *
- * @param editorPart the editor the debugger has opened
- * @param frame the stack frame for which the debugger is displaying
- * source
- */
- public boolean addAnnotations(IEditorPart editorPart, IStackFrame frame);
-
- /**
- * Removes any debug related annotations from the given editor.
- * This method is called when the debugger clears the source selection
- * in an editor opened by the debugger. For example, when a debug
- * session is resumed or terminated.
- *
- * @param editorPart an editor that annotations were added to for
- * a stack frame
- * @param thread the thread for which stack frame annotations were
- * added to the editor
- */
- public void removeAnnotations(IEditorPart editorPart, IThread thread);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentation.java
deleted file mode 100644
index cdcbc3c5f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentation.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-
-import org.eclipse.debug.core.model.IValue;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * A debug model presentation is responsible for providing labels, images,
- * and editors associated with debug elements in a specific debug model.
- * Extensions of type <code>org.eclipse.debug.ui.debugModelPresentations</code> implement
- * this interface. Generally, a debug model implementation will also provide a
- * debug model presentation extension to render and display its elements. A debug
- * model presentation is registered for a specific debug model, and is responsible
- * for the presentation elements defined/implemented by that model.
- * <p>
- * A debug model presentation extension is defined in <code>plugin.xml</code>.
- * Following is an example definition of a debug model presentation extension.
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.debugModelPresentations"&gt;
- * &lt;debugModelPresentation
- * id="com.example.debugModelIdentifier"
- * class="com.example.ExamplePresentation"
- * detailsViewerConfiguration="com.example.ExampleSourceViewerConfiguration"&gt;
- * &lt;/debugModelPresentation&gt;
- * &lt;/extension&gt;
- * </pre>
- * The attributes are specified as follows:
- * <ul>
- * <li><code>id</code> specifies the identifier of the debug model this presentation
- * is responsible for. Corresponds to the model identifier returned from a debug
- * element - see <code>IDebugElement.getModelIndentifier</code></li>
- * <li><code>class</code> specifies the fully qualified name of the Java class
- * that implements this interface.</li>
- * <li><code>detailsViewerConfiguration</code> optionally specifies the fully qualified name of the Java class
- * that is an instance of <code>org.eclipse.jface.text.source.SourceViewerConfiguration</code>.
- * When specified, the source viewer configuration will be used in the "details" area of the
- * variables and expressions view when displaying the details of an element from the
- * debug model associated with this debug model presentation. When unspecified,
- * a default configuration is used.</li>
- * </ul>
- * </p>
- * <p>
- * To allow for an extensible configuration, this interface defines
- * a <code>setAttribute</code> method. The debug UI plug-in defines
- * one presentation attribute:
- * <ul>
- * <li><code>DISPLAY_VARIABLE_TYPE_NAMES</code> - This is a boolean attribute
- * indicating whether variable elements should be rendered with the declared
- * type of a variable. For example, a Java debug model presentation would render
- * an integer as <code>"int x = 3"</code> when true, and <code>"x = 3"</code>
- * when false.</li>
- * </ul>
- * </p>
- * <p>
- * Clients may define new presentation attributes. For example, a client may wish
- * to define a "hexadecimal" property to display numeric values in hexadecimal. Implementations
- * should honor the presentation attributes defined by this interface where possible,
- * but do not need to honor presentation attributes defined by other clients.
- * To access the debug model presentation for a debug view, clients should use
- * <code>IDebugView#getPresentation(String)</code>.
- * </p>
- * <p>
- * Since 3.1, debug model presentations may optionally implement <code>IColorProvider</code>
- * and <code>IFontProvider</code> to override default fonts and colors for debug elements.
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see org.eclipse.debug.core.model.IDebugElement
- * @see org.eclipse.jface.viewers.ILabelProvider
- * @see org.eclipse.debug.ui.IDebugView
- */
-
-public interface IDebugModelPresentation extends ILabelProvider, ISourcePresentation {
- /**
- * Variable type names presentation property (value <code>"org.eclipse.debug.ui.displayVariableTypeNames"</code>).
- * When <code>DISPLAY_VARIABLE_TYPE_NAMES</code> is set to <code>true</code>,
- * this label provider should include the reference type of a variable when rendering
- * variables. When set to <code>false</code>, this label provider
- * should not include the reference type of a variable when rendering
- * variables.
- * @see #setAttribute(String, Object)
- */
- public final static String DISPLAY_VARIABLE_TYPE_NAMES= IDebugUIConstants.PLUGIN_ID + ".displayVariableTypeNames"; //$NON-NLS-1$
- /**
- * Sets a presentation attribute of this label provider. For example,
- * see the presentation attribute <code>DISPLAY_VARIABLE_TYPE_NAMES</code>
- * defined by this interface.
- *
- * @param attribute the presentation attribute identifier
- * @param value the value of the attribute
- */
- void setAttribute(String attribute, Object value);
- /**
- * Returns an image for the element, or <code>null</code> if a default
- * image should be used.
- *
- * @param element the debug model element
- * @return an image for the element, or <code>null</code> if a default
- * image should be used
- * @see ILabelProvider
- */
- public Image getImage(Object element);
- /**
- * Returns a label for the element, or <code>null</code> if a default
- * label should be used.
- *
- * @param element the debug model element
- * @return a label for the element, or <code>null</code> if a default
- * label should be used
- * @see ILabelProvider
- */
- public String getText(Object element);
-
- /**
- * Computes a detailed description of the given value, reporting
- * the result to the specified listener. This allows a presentation
- * to provide extra details about a selected value in the variable detail
- * portion of the variables view. Since this can be a long-running operation,
- * the details are reported back to the specified listener asynchronously.
- * If <code>null</code> is reported, the value's value string is displayed
- * (<code>IValue.getValueString()</code>).
- *
- * @param value the value for which a detailed description
- * is required
- * @param listener the listener to report the details to
- * asynchronously
- * @since 2.0
- */
- void computeDetail(IValue value, IValueDetailListener listener);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentationExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentationExtension.java
deleted file mode 100644
index 144dad097..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentationExtension.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-/**
- * Optional extension for an {@link IDebugModelPresentation}. Dynamically controls
- * whether labels are computed in a UI thread. The debug platform calls debug model
- * presentation label related methods that do not implement this interface in a
- * <b>non-UI</b> thread.
- * <p>
- * For example, some models may require at least one access in a UI thread to initialize
- * an image registry at which point they may be able to provide labels in a non-UI
- * thread.
- * </p>
- * <p>
- * Clients implementing a debug model presentation should also implement
- * this interface to control which thread labels are generated in.
- * </p>
- * @since 3.4
- */
-public interface IDebugModelPresentationExtension extends IDebugModelPresentation {
-
- /**
- * Returns whether the UI thread is required to retrieve a label (text, image, font,
- * foreground, background, etc.), for the specified element. When <code>true</code> is
- * returned, label related methods will be called in the UI thread, otherwise methods
- * may be called in a non-UI thread.
- *
- * @param element the element a label is to be retrieved for
- * @return whether label related methods should be called on the UI thread
- */
- public boolean requiresUIThread(Object element);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
deleted file mode 100644
index 411e523a5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
+++ /dev/null
@@ -1,1266 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * QNX Software Systems - Mikhail Khodjaiants - Registers View (Bug 53640)
- * Wind River Systems - Pawel Piech - Added Modules view (bug 211158)
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchManager;
-
-/**
- * Constant definitions for debug UI plug-in.
- * <p>
- * Popup menus in the debug UI support action contribution via the
- * <code>org.eclipse.ui.popupMenus</code> extension. Actions may be
- * contributed to any group on the menu. To facilitate insertion of actions
- * in between existing groups, empty groups have been defined
- * in the menu. Each group prefixed by "empty" indicates an empty group.
- * </p>
- * <h3>Debug View Popup Menu</h3>
- * <ul>
- * <li>Empty edit group</li>
- * <li>Edit group</li>
- * <li>Copy stack action</li>
- * <li>Empty step group</li>
- * <li>Step group</li>
- * <li>Step into group</li>
- * <li>Step into action</li>
- * <li>Step over group</li>
- * <li>Step over action</li>
- * <li>Step return group</li>
- * <li>Step return action</li>
- * <li>Empty thread group</li>
- * <li>Thread group</li>
- * <li>Resume action</li>
- * <li>Suspend action</li>
- * <li>Terminate action</li>
- * <li>Disconnect action</li>
- * <li>Empty launch group</li>
- * <li>Launch group</li>
- * <li>Remove all terminated action</li>
- * <li>Terminate and Remove action</li>
- * <li>Relaunch action</li>
- * <li>Terminate all action</li>
- * <li>Empty render group</li>
- * <li>Render group</li>
- * <li>Property group</li>
- * <li>Property dialog action</li>
- * <li>Additions group</li>
- * </ul>
- * <h3>Variables View Popup Menus</h3>
- * <ul>
- * <li>Empty variable group</li>
- * <li>Variable group</li>
- * <li>Select all action</li>
- * <li>Copy to clipboard action</li>
- * <li>Find action</li>
- * <li>Change value action</li>
- * <li>Available logical structures action</li>
- * <li>Available detail panes action</li>
- * <li>Empty render group</li>
- * <li>Render group</li>
- * <li>Show type names action</li>
- * <li>Additions group</li>
- * </ul>
- * <h3>Breakpoints View Popup Menu</h3>
- * <ul>
- * <li>Empty Navigation group</li>
- * <li>Navigation group</li>
- * <li>Open action</li>
- * <li>Empty Breakpoint group</li>
- * <li>Breakpoint group</li>
- * <li>Enable action</li>
- * <li>Disable action</li>
- * <li>Remove action</li>
- * <li>Remove all action</li>
- * <li>Empty render group</li>
- * <li>Render group</li>
- * <li>Show breakpoints for model action</li>
- * <li>Additions group</li>
- * </ul>
- * <h3>Expressions View Popup Menu</h3>
- * <ul>
- * <li>Empty Expression group</li>
- * <li>Expression group</li>
- * <li>Select all action</li>
- * <li>Copy to clipboard action</li>
- * <li>Remove action</li>
- * <li>Remove all action</li>
- * <li>Find action</li>
- * <li>Change variable value action</li>
- * <li>Available logical structures action</li>
- * <li>Available detail panes action</li>
- * <li>Empty Render group</li>
- * <li>Render group</li>
- * <li>Show type names action</li>
- * <li>Additions group</li>
- * </ul>
- * <p>
- * Constants only.
- * </p>
- * @noimplement This interface is not intended to be implemented by clients.
- * @noextend This interface is not intended to be extended by clients.
- */
-
-public interface IDebugUIConstants {
-
- /**
- * Debug UI plug-in identifier (value <code>"org.eclipse.debug.ui"</code>).
- */
- public static final String PLUGIN_ID = "org.eclipse.debug.ui"; //$NON-NLS-1$;
-
- /**
- * Debug perspective identifier (value <code>"org.eclipse.debug.ui.DebugPerspective"</code>).
- */
- public static final String ID_DEBUG_PERSPECTIVE = PLUGIN_ID + ".DebugPerspective"; //$NON-NLS-1$
-
- /**
- * Console type identifier (value <code>"org.eclipse.debug.ui.ProcessConsoleType"</code>).
- *
- * @since 3.1
- */
- public static final String ID_PROCESS_CONSOLE_TYPE = PLUGIN_ID + ".ProcessConsoleType"; //$NON-NLS-1$
-
- /**
- * Constant for referring to no perspective.
- */
- public static final String PERSPECTIVE_NONE = "perspective_none"; //$NON-NLS-1$
-
- /**
- * Constant for referring to a default perspective.
- */
- public static final String PERSPECTIVE_DEFAULT = "perspective_default"; //$NON-NLS-1$
-
- // Preferences
-
- /**
- * String preference that identifies the default 'switch to perspective id' when running a
- * launch configuration. This default is used if a particular launch configuration does not
- * override the 'switch to perspective when in run mode' attribute with something else.
- */
- public static final String PREF_SHOW_RUN_PERSPECTIVE_DEFAULT= PLUGIN_ID + ".show_run_perspective_default"; //$NON-NLS-1$
-
- /**
- * String preference that identifies the default 'switch to perspective id' when debugging a
- * launch configuration. This default is used if a particular launch configuration does not
- * override the 'switch to perspective when in debug mode' attribute with something else.
- */
- public static final String PREF_SHOW_DEBUG_PERSPECTIVE_DEFAULT= PLUGIN_ID + ".show_debug_perspective_default"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling whether a build is done before
- * launching a program (if one is needed).
- */
- public static final String PREF_BUILD_BEFORE_LAUNCH= PLUGIN_ID + ".build_before_launch"; //$NON-NLS-1$
- /**
- * Boolean preference controlling automatic removal of terminated launches
- * when a new launch is registered.
- * @since 2.0
- */
- public static final String PREF_AUTO_REMOVE_OLD_LAUNCHES= PLUGIN_ID + ".auto_remove_old_launches"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling whether the debugger re-uses non-dirty editors
- * that it opens when displaying source. When <code>true</code> the debugger
- * re-uses the same editor when showing source for a selected stack frame (unless
- * the editor is dirty).
- *
- * @since 2.0
- */
- public static final String PREF_REUSE_EDITOR = PLUGIN_ID + ".reuse_editor"; //$NON-NLS-1$
-
- /**
- * Integer preference that specifies the length of the Run & Debug launch history lists.
- *
- * @since 2.0
- */
- public static final String PREF_MAX_HISTORY_SIZE = PLUGIN_ID + ".max_history_size"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling whether the debugger shows types names
- * in its variable view. When <code>true</code> the debugger
- * will display type names in new variable views.
- *
- * @since 2.0
- * @deprecated no longer used
- */
- public static final String PREF_SHOW_TYPE_NAMES = PLUGIN_ID + ".show_type_names"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling whether the debugger shows the detail pane
- * in its variable view. When <code>true</code> the debugger
- * will show the detail panes in new variable views.
- *
- * @since 2.0
- * @deprecated no longer used
- */
- public static final String PREF_SHOW_DETAIL_PANE = PLUGIN_ID + ".show_detail_pane"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling whether the debugger will force activate the active
- * shell/window of the Eclipse workbench when a breakpoint is hit.
- *
- * @since 2.1
- */
- public static final String PREF_ACTIVATE_WORKBENCH= PLUGIN_ID + ".activate_workbench"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling whether breakpoints are
- * automatically skipped during a Run To Line operation.
- * If true, breakpoints will be skipped automatically
- * during Run To Line. If false, they will be hit.
- *
- * @since 3.0
- */
- public static final String PREF_SKIP_BREAKPOINTS_DURING_RUN_TO_LINE= PLUGIN_ID + ".skip_breakpoints_during_run_to_line"; //$NON-NLS-1$
-
- /**
- * String preference controlling in which perspectives view management will
- * occur. This preference, if set, overrides the perspectives enabled
- * through the <code>contextViewBindings</code> extension point. The value
- * is a comma-separated list of perspective IDs, an empty string (no perspectives),
- * or the value of <code>PREF_MANAGE_VIEW_PERSPECTIVES_DEFAULT</code> ("<code>DEFAULT</code>").
- *
- * @since 3.0
- */
- public static final String PREF_MANAGE_VIEW_PERSPECTIVES= PLUGIN_ID + ".manage_view_perspectives"; //$NON-NLS-1$
-
- /**
- * The default value of the {@link IDebugUIConstants#PREF_MANAGE_VIEW_PERSPECTIVES} preference.
- *
- * @see IDebugUIConstants#PREF_MANAGE_VIEW_PERSPECTIVES
- *
- * @since 3.5
- */
- public static final String PREF_MANAGE_VIEW_PERSPECTIVES_DEFAULT= "DEFAULT"; //$NON-NLS-1$
-
- /**
- * Font preference setting for the process console.
- *
- * @since 3.3
- */
- public static final String PREF_CONSOLE_FONT= "org.eclipse.debug.ui.consoleFont"; //$NON-NLS-1$
-
- /**
- * Debug view identifier (value <code>"org.eclipse.debug.ui.DebugView"</code>).
- */
- public static final String ID_DEBUG_VIEW= "org.eclipse.debug.ui.DebugView"; //$NON-NLS-1$
-
- /**
- * Breakpoint view identifier (value <code>"org.eclipse.debug.ui.BreakpointView"</code>).
- */
- public static final String ID_BREAKPOINT_VIEW= "org.eclipse.debug.ui.BreakpointView"; //$NON-NLS-1$
-
- /**
- * Variable view identifier (value <code>"org.eclipse.debug.ui.VariableView"</code>).
- */
- public static final String ID_VARIABLE_VIEW= "org.eclipse.debug.ui.VariableView"; //$NON-NLS-1$
-
- /**
- * Expression view identifier (value <code>"org.eclipse.debug.ui.ExpressionView"</code>).
- * @since 2.0
- */
- public static final String ID_EXPRESSION_VIEW= "org.eclipse.debug.ui.ExpressionView"; //$NON-NLS-1$
-
- /**
- * Register view identifier (value <code>"org.eclipse.debug.ui.RegisterView"</code>).
- * @since 3.0
- */
- public static final String ID_REGISTER_VIEW= "org.eclipse.debug.ui.RegisterView"; //$NON-NLS-1$
-
- /**
- * Module view identifier (value <code>"org.eclipse.debug.ui.ModuleView"</code>).
- * @since 3.4
- */
- public static final String ID_MODULE_VIEW= "org.eclipse.debug.ui.ModuleView"; //$NON-NLS-1$
-
- /**
- * Console view identifier (value <code>"org.eclipse.debug.ui.ConsoleView"</code>).
- * @deprecated Use org.eclipse.ui.console.IConsoleConstants.ID_CONSOLE_VIEW
- * @since 3.0
- */
- public static final String ID_CONSOLE_VIEW= "org.eclipse.debug.ui.ConsoleView"; //$NON-NLS-1$
-
- // Console stream identifiers
-
- /**
- * Identifier for the standard out stream.
- *
- * @see org.eclipse.debug.ui.console.IConsoleColorProvider#getColor(String)
- * @since 2.1
- */
- public static final String ID_STANDARD_OUTPUT_STREAM = IDebugUIConstants.PLUGIN_ID + ".ID_STANDARD_OUTPUT_STREAM"; //$NON-NLS-1$
-
- /**
- * Identifier for the standard error stream.
- *
- * @see org.eclipse.debug.ui.console.IConsoleColorProvider#getColor(String)
- * @since 2.1
- */
- public static final String ID_STANDARD_ERROR_STREAM = IDebugUIConstants.PLUGIN_ID + ".ID_STANDARD_ERROR_STREAM"; //$NON-NLS-1$
-
- /**
- * Identifier for the standard input stream.
- *
- * @see org.eclipse.debug.ui.console.IConsoleColorProvider#getColor(String)
- * @since 2.1
- */
- public static final String ID_STANDARD_INPUT_STREAM = IDebugUIConstants.PLUGIN_ID + ".ID_STANDARD_INPUT_STREAM"; //$NON-NLS-1$
-
- // Debug Action images
-
- /**
- * Debug action image identifier.
- */
- public static final String IMG_ACT_DEBUG= "IMG_ACT_DEBUG"; //$NON-NLS-1$
-
- /**
- * Run action image identifier.
- */
- public static final String IMG_ACT_RUN= "IMG_ACT_RUN"; //$NON-NLS-1$
-
- /** "Link with View" action image identifier. */
- public static final String IMG_ACT_SYNCED= "IMG_ACT_SYNCED"; //$NON-NLS-1$
-
- /** "Skip Breakpoints" action image identifier */
- public static final String IMG_SKIP_BREAKPOINTS= "IMG_SKIP_BREAKPOINTS"; //$NON-NLS-1$
-
- /** Clear action image identifier.
- * @deprecated */
- public static final String IMG_LCL_CLEAR= "IMG_LCL_CLEAR"; //$NON-NLS-1$
-
- /** Display variable type names action image identifier. */
- public static final String IMG_LCL_TYPE_NAMES= "IMG_LCL_TYPE_NAMES"; //$NON-NLS-1$
-
- /** Toggle detail pane action image identifier.*/
- public static final String IMG_LCL_DETAIL_PANE= "IMG_LCL_DETAIL_PANE"; //$NON-NLS-1$
-
- /** Change variable value action image identifier.*/
- public static final String IMG_LCL_CHANGE_VARIABLE_VALUE= "IMG_LCL_CHANGE_VARIABLE_VALUE"; //$NON-NLS-1$
-
- /**
- * Disconnect action image identifier
- *
- * @since 2.0
- */
- public static final String IMG_LCL_DISCONNECT= "IMG_LCL_DISCONNECT"; //$NON-NLS-1$
-
- /**
- * Scroll lock action image identifier
- *
- * @since 2.1
- */
- public static final String IMG_LCL_LOCK = "IMG_LCL_LOCK"; //$NON-NLS-1$
-
- /**
- * Remove all action image identifier
- *
- * @since 2.1
- */
- public static final String IMG_LCL_REMOVE_ALL = "IMG_LCL_REMOVE_ALL"; //$NON-NLS-1$
-
- /**
- * Remove action image identifier
- *
- * @since 3.2
- */
- public static final String IMG_LCL_REMOVE = "IMG_LCL_REMOVE"; //$NON-NLS-1$
-
- /**
- * Content assist action image identifier.
- */
- public static final String IMG_LCL_CONTENT_ASSIST= "IMG_LCL_CONTENT_ASSIST"; //$NON-NLS-1$
-
- /**
- * Content assist action image identifier (enabled).
- */
- public static final String IMG_ELCL_CONTENT_ASSIST= "IMG_ELCL_CONTENT_ASSIST"; //$NON-NLS-1$
-
- /**
- * Content assist action image identifier (disabled).
- */
- public static final String IMG_DLCL_CONTENT_ASSIST= "IMG_DLCL_CONTENT_ASSIST"; //$NON-NLS-1$
-
- /**
- * Content assist action image identifier.
- */
- public static final String IMG_LCL_DETAIL_PANE_UNDER= "IMG_LCL_DETAIL_PANE_UNDER"; //$NON-NLS-1$
-
- /**
- * Content assist action image identifier.
- */
- public static final String IMG_LCL_DETAIL_PANE_RIGHT= "IMG_LCL_DETAIL_PANE_RIGHT"; //$NON-NLS-1$
-
- /**
- * Content assist action image identifier.
- */
- public static final String IMG_LCL_DETAIL_PANE_HIDE= "IMG_LCL_DETAIL_PANE_HIDE"; //$NON-NLS-1$
-
- // Debug element images
-
- /** Debug mode launch image identifier. */
- public static final String IMG_OBJS_LAUNCH_DEBUG= "IMG_OBJS_LAUNCH_DEBUG"; //$NON-NLS-1$
-
- /** Run mode launch image identifier. */
- public static final String IMG_OBJS_LAUNCH_RUN= "IMG_OBJS_LAUNCH_RUN"; //$NON-NLS-1$
-
- /** Terminated run mode launch image identifier. */
- public static final String IMG_OBJS_LAUNCH_RUN_TERMINATED= "IMG_OBJS_LAUNCH_RUN_TERMINATED"; //$NON-NLS-1$
-
- /** Running debug target image identifier. */
- public static final String IMG_OBJS_DEBUG_TARGET= "IMG_OBJS_DEBUG_TARGET"; //$NON-NLS-1$
-
- /** Suspended debug target image identifier. */
- public static final String IMG_OBJS_DEBUG_TARGET_SUSPENDED= "IMG_OBJS_DEBUG_TARGET_SUSPENDED"; //$NON-NLS-1$
-
- /** Terminated debug target image identifier. */
- public static final String IMG_OBJS_DEBUG_TARGET_TERMINATED= "IMG_OBJS_DEBUG_TARGET_TERMINATED"; //$NON-NLS-1$
-
- /** Running thread image identifier. */
- public static final String IMG_OBJS_THREAD_RUNNING= "IMG_OBJS_THREAD_RUNNING"; //$NON-NLS-1$
-
- /** Suspended thread image identifier. */
- public static final String IMG_OBJS_THREAD_SUSPENDED= "IMG_OBJS_THREAD_SUSPENDED"; //$NON-NLS-1$
-
- /** Terminated thread image identifier. */
- public static final String IMG_OBJS_THREAD_TERMINATED= "IMG_OBJS_THREAD_TERMINATED"; //$NON-NLS-1$
-
- /** Stack frame (suspended) image identifier. */
- public static final String IMG_OBJS_STACKFRAME= "IMG_OBJS_STACKFRAME"; //$NON-NLS-1$
-
- /** Stack frame (running) image identifier. */
- public static final String IMG_OBJS_STACKFRAME_RUNNING= "IMG_OBJS_STACKFRAME_RUNNING"; //$NON-NLS-1$
-
- /** Enabled breakpoint image identifier. */
- public static final String IMG_OBJS_BREAKPOINT= "IMG_OBJS_BREAKPOINT"; //$NON-NLS-1$
-
- /** Disabled breakpoint image identifier. */
- public static final String IMG_OBJS_BREAKPOINT_DISABLED= "IMG_OBJS_BREAKPOINT_DISABLED"; //$NON-NLS-1$
-
- /**
- * Breakpoint group image identifier.
- *
- * @since 3.1
- */
- public static final String IMG_OBJS_BREAKPOINT_GROUP = "IMG_OBJS_BREAKPOINT_GROUP"; //$NON-NLS-1$
-
- /**
- * Disabled breakpoint group image identifier.
- *
- * @since 3.1
- */
- public static final String IMG_OBJS_BREAKPOINT_GROUP_DISABLED = "IMG_OBJS_BREAKPOINT_GROUP_DISABLED"; //$NON-NLS-1$
-
- /**
- * Enabled watchpoint image identifier (access & modification).
- * @since 3.0
- */
- public static final String IMG_OBJS_WATCHPOINT= "IMG_OBJS_WATCHPOINT"; //$NON-NLS-1$
-
- /**
- * Disabled watchpoint image identifier (access & modification).
- * @since 3.0
- */
- public static final String IMG_OBJS_WATCHPOINT_DISABLED= "IMG_OBJS_WATCHPOINT_DISABLED"; //$NON-NLS-1$
-
- /**
- * Enabled access watchpoint image identifier.
- * @since 3.1
- */
- public static final String IMG_OBJS_ACCESS_WATCHPOINT= "IMG_OBJS_ACCESS_WATCHPOINT"; //$NON-NLS-1$
-
- /**
- * Disabled access watchpoint image identifier.
- * @since 3.1
- */
- public static final String IMG_OBJS_ACCESS_WATCHPOINT_DISABLED= "IMG_OBJS_ACCESS_WATCHPOINT_DISABLED"; //$NON-NLS-1$
-
- /**
- * Enabled modification watchpoint image identifier.
- * @since 3.1
- */
- public static final String IMG_OBJS_MODIFICATION_WATCHPOINT= "IMG_OBJS_MODIFICATION_WATCHPOINT"; //$NON-NLS-1$
-
- /**
- * Disabled modification watchpoint image identifier.
- * @since 3.1
- */
- public static final String IMG_OBJS_MODIFICATION_WATCHPOINT_DISABLED= "IMG_OBJS_MODIFICATION_WATCHPOINT_DISABLED"; //$NON-NLS-1$
-
- /** Running system process image identifier. */
- public static final String IMG_OBJS_OS_PROCESS= "IMG_OBJS_OS_PROCESS"; //$NON-NLS-1$
-
- /** Terminated system process image identifier. */
- public static final String IMG_OBJS_OS_PROCESS_TERMINATED= "IMG_OBJS_OS_PROCESS_TERMINATED"; //$NON-NLS-1$
-
- /**
- * Expression image identifier.
- *
- * @since 2.0
- */
- public static final String IMG_OBJS_EXPRESSION= "IMG_OBJS_EXPRESSION"; //$NON-NLS-1$
-
- /**
- * Generic variable image identifier.
- *
- * @since 2.0
- */
- public static final String IMG_OBJS_VARIABLE= "IMG_OBJS_VARIABLE"; //$NON-NLS-1$
-
- /**
- * Generic identifier of register group image.
- *
- * @since 3.0
- */
- public static final String IMG_OBJS_REGISTER_GROUP= "IMG_OBJS_REGISTER_GROUP"; //$NON-NLS-1$
-
- /**
- * Generic register image identifier.
- *
- * @since 3.0
- */
- public static final String IMG_OBJS_REGISTER= "IMG_OBJS_REGISTER"; //$NON-NLS-1$
-
- /**
- * Environment image identifier.
- *
- * @since 3.0
- */
- public static final String IMG_OBJS_ENVIRONMENT = "IMG_OBJS_ENVIRONMENT"; //$NON-NLS-1$
-
- /**
- * Environment variable image identifier.
- *
- * @since 3.0
- */
- public static final String IMG_OBJS_ENV_VAR = "IMG_OBJS_ENV_VAR"; //$NON-NLS-1$
-
- // views
-
- /**
- * Launches view image identifier
- *
- * @since 2.0
- */
- public static final String IMG_VIEW_LAUNCHES= "IMG_VIEW_LAUNCHES"; //$NON-NLS-1$
-
- /**
- * Breakpoints view image identifier
- *
- * @since 2.0
- */
- public static final String IMG_VIEW_BREAKPOINTS= "IMG_VIEW_BREAKPOINTS"; //$NON-NLS-1$
-
- /**
- * Variables view image identifier
- *
- * @since 2.0
- */
- public static final String IMG_VIEW_VARIABLES= "IMG_VIEW_VARIABLES"; //$NON-NLS-1$
-
- /**
- * Expressions view image identifier
- *
- * @since 2.0
- */
- public static final String IMG_VIEW_EXPRESSIONS= "IMG_VIEW_EXPRESSIONS"; //$NON-NLS-1$
-
- /**
- * Console view image identifier
- *
- * @since 2.0
- */
- public static final String IMG_VIEW_CONSOLE= "IMG_VIEW_CONSOLE"; //$NON-NLS-1$
-
- // perspective
- /**
- * Debug perspective image identifier
- *
- * @since 2.0
- */
- public static final String IMG_PERSPECTIVE_DEBUG= "IMG_PERSPECTIVE_DEBUG"; //$NON-NLS-1$
-
- // wizard banners
- /** Debug wizard banner image identifier. */
- public static final String IMG_WIZBAN_DEBUG= "IMG_WIZBAN_DEBUG"; //$NON-NLS-1$
-
- /** Run wizard banner image identifier. */
- public static final String IMG_WIZBAN_RUN= "IMG_WIZBAN_RUN"; //$NON-NLS-1$
-
- // overlays
- /** Error overlay image identifier. */
- public static final String IMG_OVR_ERROR = "IMG_OVR_ERROR"; //$NON-NLS-1$
-
- /**
- * Skip breakpoint image overlay identifier.
- * @since 3.1
- */
- public static final String IMG_OVR_SKIP_BREAKPOINT = "IMG_OVR_SKIP_BREAKPOINT"; //$NON-NLS-1$
-
- /**
- * Debug action set identifier (value <code>"org.eclipse.debug.ui.debugActionSet"</code>).
- */
- public static final String DEBUG_ACTION_SET= PLUGIN_ID + ".debugActionSet"; //$NON-NLS-1$
-
-
- /**
- * Launch action set identifier (value <code>"org.eclipse.debug.ui.launchActionSet"</code>).
- */
- public static final String LAUNCH_ACTION_SET= PLUGIN_ID + ".launchActionSet"; //$NON-NLS-1$
-
- // extensions
- /**
- * Identifier for the standard 'debug' launch group.
- * @since 2.1
- */
- public static final String ID_DEBUG_LAUNCH_GROUP = PLUGIN_ID + ".launchGroup.debug"; //$NON-NLS-1$
-
- /**
- * Identifier for the standard 'run' launch group.
- * @since 2.1
- */
- public static final String ID_RUN_LAUNCH_GROUP = PLUGIN_ID + ".launchGroup.run"; //$NON-NLS-1$
-
- /**
- * Identifier for the standard 'profile' launch group.
- * @since 3.0
- */
- public static final String ID_PROFILE_LAUNCH_GROUP = PLUGIN_ID + ".launchGroup.profile"; //$NON-NLS-1$
-
- // menus
-
- /**
- * Identifier for an empty group preceding an
- * edit group in a menu (value <code>"emptyEditGroup"</code>).
- */
- public static final String EMPTY_EDIT_GROUP = "emptyEditGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an edit group in a menu (value <code>"editGroup"</code>).
- */
- public static final String EDIT_GROUP = "editGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * step group in a menu (value <code>"emptyStepGroup"</code>).
- */
- public static final String EMPTY_STEP_GROUP = "emptyStepGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a step group in a menu or toolbar (value <code>"stepGroup"</code>).
- */
- public static final String STEP_GROUP = "stepGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a step into group in a menu or toolbar (value <code>"stepIntoGroup"</code>).
- */
- public static final String STEP_INTO_GROUP = "stepIntoGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a step over group in a menu or toolbar (value <code>"stepOverGroup"</code>).
- */
- public static final String STEP_OVER_GROUP = "stepOverGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a step return group in a menu or toolbar (value <code>"stepReturnGroup"</code>).
- */
- public static final String STEP_RETURN_GROUP = "stepReturnGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * thread group in a menu (value <code>"emptyThreadGroup"</code>).
- */
- public static final String EMPTY_THREAD_GROUP = "emptyThreadGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a thread group in a menu or toolbar(value <code>"threadGroup"</code>).
- */
- public static final String THREAD_GROUP = "threadGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * launch group in a menu (value <code>"emptyLaunchGroup"</code>).
- */
- public static final String EMPTY_LAUNCH_GROUP = "emptyLaunchGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a launch group in a menu (value <code>"launchGroup"</code>).
- */
- public static final String LAUNCH_GROUP = "launchGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an output group in a menu (value
- * <code>"outputGroup"</code>).
- */
- public static final String OUTPUT_GROUP = "outputGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * variable group in a menu (value <code>"emptyVariableGroup"</code>).
- */
- public static final String EMPTY_VARIABLE_GROUP = "emptyVariableGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a variable group in a menu (value <code>"variableGroup"</code>).
- */
- public static final String VARIABLE_GROUP = "variableGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * navigation group in a menu (value <code>"emptyNavigationGroup"</code>).
- */
- public static final String EMPTY_NAVIGATION_GROUP = "emptyNavigationGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a navigation group in a menu (value <code>"navigationGroup"</code>).
- */
- public static final String NAVIGATION_GROUP = "navigationGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * breakpoint group in a menu (value <code>"emptyBreakpointGroup"</code>).
- */
- public static final String EMPTY_BREAKPOINT_GROUP = "emptyBreakpointGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a breakpoint group in a menu (value <code>"breakpointGroup"</code>).
- */
- public static final String BREAKPOINT_GROUP = "breakpointGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a "breakpoint group" group in a menu (value <code>"breakpointGroupGroup"</code>).
- *
- * @since 3.1
- */
- public static final String BREAKPOINT_GROUP_GROUP = "breakpointGroupGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding an
- * expression group in a menu (value <code>"emptyExpressionGroup"</code>).
- *
- * @since 2.0
- */
- public static final String EMPTY_EXPRESSION_GROUP = "emptyExpressionGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an expression group in a menu (value <code>"expressionGroup"</code>).
- *
- * @since 2.0
- */
- public static final String EXPRESSION_GROUP = "expressionGroup"; //$NON-NLS-1$
- /**
- * Identifier for an empty group preceding a
- * render group in a menu (value <code>"emptyRenderGroup"</code>).
- */
- public static final String EMPTY_RENDER_GROUP = "emptyRenderGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a render group in a menu or toolbar(value <code>"renderGroup"</code>).
- */
- public static final String RENDER_GROUP = "renderGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a property group in a menu (value <code>"propertyGroup"</code>).
- */
- public static final String PROPERTY_GROUP = "propertyGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * register group in a menu (value <code>"emptyRegisterGroup"</code>).
- */
- public static final String EMPTY_REGISTER_GROUP = "emptyRegisterGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a register group in a menu (value <code>"registerGroup"</code>).
- */
- public static final String REGISTER_GROUP = "registerGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for an empty group preceding a
- * modules group in a menu (value <code>"emptyModulesGroup"</code>).
- * @since 3.4
- */
- public static final String EMPTY_MODULES_GROUP = "emptyModulesGroup"; //$NON-NLS-1$
-
- /**
- * Identifier for a modules group in a menu (value <code>"modulesGroup"</code>).
- * @since 3.4
- */
- public static final String MODULES_GROUP = "modulesGroup"; //$NON-NLS-1$
-
- /**
- * Id for the popup menu associated with the variables (tree viewer) part of the VariableView
- */
- public static final String VARIABLE_VIEW_VARIABLE_ID = "org.eclipse.debug.ui.VariableView.variables"; //$NON-NLS-1$
-
- /**
- * Id for the popup menu associated with the detail (text viewer) part of the VariableView
- */
- public static final String VARIABLE_VIEW_DETAIL_ID = "org.eclipse.debug.ui.VariableView.detail"; //$NON-NLS-1$
-
- // status codes
- /**
- * Status indicating an invalid extension definition.
- */
- public static final int STATUS_INVALID_EXTENSION_DEFINITION = 100;
-
- /**
- * Status code indicating an unexpected internal error.
- */
- public static final int INTERNAL_ERROR = 120;
-
- // launch configuration attribute keys
- /**
- * Launch configuration attribute - the perspective to
- * switch to when a launch configuration is launched in
- * run mode (value <code>org.eclipse.debug.ui.target_run_perspective</code>).
- * Value is a string corresponding to a perspective identifier,
- * or <code>null</code> indicating no perspective change.
- *
- * @since 2.0
- * @deprecated Since 3.0, this launch configuration attribute is no longer supported.
- * Use <code>DebugUITools.setLaunchPerspective(ILaunchConfigurationType type, String mode, String perspective)</code>.
- */
- public static final String ATTR_TARGET_RUN_PERSPECTIVE = PLUGIN_ID + ".target_run_perspective"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute - the perspective to
- * switch to when a launch configuration is launched in
- * debug mode (value <code>org.eclipse.debug.ui.target_debug_perspective</code>).
- * Value is a string corresponding to a perspective identifier,
- * or <code>null</code> indicating no perspective change.
- *
- * @since 2.0
- * @deprecated Since 3.0, this launch configuration attribute is no longer supported.
- * Use <code>DebugUITools.setLaunchPerspective(ILaunchConfigurationType type, String mode, String perspective)</code>.
- */
- public static final String ATTR_TARGET_DEBUG_PERSPECTIVE = PLUGIN_ID + ".target_debug_perspective"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute - the container where the configuration file
- * is stored. The container is set via the 'setContainer()' call on ILaunchConfigurationWorkingCopy.
- * This constant is only needed for persisting and reading the default value of the
- * container value for individual resources.
- *
- * @since 2.0
- */
- public static final String ATTR_CONTAINER = PLUGIN_ID + ".container"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute - a boolean value that indicates if the launch configuration
- * is 'private'. A private configuration is one that does not appear to the user in the launch
- * history or the launch configuration dialog.
- *
- * @since 2.0
- */
- public static final String ATTR_PRIVATE = ILaunchManager.ATTR_PRIVATE;
-
- /**
- * Launch configuration attribute - a boolean value that indicates if the launch configuration
- * is displayed in the debug favorites menu. Default value is
- * <code>false</code> if absent.
- *
- * @since 2.0
- * @deprecated use <code>ATTR_FAVORITE_GROUPS</code> instead
- */
- public static final String ATTR_DEBUG_FAVORITE = PLUGIN_ID + ".debugFavorite"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute - a boolean value that indicates if the launch configuration
- * is displayed in the run favorites menu.Default value is
- * <code>false</code> if absent.
- *
- * @since 2.0
- * @deprecated use <code>ATTR_FAVORITE_GROUPS</code> instead
- */
- public static final String ATTR_RUN_FAVORITE = PLUGIN_ID + ".runFavorite"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute - a list of launch group identifiers
- * representing the favorite histories a launch configuration should appear
- * in. When <code>null</code>, the configuration does not appear in any
- * favorite lists.
- *
- * @since 2.1
- */
- public static final String ATTR_FAVORITE_GROUPS = PLUGIN_ID + ".favoriteGroups"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute - a boolean value indicating whether a
- * configuration should be launched in the background. Default value is <code>true</code>.
- *
- * @since 3.0
- */
- public static final String ATTR_LAUNCH_IN_BACKGROUND = PLUGIN_ID + ".ATTR_LAUNCH_IN_BACKGROUND"; //$NON-NLS-1$
-
- /**
- * ProcessConsole attribute - references the process that was launched.
- *
- * @since 3.1
- */
- public static final String ATTR_CONSOLE_PROCESS = PLUGIN_ID + ".ATTR_CONSOLE_PROCESS"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute specifying the encoding that the console should use.
- * When unspecified, the default encoding is used. Encoding names are available
- * from {@link org.eclipse.ui.WorkbenchEncoding}.
- *
- * @since 3.1
- * @deprecated in 3.3 Please use DebugPlugin.ATTR_CONSOLE_ENCODING instead.
- */
- public static final String ATTR_CONSOLE_ENCODING = DebugPlugin.ATTR_CONSOLE_ENCODING;
-
- /**
- * Launch configuration boolean attribute specifying whether output from the launched process will
- * be captured and written to the console. Default value is <code>true</code>.
- *
- * @since 3.1
- */
- public static final String ATTR_CAPTURE_IN_CONSOLE = PLUGIN_ID + ".ATTR_CONSOLE_OUTPUT_ON"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute specifying a file name that console output should
- * be written to or <code>null</code> if none. Default value is <code>null</code>.
- * When specified, all output from the launched process will be written to the file.
- * The file name attribute may contain variables which will be resolved by the
- * {@link org.eclipse.core.variables.IStringVariableManager}.
- *
- * @since 3.1
- */
- public static final String ATTR_CAPTURE_IN_FILE = PLUGIN_ID + ".ATTR_CAPTURE_IN_FILE"; //$NON-NLS-1$
-
- /**
- * Launch configuration attribute specifying whether process output will be appended to the
- * file specified by the <code>ATTR_CAPTURE_IN_FILE</code> attribute instead of overwriting
- * the file. Default value is <code>false</code>.
- *
- * @since 3.1
- */
- public static final String ATTR_APPEND_TO_FILE = PLUGIN_ID + ".ATTR_APPEND_TO_FILE"; //$NON-NLS-1$
-
- // Extension points
-
- /**
- * Debug model presentation simple extension point identifier (value <code>"debugModelPresentations"</code>).
- */
- public static final String ID_DEBUG_MODEL_PRESENTATION= "debugModelPresentations"; //$NON-NLS-1$
-
- /**
- * Debug action groups extension point identifier
- * (value <code>"debugActionGroups"</code>).
- *
- * @since 2.0
- * @deprecated The Debug Action Groups extension point no longer exists. Product
- * vendors should use Activities instead.
- */
- public static final String EXTENSION_POINT_DEBUG_ACTION_GROUPS= "debugActionGroups"; //$NON-NLS-1$
-
- /**
- * Launch configuration tab groups extension point identifier
- * (value <code>"launchConfigurationTabGroups"</code>).
- *
- * @since 2.0
- */
- public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_TAB_GROUPS= "launchConfigurationTabGroups"; //$NON-NLS-1$
-
- /**
- * Contributed Launch Configuration Tab extension point identifier
- * (value <code>"launchConfigurationTabs"</code>).
- *
- * @since 3.3
- */
- public static final String EXTENSION_POINT_LAUNCH_TABS = "launchConfigurationTabs"; //$NON-NLS-1$
-
- /**
- * Launch shortcuts extension point identifier
- * (value <code>"launchShortcuts"</code>).
- *
- * @since 2.0
- */
- public static final String EXTENSION_POINT_LAUNCH_SHORTCUTS= "launchShortcuts"; //$NON-NLS-1$
-
- /**
- * Extension point for launch configuration type images.
- *
- * @since 2.0
- */
- public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPE_IMAGES = "launchConfigurationTypeImages"; //$NON-NLS-1$
-
- /**
- * Console document color provider extension point identifier
- * (value <code>"consoleColorProviders"</code>).
- *
- * @since 2.1
- */
- public static final String EXTENSION_POINT_CONSOLE_COLOR_PROVIDERS = "consoleColorProviders"; //$NON-NLS-1$
-
- /**
- * Launch groups extension point identifier (value
- * <code>"launchGroups"</code>).
- *
- * @since 2.1
- */
- public static final String EXTENSION_POINT_LAUNCH_GROUPS = "launchGroups"; //$NON-NLS-1$
-
- /**
- * Console line trackers extension point identifier (value
- * <code>"consoleLineTrackers"</code>).
- *
- * @since 2.1
- */
- public static final String EXTENSION_POINT_CONSOLE_LINE_TRACKERS = "consoleLineTrackers"; //$NON-NLS-1$
-
- /**
- * Variables content providers extension point identifier (value
- * <code>"variablesContentProviders"</code>).
- *
- * @since 3.0
- */
- public static final String EXTENSION_POINT_OBJECT_BROWSERS = "objectBrowsers"; //$NON-NLS-1$
-
- /**
- * Launch variable components extension point identifier (value
- * <code>"launchVariableComponents"</code>). The launch variable
- * components extension point specifies an <code>IVariableComponent</code>
- * for an <code>IContextLaunchVariable</code>.
- */
- public static final String EXTENSION_POINT_LAUNCH_VARIABLE_COMPONENTS = "launchVariableComponents"; //$NON-NLS-1$
-
- /**
- * Variable value editors extension point identifier (value
- * <code>"variableValueEditors"</code>
- *
- * @since 3.1
- */
- public static final String EXTENSION_POINT_VARIABLE_VALUE_EDITORS = "variableValueEditors"; //$NON-NLS-1$
-
- /**
- * Memory renderings extension point identifier (value
- * <code>"memoryRenderings"</code>
- *
- * @since 3.1
- * @deprecated As of release 3.4, replaced by {@link #EXTENSION_POINT_MEMORY_RENDERINGS}
- */
- public static final String EXTENSION_POINT_MEMORY_RENDERIGNS = "memoryRenderings"; //$NON-NLS-1$
-
- /**
- * Memory renderings extension point identifier (value
- * <code>"memoryRenderings"</code>
- *
- * @since 3.4
- */
- public static final String EXTENSION_POINT_MEMORY_RENDERINGS = "memoryRenderings"; //$NON-NLS-1$
-
- /**
- * Breakpoint organizers extension point identifier (value
- * <code>"breakpointOrganizers"</code>
- *
- * @since 3.1
- */
- public static final String EXTENSION_POINT_BREAKPOINT_ORGANIZERS = "breakpointOrganizers"; //$NON-NLS-1$
-
- /**
- * Simple identifier constant (value <code>"detailPaneFactories"</code>) for the
- * detail pane factories extension point.
- *
- * @since 3.3
- */
- public static final String EXTENSION_POINT_DETAIL_FACTORIES = "detailPaneFactories"; //$NON-NLS-1$
-
- /**
- * Simple identifier constant (value <code>"toggleBreakpointsTargetFactories"</code>) for the
- * toggle breakpoint targets extension point.
- *
- * @since 3.5
- */
- public static final String EXTENSION_POINT_TOGGLE_BREAKPOINTS_TARGET_FACTORIES = "toggleBreakpointsTargetFactories"; //$NON-NLS-1$
-
- /**
- * Update policies extension point identifier (value
- * <code>"updatePolicies"</code>
- *
- * @since 3.2
- */
- public static final String EXTENSION_POINT_UPDATE_POLICIES = "updatePolicies"; //$NON-NLS-1$
-
- /**
- * Padded string preference for renderings. Padded string is the string to be used in place of
- * of a memory byte if a rendering cannot render the data properly.
- * @since 3.1
- */
- public static final String PREF_PADDED_STR = PLUGIN_ID + ".memory.paddedStr"; //$NON-NLS-1$
-
- /**
- * ASCII code page for rendering memory to ASCII strings.
- * @since 3.1
- */
- public static final String PREF_DEFAULT_ASCII_CODE_PAGE = PLUGIN_ID + ".defaultAsciiCodePage"; //$NON-NLS-1$
-
- /**
- * EBCDIC code page for rendering memory to EBCDIC strings.
- * @since 3.1
- */
- public static final String PREF_DEFAULT_EBCDIC_CODE_PAGE = PLUGIN_ID + ".defaultEbcdicCodePage"; //$NON-NLS-1$
-
- /**
- * Maximum number of characters to display in the details area of the variables
- * view, or 0 if unlimited.
- *
- * @since 3.2
- */
- public static final String PREF_MAX_DETAIL_LENGTH = PLUGIN_ID + ".max_detail_length"; //$NON-NLS-1$
-
- /**
- * Identifier for breakpoint working set type.
- * <br>
- * Value is: <code>org.eclipse.debug.ui.breakpointWorkingSet</code>
- *
- * @since 3.2
- */
- public static final String BREAKPOINT_WORKINGSET_ID = "org.eclipse.debug.ui.breakpointWorkingSet"; //$NON-NLS-1$
-
- /**
- * Memory view identifier (value <code>"org.eclipse.debug.ui.MemoryView"</code>).
- *
- * @since 3.2
- */
- public static String ID_MEMORY_VIEW = "org.eclipse.debug.ui.MemoryView"; //$NON-NLS-1$
-
- /**
- * Memory view's rendering view pane identifier for the rendering view pane
- * on the left. (value <code>"org.eclipse.debug.ui.MemoryView.RenderingViewPane.1"</code>).
- *
- * @since 3.2
- */
- public static String ID_RENDERING_VIEW_PANE_1 = "org.eclipse.debug.ui.MemoryView.RenderingViewPane.1"; //$NON-NLS-1$
-
- /**
- * Memory view's rendering view pane identifier for the rendering view pane
- * on the right. (value <code>"org.eclipse.debug.ui.MemoryView.RenderingViewPane.2"</code>).
- *
- * @since 3.2
- */
- public static String ID_RENDERING_VIEW_PANE_2 = "org.eclipse.debug.ui.MemoryView.RenderingViewPane.2"; //$NON-NLS-1$
-
- /**
- * Preference color to indicate that a <code>MemoryByte</code> does not have history.
- * (value <code> org.eclipse.debug.ui.MemoryHistoryUnknownColor </code>)
- *
- * @since 3.2
- */
- public static final String PREF_MEMORY_HISTORY_UNKNOWN_COLOR = PLUGIN_ID + ".MemoryHistoryUnknownColor"; //$NON-NLS-1$
-
- /**
- * Preference color to indicate that a <code>MemoryByte</code> has history.
- * (value <code> org.eclipse.debug.ui.MemoryHistoryKnownColor </code>)
- *
- * @since 3.2
- */
- public static final String PREF_MEMORY_HISTORY_KNOWN_COLOR = PLUGIN_ID + ".MemoryHistoryKnownColor"; //$NON-NLS-1$
-
- /**
- * Annotation type identifier for default annotation of the current instruction
- * pointer (top stack frame in a thread). Value is <code>org.eclipse.debug.ui.currentIP</code>,
- * identifying a <code>org.eclipse.ui.editors.markerAnnotationSpecification</code>
- * extension.
- *
- * @since 3.2
- */
- public static final String ANNOTATION_TYPE_INSTRUCTION_POINTER_CURRENT = "org.eclipse.debug.ui.currentIP"; //$NON-NLS-1$
-
- /**
- * Annotation type identifier for default annotation of secondary instruction pointers
- * (non top stack frames). Value is <code>org.eclipse.debug.ui.secondaryIP</code>,
- * identifying a <code>org.eclipse.ui.editors.markerAnnotationSpecification</code>
- * extension.
- *
- * @since 3.2
- */
- public static final String ANNOTATION_TYPE_INSTRUCTION_POINTER_SECONDARY = "org.eclipse.debug.ui.secondaryIP"; //$NON-NLS-1$
-
- /**
- * Editor Identifier for the "Common Source Not Found" editor.
- * Value is <code>org.eclipse.debug.ui.sourcelookup.CommonSourceNotFoundEditor</code>
- *
- * @since 3.2
- */
- public static final String ID_COMMON_SOURCE_NOT_FOUND_EDITOR="org.eclipse.debug.ui.sourcelookup.CommonSourceNotFoundEditor"; //$NON-NLS-1$
-
- /**
- * Preference color used to render debug elements that have changed
- * (value <code>org.eclipse.debug.ui.changedDebugElement</code>).
- * For example, when a variable value changes, variables are rendered in this
- * color.
- *
- * @since 3.2
- * @see DebugUITools
- */
- public static final String PREF_CHANGED_DEBUG_ELEMENT_COLOR= "org.eclipse.debug.ui.changedDebugElement"; //$NON-NLS-1$
-
-
- /**
- * Preference for background color in tree columns when a value changes color.
- *
- * @since 3.5
- * @see DebugUITools
- */
- public static final String PREF_CHANGED_VALUE_BACKGROUND = PLUGIN_ID + ".PREF_CHANGED_VALUE_BACKGROUND"; //$NON-NLS-1$
-
-
- /**
- * The name of the font to use for the variable text in the variables, registers and expression views.
- * This font is managed via the workbench font preference page.
- *
- * @since 3.5
- */
- public static final String PREF_VARIABLE_TEXT_FONT= "org.eclipse.debug.ui.VariableTextFont"; //$NON-NLS-1$
-
- /**
- * The name of the font to use for detail panes. This font is managed via
- * the workbench font preference page.
- *
- * @since 3.5
- */
- public static final String PREF_DETAIL_PANE_FONT= "org.eclipse.debug.ui.DetailPaneFont"; //$NON-NLS-1$
-
- /**
- * Instruction pointer image for editor ruler for the currently executing
- * instruction in the top stack frame.
- *
- * @since 3.2
- */
- public static final String IMG_OBJS_INSTRUCTION_POINTER_TOP = "IMG_OBJS_INSTRUCTION_POINTER_TOP"; //$NON-NLS-1$
-
- /**
- * Instruction pointer image for editor ruler for secondary (non-top) stack frames.
- *
- * @since 3.2
- */
- public static final String IMG_OBJS_INSTRUCTION_POINTER = "IMG_OBJS_INSTRUCTION_POINTER"; //$NON-NLS-1$
-
- /**
- * A key for a system property that indicates whether there are toggle
- * breakpoint factories registered in this installation. This can be used
- * to trigger the UI to include menus related to breakpoint types.
- *
- * @since 3.5
- */
- public static final String SYS_PROP_BREAKPOINT_TOGGLE_FACTORIES_USED = "org.eclipse.debug.ui.breakpoints.toggleFactoriesUsed"; //$NON-NLS-1$
-
- /**
- * Name of the debug context variable which can be used in standard
- * expressions and command handlers to access the active debug context.
- *
- * @since 3.5
- */
- public static final String DEBUG_CONTEXT_SOURCE_NAME = "debugContext"; //$NON-NLS-1$
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java
deleted file mode 100644
index da04b4d78..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * Common function for debug views. Provides access to the underlying viewer and
- * debug model presentation being used by a viewer. This allows clients to do
- * such things as add and remove filters to a viewer, and configure a debug
- * model presentation.
- * <p>
- * Clients may implement this interface. Generally, clients should subclass
- * <code>AbstractDebugView</code> when creating a new debug view.
- * </p>
- * @see org.eclipse.core.runtime.IAdaptable
- * @see org.eclipse.debug.ui.IDebugModelPresentation
- * @see org.eclipse.debug.ui.AbstractDebugView
- * @since 2.0
- */
-
-public interface IDebugView extends IViewPart {
-
- /**
- * Action id for a view's copy action. Any view
- * with a copy action that should be invoked when
- * CTRL+C is pressed should store their
- * copy action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String COPY_ACTION = ActionFactory.COPY.getId();
-
- /**
- * Action id for a view's cut action. Any view
- * with a cut action that should be invoked when
- * CTRL+X is pressed should store their
- * cut action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String CUT_ACTION = ActionFactory.CUT.getId();
-
- /**
- * Action id for a view's double-click action. Any view
- * with an action that should be invoked when
- * the mouse is double-clicked should store their
- * double-click action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String DOUBLE_CLICK_ACTION = "Double_Click_ActionId"; //$NON-NLS-1$
-
- /**
- * Action id for a view's find action. Any view
- * with a find action that should be invoked when
- * CTRL+F is pressed should store their
- * find action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String FIND_ACTION = ActionFactory.FIND.getId();
-
- /**
- * Action id for a view's paste action. Any view
- * with a paste action that should be invoked when
- * CTRL+V is pressed should store their
- * paste action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String PASTE_ACTION = ActionFactory.PASTE.getId();
-
- /**
- * Action id for a view's remove action. Any view
- * with a remove action that should be invoked when
- * the delete key is pressed should store their
- * remove action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String REMOVE_ACTION = "Remove_ActionId"; //$NON-NLS-1$
-
- /**
- * Action id for a view's select all action. Any view
- * with a select all action that should be invoked when
- * CTRL+A is pressed should store their
- * select all action with this key.
- *
- * @see #setAction(String, IAction)
- */
- public static final String SELECT_ALL_ACTION = ActionFactory.SELECT_ALL.getId();
-
- /**
- * Returns the viewer contained in this debug view.
- *
- * @return viewer
- */
- public Viewer getViewer();
-
- /**
- * Returns the debug model presentation for this view specified
- * by the debug model identifier.
- *
- * @param id the debug model identifier that corresponds to the <code>id</code>
- * attribute of a debug model presentation extension
- * @return the debug model presentation, or <code>null</code> if no
- * presentation is registered for the specified id
- */
- public IDebugModelPresentation getPresentation(String id);
-
- /**
- * Installs the given action under the given action id.
- *
- * If the action has an id that maps to one of the global
- * action ids defined by this interface, the action is registered
- * as a global action handler.
- *
- * If the action is an instance of <code>IUpdate</code> it is added/remove
- * from the collection of updateables associated with this view.
- *
- * @param actionID the action id
- * @param action the action, or <code>null</code> to clear it
- * @see #getAction
- */
- public void setAction(String actionID, IAction action);
-
- /**
- * Adds the given IUpdate to this view's collection of updatable
- * objects. Allows the view to periodically update these registered
- * objects.
- * Has no effect if an identical IUpdate is already registered.
- *
- * @param updatable The IUpdate instance to be added
- */
- public void add(IUpdate updatable);
-
- /**
- * Removes the given IUpdate from this view's collection of updatable
- * objects.
- * Has no effect if an identical IUpdate was not already registered.
- *
- * @param updatable The IUpdate instance to be removed
- */
- public void remove(IUpdate updatable);
-
- /**
- * Returns the action installed under the given action id.
- *
- * @param actionID the action id
- * @return the action, or <code>null</code> if none
- * @see #setAction
- */
- public IAction getAction(String actionID);
-
- /**
- * Returns the context menu manager for this view.
- *
- * @return the context menu manager for this view, or <code>null</code> if none
- * @deprecated See AbstractDebugView#getContextMenuManagers()
- */
- public IMenuManager getContextMenuManager();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPane.java
deleted file mode 100644
index 9dc2c84c9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPane.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River - Anton Leherbauer - Fix selection provider (Bug 254442)
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IWorkbenchPartSite;
-
-/**
- * A detail pane is created from a detail pane factory and displays detailed information about
- * a current selection with an SWT <code>Control</code>. Use the
- * <code>org.eclipse.debug.ui.detailFactories</code> extension point to contribute a detail pane
- * factory.
- * <p>
- * Implementors should implement {@link IDetailPane2} in favor of this interface.
- * </p>
- * @see IDetailPaneFactory
- * @see IDetailPane2
- * @since 3.3
- */
-public interface IDetailPane {
-
- /**
- * Initializes this detail pane for the given workbench part site. This is the first method
- * invoked on a detail pane after instantiation. If this detail pane is being added to a
- * non-view component such as a dialog, the passed workbench part site will be <code>null</code>.
- *
- * @param partSite The workbench part site that this detail pane has been created in or <code>null</code>
- */
- public void init(IWorkbenchPartSite partSite);
-
- /**
- * Creates and returns the main control for this detail pane using the given composite as a
- * parent.
- *
- * @param parent The parent composite that UI components should be added to
- * @return The main control for this detail pane
- */
- public Control createControl(Composite parent);
-
- /**
- * Disposes this detail pane. This is the last method invoked on a detail pane and should
- * dispose of all UI components including the main composite returned in <code>createControl()</code>.
- */
- public void dispose();
-
- /**
- * Displays details for the given selection, possible <code>null</code>. An empty selection
- * or <code>null</code> should clear this detail pane.
- *
- * @param selection The selection to be displayed, possibly empty or <code>null</code>
- */
- public void display(IStructuredSelection selection);
-
- /**
- * Allows this detail pane to give focus to an appropriate control, and returns whether
- * the detail pane accepted focus. If this detail pane does not want focus, it should
- * return <code>false</code>, allowing the containing view to choose another target
- * for focus.
- *
- * @return whether focus was taken
- */
- public boolean setFocus();
-
- /**
- * Returns a unique identifier for this detail pane.
- *
- * @return A unique identifier for this detail pane
- */
- public String getID();
-
- /**
- * The human readable name of this detail pane. This is a short description of the type
- * of details this pane displays that appears in the context menu.
- *
- * @return name of this detail pane
- */
- public String getName();
-
- /**
- * A brief description of this detail pane, or <code>null</code> if none
- *
- * @return a description of this detail pane, or <code>null</code> if none
- */
- public String getDescription();
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPane2.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPane2.java
deleted file mode 100644
index 1a6fb5109..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPane2.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems, Inc. and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import org.eclipse.jface.viewers.ISelectionProvider;
-
-/**
- * An extension to the detail pane interface which allows implementors to
- * provide a selection provider instead of setting the selection provider of the
- * view's {@link org.eclipse.ui.IWorkbenchPartSite site} directly.
- * <p>
- * Clients may implement this interface.
- * </p>
- *
- * @since 3.5
- */
-public interface IDetailPane2 extends IDetailPane {
-
- /**
- * Request the selection provider of this detail pane.
- * <p>
- * This method is called on every focus change of the <code>Control</code>
- * returned by {@link #createControl(org.eclipse.swt.widgets.Composite)
- * createControl(Composite)}.
- * </p>
- *
- * @return the selection provider of this detail pane or <code>null</code>
- */
- public ISelectionProvider getSelectionProvider();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPaneFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPaneFactory.java
deleted file mode 100644
index 2dbfdfbdd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPaneFactory.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import java.util.Set;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * A detail pane factory creates one or more types of detail panes.
- * <p>
- * Detail pane factories are contributed via the <code>org.eclipse.debug.ui.detailPaneFactories</code>
- * extension point. Following is an example of a detail pane factory extension:
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.detailPaneFactories"&gt;
- * &lt;detailFactories
- * class="org.eclipse.temp.TableDetailPaneFactory"
- * name="Table Detail Factory"&gt;
- * &lt;/detailFactories&gt;
- * &lt;/extension&gt;
- * </pre>
- * </p>
- * <p>
- * <p>
- * Clients contributing a detail pane factory are intended to implement this interface.
- * @see IDetailPane
- * @since 3.3
- *
- */
-public interface IDetailPaneFactory {
-
- /**
- * Returns all possible types detail panes that this factory can
- * create for the given selection, possibly empty. Detail panes are returned
- * as a set of detail pane identifiers.
- *
- * @param selection The current selection
- * @return Set of String IDs for possible detail pane types, possibly empty
- */
- public Set getDetailPaneTypes(IStructuredSelection selection);
-
- /**
- * Returns the identifier of the default detail pane type to use for the given
- * selection, or <code>null</code> if this factory has no preference.
- * A factory can override the platform's default detail pane by returning
- * a non-<code>null</code> value.
- *
- * @param selection The current selection
- * @return a detail pane type identifier or <code>null</code>
- */
- public String getDefaultDetailPane(IStructuredSelection selection);
-
- /**
- * Creates and returns a detail pane corresponding to the given detail pane
- * type identifier that this factory can produce (according to
- * <code>getDetailPaneTypes(IStructuredSelection selection)</code>).
- *
- * @param paneID The id of the detain pane type to be created
- * @return detail pane or <code>null</code> if one could not be created
- */
- public IDetailPane createDetailPane(String paneID);
-
- /**
- * Returns a name for the detail pane type associated with the given ID
- * or <code>null</code> if none. Used to
- * populate the context menu with meaningful names of the pane types.
- *
- * @param paneID detail pane type identifier
- * @return detail pane name or <code>null</code> if none
- */
- public String getDetailPaneName(String paneID);
-
- /**
- * Returns a description for the detail pane type associated with the given ID
- * or <code>null</code> if none.
- *
- * @param paneID detail pane type identifier
- * @return detail pane description or <code>null</code> if none
- */
- public String getDetailPaneDescription(String paneID);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IInstructionPointerPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IInstructionPointerPresentation.java
deleted file mode 100644
index 3b90b387c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IInstructionPointerPresentation.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import org.eclipse.debug.core.model.IStackFrame;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * A debug model presentation may implement this interface to override
- * standard annotations used to display instruction pointers for stack frames.
- * <p>
- * A client has several options when overriding default instruction pointer
- * annotations, and the debug platform uses the following prioritized order
- * when computing an annotation for a stack frame.
- * <ol>
- * <li>Specify the annotation object to use. This is done by returning a non-<code>null</code>
- * value from <code>getInstructionPointerAnnotation(..)</code>.</li>
- * <li>Specify an <code>annotationType</code> extension to use.
- * This is done by returning a non-<code>null</code> value from
- * <code>getInstructionPointerAnnotationType(..)</code>. When specified, the annotation
- * type controls the image displayed via its associated
- * <code>markerAnnotationSpecification</code>.</li>
- * <li>Specify the image to use. This is done by returning a non-<code>null</code>
- * value from <code>getInstructionPointerImage(..)</code>.</li>
- * </ol>
- * Additionally, when specifying an annotation type or image the text
- * for the instruction pointer may be specified by returning a non-<code>null</code>
- * value from <code>getInstructionPointerText(..)</code>.
- * </p>
- * <p>
- * These methods are called when the debugger has opened an editor to display
- * source for the given stack frame. The image will be positioned based on stack frame
- * line number and character ranges.
- * </p>
- * <p>
- * By default, the debug platform uses different annotations for top stack
- * frames and non-top stack frames in a thread. The default platform annotations
- * are contributed as <code>annotationType</code> extensions with
- * the identifiers <code>IDebugUIConstants.ANNOTATION_INSTRUCTION_POINTER_CURRENT</code>
- * and <code>IDebugUIConstants.ANNOTAION_INSTRUCTION_POINTER_SECONDARY</code>.
- * </p>
- * <p>
- * Clients implementing a debug model presentation may also implement this interface.
- * </p>
- * @since 3.2
- */
-public interface IInstructionPointerPresentation extends IDebugModelPresentation {
- /**
- * Returns an annotation used for the specified stack frame in the specified
- * editor, or <code>null</code> if a default annotation should be used.
- *
- * @param editorPart the editor the debugger has opened
- * @param frame the stack frame for which the debugger is displaying
- * source
- * @return annotation or <code>null</code>
- */
- public Annotation getInstructionPointerAnnotation(IEditorPart editorPart, IStackFrame frame);
-
- /**
- * Returns an identifier of a <code>org.eclipse.ui.editors.annotationTypes</code> extension used for
- * the specified stack frame in the specified editor, or <code>null</code> if a default annotation
- * should be used.
- *
- * @param editorPart the editor the debugger has opened
- * @param frame the stack frame for which the debugger is displaying
- * source
- * @return annotation type identifier or <code>null</code>
- */
- public String getInstructionPointerAnnotationType(IEditorPart editorPart, IStackFrame frame);
-
- /**
- * Returns the instruction pointer image used for the specified stack frame in the specified
- * editor, or <code>null</code> if a default image should be used.
- * <p>
- * By default, the debug platform uses different images for top stack
- * frames and non-top stack frames in a thread.
- * </p>
- * @param editorPart the editor the debugger has opened
- * @param frame the stack frame for which the debugger is displaying
- * source
- * @return image or <code>null</code>
- */
- public Image getInstructionPointerImage(IEditorPart editorPart, IStackFrame frame);
-
- /**
- * Returns the text to associate with the instruction pointer annotation used for the
- * specified stack frame in the specified editor, or <code>null</code> if a default
- * message should be used.
- * <p>
- * By default, the debug platform uses different images for top stack
- * frames and non-top stack frames in a thread.
- * </p>
- * @param editorPart the editor the debugger has opened
- * @param frame the stack frame for which the debugger is displaying
- * source
- * @return message or <code>null</code>
- */
- public String getInstructionPointerText(IEditorPart editorPart, IStackFrame frame);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java
deleted file mode 100644
index e7eb3522c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import org.eclipse.jface.operation.IRunnableContext;
-
-
- /**
- * A launch configuration dialog is used to edit and launch
- * launch configurations. It contains a launch configuration
- * tab group.
- * @see ILaunchConfigurationTabGroup
- * @see ILaunchConfigurationTab
- * @since 2.0
- * @noimplement This interface is not intended to be implemented by clients.
- * @noextend This interface is not intended to be extended by clients.
- */
-
-public interface ILaunchConfigurationDialog extends IRunnableContext {
-
- /**
- * Return value from <code>open()</code> method of a
- * launch configuration dialog when a launch completed
- * successfully with a single click (without opening a
- * launch configuration dialog).
- *
- * @deprecated the launch dialog no longer supports launching without
- * opening - this constant will never be returned by the dialog
- */
- public static final int LAUNCHED_BEFORE_OPENING = 2;
-
- /**
- * Adjusts the enable state of this dialog's buttons
- * to reflect the state of the active tab group.
- * <p>
- * This may be called by to force a button state
- * update.
- * </p>
- */
- public void updateButtons();
-
- /**
- * Updates the message (or error message) shown in the message line to
- * reflect the state of the currently active tab in this launch
- * configuration dialog.
- * <p>
- * This method may be called to force a message
- * update.
- * </p>
- */
- public void updateMessage();
-
- /**
- * Sets the contents of the name field to the given name.
- *
- * @param name new name value
- */
- public void setName(String name);
-
- /**
- * Returns a unique launch configuration name, using the given name
- * as a seed.
- *
- * @param name seed from which to generate a new unique name
- */
- public String generateName(String name);
-
- /**
- * Returns the tabs currently being displayed, or
- * <code>null</code> if none.
- *
- * @return currently displayed tabs, or <code>null</code>
- */
- public ILaunchConfigurationTab[] getTabs();
-
- /**
- * Returns the currently active <code>ILaunchConfigurationTab</code>
- * being displayed, or <code>null</code> if there is none.
- *
- * @return currently active <code>ILaunchConfigurationTab</code>, or <code>null</code>.
- */
- public ILaunchConfigurationTab getActiveTab();
-
- /**
- * Returns the mode in which this dialog was opened -
- * run or debug.
- *
- * @return one of <code>RUN_MODE</code> or <code>DEBUG_MODE</code> defined in <code>ILaunchManager</code>
- * @see org.eclipse.debug.core.ILaunchManager
- */
- public String getMode();
-
- /**
- * Sets the displayed tab to the given tab. Has no effect if the specified
- * tab is not one of the tabs being displayed in the dialog currently.
- *
- * @param tab the tab to display/activate
- * @since 2.1
- */
- public void setActiveTab(ILaunchConfigurationTab tab);
-
- /**
- * Sets the displayed tab to the tab with the given index. Has no effect if
- * the specified index is not within the limits of the tabs returned by
- * <code>getTabs()</code>.
- *
- * @param index the index of the tab to display
- * @since 2.1
- */
- public void setActiveTab(int index);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java
deleted file mode 100644
index e7256f5bc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * A launch configuration tab is used to edit/view attributes
- * of a specific type of launch configuration. Launch
- * configurations are presented in a dialog, with a tab folder.
- * Each tab manipulates one ore more attributes of a launch
- * configuration.
- * <p>
- * A tab has the following lifecycle methods:
- * <ul>
- * <li><code>setLaunchConfigurationDialog(ILaunchConfigurationDialog)</code> -
- * this is the first method called on a tab after it is instantiated.</li>
- * <li><code>initializeFrom(ILaunchConfiguration)</code> - called when a
- * launch configuration is selected to be displayed.</li>
- * <li><code>activated(ILaunchConfigurationWorkingCopy)</code> - called when
- * a tab is entered.</li>
- * <li><code>deactivated(ILaunchConfigurationWorkingCopy)</code> - called when
- * a tab is exited.</li>
- * <li><code>performApply(ILaunchConfigurationWorkingCopy)</code> - called when
- * a tab is to write its values to a launch configuration.</li>
- * <li><code>dispose()</code> - the last method called on a tab, when it is
- * to perform any required cleanup. Note that a tab can be disposed before its control
- * has been created.</li>
- * </ul>
- * The method <code>setDefaults(ILaunchConfigurationWorkingCopy)</code>
- * can be called before a tab's controls are created.
- * <p>
- * The launch tab framework was originally designed to handle inter tab
- * communication by applying attributes from the active tab to a launch configuration
- * being edited, when a tab is exited, and by initializing a tab when activated.
- * In 3.0, the addition of the methods <code>activated</code> and <code>deactivated</code>
- * allow tabs to determine the appropriate course of action. The default implementation
- * in <code>AbstractLaunchConfigurationTab</code> is to call the old methods
- * (<code>initializeFrom</code> and <code>performApply</code>). Tabs should override
- * the new methods as required.
- * </p>
- * <p>
- * This interface is intended to be implemented by clients.
- * </p>
- * @see org.eclipse.debug.core.ILaunchConfigurationType
- * @see org.eclipse.debug.core.ILaunchConfiguration
- * @since 2.0
- */
-public interface ILaunchConfigurationTab {
-
- /**
- * Creates the top level control for this launch configuration
- * tab under the given parent composite. This method is called once on
- * tab creation, after <code>setLaunchConfigurationDialog</code>
- * is called.
- * <p>
- * Implementors are responsible for ensuring that
- * the created control can be accessed via <code>getControl</code>
- * </p>
- *
- * @param parent the parent composite
- */
- public void createControl(Composite parent);
-
- /**
- * Returns the top level control for this tab.
- * <p>
- * May return <code>null</code> if the control
- * has not been created yet.
- * </p>
- *
- * @return the top level control or <code>null</code>
- */
- public Control getControl();
-
- /**
- * Initializes the given launch configuration with
- * default values for this tab. This method
- * is called when a new launch configuration is created
- * such that the configuration can be initialized with
- * meaningful values. This method may be called before this
- * tab's control is created.
- *
- * @param configuration launch configuration
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration);
-
- /**
- * Initializes this tab's controls with values from the given
- * launch configuration. This method is called when
- * a configuration is selected to view or edit, after this
- * tab's control has been created.
- *
- * @param configuration launch configuration
- */
- public void initializeFrom(ILaunchConfiguration configuration);
-
- /**
- * Notifies this launch configuration tab that it has
- * been disposed. Marks the end of this tab's lifecycle,
- * allowing this tab to perform any cleanup required.
- */
- public void dispose();
-
- /**
- * Copies values from this tab into the given
- * launch configuration.
- *
- * @param configuration launch configuration
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration);
-
- /**
- * Returns the current error message for this tab.
- * May be <code>null</code> to indicate no error message.
- * <p>
- * An error message should describe some error state,
- * as opposed to a message which may simply provide instruction
- * or information to the user.
- * </p>
- *
- * @return the error message, or <code>null</code> if none
- */
- public String getErrorMessage();
-
- /**
- * Returns the current message for this tab.
- * <p>
- * A message provides instruction or information to the
- * user, as opposed to an error message which should
- * describe some error state.
- * </p>
- *
- * @return the message, or <code>null</code> if none
- */
- public String getMessage();
-
- /**
- * Returns whether this tab is in a valid state in the context of the specified launch configuration.
- * <p>
- * This information is typically used by the launch configuration
- * dialog to decide when it is okay to launch.
- * </p>
- *
- * @param launchConfig launch configuration which provides context for validating this tab.
- * This value must not be <code>null</code>.
- *
- * @return whether this tab is in a valid state
- */
- public boolean isValid(ILaunchConfiguration launchConfig);
-
- /**
- * Returns whether this tab is in a state that allows the launch configuration whose values
- * this tab is showing to be saved. This differs from <code>isValid()</code> in that <code>canSave()</code>
- * determines if this tab prevents the current launch configuration from being saved, whereas
- * <code>isValid()</code> determines if this tab prevents the current launch configuration from
- * being launched.
- *
- * <p>
- * This information is typically used by the launch configuration
- * dialog to decide when it is okay to save a launch configuration.
- * </p>
- *
- * @return whether this tab is in a state that allows the current launch configuration to be saved
- */
- public boolean canSave();
-
- /**
- * Sets the launch configuration dialog that hosts this tab.
- * This is the first method called on a launch configuration
- * tab, and marks the beginning of this tab's lifecycle.
- *
- * @param dialog launch configuration dialog
- */
- public void setLaunchConfigurationDialog(ILaunchConfigurationDialog dialog);
-
- /**
- * Notifies this tab that the specified configuration has been
- * launched, resulting in the given launch. This method can be
- * called when a tab's control does not exist, to support single-click
- * launching.
- *
- * @param launch the result of launching the current
- * launch configuration
- * @deprecated As of R3.0, this method is no longer called by the launch
- * framework. Since tabs do not exist when launching is performed elsewhere
- * than the launch dialog, this method cannot be relied upon for launching
- * functionality.
- */
- public void launched(ILaunch launch);
-
- /**
- * Returns the name of this tab.
- *
- * @return the name of this tab
- */
- public String getName();
-
- /**
- * Returns the image for this tab, or <code>null</code> if none
- *
- * @return the image for this tab, or <code>null</code> if none
- */
- public Image getImage();
-
- /**
- * Notification that this tab has become the active tab in the launch
- * configuration dialog.
- *
- * @param workingCopy the launch configuration being edited
- * @since 3.0
- */
- public void activated(ILaunchConfigurationWorkingCopy workingCopy);
-
- /**
- * Notification that this tab is no longer the active tab in the launch
- * configuration dialog.
- *
- * @param workingCopy the launch configuration being edited
- * @since 3.0
- */
- public void deactivated(ILaunchConfigurationWorkingCopy workingCopy);
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTabGroup.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTabGroup.java
deleted file mode 100644
index 1f4f117a2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTabGroup.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-
-/**
- * A launch configuration tab group is used to edit/view attributes
- * of a specific type of launch configuration. Launch
- * configurations are presented in a dialog, with a tab folder.
- * Each tab manipulates one or more attributes of a launch
- * configuration. The tab group controls which tabs are
- * displayed for a specific type of launch configuration,
- * and provides a mechanism for overriding configuration
- * initialization performed by tabs.
- * <p>
- * A tab group has the following lifecycle methods:
- * <ul>
- * <li><code>createTabs(ILaunchConfigurationDialog, String)</code> -
- * this is the first method called on a tab group after it is instantiated.</li>
- * <li><code>initializeFrom(ILaunchConfiguration)</code> - called when a
- * launch configuration is selected to be displayed.</li>
- * <li><code>performApply(ILaunchConfigurationWorkingCopy)</code> - called when
- * a tab group's values are to be written to a launch configuration.</li>
- * <li><code>dispose()</code> - the last method called on a tab group, when it is
- * to perform any required cleanup. Note that a tab can be disposed before its control
- * has been created.</li>
- * </ul>
- * The method <code>setDefaults(ILaunchConfigurationWorkingCopy)</code>
- * can be called before a tab's controls are created.
- * </p>
- * <p>
- * The launch tab framework was originally designed to handle inter tab
- * communication by applying attributes from the active tab to a launch configuration
- * being edited, when a tab is exited, and by initializing a tab when activated.
- * In 3.0, the addition of the methods <code>activated</code> and <code>deactivated</code>
- * allow tabs to determine the appropriate course of action. The default implementation
- * in <code>AbstractLaunchConfigurationTab</code> is to call the old methods
- * (<code>initializeFrom</code> and <code>performApply</code>). Tabs should override
- * the new methods as required.
- * </p>
- * <p>
- * A launch configuration group extension is defined in <code>plugin.xml</code>.
- * Following is an example definition of a launch configuration
- * group extension.
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.launchConfigurationTabGroups"&gt;
- * &lt;launchConfigurationTabGroup
- * id="com.example.ExampleTabGroup"
- * type="com.example.ExampleLaunchConfigurationTypeIdentifier"
- * class="com.example.ExampleLaunchConfigurationTabGroupClass"&gt;
- * &lt;/launchConfigurationTabGroup&gt;
- * &lt;/extension&gt;
- * </pre>
- * The attributes are specified as follows:
- * <ul>
- * <li><code>id</code> specifies a unique identifier for this launch configuration
- * tab group.</li>
- * <li><code>type</code> specifies launch configuration type that this tab
- * group is applicable to (corresponds to the id of a launch configuration type
- * extension).</li>
- * <li><code>class</code> specifies a fully qualified name of a Java class
- * that implements <code>ILaunchConfigurationTabGroup</code>.</li>
- * </ul>
- * </p>
- * <p>
- * This interface is intended to be implemented by clients.
- * </p>
- * @see org.eclipse.debug.core.ILaunchConfigurationType
- * @see org.eclipse.debug.core.ILaunchConfiguration
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab
- * @since 2.0
- */
-public interface ILaunchConfigurationTabGroup {
-
- /**
- * Creates the tabs contained in this tab group for the specified
- * launch mode. The tabs control's are not created. This is the
- * fist method called in the lifecycle of a tab group.
- *
- * @param dialog the launch configuration dialog this tab group
- * is contained in
- * @param mode the mode the launch configuration dialog was
- * opened in
- */
- public void createTabs(ILaunchConfigurationDialog dialog, String mode);
-
- /**
- * Returns the tabs contained in this tab group.
- *
- * @return the tabs contained in this tab group
- */
- public ILaunchConfigurationTab[] getTabs();
-
- /**
- * Notifies this launch configuration tab group that it has
- * been disposed, and disposes this group's tabs. Marks the end
- * of this tab group's lifecycle, allowing this tab group to
- * perform any cleanup required.
- */
- public void dispose();
-
- /**
- * Initializes the given launch configuration with
- * default values for this tab group. This method
- * is called when a new launch configuration is created
- * such that the configuration can be initialized with
- * meaningful values. This method may be called before
- * tab controls are created.
- *
- * @param configuration launch configuration
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration);
-
- /**
- * Initializes this group's tab controls with values from the given
- * launch configuration. This method is called when
- * a configuration is selected to view or edit.
- *
- * @param configuration launch configuration
- */
- public void initializeFrom(ILaunchConfiguration configuration);
-
- /**
- * Copies values from this group's tabs into the given
- * launch configuration.
- *
- * @param configuration launch configuration
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration);
-
- /**
- * Notifies this tab that a configuration has been
- * launched, resulting in the given launch. This method can be
- * called when a tab's control does not exist, to support single-click
- * launching.
- *
- * @param launch the result of launching the current
- * launch configuration
- * @deprecated As of R3.0, this method is no longer called by the launch
- * framework. Since tabs do not exist when launching is performed elsewhere
- * than the launch dialog, this method cannot be relied upon for launching
- * functionality.
- */
- public void launched(ILaunch launch);
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchGroup.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchGroup.java
deleted file mode 100644
index cce5c1034..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchGroup.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * A launch group identifies a group of launch configurations by a launch
- * mode and category. The launch configuration dialog can be opened on
- * a launch group, and a launch history is maintained for each group.
- * A launch group is defined in plug-in XML via the <code>launchGroups</code>
- * extension point.
- * <p>
- * Following is an example of a launch group contribution:
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.launchGroups"&gt;
- * &lt;launchGroup
- * id="com.example.ExampleLaunchGroupId"
- * mode="run"
- * label="Run"
- * image="icons\run.gif"
- * &lt;/launchGroup&gt;
- * &lt;/extension&gt;
- * </pre>
- * </p>
- * <p>
- * The debug platform defines constants for the identifiers of the launch groups
- * provided by the debug platform:
- * <ul>
- * <li>IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP</li>
- * <li>IDebugUIConstants.ID_RUN_LAUNCH_GROUP</li>
- * <li>IDebugUIConstants.ID_PROFILE_LAUNCH_GROUP</li>
- * </ul>
- * </p>
- * @since 3.0
- * @noimplement This interface is not intended to be implemented by clients.
- * @noextend This interface is not intended to be extended by clients.
- */
-public interface ILaunchGroup {
-
- /**
- * Returns the image for this launch group, or <code>null</code>
- * if none.
- *
- * @return the image for this launch group, or <code>null</code> if none
- */
- public ImageDescriptor getImageDescriptor();
-
- /**
- * Returns the banner image for this launch group, or <code>null</code> if
- * none
- *
- * @return the banner image for this launch group, or <code>null</code> if
- * none
- */
- public ImageDescriptor getBannerImageDescriptor();
-
- /**
- * Returns the label for this launch group
- *
- * @return the label for this launch group
- */
- public String getLabel();
-
- /**
- * Returns the id for this launch group
- *
- * @return the id for this launch group
- */
- public String getIdentifier();
-
- /**
- * Returns the category for this launch group, possibly <code>null</code>
- *
- * @return the category for this launch group, possibly <code>null</code>
- */
- public String getCategory();
-
- /**
- * Returns the mode for this launch group
- *
- * @return the mode for this launch group
- */
- public String getMode();
-
- /**
- * Returns whether this launch group is public
- *
- * @return boolean
- */
- public boolean isPublic();
-
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchShortcut.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchShortcut.java
deleted file mode 100644
index 3717741c8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchShortcut.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * A launch shortcut is capable of launching a selection
- * or active editor in the workbench. The delegate is responsible for
- * interpreting the selection or active editor (if it applies), and launching
- * an application. This may require creating a new launch configuration
- * with default values, or re-using an existing launch configuration.
- * <p>
- * A launch shortcut is defined as an extension
- * of type <code>org.eclipse.debug.ui.launchShortcuts</code>.
- * A shortcut specifies the perspectives in which is should be available
- * from the "Run/Debug" cascade menus.
- * </p>
- * <p>
- * A launch shortcut extension is defined in <code>plugin.xml</code>.
- * Following is an example definition of a launch shortcut extension.
- * </p>
- * <br>
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.launchShortcuts"&gt;
- * &lt;shortcut
- * class="org.eclipse.jdt.internal.debug.ui.launcher.JavaApplicationLaunchShortcut"
- * description="%JavaLaunchShortcut.description"
- * helpContextId="org.eclipse.jdt.debug.ui.shortcut_local_java_application"
- * icon="$nl$/icons/full/etool16/java_app.gif"
- * id="org.eclipse.jdt.debug.ui.localJavaShortcut"
- * label="%JavaApplicationShortcut.label"
- * modes="run, debug"&gt;
- * &lt;contextualLaunch&gt;
- * &lt;enablement&gt;
- * &lt;with variable="selection"&gt;
- * &lt;count value="1"/&gt;
- * &lt;iterate&gt;
- * &lt;and&gt;
- * &lt;adapt type="org.eclipse.jdt.core.IJavaElement"&gt;
- * &lt;test property="org.eclipse.jdt.core.isInJavaProject"/&gt;
- * &lt;/adapt&gt;
- * &lt;or&gt;
- * &lt;test property="org.eclipse.jdt.launching.hasMain"/&gt;
- * &lt;test property="org.eclipse.jdt.launching.isContainer"/&gt;
- * &lt;test property="org.eclipse.jdt.launching.isPackageFragment"/&gt;
- * &lt;test property="org.eclipse.jdt.launching.isPackageFragmentRoot"/&gt;
- * &lt;/or&gt;
- * &lt;/and&gt;
- * &lt;/iterate&gt;
- * &lt;/with&gt;
- * &lt;/enablement&gt;
- * &lt;/contextualLaunch&gt;
- * &lt;configurationType
- * id="org.eclipse.jdt.launching.localJavaApplication"&gt;
- * &lt;/configurationType&gt;
- * &lt;description
- * description="%RunJavaLaunchShortcut.description"
- * mode="run"&gt;
- * &lt;/description&gt;
- * &lt;description
- * description="%DebugJavaLaunchShortcut.description"
- * mode="debug"&gt;
- * &lt;/description&gt;
- * &lt;/shortcut&gt;
- * &lt;/extension&gt;
- * </pre>
- * <br>
- * <p>
- * The attributes are specified as follows:
- * <ul>
- * <li><code>id</code> specifies a unique identifier for this launch shortcut.</li>
- * <li><code>modes</code> specifies a comma separated list of modes this shortcut
- * supports.</li>
- * <li><code>class</code> specifies a fully qualified name of a Java class
- * that implements <code>ILaunchShortcut</code>.</li>
- * <li><code>label</code> specifies a label used to render this shortcut.</li>
- * <li><code>icon</code> specifies a plug-in relative path to an icon used to
- * render this shortcut.</li>
- * <li><code>category</code> specifies the launch configuration type category this shortcut is applicable for.
- * When unspecified, the category is <code>null</code> (default).</li>
- * <li><code>path</code> an optional menu path used to group launch shortcuts in menus.
- * Launch shortcuts are grouped alphabetically based on the <code>path</code> attribute,
- * and then sorted alphabetically within groups based on the <code>label</code> attribute.
- * When unspecified, a shortcut appears in the last group. This attribute was added in the 3.0.1 release.</li>
- * <li><code>helpContextId</code> optional attribute specifying the help context
- * identifier to associate with the launch shortcut action in a menu.</li>
- * <li><code>description</code> Provides a human readable description of what the shortcut does (or will do)
- * if the user selects it. A Description provided in this field will apply as the default description for all
- * of the modes listed in the modes attribute.</li>
- * <li><code>perspective</code> has been <b>deprecated</b> in the 3.1 release.
- * The top level Run/Debug/Profile cascade menus now support contextual (selection sensitive)
- * launching, and clients should provide a <code>contextualLaunch</code> element instead.</li>
- * <li><code>contextualLaunch</code> holds all descriptions for adding shortcuts to the selection sensitive
- * Run/Debug/Profile cascade menus. Only objects that provide an <code>org.eclipse.debug.ui.actions.ILaunchable</code>
- * adapter are considered for the cascade menus. The <code>org.eclipse.debug.ui.actions.ILaunchable</code>
- * interface is simply used to tag objects that support contextual launching.</li>
- * <li><code>contextLabel</code> zero or more context menu labels. For
- * shortcuts that pass their filter tests, the specified label will appear
- * in the "Run ->" context menu and be bound to a launch action of the
- * specified mode (e.g. run,debug,profile).</li>
- * <li><code>configurationType</code> allows more that one associated launch configuration type to be
- * specified for this launch shortcut. That way consumers of launch shortcut information can know what kinds
- * of launch configurations your short is associated with/creates</li>
- * <li><code>description</code> allows a mode specific description(s) to be provided for this launch shortcut.</li>
- * </ul>
- * </p>
- * <p>
- * <br>
- * Clients contributing a launch shortcut are intended to implement this interface.
- * </p>
- * @since 2.0
- */
-public interface ILaunchShortcut {
-
- /**
- * Locates a launchable entity in the given selection and launches
- * an application in the specified mode. This launch configuration
- * shortcut is responsible for progress reporting as well
- * as error handling, in the event that a launchable entity cannot
- * be found, or launching fails.
- *
- * @param selection workbench selection
- * @param mode one of the launch modes defined by the
- * launch manager
- * @see org.eclipse.debug.core.ILaunchManager
- */
- public void launch(ISelection selection, String mode);
-
- /**
- * Locates a launchable entity in the given active editor, and launches
- * an application in the specified mode. This launch configuration
- * shortcut is responsible for progress reporting as well as error
- * handling, in the event that a launchable entity cannot be found,
- * or launching fails.
- *
- * @param editor the active editor in the workbench
- * @param mode one of the launch modes defined by the launch
- * manager
- * @see org.eclipse.debug.core.ILaunchManager
- */
- public void launch(IEditorPart editor, String mode);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchShortcut2.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchShortcut2.java
deleted file mode 100644
index 7e5249035..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchShortcut2.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IEditorPart;
-
-
-/**
- * <p>
- * An extension to a standard launch shortcut ({@link ILaunchShortcut}) allowing
- * launch shortcuts to specify how selections and editors should be launched.
- * </p>
- * <p>
- * To launch a selection (or active editor), the debug platform derives a resource associated
- * with the selection (or active editor), and then resolves the most recently launched configuration
- * associated with that resource. This interface allows a launch shortcut to override the
- * framework's resource and launch configuration resolution for selections (and active editors).
- * </p>
- * <p>
- * NOTE: the methods in this interface can be called in a <b>non-UI</b> thread.
- * </p>
- * <p>
- * Clients contributing a launch shortcut are intended to implement this interface.
- * </p>
- * @see org.eclipse.debug.internal.ui.contextlaunching.ContextRunner
- * @see org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager
- * @since 3.4
- */
-public interface ILaunchShortcut2 extends ILaunchShortcut {
-
- /**
- * Returns an array of <code>ILaunchConfiguration</code>s that apply to the specified
- * selection, an empty collection if one could be created but does not exist, or
- * <code>null</code> if default resource mappings should be used to derive associated
- * configurations.
- *
- * @param selection the current selection
- * @return an array of existing <code>ILaunchConfiguration</code>s that could be
- * used to launch the given selection, an empty array if one could be created
- * but does not exist, or <code>null</code> if default resource mappings should
- * be used to derive associated configurations
- */
- public ILaunchConfiguration[] getLaunchConfigurations(ISelection selection);
-
- /**
- * Returns an array of existing <code>ILaunchConfiguration</code>s that could be
- * used to launch the given editor part, an empty array if one
- * could be created but does not exist, or <code>null</code> if default resource
- * mappings should be used to derive associated configurations
- *
- * @param editorpart the current selection
- * @return an array of existing <code>ILaunchConfiguration</code>s that could be
- * used to launch the given editor part/editor input, an empty array if one
- * could be created but does not exist, or <code>null</code> if default resource
- * mappings should be used to derive associated configurations
- */
- public ILaunchConfiguration[] getLaunchConfigurations(IEditorPart editorpart);
-
- /**
- * Returns an <code>IResource</code> that maps to the given selection for launch
- * purposes, or <code>null</code> if none. The resource is used to resolve a configuration
- * to launch if this shortcut does not provide specific launch configurations to launch
- * for the selection (via {@link #getLaunchConfigurations(ISelection)}.
- *
- * @param selection the current selection
- * @return an <code>IResource</code> that maps to the given selection for launch
- * purposes or <code>null</code> if none
- */
- public IResource getLaunchableResource(ISelection selection);
-
- /**
- * Returns an <code>IResource</code> that maps to given editor part for launch
- * purposes, or <code>null</code> if none. The resource is used to resolve a configuration
- * to launch if this shortcut does not provide specific launch configurations to launch
- * for the editor (via {@link #getLaunchConfigurations(IEditorPart)}.
- *
- * @param editorpart the current editor part
- * @return an <code>IResource</code> that maps to given editor part for launch
- * purposes, or <code>null</code> if none
- */
- public IResource getLaunchableResource(IEditorPart editorpart);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ISourcePresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ISourcePresentation.java
deleted file mode 100644
index 329ce6bd4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ISourcePresentation.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-
-import org.eclipse.ui.IEditorInput;
-
-/**
- * A source presentation is used to resolve an editor in
- * which to display a debug model element, breakpoint, or
- * source element. By default, a debug model presentation
- * (which implements this interface) is used to resolve
- * editors when performing source lookup. However, a source
- * locator may override default editor resolution by implementing
- * this interface.
- * <p>
- * Source lookup consists of the following steps:<ol>
- * <li>Locating a source element - the source locator associated
- * with a launch is queried for the source element associated
- * with a stack frame.</li>
- * <li>Resolving an editor in which to display a source element -
- * by default, the debug model presentation associated with the
- * debug model being debugged is queried for an editor input
- * and editor id in which to display a source element. However,
- * clients may override editor resolution by specifying a source
- * locator that is an instance of <code>ISourcePresentation</code>.
- * When a source presentation is specified as a source locator,
- * the source presentation is used to resolve an editor, rather
- * than the default debug model presentation.</li>
- * </ol>
- * </p>
- * <p>
- * Clients may implement this interface as part of an
- * {@link org.eclipse.debug.ui.IDebugModelPresentation} or as an optional
- * extension to an {@link org.eclipse.debug.core.model.ISourceLocator}.
- * </p>
- * @since 2.0
- */
-public interface ISourcePresentation {
-
- /**
- * Returns an editor input that should be used to display the given object
- * in an editor or <code>null</code> if unable to provide an editor input
- * for the given object.
- *
- * @param element a debug model element, breakpoint, or a source element
- * that was returned by a source locator's <code>getSourceElement(IStackFrame)</code>
- * method
- * @return an editor input, or <code>null</code> if none
- */
- public IEditorInput getEditorInput(Object element);
-
- /**
- * Returns the id of the editor to use to display the
- * given editor input and object, or <code>null</code> if
- * unable to provide an editor id.
- *
- * @param input an editor input that was previously retrieved from this
- * source presentation's <code>getEditorInput</code> method
- * @param element the object that was used in the call to
- * <code>getEditorInput</code>, that corresponds to the given editor
- * input
- * @return an editor id, or <code>null</code> if none
- */
- public String getEditorId(IEditorInput input, Object element);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IValueDetailListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IValueDetailListener.java
deleted file mode 100644
index 05bcc4860..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IValueDetailListener.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-
-import org.eclipse.debug.core.model.IValue;
-
-/**
- * Notified of detailed value descriptions.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see IDebugModelPresentation
- * @since 2.0
- */
-
-public interface IValueDetailListener {
- /**
- * Notifies this listener that the details for the given
- * value have been computed as the specified result.
- *
- * @param value the value for which the detail is provided
- * @param result the detailed description of the given value
- */
- public void detailComputed(IValue value, String result);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java
deleted file mode 100644
index 2144d26a0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java
+++ /dev/null
@@ -1,357 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IExpression;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.model.elements.ElementContentProvider;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
-import org.eclipse.debug.internal.ui.views.DebugUIViewsMessages;
-import org.eclipse.debug.internal.ui.views.variables.VariablesView;
-import org.eclipse.debug.internal.ui.views.variables.details.DefaultDetailPane;
-import org.eclipse.debug.internal.ui.views.variables.details.DetailPaneProxy;
-import org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.PartInitException;
-
-/**
- * A <code>DebugPopup</code> that can be used to inspect an
- * <code>IExpression</code> object.
- * @since 3.2
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class InspectPopupDialog extends DebugPopup {
-
- private static final String PREF_INSPECT_POPUP_SASH_WEIGHTS = DebugUIPlugin.getUniqueIdentifier() + "inspectPopupSashWeights"; //$NON-NLS-1$
-
- private static final int[] DEFAULT_SASH_WEIGHTS = new int[] { 75, 25 };
- private static final int MIN_WIDTH = 300;
- private static final int MIN_HEIGHT = 250;
-
- private TreeModelViewer fViewer;
- private SashForm fSashForm;
- private Composite fDetailPaneComposite;
- private DetailPaneProxy fDetailPane;
- private Tree fTree;
- private IExpression fExpression;
-
- /**
- * Creates a new inspect popup.
- *
- * @param shell The parent shell
- * @param anchor point at which to anchor the popup in Display coordinates. Since
- * 3.3 <code>null</code> indicates a default location should be used.
- * @param commandId The command id to be used for persistence of
- * the dialog (possibly <code>null</code>)
- * @param expression The expression being inspected
- */
- public InspectPopupDialog(Shell shell, Point anchor, String commandId, IExpression expression) {
- super(shell, anchor, commandId);
- fExpression = expression;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.DebugPopup#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- Composite composite = new Composite(parent, parent.getStyle());
- GridLayout layout = new GridLayout();
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- fSashForm = new SashForm(composite, parent.getStyle());
- fSashForm.setOrientation(SWT.VERTICAL);
- fSashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- VariablesView view = getViewToEmulate();
- IPresentationContext context = new PresentationContext(IDebugUIConstants.ID_VARIABLE_VIEW);
- if (view != null) {
- // copy over properties
- IPresentationContext copy = ((TreeModelViewer)view.getViewer()).getPresentationContext();
- String[] properties = copy.getProperties();
- for (int i = 0; i < properties.length; i++) {
- String key = properties[i];
- context.setProperty(key, copy.getProperty(key));
- }
- }
- fViewer = new TreeModelViewer(fSashForm, SWT.NO_TRIM | SWT.MULTI | SWT.VIRTUAL, context);
- fViewer.setAutoExpandLevel(1);
-
- fDetailPaneComposite = SWTFactory.createComposite(fSashForm, 1, 1, GridData.FILL_BOTH);
-
- fDetailPane = new DetailPaneProxy(new DetailPaneContainer());
- fDetailPane.display(null); // Bring up the default pane so the user doesn't see an empty composite
-
- fTree = fViewer.getTree();
- fTree.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- fDetailPane.display((IStructuredSelection)fViewer.getSelection());
- }
- public void widgetDefaultSelected(SelectionEvent e) {}
- });
-
- initSashWeights();
-
- fViewer.getContentProvider();
- if (view != null) {
- StructuredViewer structuredViewer = (StructuredViewer) view.getViewer();
- if (structuredViewer != null) {
- ViewerFilter[] filters = structuredViewer.getFilters();
- for (int i = 0; i < filters.length; i++) {
- fViewer.addFilter(filters[i]);
- }
- }
- }
-
- TreeRoot treeRoot = new TreeRoot();
- // add update listener to auto-select and display details of root expression
- fViewer.addViewerUpdateListener(new IViewerUpdateListener() {
- public void viewerUpdatesComplete() {
- }
- public void viewerUpdatesBegin() {
- }
- public void updateStarted(IViewerUpdate update) {
- }
- public void updateComplete(IViewerUpdate update) {
- if (update instanceof IChildrenUpdate) {
- TreeSelection selection = new TreeSelection(new TreePath(new Object[]{fExpression}));
- fViewer.setSelection(selection);
- fDetailPane.display(selection);
- fViewer.removeViewerUpdateListener(this);
- }
- }
- });
- fViewer.setInput(treeRoot);
-
- return fTree;
- }
-
- /**
- * Initializes the sash form weights from the preference store (using default values if
- * no sash weights were stored previously).
- */
- protected void initSashWeights(){
- String prefWeights = DebugUIPlugin.getDefault().getPreferenceStore().getString(PREF_INSPECT_POPUP_SASH_WEIGHTS);
- if (prefWeights.length() > 0){
- String[] weights = prefWeights.split(":"); //$NON-NLS-1$
- if (weights.length == 2){
- try{
- int[] intWeights = new int[2];
- intWeights[0] = Integer.parseInt(weights[0]);
- intWeights[1] = Integer.parseInt(weights[1]);
- fSashForm.setWeights(intWeights);
- return;
- } catch (NumberFormatException e){}
- }
- }
- fSashForm.setWeights(DEFAULT_SASH_WEIGHTS);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.PopupDialog#saveDialogBounds(org.eclipse.swt.widgets.Shell)
- */
- protected void saveDialogBounds(Shell shell) {
- super.saveDialogBounds(shell);
- if (fSashForm != null && !fSashForm.isDisposed()){
- int[] weights = fSashForm.getWeights();
- if (weights.length == 2){
- String weightString = weights[0] + ":" + weights[1]; //$NON-NLS-1$
- DebugUIPlugin.getDefault().getPluginPreferences().setValue(PREF_INSPECT_POPUP_SASH_WEIGHTS, weightString);
- }
- }
- }
-
- /**
- * Creates the content for the root element of the tree viewer in the inspect
- * popup dialog. Always has one child, the expression this popup is displaying.
- *
- */
- private class TreeRoot extends ElementContentProvider {
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return 1;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
- protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
- return new Object[] { fExpression };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
- */
- protected boolean supportsContextId(String id) {
- return true;
- }
- }
-
- /**
- * Attempts to find an appropriate view to emulate, this will either be the
- * variables view or the expressions view.
- * @return a view to emulate or <code>null</code>
- */
- private VariablesView getViewToEmulate() {
- IWorkbenchPage page = DebugUIPlugin.getActiveWorkbenchWindow().getActivePage();
- VariablesView expressionsView = (VariablesView) page.findView(IDebugUIConstants.ID_EXPRESSION_VIEW);
- if (expressionsView != null && expressionsView.isVisible()) {
- return expressionsView;
- }
- VariablesView variablesView = (VariablesView) page.findView(IDebugUIConstants.ID_VARIABLE_VIEW);
- if (variablesView != null && variablesView.isVisible()) {
- return variablesView;
- }
- if (expressionsView != null) {
- return expressionsView;
- }
- return variablesView;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.DebugPopup#close()
- */
- public boolean close() {
- if (!wasPersisted()) {
- fExpression.dispose();
- }
- fDetailPane.dispose();
- return super.close();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.DebugPopup#getActionText()
- */
- protected String getActionText() {
- return DebugUIViewsMessages.InspectPopupDialog_0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.DebugPopup#persist()
- */
- protected void persist() {
- super.persist();
- DebugPlugin.getDefault().getExpressionManager().addExpression(fExpression);
-
- fExpression = null;
- IWorkbenchPage page = DebugUIPlugin.getActiveWorkbenchWindow().getActivePage();
- IViewPart part = page.findView(IDebugUIConstants.ID_EXPRESSION_VIEW);
- if (part == null) {
- try {
- page.showView(IDebugUIConstants.ID_EXPRESSION_VIEW);
- } catch (PartInitException e) {
- }
- } else {
- page.bringToTop(part);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.PopupDialog#getInitialSize()
- */
- protected Point getInitialSize() {
- Point initialSize = super.getInitialSize();
- initialSize.x = Math.max(initialSize.x, MIN_WIDTH);
- initialSize.y = Math.max(initialSize.y, MIN_HEIGHT);
- return initialSize;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.PopupDialog#getBackgroundColorExclusions()
- */
- protected List getBackgroundColorExclusions() {
- List list = super.getBackgroundColorExclusions();
- list.add(fSashForm);
- return list;
- }
-
- /**
- * Inner class implementing IDetailPaneContainer methods. Handles changes to detail
- * pane and provides limited access to the detail pane proxy.
- */
- private class DetailPaneContainer implements IDetailPaneContainer{
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getCurrentPaneID()
- */
- public String getCurrentPaneID() {
- return fDetailPane.getCurrentPaneID();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getCurrentSelection()
- */
- public IStructuredSelection getCurrentSelection() {
- return (IStructuredSelection)fViewer.getSelection();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#refreshDetailPaneContents()
- */
- public void refreshDetailPaneContents() {
- fDetailPane.display(getCurrentSelection());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getParentComposite()
- */
- public Composite getParentComposite() {
- return fDetailPaneComposite;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getWorkbenchPartSite()
- */
- public IWorkbenchPartSite getWorkbenchPartSite() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#paneChanged(java.lang.String)
- */
- public void paneChanged(String newPaneID) {
- if (newPaneID.equals(DefaultDetailPane.ID)){
- applyBackgroundColor(getShell().getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND), fDetailPane.getCurrentControl());
- }
- }
-
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java
deleted file mode 100644
index a35fc7af6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java
+++ /dev/null
@@ -1,487 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.RefreshUtil;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog;
-import org.eclipse.debug.internal.ui.stringsubstitution.StringSubstitutionMessages;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.IWorkingSetEditWizard;
-
-/**
- * A launch configuration tab which allows the user to specify
- * which resources should be refreshed when the launch
- * terminates.
- * <p>
- * This class may be instantiate.
- * </p>
- * @since 3.0
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class RefreshTab extends AbstractLaunchConfigurationTab {
-
- /**
- * Boolean attribute indicating if a refresh scope is recursive. Default
- * value is <code>true</code>.
- */
- public static final String ATTR_REFRESH_RECURSIVE = RefreshUtil.ATTR_REFRESH_RECURSIVE;
-
- /**
- * String attribute identifying the scope of resources that should be
- * refreshed after an external tool is run. The value is either a refresh
- * variable or the default value, <code>null</code>, indicating no refresh.
- */
- public static final String ATTR_REFRESH_SCOPE = RefreshUtil.ATTR_REFRESH_SCOPE;
-
- // Check Buttons
- private Button fRefreshButton;
- private Button fRecursiveButton;
-
- // Group box
- private Group fGroup;
-
- // Radio Buttons
- private Button fContainerButton;
- private Button fProjectButton;
- private Button fResourceButton;
- private Button fWorkingSetButton;
- private Button fWorkspaceButton;
-
- // Push Button
- private Button fSelectButton;
-
- // Working set
- private IWorkingSet fWorkingSet;
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- Composite mainComposite = new Composite(parent, SWT.NONE);
- setControl(mainComposite);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_REFRESH_TAB);
-
- GridLayout layout = new GridLayout();
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- mainComposite.setLayout(layout);
- mainComposite.setLayoutData(gd);
- mainComposite.setFont(parent.getFont());
-
- fRefreshButton = createCheckButton(mainComposite, StringSubstitutionMessages.RefreshTab_31);
- fRefreshButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateEnabledState();
- updateLaunchConfigurationDialog();
- }
- });
-
- fGroup = new Group(mainComposite, SWT.NONE);
- fGroup.setFont(mainComposite.getFont());
- layout = new GridLayout();
- layout.numColumns = 2;
- layout.makeColumnsEqualWidth = false;
- fGroup.setLayout(layout);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- fGroup.setLayoutData(gd);
-
- SelectionAdapter adapter = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (((Button)e.getSource()).getSelection()) {
- updateEnabledState();
- updateLaunchConfigurationDialog();
- }
- }
- };
-
- fWorkspaceButton = createRadioButton(fGroup, StringSubstitutionMessages.RefreshTab_32);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- fWorkspaceButton.setLayoutData(gd);
- fWorkspaceButton.addSelectionListener(adapter);
-
- fResourceButton = createRadioButton(fGroup, StringSubstitutionMessages.RefreshTab_33);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- fResourceButton.setLayoutData(gd);
- fResourceButton.addSelectionListener(adapter);
-
- fProjectButton = createRadioButton(fGroup, StringSubstitutionMessages.RefreshTab_34);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- fProjectButton.setLayoutData(gd);
- fProjectButton.addSelectionListener(adapter);
-
- fContainerButton = createRadioButton(fGroup, StringSubstitutionMessages.RefreshTab_35);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- fContainerButton.setLayoutData(gd);
- fContainerButton.addSelectionListener(adapter);
-
- fWorkingSetButton = createRadioButton(fGroup, StringSubstitutionMessages.RefreshTab_36);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 1;
- fWorkingSetButton.setLayoutData(gd);
- fWorkingSetButton.addSelectionListener(adapter);
-
- fSelectButton = createPushButton(fGroup, StringSubstitutionMessages.RefreshTab_37, null);
- gd = (GridData)fSelectButton.getLayoutData();
- gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_END;
- fSelectButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- selectResources();
- }
- });
-
- createVerticalSpacer(fGroup, 2);
- createRecursiveComponent(fGroup);
- }
-
- /**
- * Prompts the user to select the resources to refresh.
- */
- private void selectResources() {
- IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
-
- if (fWorkingSet == null){
- fWorkingSet = workingSetManager.createWorkingSet(StringSubstitutionMessages.RefreshTab_40, new IAdaptable[0]);
- }
- IWorkingSetEditWizard wizard = workingSetManager.createWorkingSetEditWizard(fWorkingSet);
- WizardDialog dialog = new WizardDialog(((LaunchConfigurationsDialog)LaunchConfigurationsDialog.getCurrentlyVisibleLaunchConfigurationDialog()).getShell(), wizard);
- dialog.create();
-
- if (dialog.open() == Window.CANCEL) {
- return;
- }
- fWorkingSet = wizard.getSelection();
- updateLaunchConfigurationDialog();
- }
-
- /**
- * Creates the controls needed to edit the refresh recursive
- * attribute of a launch configuration
- *
- * @param parent the composite to create the controls in
- */
- private void createRecursiveComponent(Composite parent) {
- fRecursiveButton = createCheckButton(parent, StringSubstitutionMessages.RefreshTab_0);
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- data.horizontalSpan = 2;
- fRecursiveButton.setLayoutData(data);
- fRecursiveButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- updateRefresh(configuration);
- updateRecursive(configuration);
- updateScope(configuration);
- updateEnabledState();
- }
-
- /**
- * Updates the tab to display the refresh scope specified by the launch config
- */
- private void updateScope(ILaunchConfiguration configuration) {
- String scope = null;
- try {
- scope= configuration.getAttribute(ATTR_REFRESH_SCOPE, (String)null);
- } catch (CoreException ce) {
- DebugUIPlugin.log(DebugUIPlugin.newErrorStatus("Exception reading launch configuration", ce)); //$NON-NLS-1$
- }
- fWorkspaceButton.setSelection(false);
- fResourceButton.setSelection(false);
- fContainerButton.setSelection(false);
- fProjectButton.setSelection(false);
- fWorkingSetButton.setSelection(false);
- if (scope == null) {
- // select the workspace by default
- fWorkspaceButton.setSelection(true);
- } else {
- if (scope.equals(RefreshUtil.MEMENTO_WORKSPACE)) {
- fWorkspaceButton.setSelection(true);
- } else if (scope.equals(RefreshUtil.MEMENTO_SELECTED_RESOURCE)) {
- fResourceButton.setSelection(true);
- } else if (scope.equals(RefreshUtil.MEMENTO_SELECTED_CONTAINER)) {
- fContainerButton.setSelection(true);
- } else if (scope.equals(RefreshUtil.MEMENTO_SELECTED_PROJECT)) {
- fProjectButton.setSelection(true);
- } else if (scope.startsWith("${resource:")) { //$NON-NLS-1$
- fWorkingSetButton.setSelection(true);
- try {
- IResource[] resources = getRefreshResources(scope);
- IWorkingSetManager workingSetManager= PlatformUI.getWorkbench().getWorkingSetManager();
- fWorkingSet = workingSetManager.createWorkingSet(StringSubstitutionMessages.RefreshTab_40, resources);
- } catch (CoreException e) {
- fWorkingSet = null;
- }
- } else if (scope.startsWith("${working_set:")) { //$NON-NLS-1$
- fWorkingSetButton.setSelection(true);
- fWorkingSet = getWorkingSet(scope);
- }
- }
- }
- /**
- * Method updateRecursive.
- * @param configuration
- */
- private void updateRecursive(ILaunchConfiguration configuration) {
- boolean recursive= true;
- try {
- recursive= configuration.getAttribute(ATTR_REFRESH_RECURSIVE, true);
- } catch (CoreException ce) {
- DebugUIPlugin.log(DebugUIPlugin.newErrorStatus("Exception reading launch configuration", ce)); //$NON-NLS-1$
- }
- fRecursiveButton.setSelection(recursive);
- }
- /**
- * Method updateRefresh.
- * @param configuration
- */
- private void updateRefresh(ILaunchConfiguration configuration) {
- String scope= null;
- try {
- scope= configuration.getAttribute(ATTR_REFRESH_SCOPE, (String)null);
- } catch (CoreException ce) {
- DebugUIPlugin.log(DebugUIPlugin.newErrorStatus("Exception reading launch configuration", ce)); //$NON-NLS-1$
- }
- fRefreshButton.setSelection(scope != null);
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- if (fRefreshButton.getSelection()) {
- String scope = generateScopeMemento();
- configuration.setAttribute(ATTR_REFRESH_SCOPE, scope);
- setAttribute(ATTR_REFRESH_RECURSIVE, configuration, fRecursiveButton.getSelection(), true);
- } else {
- //clear the refresh attributes
- configuration.setAttribute(ATTR_REFRESH_SCOPE, (String)null);
- setAttribute(ATTR_REFRESH_RECURSIVE, configuration, true, true);
- }
- }
-
- /**
- * Generates a memento for the refresh scope. This is based on old refresh
- * variables.
- *
- * @return a memento
- */
- private String generateScopeMemento() {
- if (fWorkspaceButton.getSelection()) {
- return RefreshUtil.MEMENTO_WORKSPACE;
- }
- if (fResourceButton.getSelection()) {
- return RefreshUtil.MEMENTO_SELECTED_RESOURCE;
- }
- if (fContainerButton.getSelection()) {
- return RefreshUtil.MEMENTO_SELECTED_CONTAINER;
- }
- if (fProjectButton.getSelection()) {
- return RefreshUtil.MEMENTO_SELECTED_PROJECT;
- }
- if (fWorkingSetButton.getSelection()) {
- return getRefreshAttribute(fWorkingSet);
- }
- return null;
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return StringSubstitutionMessages.RefreshTab_6;
- }
-
- /**
- * Updates the enablement state of the fields.
- */
- private void updateEnabledState() {
- boolean enabled= fRefreshButton.getSelection();
- fRecursiveButton.setEnabled(enabled);
- fGroup.setEnabled(enabled);
- fWorkspaceButton.setEnabled(enabled);
- fResourceButton.setEnabled(enabled);
- fContainerButton.setEnabled(enabled);
- fProjectButton.setEnabled(enabled);
- fWorkingSetButton.setEnabled(enabled);
- fSelectButton.setEnabled(enabled && fWorkingSetButton.getSelection());
- if (!enabled) {
- super.setErrorMessage(null);
- }
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
- */
- public Image getImage() {
- return DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_OBJS_REFRESH_TAB);
- }
-
- public boolean isValid(ILaunchConfiguration launchConfig) {
- setErrorMessage(null);
- setMessage(null);
- if (fRefreshButton.getSelection() && (fWorkingSetButton.getSelection() && (fWorkingSet == null || fWorkingSet.getElements().length == 0))) {
- setErrorMessage(StringSubstitutionMessages.RefreshTab_42);
- return false;
- }
- return true;
- }
-
- /**
- * Refreshes the resources as specified by the given launch configuration.
- *
- * @param configuration launch configuration
- * @param monitor progress monitor which may be <code>null</code>
- * @throws CoreException if an exception occurs while refreshing resources
- */
- public static void refreshResources(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
- RefreshUtil.refreshResources(configuration, monitor);
- }
-
- /**
- * Returns a collection of resources referred to by a refresh scope attribute.
- *
- * @param scope refresh scope attribute (<code>ATTR_REFRESH_SCOPE</code>)
- * @return collection of resources referred to by the refresh scope attribute
- * @throws CoreException if unable to resolve a set of resources
- */
- public static IResource[] getRefreshResources(String scope) throws CoreException {
- return RefreshUtil.toResources(scope);
- }
-
- /**
- * Returns the refresh scope attribute specified by the given launch configuration
- * or <code>null</code> if none.
- *
- * @param configuration launch configuration
- * @return refresh scope attribute (<code>ATTR_REFRESH_SCOPE</code>)
- * @throws CoreException if unable to access the associated attribute
- */
- public static String getRefreshScope(ILaunchConfiguration configuration) throws CoreException {
- return configuration.getAttribute(ATTR_REFRESH_SCOPE, (String) null);
- }
-
- /**
- * Returns whether the refresh scope specified by the given launch
- * configuration is recursive.
- *
- * @param configuration
- * @return whether the refresh scope is recursive
- * @throws CoreException if unable to access the associated attribute
- */
- public static boolean isRefreshRecursive(ILaunchConfiguration configuration) throws CoreException {
- return configuration.getAttribute(ATTR_REFRESH_RECURSIVE, true);
- }
-
- /**
- * Creates and returns a memento for the given working set, to be used as a
- * refresh attribute.
- *
- * @param workingSet a working set, or <code>null</code>
- * @return an equivalent refresh attribute
- */
- public static String getRefreshAttribute(IWorkingSet workingSet) {
- if (workingSet == null || workingSet.getElements().length == 0) {
- return RefreshUtil.toMemento(new IResource[0]);
- } else {
- IAdaptable[] elements = workingSet.getElements();
- IResource[] resources = new IResource[elements.length];
- for (int i = 0; i < resources.length; i++) {
- resources[i]= (IResource) elements[i].getAdapter(IResource.class);
- }
- return RefreshUtil.toMemento(resources);
- }
- }
-
- /**
- * Creates and returns a working set from the given refresh attribute created by
- * the method <code>getRefreshAttribute(IWorkingSet)</code>, or <code>null</code>
- * if none.
- *
- * @param refreshAttribute a refresh attribute that represents a working set
- * @return equivalent working set, or <code>null</code>
- */
- public static IWorkingSet getWorkingSet(String refreshAttribute) {
- if (refreshAttribute.startsWith("${working_set:")) { //$NON-NLS-1$
- try {
- IResource[] resources = RefreshUtil.toResources(refreshAttribute);
- IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
- IWorkingSet workingSet = workingSetManager.createWorkingSet(StringSubstitutionMessages.RefreshTab_1, resources);
- return workingSet;
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
- // do nothing on activation
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
- // do nothing on deactivation
- }
-
- /**
- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId()
- *
- * @since 3.5
- */
- public String getId() {
- return "org.eclipse.debug.ui.refreshTab"; //$NON-NLS-1$
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java
deleted file mode 100644
index 66fa6cc90..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import org.eclipse.core.variables.IDynamicVariable;
-import org.eclipse.core.variables.IStringVariable;
-import org.eclipse.core.variables.VariablesPlugin;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.debug.internal.ui.stringsubstitution.IArgumentSelector;
-import org.eclipse.debug.internal.ui.stringsubstitution.StringSubstitutionMessages;
-import org.eclipse.debug.internal.ui.stringsubstitution.StringVariableLabelProvider;
-import org.eclipse.debug.internal.ui.stringsubstitution.StringVariablePresentationManager;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-
-/**
- * A dialog that prompts the user to choose and configure a string
- * substitution variable.
- * <p>
- * Clients may instantiate this class.
- * </p>
- * @since 3.1
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class StringVariableSelectionDialog extends ElementListSelectionDialog {
-
- // button to configure variable's argument
- private Button fArgumentButton;
- // variable description
- private Text fDescriptionText;
- // the argument value
- private Text fArgumentText;
- private String fArgumentValue;
- private Button fEditVariablesButton;
-
- /**
- * Constructs a new string substitution variable selection dialog.
- *
- * @param parent parent shell
- */
- public StringVariableSelectionDialog(Shell parent) {
- super(parent, new StringVariableLabelProvider());
- setShellStyle(getShellStyle() | SWT.RESIZE);
- setTitle(StringSubstitutionMessages.StringVariableSelectionDialog_2);
- setMessage(StringSubstitutionMessages.StringVariableSelectionDialog_3);
- setMultipleSelection(false);
- setElements(VariablesPlugin.getDefault().getStringVariableManager().getVariables());
- }
-
- /**
- * Returns the variable expression the user generated from this
- * dialog, or <code>null</code> if none.
- *
- * @return variable expression the user generated from this
- * dialog, or <code>null</code> if none
- */
- public String getVariableExpression() {
- Object[] selected = getResult();
- if (selected != null && selected.length == 1) {
- IStringVariable variable = (IStringVariable)selected[0];
- StringBuffer buffer = new StringBuffer();
- buffer.append("${"); //$NON-NLS-1$
- buffer.append(variable.getName());
- if (fArgumentValue != null && fArgumentValue.length() > 0) {
- buffer.append(":"); //$NON-NLS-1$
- buffer.append(fArgumentValue);
- }
- buffer.append("}"); //$NON-NLS-1$
- return buffer.toString();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Control ctrl = super.createContents(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(ctrl, IDebugHelpContextIds.VARIABLE_SELECTION_DIALOG);
- return ctrl;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- Control control = super.createDialogArea(parent);
- createArgumentArea((Composite)control);
- return control;
- }
-
- /**
- * Creates an area to display a description of the selected variable
- * and a button to configure the variable's argument.
- *
- * @param parent parent widget
- */
- private void createArgumentArea(Composite parent) {
- Composite container = SWTFactory.createComposite(parent, parent.getFont(), 2, 1, GridData.FILL_HORIZONTAL, 0, 0);
- SWTFactory.createHorizontalSpacer(container, 1);
-
- fEditVariablesButton = SWTFactory.createPushButton(container, StringSubstitutionMessages.StringVariableSelectionDialog_0, null, GridData.HORIZONTAL_ALIGN_END);
- fEditVariablesButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- editVariables();
- }
- });
-
- SWTFactory.createWrapLabel(container, StringSubstitutionMessages.StringVariableSelectionDialog_6, 2);
-
- Composite args = SWTFactory.createComposite(container, container.getFont(), 2, 2, GridData.FILL_HORIZONTAL, 0, 0);
-
- fArgumentText = new Text(args, SWT.BORDER);
- fArgumentText.setFont(container.getFont());
- fArgumentText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- fArgumentButton = SWTFactory.createPushButton(args, StringSubstitutionMessages.StringVariableSelectionDialog_7, null);
- fArgumentButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- configureArgument();
- }
- });
-
- SWTFactory.createWrapLabel(container, StringSubstitutionMessages.StringVariableSelectionDialog_8, 2);
-
- fDescriptionText = new Text(container, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
- fDescriptionText.setFont(container.getFont());
- fDescriptionText.setEditable(false);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- gd.heightHint = 50;
- fDescriptionText.setLayoutData(gd);
- }
-
- /**
- * Opens the preference dialog to the correct page an allows editing of variables
- */
- protected void editVariables() {
- final Display display = DebugUIPlugin.getStandardDisplay();
- BusyIndicator.showWhile(display, new Runnable() {
- public void run() {
- SWTFactory.showPreferencePage("org.eclipse.debug.ui.StringVariablePreferencePage"); //$NON-NLS-1$
- final IStringVariable[] elements = VariablesPlugin.getDefault().getStringVariableManager().getVariables();
- display.asyncExec(new Runnable() {
- public void run() {
- setListElements(elements);
- }
- });
- }
- });
- }
-
- /**
- * Configures the argument for the selected variable.
- */
- protected void configureArgument() {
- Object[] objects = getSelectedElements();
- IStringVariable variable = (IStringVariable)objects[0];
- IArgumentSelector selector = StringVariablePresentationManager.getDefault().getArgumentSelector(variable);
- String value = selector.selectArgument(variable, getShell());
- if (value != null) {
- fArgumentText.setText(value);
- }
- }
-
- /**
- * Update variable description and argument button enablement.
- *
- * @see org.eclipse.ui.dialogs.AbstractElementListSelectionDialog#handleSelectionChanged()
- */
- protected void handleSelectionChanged() {
- super.handleSelectionChanged();
- Object[] objects = getSelectedElements();
- boolean buttonEnabled = false;
- boolean argEnabled = false;
- String text = null;
- if (objects.length == 1) {
- IStringVariable variable = (IStringVariable)objects[0];
- IArgumentSelector selector = StringVariablePresentationManager.getDefault().getArgumentSelector(variable);
- if (variable instanceof IDynamicVariable) {
- argEnabled = ((IDynamicVariable)variable).supportsArgument();
- }
- buttonEnabled = argEnabled && selector != null;
- text = variable.getDescription();
- }
- if (text == null) {
- text = IInternalDebugCoreConstants.EMPTY_STRING;
- }
- fArgumentText.setEnabled(argEnabled);
- fArgumentButton.setEnabled(buttonEnabled);
- fDescriptionText.setText(text);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- fArgumentValue = fArgumentText.getText().trim();
- super.okPressed();
- }
-
- /**
- * Returns the name of the section that this dialog stores its settings in
- *
- * @return String
- */
- private String getDialogSettingsSectionName() {
- return IDebugUIConstants.PLUGIN_ID + ".STRING_VARIABLE_SELECTION_DIALOG_SECTION"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
- */
- protected IDialogSettings getDialogBoundsSettings() {
- IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(getDialogSettingsSectionName());
- if (section == null) {
- section = settings.addNewSection(getDialogSettingsSectionName());
- }
- return section;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/WorkingDirectoryBlock.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/WorkingDirectoryBlock.java
deleted file mode 100644
index f879120af..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/WorkingDirectoryBlock.java
+++ /dev/null
@@ -1,476 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Remy Chi Jian Suen <remy.suen@gmail.com>
- * - Bug 214696 Expose WorkingDirectoryBlock as API
- * - Bug 221973 Make WorkingDirectoryBlock from JDT a Debug API class
- *******************************************************************************/
-package org.eclipse.debug.ui;
-
-import java.io.File;
-
-import org.eclipse.core.filesystem.URIUtil;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.variables.IStringVariableManager;
-import org.eclipse.core.variables.VariablesPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.SWTFactory;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-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.DirectoryDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
-
-/**
- * A control for setting the working directory associated with a launch
- * configuration.
- *
- * @since 3.5
- */
-public abstract class WorkingDirectoryBlock extends AbstractLaunchConfigurationTab {
-
- // Local directory
- private Button fWorkspaceButton;
- private Button fFileSystemButton;
- private Button fVariablesButton;
-
- //bug 29565 fix
- private Button fUseDefaultDirButton = null;
- private Button fUseOtherDirButton = null;
- private Text fOtherWorkingText = null;
- private Text fWorkingDirText;
-
- /**
- * The last launch config this tab was initialized from
- */
- private ILaunchConfiguration fLaunchConfiguration;
-
- /**
- * A listener to update for text changes and widget selection
- */
- private class WidgetListener extends SelectionAdapter implements ModifyListener {
- public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
- }
- public void widgetSelected(SelectionEvent e) {
- Object source= e.getSource();
- if (source == fWorkspaceButton) {
- handleWorkspaceDirBrowseButtonSelected();
- }
- else if (source == fFileSystemButton) {
- handleWorkingDirBrowseButtonSelected();
- }
- else if (source == fVariablesButton) {
- handleWorkingDirVariablesButtonSelected();
- }
- else if(source == fUseDefaultDirButton) {
- //only perform the action if this is the button that was selected
- if(fUseDefaultDirButton.getSelection()) {
- setDefaultWorkingDir();
- }
- }
- else if(source == fUseOtherDirButton) {
- //only perform the action if this is the button that was selected
- if(fUseOtherDirButton.getSelection()) {
- handleUseOtherWorkingDirButtonSelected();
- }
- }
- }
- }
-
- private WidgetListener fListener = new WidgetListener();
-
- /**
- * The name of the launch configuration attribute that will be used to save
- * the location of the working directory.
- */
- private final String workingDirectoryAttribteName;
-
- /**
- * The help context id to use to connect this working directory block
- * to the help system.
- */
- private final String helpContextId;
-
- /**
- * Creates a new WorkingDirectoryBlock for setting a working directory.
- *
- * @param workingDirectoryAttribteName the name of the launch configuration attribute to set the working directory's location, cannot be <tt>null</tt>
- */
- protected WorkingDirectoryBlock(String workingDirectoryAttribteName) {
- this(workingDirectoryAttribteName, null);
- }
-
- /**
- * Creates a new WorkingDirectoryBlock for setting a working directory.
- *
- * @param workingDirectoryAttribteName the name of the launch configuration attribute to set the working directory's location, cannot be <tt>null</tt>
- * @param helpContextId the help context id to use to hook onto the help system
- */
- protected WorkingDirectoryBlock(String workingDirectoryAttribteName,
- String helpContextId) {
- Assert.isNotNull(workingDirectoryAttribteName);
- this.workingDirectoryAttribteName = workingDirectoryAttribteName;
- this.helpContextId = helpContextId;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
- */
- public final void createControl(Composite parent) {
- Font font = parent.getFont();
- Group group = SWTFactory.createGroup(parent, DebugUIMessages.WorkingDirectoryBlock_12, 2, 1, GridData.FILL_HORIZONTAL);
- setControl(group);
-
- if (helpContextId != null) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(group, helpContextId);
- }
-
- //default choice
- Composite comp = SWTFactory.createComposite(group, font, 2, 2, GridData.FILL_BOTH, 0, 0);
- fUseDefaultDirButton = SWTFactory.createRadioButton(comp, DebugUIMessages.WorkingDirectoryBlock_18);
- fUseDefaultDirButton.addSelectionListener(fListener);
- fWorkingDirText = SWTFactory.createSingleText(comp, 1);
- fWorkingDirText.addModifyListener(fListener);
- fWorkingDirText.setEnabled(false);
- //user enter choice
- fUseOtherDirButton = SWTFactory.createRadioButton(comp, DebugUIMessages.WorkingDirectoryBlock_19);
- fUseOtherDirButton.addSelectionListener(fListener);
- fOtherWorkingText = SWTFactory.createSingleText(comp, 1);
- fOtherWorkingText.addModifyListener(fListener);
- //buttons
- Composite buttonComp = SWTFactory.createComposite(comp, font, 3, 2, GridData.HORIZONTAL_ALIGN_END);
- GridLayout ld = (GridLayout)buttonComp.getLayout();
- ld.marginHeight = 1;
- ld.marginWidth = 0;
- fWorkspaceButton = createPushButton(buttonComp, DebugUIMessages.WorkingDirectoryBlock_0, null);
- fWorkspaceButton.addSelectionListener(fListener);
- fFileSystemButton = createPushButton(buttonComp, DebugUIMessages.WorkingDirectoryBlock_1, null);
- fFileSystemButton.addSelectionListener(fListener);
- fVariablesButton = createPushButton(buttonComp, DebugUIMessages.WorkingDirectoryBlock_17, null);
- fVariablesButton.addSelectionListener(fListener);
- }
-
- /**
- * Show a dialog that lets the user select a working directory
- */
- private void handleWorkingDirBrowseButtonSelected() {
- DirectoryDialog dialog = new DirectoryDialog(getShell());
- dialog.setMessage(DebugUIMessages.WorkingDirectoryBlock_7);
- String currentWorkingDir = getWorkingDirectoryText();
- if (!currentWorkingDir.trim().equals("")) { //$NON-NLS-1$
- File path = new File(currentWorkingDir);
- if (path.exists()) {
- dialog.setFilterPath(currentWorkingDir);
- }
- }
- String selectedDirectory = dialog.open();
- if (selectedDirectory != null) {
- fOtherWorkingText.setText(selectedDirectory);
- }
- }
-
- /**
- * Show a dialog that lets the user select a working directory from
- * the workspace
- */
- private void handleWorkspaceDirBrowseButtonSelected() {
- IContainer currentContainer= getContainer();
- if (currentContainer == null) {
- currentContainer = ResourcesPlugin.getWorkspace().getRoot();
- }
- ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), currentContainer, false, DebugUIMessages.WorkingDirectoryBlock_4);
- dialog.showClosedProjects(false);
- dialog.open();
- Object[] results = dialog.getResult();
- if ((results != null) && (results.length > 0) && (results[0] instanceof IPath)) {
- IPath path = (IPath)results[0];
- String containerName = path.makeRelative().toString();
- setOtherWorkingDirectoryText("${workspace_loc:" + containerName + "}"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * Returns the selected workspace container,or <code>null</code>
- */
- protected IContainer getContainer() {
- String path = getWorkingDirectoryText();
- if (path.length() > 0) {
- IResource res = null;
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- if (path.startsWith("${workspace_loc:")) { //$NON-NLS-1$
- IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
- try {
- path = manager.performStringSubstitution(path, false);
- IPath uriPath = new Path(path).makeAbsolute();
- IContainer[] containers = root.findContainersForLocationURI(URIUtil.toURI(uriPath));
- if (containers.length > 0) {
- res = containers[0];
- }
- }
- catch (CoreException e) {
- log(e);
- }
- }
- else {
- res = root.findMember(path);
- }
- if (res instanceof IContainer) {
- return (IContainer)res;
- }
- }
- return null;
- }
-
- /**
- * The default working dir radio button has been selected.
- */
- private void handleUseDefaultWorkingDirButtonSelected() {
- fWorkspaceButton.setEnabled(false);
- fOtherWorkingText.setEnabled(false);
- fVariablesButton.setEnabled(false);
- fFileSystemButton.setEnabled(false);
- fUseOtherDirButton.setSelection(false);
- }
-
- /**
- * The other working dir radio button has been selected
- */
- private void handleUseOtherWorkingDirButtonSelected() {
- fOtherWorkingText.setEnabled(true);
- fWorkspaceButton.setEnabled(true);
- fVariablesButton.setEnabled(true);
- fFileSystemButton.setEnabled(true);
- updateLaunchConfigurationDialog();
- }
-
- /**
- * The working dir variables button has been selected
- */
- private void handleWorkingDirVariablesButtonSelected() {
- StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
- dialog.open();
- String variableText = dialog.getVariableExpression();
- if (variableText != null) {
- fOtherWorkingText.insert(variableText);
- }
- }
-
- /**
- * Sets the default working directory.
- */
- protected void setDefaultWorkingDir() {
- try {
- ILaunchConfiguration config = getLaunchConfiguration();
- if (config != null) {
- IProject project = getProject(config);
- if (project != null) {
- setDefaultWorkingDirectoryText("${workspace_loc:" + project.getFullPath().makeRelative().toOSString() + "}"); //$NON-NLS-1$//$NON-NLS-2$
- return;
- }
- }
- }
- catch (CoreException ce) {
- log(ce);
- }
- setDefaultWorkingDirectoryText(System.getProperty("user.dir")); //$NON-NLS-1$
- }
-
- /**
- * Returns the project associated with the specified launch configuration or
- * <code>null</code> if none.
- *
- * @param configuration the launch configuration that has been set to this working directory block
- * @return the project specified by the launch configuration, or <tt>null</tt> if nothing has been set
- * @throws CoreException if an error occurred while retrieving the project from the launch configuration
- */
- protected abstract IProject getProject(ILaunchConfiguration configuration) throws CoreException;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public boolean isValid(ILaunchConfiguration config) {
- setErrorMessage(null);
- setMessage(null);
- // if variables are present, we cannot resolve the directory
- String workingDirPath = getWorkingDirectoryText();
- if (workingDirPath.indexOf("${") >= 0) { //$NON-NLS-1$
- IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
- try {
- manager.validateStringVariables(workingDirPath);
- }
- catch (CoreException e) {
- setErrorMessage(e.getMessage());
- return false;
- }
- }
- else if (workingDirPath.length() > 0) {
- IContainer container = getContainer();
- if (container == null) {
- File dir = new File(workingDirPath);
- if (dir.isDirectory()) {
- return true;
- }
- setErrorMessage(DebugUIMessages.WorkingDirectoryBlock_10);
- return false;
- }
- } else if (workingDirPath.length() == 0) {
- setErrorMessage(DebugUIMessages.WorkingDirectoryBlock_20);
- return false;
- }
- return true;
- }
-
- /**
- * Sets the default working directory to be used by the launch configuration.
- * The default implementation has no default working directory.
- *
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy config) {
- config.setAttribute(workingDirectoryAttribteName, (String)null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- setLaunchConfiguration(configuration);
- try {
- String wd = configuration.getAttribute(workingDirectoryAttribteName, (String)null);
- setDefaultWorkingDir();
- if (wd != null) {
- setOtherWorkingDirectoryText(wd);
- }
- }
- catch (CoreException e) {
- setErrorMessage(DebugUIMessages.WorkingDirectoryBlock_Exception_occurred_reading_configuration___15 + e.getStatus().getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- if(fUseDefaultDirButton.getSelection()) {
- configuration.setAttribute(workingDirectoryAttribteName, (String)null);
- }
- else {
- configuration.setAttribute(workingDirectoryAttribteName, getWorkingDirectoryText());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return DebugUIMessages.WorkingDirectoryBlock_Working_Directory_8;
- }
-
- /**
- * Logs exceptions that have been caught by this working directory block.
- * Subclasses should reimplement if they wish to monitor such exceptions.
- * Default implementation does nothing.
- * @param e the exception to log
- */
- protected void log(CoreException e) {
- // nothing
- }
-
- /**
- * Retrieves the path from the text box that has been selected.
- * @return the working directory the user wishes to use
- */
- protected final String getWorkingDirectoryText() {
- if(fUseDefaultDirButton.getSelection()) {
- return fWorkingDirText.getText().trim();
- }
- return fOtherWorkingText.getText().trim();
- }
-
- /**
- * Sets the text of the default working directory.
- * @param dir the directory to set the widget to
- */
- protected final void setDefaultWorkingDirectoryText(String dir) {
- if(dir != null) {
- fWorkingDirText.setText(dir);
- fUseDefaultDirButton.setSelection(true);
- handleUseDefaultWorkingDirButtonSelected();
- }
- }
-
- /**
- * Sets the directory of the other working directory to be used.
- * @param dir the directory to set the widget to
- */
- protected final void setOtherWorkingDirectoryText(String dir) {
- if(dir != null) {
- fOtherWorkingText.setText(dir);
- fUseDefaultDirButton.setSelection(false);
- fUseOtherDirButton.setSelection(true);
- handleUseOtherWorkingDirButtonSelected();
- }
- }
-
- /**
- * Sets the launch configuration to be used by this working directory block.
- */
- protected void setLaunchConfiguration(ILaunchConfiguration config) {
- fLaunchConfiguration = config;
- }
-
- /**
- * Returns the launch configuration that this working directory block is using.
- * @return this working directory block's launch configuration
- */
- protected ILaunchConfiguration getLaunchConfiguration() {
- return fLaunchConfiguration;
- }
-
- /**
- * Allows this entire block to be enabled/disabled
- * @param enabled whether to enable it or not
- */
- public final void setEnabled(boolean enabled) {
- fUseDefaultDirButton.setEnabled(enabled);
- fUseOtherDirButton.setEnabled(enabled);
- if(fOtherWorkingText.isEnabled()) {
- fOtherWorkingText.setEnabled(enabled);
- fWorkspaceButton.setEnabled(enabled);
- fVariablesButton.setEnabled(enabled);
- fFileSystemButton.setEnabled(enabled);
- }
- // in the case where the 'other' text is selected and we want to enable
- if(fUseOtherDirButton.getSelection() && enabled == true) {
- fOtherWorkingText.setEnabled(enabled);
- }
- }
-
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java
deleted file mode 100644
index 462828642..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java
+++ /dev/null
@@ -1,504 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.ILaunchHistoryChangedListener;
-import org.eclipse.debug.internal.ui.ILaunchLabelChangedListener;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Abstract implementation of an action that displays a drop-down launch
- * history for a specific launch group.
- * <p>
- * Clients may subclass this class.
- * </p>
- * @see LaunchingResourceManager
- * @see ILaunchLabelChangedListener
- * @since 2.1
- */
-public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, IWorkbenchWindowPulldownDelegate2, ILaunchHistoryChangedListener {
-
- /**
- * The menu created by this action
- */
- private Menu fMenu;
-
- /**
- * The action used to render this delegate.
- */
- private IAction fAction;
-
- /**
- * The associated <code>ILaunchGroup</code>
- * @since 3.3
- */
- private ILaunchGroup fLaunchGroup = null;
-
- /**
- * Indicates whether the launch history has changed and
- * the sub menu needs to be recreated.
- */
- protected boolean fRecreateMenu = false;
-
- /**
- * Constructs a launch history action.
- *
- * @param launchGroupIdentifier unique identifier of the launch group
- * extension that this action displays a launch history for.
- */
- public AbstractLaunchHistoryAction(String launchGroupIdentifier) {
- fLaunchGroup = getLaunchConfigurationManager().getLaunchGroup(launchGroupIdentifier);
- }
-
- /**
- * A listener to be notified of launch label updates
- * @since 3.3
- */
- private ILaunchLabelChangedListener fLabelListener = new ILaunchLabelChangedListener() {
- public ILaunchGroup getLaunchGroup() {
- return fLaunchGroup;
- }
- public void labelChanged() {
- updateTooltip();
- }
- };
-
- /**
- * Sets the action used to render this delegate.
- *
- * @param action the action used to render this delegate
- */
- private void setAction(IAction action) {
- fAction = action;
- }
-
- /**
- * Returns the action used to render this delegate.
- *
- * @return the action used to render this delegate
- */
- protected IAction getAction() {
- return fAction;
- }
-
- /**
- * Adds the given action to the specified menu with an accelerator specified
- * by the given number.
- *
- * @param menu the menu to add the action to
- * @param action the action to add
- * @param accelerator the number that should appear as an accelerator
- */
- protected void addToMenu(Menu menu, IAction action, int accelerator) {
- StringBuffer label= new StringBuffer();
- if (accelerator >= 0 && accelerator < 10) {
- //add the numerical accelerator
- label.append('&');
- label.append(accelerator);
- label.append(' ');
- }
- label.append(action.getText());
- action.setText(label.toString());
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(menu, -1);
- }
-
- /**
- * Initialize this action so that it can dynamically set its tool-tip. Also set the enabled state
- * of the underlying action based on whether there are any registered launch configuration types that
- * understand how to launch in the mode of this action.
- */
- private void initialize(IAction action) {
- getLaunchConfigurationManager().addLaunchHistoryListener(this);
- setAction(action);
- updateTooltip();
- action.setEnabled(existsConfigTypesForMode());
- }
-
- /**
- * Return whether there are any registered launch configuration types for
- * the mode of this action.
- *
- * @return whether there are any registered launch configuration types for
- * the mode of this action
- */
- private boolean existsConfigTypesForMode() {
- ILaunchConfigurationType[] configTypes = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes();
- for (int i = 0; i < configTypes.length; i++) {
- if (configTypes[i].supportsMode(getMode())) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Updates this action's tool-tip. The tooltip is based on user preference settings
- * for launching - either the previous launch, or based on the selection and which
- * configuration will be launched.
- * <p>
- * Subclasses may override as required.
- * </p>
- */
- protected void updateTooltip() {
- getAction().setToolTipText(getToolTip());
- }
-
- /**
- * Returns the tooltip specific to a configuration.
- *
- * @param configuration a <code>ILauncConfiguration</code>
- * @return the string for the tool tip
- */
- protected String getToolTip(ILaunchConfiguration configuration) {
- String launchName= configuration.getName();
- String mode= getMode();
- String label;
- if (mode.equals(ILaunchManager.RUN_MODE)) {
- label= ActionMessages.AbstractLaunchHistoryAction_1;
- } else if (mode.equals(ILaunchManager.DEBUG_MODE)){
- label= ActionMessages.AbstractLaunchHistoryAction_2;
- } else if (mode.equals(ILaunchManager.PROFILE_MODE)){
- label= ActionMessages.AbstractLaunchHistoryAction_3;
- } else {
- label= ActionMessages.AbstractLaunchHistoryAction_4;
- }
- return MessageFormat.format(ActionMessages.AbstractLaunchHistoryAction_0, new String[] {label, launchName});
- }
-
- /**
- * Returns this action's tooltip. The tooltip is retrieved from the launch resource manager
- * which builds tool tips asynchronously for context launching support.
- *
- * @return the string for the tool tip
- */
- private String getToolTip() {
- String launchName = getLaunchingResourceManager().getLaunchLabel(fLaunchGroup);
- if(launchName == null) {
- return DebugUIPlugin.removeAccelerators(internalGetHistory().getLaunchGroup().getLabel());
- }
- String label = null;
- String mode = getMode();
- if (mode.equals(ILaunchManager.RUN_MODE)) {
- label = ActionMessages.AbstractLaunchHistoryAction_1;
- } else if (mode.equals(ILaunchManager.DEBUG_MODE)){
- label = ActionMessages.AbstractLaunchHistoryAction_2;
- } else if (mode.equals(ILaunchManager.PROFILE_MODE)){
- label = ActionMessages.AbstractLaunchHistoryAction_3;
- } else {
- label = ActionMessages.AbstractLaunchHistoryAction_4;
- }
- if(IInternalDebugCoreConstants.EMPTY_STRING.equals(launchName)) {
- return MessageFormat.format(ActionMessages.AbstractLaunchHistoryAction_5, new String[] {label});
- }
- else {
- return MessageFormat.format(ActionMessages.AbstractLaunchHistoryAction_0, new String[] {label, launchName});
- }
- }
-
- /**
- * @see ILaunchHistoryChangedListener#launchHistoryChanged()
- */
- public void launchHistoryChanged() {
- fRecreateMenu = true;
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {
- setMenu(null);
- getLaunchConfigurationManager().removeLaunchHistoryListener(this);
- getLaunchingResourceManager().removeLaunchLabelChangedListener(fLabelListener);
- }
-
- /**
- * Return the last launch in this action's launch history.
- *
- * @return the most recent configuration that was launched from this
- * action's launch history that is not filtered from the menu
- */
- protected ILaunchConfiguration getLastLaunch() {
- return getLaunchConfigurationManager().getFilteredLastLaunch(getLaunchGroupIdentifier());
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowPulldownDelegate#getMenu(org.eclipse.swt.widgets.Control)
- */
- public Menu getMenu(Control parent) {
- setMenu(new Menu(parent));
- fillMenu(fMenu);
- initMenu();
- return fMenu;
- }
-
- /**
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
- */
- public Menu getMenu(Menu parent) {
- setMenu(new Menu(parent));
- fillMenu(fMenu);
- initMenu();
- return fMenu;
- }
-
- /**
- * Creates the menu for the action
- */
- private void initMenu() {
- // Add listener to re-populate the menu each time
- // it is shown because of dynamic history list
- fMenu.addMenuListener(new MenuAdapter() {
- public void menuShown(MenuEvent e) {
- if (fRecreateMenu) {
- Menu m = (Menu)e.widget;
- MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
- }
- fillMenu(m);
- fRecreateMenu= false;
- }
- }
- });
- }
-
- /**
- * Sets this action's drop-down menu, disposing the previous menu.
- *
- * @param menu the new menu
- */
- private void setMenu(Menu menu) {
- if (fMenu != null) {
- fMenu.dispose();
- }
- fMenu = menu;
- }
-
- /**
- * Fills the drop-down menu with favorites and launch history
- *
- * @param menu the menu to fill
- */
- protected void fillMenu(Menu menu) {
- ILaunchConfiguration[] historyList= getHistory();
- ILaunchConfiguration[] favoriteList = getFavorites();
-
- // Add favorites
- int accelerator = 1;
- for (int i = 0; i < favoriteList.length; i++) {
- ILaunchConfiguration launch= favoriteList[i];
- LaunchAction action= new LaunchAction(launch, getMode());
- addToMenu(menu, action, accelerator);
- accelerator++;
- }
-
- // Separator between favorites and history
- if (favoriteList.length > 0 && historyList.length > 0) {
- addSeparator(menu);
- }
-
- // Add history launches next
- for (int i = 0; i < historyList.length; i++) {
- ILaunchConfiguration launch= historyList[i];
- LaunchAction action= new LaunchAction(launch, getMode());
- addToMenu(menu, action, accelerator);
- accelerator++;
- }
-
- if(accelerator == 1) {
- IAction action = new Action(ActionMessages.AbstractLaunchHistoryAction_6) {};
- action.setEnabled(false);
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(menu, -1);
- }
- }
-
- /**
- * Adds a separator to the given menu
- *
- * @param menu
- */
- protected void addSeparator(Menu menu) {
- new MenuItem(menu, SWT.SEPARATOR);
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- // do nothing - this is just a menu
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- * @since 3.6
- */
- public void runWithEvent(IAction action, Event event) {
- if((event.stateMask & SWT.MOD1) > 0) {
- ILaunchConfiguration config = getLastLaunch();
- IStructuredSelection selection = null;
- if (config != null){
- selection = new StructuredSelection(config);
- }
- DebugUITools.openLaunchConfigurationDialogOnGroup(
- DebugUIPlugin.getShell(),
- selection,
- getLaunchGroupIdentifier());
- return;
- }
- run(action);
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- * @since 3.6
- */
- public void init(IAction action) {
- // do nothing by default
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection){
- if (fAction == null) {
- initialize(action);
- }
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
- if (this instanceof AbstractLaunchToolbarAction) {
- getLaunchingResourceManager().addLaunchLabelUpdateListener(fLabelListener);
- }
- }
-
- /**
- * Returns the launch history associated with this action's launch group.
- *
- * @return the launch history associated with this action's launch group
- * @deprecated this method returns a class that is not API and is not intended
- * for clients of the debug platform. Instead, use <code>getHistory()</code>,
- * <code>getFavorites()</code>, and <code>getLastLaunch()</code>.
- */
- protected LaunchHistory getLaunchHistory() {
- return getLaunchConfigurationManager().getLaunchHistory(getLaunchGroupIdentifier());
- }
-
- /**
- * Returns the launch history associated with this action's launch group.
- *
- * @return the launch history associated with this action's launch group
- * @since 3.3
- */
- private LaunchHistory internalGetHistory() {
- return getLaunchConfigurationManager().getLaunchHistory(getLaunchGroupIdentifier());
- }
-
- /**
- * Returns the launch history associated with this action's launch mode and group in most
- * recently launched order. Configurations associated with disabled activities are not included
- * in the list. As well, configurations are filtered based on workspace preference settings
- * to filter configurations from closed projects, deleted projects, working sets and to filter
- * specific launch configuration types.
- *
- * @return launch history
- * @since 3.3
- */
- protected ILaunchConfiguration[] getHistory() {
- return LaunchConfigurationManager.filterConfigs(internalGetHistory().getHistory());
- }
-
- /**
- * Returns the launch favorites associated with this action's launch mode and group in user
- * preference order. Configurations associated with disabled activities are not included
- * in the list. As well, configurations are filtered based on workspace preference settings
- * to filter configurations from closed projects, deleted projects, working sets and to filter
- * specific launch configuration types.
- *
- * @return favorite launch configurations
- * @since 3.3
- */
- protected ILaunchConfiguration[] getFavorites() {
- return LaunchConfigurationManager.filterConfigs(internalGetHistory().getFavorites());
- }
-
- /**
- * Returns the mode (e.g., 'run' or 'debug') of this drop down.
- *
- * @return the mode of this action
- */
- protected String getMode() {
- return internalGetHistory().getLaunchGroup().getMode();
- }
-
- /**
- * Returns the launch configuration manager.
- *
- * @return launch configuration manager
- */
- private LaunchConfigurationManager getLaunchConfigurationManager() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager();
- }
-
- /**
- * Returns the <code>ContextualLaunchingResourceManager</code>
- *
- * @return <code>ContextualLaunchingResourceManager</code>
- */
- private LaunchingResourceManager getLaunchingResourceManager() {
- return DebugUIPlugin.getDefault().getLaunchingResourceManager();
- }
-
- /**
- * Returns the identifier of the launch group this action is associated
- * with.
- *
- * @return the identifier of the launch group this action is associated
- * with
- */
- protected String getLaunchGroupIdentifier() {
- return fLaunchGroup.getIdentifier();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchToolbarAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchToolbarAction.java
deleted file mode 100644
index d7f41bbdf..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchToolbarAction.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.contextlaunching.ContextRunner;
-import org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.OrganizeFavoritesAction;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.widgets.Menu;
-
-/**
- * A launch history action that also includes launch shortcut actions (run/debug
- * as), and an action to open the launch configuration dialog.
- * <p>
- * Clients may subclass this class.
- * </p>
- * @since 2.1
- */
-public class AbstractLaunchToolbarAction extends AbstractLaunchHistoryAction {
-
-
- /**
- * Constructs a launch toolbar action.
- *
- * @param launchGroupIdentifier unique identifier of the launch group
- * extension that this action displays a launch history, shortcuts, and
- * launch configuration dialog for.
- */
- public AbstractLaunchToolbarAction(String launchGroupIdentifier) {
- super(launchGroupIdentifier);
- }
-
- /**
- * Fills the drop-down menu with favorites and launch history,
- * launch shortcuts, and an action to open the launch configuration dialog.
- *
- * @param menu the menu to fill
- */
- protected void fillMenu(Menu menu) {
- super.fillMenu(menu);
- // Separator between history and common actions
- if (menu.getItemCount() > 0) {
- addSeparator(menu);
- }
- addToMenu(menu, new LaunchShortcutsAction(getLaunchGroupIdentifier()), -1);
- addToMenu(menu, getOpenDialogAction(), -1);
- addToMenu(menu, new OrganizeFavoritesAction(getLaunchGroupIdentifier()), -1);
- }
-
- /**
- * Returns an action to open the launch dialog
- * @since 3.1
- */
- protected IAction getOpenDialogAction() {
- return new OpenLaunchDialogAction(getLaunchGroupIdentifier());
- }
-
- /**
- * Launch the last launch, or open the launch config dialog if none.
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- //always ignore external tools during context launching
- if(LaunchingResourceManager.isContextLaunchEnabled() &&
- !getLaunchGroupIdentifier().equals("org.eclipse.ui.externaltools.launchGroup")) { //$NON-NLS-1$
- ContextRunner.getDefault().launch(DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(getLaunchGroupIdentifier()));
- }
- else {
- ILaunchConfiguration configuration = getLastLaunch();
- if (configuration == null) {
- DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUIPlugin.getShell(), new StructuredSelection(), getLaunchGroupIdentifier());
- } else {
- DebugUITools.launch(configuration, getMode());
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java
deleted file mode 100644
index 2e180cd05..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * WindRiver - Bug 192028 [Memory View] Memory view does not
- * display memory blocks that do not reference IDebugTarget
- *******************************************************************************/
-
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.memory.IMemoryRenderingType;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * A cascade menu to add a memory rendering to the memory view. This action delegate can be
- * contributed to a an editor, view or object via standard workbench extension points.
- * The action works on the {@link IAddMemoryRenderingsTarget} adapter provided
- * by the active debug context, creating a context menu to add applicable renderings
- * to the memory view.
- * <p>
- * Clients may reference/contribute this class as an action delegate
- * in plug-in XML.
- * </p>
- * @since 3.2
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- */
-public class AddMemoryRenderingActionDelegate extends Action implements IViewActionDelegate, IEditorActionDelegate, IObjectActionDelegate, IActionDelegate2{
-
- private IAction fAction;
- private IWorkbenchPart fPart;
- private ISelection fCurrentSelection;
- private IAddMemoryRenderingsTarget fActionDelegate;
- private IMenuCreator fMenuCreator;
- private IAdaptable fDebugContext;
- private IWorkbenchWindow fWindow;
- private DebugContextListener fDebugContextListener = new DebugContextListener();
-
- private class AddMemoryRenderingAction extends Action
- {
- private IMemoryRenderingType fRenderingType; // type of rendering to add
- AddMemoryRenderingAction(IMemoryRenderingType renderingType)
- {
- super(renderingType.getLabel());
- fRenderingType = renderingType;
- }
-
- public void runWithEvent(Event event) {
- if (fActionDelegate != null)
- {
- try {
- fActionDelegate.addMemoryRenderings(fPart, fCurrentSelection, new IMemoryRenderingType[]{fRenderingType});
- } catch (CoreException e) {
- DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), ActionMessages.AddMemoryRenderingActionDelegate_0, ActionMessages.AddMemoryRenderingActionDelegate_1, e);
- }
- }
- }
- }
-
- private class AddMemoryRenderingMenuCreator implements IMenuCreator
- {
-
- public void dispose() {
-
- }
-
- public Menu getMenu(Control parent) {
- return null;
- }
-
- public Menu getMenu(Menu parent) {
- Menu menu = new Menu(parent);
- menu.addMenuListener(new MenuAdapter() {
- public void menuShown(MenuEvent e) {
- Menu m = (Menu)e.widget;
- MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
- }
- fillMenu(m);
- }
- });
- return menu;
- }
-
- private void fillMenu(Menu parent)
- {
- if (fActionDelegate != null)
- {
- IMemoryRenderingType[] types = fActionDelegate.getMemoryRenderingTypes(fPart, fCurrentSelection);
-
- for (int i=0; i<types.length; i++)
- {
- AddMemoryRenderingAction action = new AddMemoryRenderingAction(types[i]);
- ActionContributionItem item = new ActionContributionItem(action);
- item.fill(parent, -1);
- }
- }
- }
- }
-
- private class DebugContextListener implements IDebugContextListener
- {
-
- private void contextActivated(ISelection selection) {
- setupActionDelegate(selection);
- updateAction(fAction, fCurrentSelection);
-
- }
-
- public void debugContextChanged(DebugContextEvent event) {
- contextActivated(event.getContext());
- }
-
-
- }
-
- private void setupActionDelegate(ISelection context)
- {
- IAdaptable debugContext = null;
- if (context instanceof IStructuredSelection)
- {
- if (((IStructuredSelection)context).getFirstElement() instanceof IAdaptable)
- debugContext = (IAdaptable)((IStructuredSelection)context).getFirstElement();
- }
-
- if (debugContext == null)
- fActionDelegate = null;
-
- if (debugContext == fDebugContext)
- return;
-
- fDebugContext = debugContext;
-
- if (fDebugContext == null)
- return;
-
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(fDebugContext);
-
- if (retrieval == null)
- return;
-
- IAddMemoryRenderingsTarget target = null;
- if (fCurrentSelection instanceof IStructuredSelection)
- {
- // get target from current selection
- IStructuredSelection strucSel = (IStructuredSelection)fCurrentSelection;
- Object obj = strucSel.getFirstElement();
- target = getAddMemoryRenderingTarget(obj);
- }
- if (target == null)
- {
- // get the target from Debug View
- target = getAddMemoryRenderingTarget(fDebugContext);
- }
- if (target == null)
- {
- // try to get target from memory block retrieval
- target = getAddMemoryRenderingTarget(retrieval);
- }
-
- fActionDelegate = target;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- bindPart(view);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- bindAction(action);
- fCurrentSelection = selection;
- updateAction(action, selection);
- }
-
- private void updateAction(IAction action, ISelection selection)
- {
- if (fActionDelegate != null)
- {
- action.setEnabled(fActionDelegate.canAddMemoryRenderings(fPart, selection));
- bindAction(action);
- }
- else
- {
- action.setEnabled(false);
- }
- }
-
- private void bindAction(IAction action) {
- if (action == null)
- return;
-
- if (action != fAction) {
- if (fMenuCreator == null)
- fMenuCreator = new AddMemoryRenderingMenuCreator();
- action.setMenuCreator(fMenuCreator);
- fAction= action;
- }
- }
-
- private IAddMemoryRenderingsTarget getAddMemoryRenderingTarget(Object elmt) {
- IAddMemoryRenderingsTarget target = null;
-
- if (elmt instanceof IAddMemoryRenderingsTarget)
- {
- target = (IAddMemoryRenderingsTarget)elmt;
- }
- else if (elmt instanceof IAdaptable)
- {
- target = (IAddMemoryRenderingsTarget)((IAdaptable)elmt).getAdapter(IAddMemoryRenderingsTarget.class);
- }
- return target;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart)
- */
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- bindPart(targetEditor);
- bindAction(action);
- updateAction(action, fCurrentSelection);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- bindPart(targetPart);
- bindAction(action);
- updateAction(action, fCurrentSelection);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- bindAction(action);
- if (action != null)
- {
- action.setText(ActionMessages.AddMemoryRenderingActionDelegate_2);
- action.setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_MONITOR_EXPRESSION));
- action.setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_MONITOR_EXPRESSION));
- action.setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_MONITOR_EXPRESSION));
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#dispose()
- */
- public void dispose() {
- // remove as debug context listener
- fAction = null;
- fPart = null;
- fCurrentSelection = null;
- fActionDelegate = null;
-
- // remove debug context listener
- bindPart(null);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- // do nothing
- }
-
- private void bindPart(IWorkbenchPart part)
- {
- IWorkbenchWindow window = null;
- if (part != null)
- {
- window = part.getSite().getWorkbenchWindow();
- }
- if (window != fWindow)
- {
-
- if (fWindow != null)
- {
- DebugUITools.getDebugContextManager().getContextService(fWindow).removeDebugContextListener(fDebugContextListener);
- }
-
- if (window != null)
- {
- DebugUITools.getDebugContextManager().getContextService(window).addDebugContextListener(fDebugContextListener);
- }
- fWindow = window;
- }
-
- if (part != fPart)
- fPart = part;
-
- if (fWindow != null)
- setupActionDelegate(DebugUITools.getDebugContextManager().getContextService(fWindow).getActiveContext());
- }
-
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java
deleted file mode 100644
index 368f8cc39..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.expressions.EvaluationContext;
-import org.eclipse.core.expressions.Expression;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.LaunchConfigurationAction;
-import org.eclipse.debug.internal.ui.actions.LaunchShortcutAction;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension;
-import org.eclipse.debug.internal.ui.stringsubstitution.SelectedResourceManager;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.activities.WorkbenchActivityHelper;
-
-/**
- * An action delegate that builds a context menu with applicable launch shortcuts
- * for a specific launch mode.
- * <p>
- * This class can be sub-classed and contributed as an object contribution pop-up
- * menu extension action. When invoked, it becomes a sub-menu that dynamically
- * builds a list of applicable launch shortcuts for the current selection.
- * Each launch shortcut may have optional information to support a context menu action.
- * </p>
- * <p>
- * Clients may subclass this class.
- * </p>
- * @since 3.0
- */
-public abstract class ContextualLaunchAction implements IObjectActionDelegate, IMenuCreator {
-
- private IAction fDelegateAction;
- private String fMode;
- // default launch group for this mode (null category)
- private ILaunchGroup fGroup = null;
- // map of launch groups by (non-null) categories, for this mode
- private Map fGroupsByCategory = null;
- // whether to re-fill the menu (reset on selection change)
- private boolean fFillMenu = true;
-
- /**
- * Constructs a contextual launch action for the given launch mode.
- *
- * @param mode launch mode
- */
- public ContextualLaunchAction(String mode) {
- fMode = mode;
- ILaunchGroup[] groups = DebugUITools.getLaunchGroups();
- fGroupsByCategory = new HashMap(3);
- for (int i = 0; i < groups.length; i++) {
- ILaunchGroup group = groups[i];
- if (group.getMode().equals(mode)) {
- if (group.getCategory() == null) {
- fGroup = group;
- } else {
- fGroupsByCategory.put(group.getCategory(), group);
- }
- }
- }
- }
-
- /*
- * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- // We don't have a need for the active part.
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#dispose()
- */
- public void dispose() {
- // nothing to do
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
- */
- public Menu getMenu(Control parent) {
- // never called
- return null;
- }
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
- */
- public Menu getMenu(Menu parent) {
- //Create the new menu. The menu will get filled when it is about to be shown. see fillMenu(Menu).
- Menu menu = new Menu(parent);
- /**
- * Add listener to re-populate the menu each time
- * it is shown because MenuManager.update(boolean, boolean)
- * doesn't dispose pull-down ActionContribution items for each popup menu.
- */
- menu.addMenuListener(new MenuAdapter() {
- public void menuShown(MenuEvent e) {
- if (fFillMenu) {
- Menu m = (Menu)e.widget;
- MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
- }
- fillMenu(m);
- fFillMenu = false;
- }
- }
- });
- return menu;
- }
-
- /*
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- // Never called because we become a menu.
- }
-
- /*
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- // if the selection is an IResource, save it and enable our action
- if (selection instanceof IStructuredSelection) {
- fFillMenu = true;
- if (fDelegateAction != action) {
- fDelegateAction = action;
- fDelegateAction.setMenuCreator(this);
- }
- //enable our menu
- action.setEnabled(true);
- return;
- }
- action.setEnabled(false);
- }
-
- /**
- * Returns the launch manager
- * @return the launch manager
- * @since 3.3
- */
- protected ILaunchManager getLaunchManager() {
- return DebugPlugin.getDefault().getLaunchManager();
- }
-
- /**
- * Fills the menu with applicable launch shortcuts
- * @param menu The menu to fill
- */
- protected void fillMenu(Menu menu) {
- IStructuredSelection ss = SelectedResourceManager.getDefault().getCurrentSelection();
- int accelerator = 1;
- if(!ss.isEmpty()) {
- try {
- //try to add the shared config it the context is one.
- ILaunchConfiguration config = getLaunchConfigurationManager().isSharedConfig(ss.getFirstElement());
- if(config != null && config.exists() && config.supportsMode(fMode)) {
- IAction action = new LaunchConfigurationAction(config, fMode, config.getName(), DebugUITools.getDefaultImageDescriptor(config), accelerator++);
- ActionContributionItem item = new ActionContributionItem(action);
- item.fill(menu, -1);
- }
- }
- catch (CoreException ce) {}
- }
-
- List allShortCuts = getLaunchConfigurationManager().getLaunchShortcuts();
- Iterator iter = allShortCuts.iterator();
- List filteredShortCuts = new ArrayList(10);
-
- //create a context
- List selection = ss.toList();
- //in 3.4 we are correctly passing the IEditorPart and ISelection, so we have to perform
- //some sneekyness to make sure the IEditorInput is passed to the eval expressions
- //for backwards compatibility
- Object o = ss.getFirstElement();
- if(o instanceof IEditorPart) {
- selection.set(0, ((IEditorPart)o).getEditorInput());
- }
- IEvaluationContext context = new EvaluationContext(null, selection);
- context.setAllowPluginActivation(true);
- context.addVariable("selection", selection); //$NON-NLS-1$
- while (iter.hasNext()) {
- LaunchShortcutExtension ext = (LaunchShortcutExtension) iter.next();
- try {
- if (!WorkbenchActivityHelper.filterItem(ext) && isApplicable(ext, context)) {
- filteredShortCuts.add(ext);
- }
- }
- catch (CoreException e) {}
- }
- iter = filteredShortCuts.iterator();
-
- //we need a separator iff the shared config entry has been added and there are following shortcuts
- if(menu.getItemCount() > 0 && filteredShortCuts.size() > 0) {
- new MenuItem(menu, SWT.SEPARATOR);
- }
- List categories = new ArrayList();
- while (iter.hasNext()) {
- LaunchShortcutExtension ext = (LaunchShortcutExtension) iter.next();
- Set modes = ext.getModes(); // supported launch modes
- Iterator modeIter = modes.iterator();
- while (modeIter.hasNext()) {
- String mode = (String) modeIter.next();
- if (mode.equals(fMode)) {
- String category = ext.getCategory();
- // NOTE: category can be null
- if (categories!= null && !categories.contains(category)) {
- categories.add(category);
- }
- populateMenuItem(mode, ext, menu, accelerator++);
- }
- }
- }
-
- // add in the open ... dialog shortcut(s)
- if (categories.isEmpty()) {
- if (accelerator > 1) {
- new MenuItem(menu, SWT.SEPARATOR);
- }
- IAction action = new OpenLaunchDialogAction(fGroup.getIdentifier());
- ActionContributionItem item = new ActionContributionItem(action);
- item.fill(menu, -1);
- } else {
- boolean addedSep = false;
- iter = categories.iterator();
- while (iter.hasNext()) {
- // NOTE: category can be null
- String category = (String) iter.next();
- ILaunchGroup group = fGroup;
- if (category != null) {
- group = (ILaunchGroup) fGroupsByCategory.get(category);
- }
- if (group != null) {
- if (accelerator > 1 && !addedSep) {
- new MenuItem(menu, SWT.SEPARATOR);
- addedSep = true;
- }
- IAction action = new OpenLaunchDialogAction(group.getIdentifier());
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(menu, -1);
- }
- }
- }
-
- }
-
- /**
- * Evaluate the enablement logic in the contextualLaunch
- * element description. A true result means that we should
- * include this shortcut in the context menu.
- * @return true iff shortcut should appear in context menu
- */
- private boolean isApplicable(LaunchShortcutExtension ext, IEvaluationContext context) throws CoreException {
- Expression expr = ext.getContextualLaunchEnablementExpression();
- return ext.evalEnablementExpression(context, expr);
- }
-
- /**
- * Add the shortcut to the context menu's launch sub-menu.
- */
- private void populateMenuItem(String mode, LaunchShortcutExtension ext, Menu menu, int accelerator) {
- LaunchShortcutAction action = new LaunchShortcutAction(mode, ext);
- action.setActionDefinitionId(ext.getId() + "." + mode); //$NON-NLS-1$
- String helpContextId = ext.getHelpContextId();
- if (helpContextId != null) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(action, helpContextId);
- }
- StringBuffer label= new StringBuffer();
- if (accelerator >= 0 && accelerator < 10) {
- //add the numerical accelerator
- label.append('&');
- label.append(accelerator);
- label.append(' ');
- }
- String contextLabel= ext.getContextLabel(mode);
- // replace default action label with context label if specified.
- label.append((contextLabel != null) ? contextLabel : action.getText());
- action.setText(label.toString());
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(menu, -1);
- }
-
- /**
- * Returns the launch configuration manager.
- *
- * @return launch configuration manager
- */
- private LaunchConfigurationManager getLaunchConfigurationManager() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugAction.java
deleted file mode 100644
index 3423222e1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugAction.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.actions.ExecutionAction;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Action to launch the last launch configuration that was successfully
- * launched, in debug mode. If no configurations have been launched, the launch
- * configuration dialog is opened.
- * <p>
- * This class may be instantiated.
- * </p>
- * @since 2.0
- */
-public final class DebugAction extends ExecutionAction {
-
- public DebugAction() {
- super(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP);
- }
-
- /**
- * @see ExecutionAction#getMode()
- */
- protected String getMode() {
- return ILaunchManager.DEBUG_MODE;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java
deleted file mode 100644
index 7877022d3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.debug.core.IRequest;
-import org.eclipse.debug.internal.ui.commands.actions.DebugCommandService;
-import org.eclipse.debug.internal.ui.commands.actions.ICommandParticipant;
-import org.eclipse.debug.internal.ui.commands.actions.IEnabledTarget;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextService;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Abstract base class for re-targeting actions which delegate execution to
- * {@link org.eclipse.debug.core.commands.IDebugCommandHandler} handlers.
- * The specific type of <code>IDebugCommandHandler</code> is determined by the
- * abstract {@link #getCommandType()} method.
- * <p>
- * This base class is an action which can be instantiated directly by views,
- * etc. In order to contribute an action using an extension point, a class
- * implementing {@link org.eclipse.ui.IActionDelegate} should be created first.
- * The delegate should then use a <code>DebugCommandAction</code> to implement
- * the needed functionality. The IActionDelegate must use {@link #setActionProxy(IAction)}
- * specifying the workbench's action that is a proxy to the action delegate. This
- * way, the workbench action can be updated visually as needed.<br>
- * Note: <code>IDebugCommandHandler</code> command typically act on the active
- * debug context as opposed to the active selection in view or window. The
- * action delegate should ignore the active window selection, and instead allow
- * the <code>DebugCommandAction</code> to update itself based on the active
- * debug context.
- * </p>
- * <p>
- * Clients may subclass this class.
- * </p>
- * @see org.eclipse.debug.core.commands.IDebugCommandHandler
- * @since 3.6
- */
-public abstract class DebugCommandAction extends Action implements IDebugContextListener {
-
- private boolean fInitialized = false;
-
- /**
- * The window this action is working for.
- */
- private IWorkbenchWindow fWindow;
-
- /**
- * The part this action is working for, or <code>null</code> if global to
- * a window.
- */
- private IWorkbenchPart fPart;
-
- /**
- * Command service.
- */
- private DebugCommandService fUpdateService;
-
- /**
- * Delegate this action is working for or <code>null</code> if none.
- */
- private IAction fAction;
-
- private IEnabledTarget fEnabledTarget = new IEnabledTarget() {
- public void setEnabled(boolean enabled) {
- DebugCommandAction.this.setEnabled(enabled);
- }
- };
-
- /**
- * Constructor
- */
- public DebugCommandAction() {
- super();
- String helpContextId = getHelpContextId();
- if (helpContextId != null)
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, helpContextId);
- setEnabled(false);
- }
-
- /**
- * Sets the current workbench action that is a proxy to an {@link org.eclipse.ui.IActionDelegate}
- * that is using this action to perform its actual work. This only needs to be called when
- * an {@link org.eclipse.ui.IActionDelegate} is using one of these actions to perform its
- * function.
- *
- * @param action workbench proxy action
- */
- public void setActionProxy(IAction action) {
- fAction = action;
- fAction.setEnabled(isEnabled());
- }
-
- /**
- * Executes this action on the given target object
- *
- * @param target the target to perform the action on
- */
- private boolean execute(final Object[] targets) {
- return fUpdateService.executeCommand(
- getCommandType(), targets,
- new ICommandParticipant() {
- public void requestDone(org.eclipse.debug.core.IRequest request) {
- DebugCommandAction.this.postExecute(request, targets);
- }
- });
- }
-
- /**
- * This method is called after the completion of the execution of this
- * command. Extending classes may override this method to perform additional
- * operation after command execution.
- *
- * @param request The completed request object which was given to the
- * debug command handler.
- * @param targets Objects which were the targets of this action
- */
- protected void postExecute(IRequest request, Object[] targets) {
- // do nothing by default
- }
-
- /**
- * Returns the {@link org.eclipse.debug.core.commands.IDebugCommandHandler}
- * command handler that type this action executes.
- *
- * @return command class.
- *
- * @see org.eclipse.debug.core.commands.IDebugCommandHandler
- */
- abstract protected Class getCommandType();
-
- /**
- * @see org.eclipse.debug.ui.contexts.IDebugContextListener#debugContextChanged(org.eclipse.debug.ui.contexts.DebugContextEvent)
- */
- public void debugContextChanged(DebugContextEvent event) {
- fUpdateService.postUpdateCommand(getCommandType(), fEnabledTarget);
- }
-
- /**
- * @see org.eclipse.jface.action.Action#setEnabled(boolean)
- */
- public void setEnabled(boolean enabled) {
- synchronized (this) {
- if (!fInitialized) {
- fInitialized = true;
- notifyAll();
- }
- }
- super.setEnabled(enabled);
- if (fAction != null) {
- fAction.setEnabled(enabled);
- }
- }
-
- /**
- * Initializes this action for a specific part.
- *
- * @param part workbench part
- */
- public void init(IWorkbenchPart part) {
- fPart = part;
- fWindow = part.getSite().getWorkbenchWindow();
- fUpdateService = DebugCommandService.getService(fWindow);
- IDebugContextService service = getDebugContextService();
- String partId = part.getSite().getId();
- service.addDebugContextListener(this, partId);
- ISelection activeContext = service.getActiveContext(partId);
- if (activeContext != null) {
- fUpdateService.updateCommand(getCommandType(), fEnabledTarget);
- } else {
- setEnabled(getInitialEnablement());
- }
- }
-
- /**
- * Initializes the context action
- * @param window the window
- */
- public void init(IWorkbenchWindow window) {
- fWindow = window;
- fUpdateService = DebugCommandService.getService(fWindow);
- IDebugContextService contextService = getDebugContextService();
- contextService.addDebugContextListener(this);
- ISelection activeContext = contextService.getActiveContext();
- if (activeContext != null) {
- fUpdateService.updateCommand(getCommandType(), fEnabledTarget);
- } else {
- setEnabled(getInitialEnablement());
- }
- }
-
- /**
- * Returns whether this action should be enabled when initialized
- * and there is no active debug context. By default, <code>false</code>
- * is returned.
- *
- * @return initial enabled state when there is no active context.
- */
- protected boolean getInitialEnablement() {
- return false;
- }
-
- /**
- * Returns the context this action operates on as a selection.
- *
- * @return the context this action operates on
- */
- private ISelection getContext() {
- if (fPart != null) {
- getDebugContextService().getActiveContext(fPart.getSite().getId());
- }
- return getDebugContextService().getActiveContext();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- synchronized (this) {
- if (!fInitialized) {
- try {
- wait();
- } catch (InterruptedException e) {
- }
- }
- }
-
- ISelection selection = getContext();
- if (selection instanceof IStructuredSelection && isEnabled()) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- boolean enabled = execute(ss.toArray());
- // disable the action according to the command
- setEnabled(enabled);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.Action#runWithEvent(org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(Event event) {
- run();
- }
-
- /**
- * Clean up when removing
- */
- public void dispose() {
- IDebugContextService service = getDebugContextService();
- if (fPart != null) {
- service.removeDebugContextListener(this, fPart.getSite().getId());
- } else {
- service.removeDebugContextListener(this);
- }
- fWindow = null;
- fPart = null;
- }
-
- /**
- * Returns the context service this action linked to. By default, this actions is
- * associated with the context service for the window this action is operating in.
- *
- * @return associated context service
- */
- protected IDebugContextService getDebugContextService() {
- return DebugUITools.getDebugContextManager().getContextService(fWindow);
- }
-
- /**
- * Returns the help context id for this action or <code>null</code> if none.
- *
- * @return The help context id for this action or <code>null</code>
- */
- public abstract String getHelpContextId();
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getId()
- */
- public abstract String getId();
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getText()
- */
- public abstract String getText();
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getToolTipText()
- */
- public abstract String getToolTipText();
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getDisabledImageDescriptor()
- */
- public abstract ImageDescriptor getDisabledImageDescriptor();
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getHoverImageDescriptor()
- */
- public abstract ImageDescriptor getHoverImageDescriptor();
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.Action#getImageDescriptor()
- */
- public abstract ImageDescriptor getImageDescriptor();
-
- /**
- * Returns the workbench proxy associated with this action or <code>null</code>
- * if none. This is the workbench proxy to an {@link org.eclipse.ui.IActionDelegate}
- * that is using this action to perform its actual work. This is only used when
- * an {@link org.eclipse.ui.IActionDelegate} is using one of these actions to perform its
- * function.
- *
- * @return workbench proxy action or <code>null</code>
- */
- protected IAction getActionProxy() {
- return fAction;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java
deleted file mode 100644
index 5ec94d494..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.ui.actions;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.HandlerEvent;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.debug.core.IRequest;
-import org.eclipse.debug.internal.ui.commands.actions.DebugCommandService;
-import org.eclipse.debug.internal.ui.commands.actions.ICommandParticipant;
-import org.eclipse.debug.internal.ui.commands.actions.IEnabledTarget;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextService;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.IWindowListener;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Abstract base class for re-targeting command framework handlers, which
- * delegate execution to {@link org.eclipse.debug.core.commands.IDebugCommandHandler}
- * handlers. The specific type of <code>IDebugCommandHandler</code> is
- * determined by the abstract {@link #getCommandType()} method.
- *
- * <p> Note: This class is not an implementation of the <code>IDebugCommandHandler</code>
- * interface, which was somewhat unfortunately named. <code>IDebugCommandHandler</code>
- * is an interface that used only by the debugger plug-ins. This class implements
- * {@link org.eclipse.core.commands.IHandler} interface and is to be used with the
- * platform commands framework. </p>
- *
- * <p>
- * Clients may subclass this class.
- * </p>
- * @see org.eclipse.debug.core.commands.IDebugCommandHandler
- * @see org.eclipse.core.commands.IHandler
- *
- * @since 3.6
- */
-public abstract class DebugCommandHandler extends AbstractHandler {
-
- /**
- * The DebugCommandService is able to evaluate the command handler
- * enablement in each workbench window separately, however the workbench
- * command framework uses only a single handler instance for all windows.
- * This IEnabledTarget implementation tracks enablement of the command
- * for a given window. When the handler enablement is tested, the
- * currently active window is used to determine which enabled target
- * to use.
- */
- private class EnabledTarget implements IEnabledTarget, IDebugContextListener {
- boolean fEnabled = getInitialEnablement();
- IWorkbenchWindow fWindow;
-
- EnabledTarget(IWorkbenchWindow window) {
- fWindow = window;
- DebugCommandService.getService(fWindow).updateCommand(getCommandType(), this);
- getContextService(fWindow).addDebugContextListener(this);
- }
-
- public void setEnabled(boolean enabled) {
- boolean oldEnabled = fEnabled;
- fEnabled = enabled;
- if (fEnabled != oldEnabled && fCurrentEnabledTarget == this) {
- fireHandlerChanged(new HandlerEvent(DebugCommandHandler.this, true, false));
- }
- }
-
- public void debugContextChanged(DebugContextEvent event) {
- DebugCommandService.getService(fWindow).postUpdateCommand(getCommandType(), this);
- }
-
- void dispose() {
- if (isDisposed()) {
- return;
- }
- getContextService(fWindow).removeDebugContextListener(this);
- fWindow = null;
- }
-
- boolean isDisposed() {
- return fWindow == null;
- }
- }
-
- /**
- * Window listener is used to make sure that the handler enablement
- * is updated when the active workbench window is changed.
- */
- private IWindowListener fWindowListener = new IWindowListener() {
-
- public void windowOpened(IWorkbenchWindow w) {
- }
-
- public void windowDeactivated(IWorkbenchWindow w) {
- }
-
- public void windowClosed(IWorkbenchWindow w) {
- EnabledTarget enabledTarget = (EnabledTarget)fEnabledTargetsMap.get(w);
- if (enabledTarget != null) {
- enabledTarget.dispose();
- }
- }
-
- public void windowActivated(IWorkbenchWindow w) {
- fCurrentEnabledTarget = (EnabledTarget)fEnabledTargetsMap.get(w);
- fireHandlerChanged(new HandlerEvent(DebugCommandHandler.this, true, false));
- }
- };
-
- /**
- * Map of enabled targets keyed by workbench window.
- */
- private Map fEnabledTargetsMap = new WeakHashMap();
-
- /**
- * The current enabled target, based on the active
- * workbench window.
- */
- private EnabledTarget fCurrentEnabledTarget = null;
-
- /**
- * The constructor adds the handler as the
- */
- public DebugCommandHandler() {
- super();
- PlatformUI.getWorkbench().addWindowListener(fWindowListener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.AbstractHandler#setEnabled(java.lang.Object)
- */
- public void setEnabled(Object evaluationContext) {
- // This method is called with the current evaluation context
- // just prior to the isEnabled() being called. Check the active
- // window and update the current enabled target based on it
- fCurrentEnabledTarget = null;
-
- if (!(evaluationContext instanceof IEvaluationContext)) {
- return;
- }
- IEvaluationContext context = (IEvaluationContext) evaluationContext;
- Object _window = context.getVariable(ISources.ACTIVE_WORKBENCH_WINDOW_NAME);
- if (_window instanceof IWorkbenchWindow) {
- IWorkbenchWindow window = (IWorkbenchWindow)_window;
- fCurrentEnabledTarget = getEnabledTarget(window);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
- */
- public boolean isEnabled() {
- if (fCurrentEnabledTarget == null) {
- return false;
- }
- return fCurrentEnabledTarget.fEnabled;
- }
-
- private EnabledTarget getEnabledTarget(IWorkbenchWindow window) {
- EnabledTarget target = (EnabledTarget)fEnabledTargetsMap.get(window);
- if (target == null) {
- target = new EnabledTarget(window);
- fEnabledTargetsMap.put(window, target);
- }
- return target;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
- if (window == null) {
- throw new ExecutionException("No active workbench window."); //$NON-NLS-1$
- }
- fCurrentEnabledTarget = getEnabledTarget(window);
-
- ISelection selection = getContextService(window).getActiveContext();
- if (selection instanceof IStructuredSelection && isEnabled()) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- boolean enabledAfterExecute = execute(window, ss.toArray());
-
- // enable/disable the action according to the command
- fCurrentEnabledTarget.setEnabled(enabledAfterExecute);
- }
-
- return null;
- }
-
- private IDebugContextService getContextService(IWorkbenchWindow window) {
- return DebugUITools.getDebugContextManager().getContextService(window);
- }
-
- /**
- * Executes this action on the given target object
- *
- * @param target the target to perform the action on
- */
- private boolean execute(IWorkbenchWindow window, final Object[] targets) {
- DebugCommandService service = DebugCommandService.getService(window);
- return service.executeCommand(
- getCommandType(), targets,
- new ICommandParticipant() {
- public void requestDone(org.eclipse.debug.core.IRequest request) {
- DebugCommandHandler.this.postExecute(request, targets);
- }
- });
- }
-
- /**
- * This method is called after the completion of the execution of this
- * command. Extending classes may override this method to perform additional
- * operation after command execution.
- *
- * @param request The completed request object which was given the the
- * debug command handler.
- * @param targets Objects which were the targets of this action
- */
- protected void postExecute(IRequest request, Object[] targets) {
- // do nothing by default
- }
-
- /**
- * Returns the {@link org.eclipse.debug.core.commands.IDebugCommandHandler}
- * command handler that type this action executes.
- *
- * @return command class.
- *
- * @see org.eclipse.debug.core.commands.IDebugCommandHandler
- */
- abstract protected Class getCommandType();
-
-
- /**
- * Returns whether this action should be enabled when initialized
- * and there is no active debug context.
- *
- * @return false, by default
- */
- protected boolean getInitialEnablement() {
- return false;
- }
-
-
- /**
- * Clean up when removing
- */
- public void dispose() {
- PlatformUI.getWorkbench().removeWindowListener(fWindowListener);
- for (Iterator itr = fEnabledTargetsMap.values().iterator(); itr.hasNext();) {
- EnabledTarget target = (EnabledTarget)itr.next();
- if (!target.isDisposed()) {
- target.dispose();
- }
- }
- fEnabledTargetsMap.clear();
- fCurrentEnabledTarget = null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ExportBreakpointsOperation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ExportBreakpointsOperation.java
deleted file mode 100644
index 4ab6983ec..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ExportBreakpointsOperation.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.ui.actions;
-
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.importexport.breakpoints.IImportExportConstants;
-import org.eclipse.debug.internal.ui.importexport.breakpoints.ImportExportMessages;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.XMLMemento;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Exports breakpoints to a file or string buffer.
- * <p>
- * This class may be instantiated.
- * <p>
- * @since 3.2
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class ExportBreakpointsOperation implements IRunnableWithProgress {
-
- private IBreakpoint[] fBreakpoints = null;
- /**
- * Only one of file name or writer is used depending how the operation is
- * created.
- */
- private String fFileName = null;
- private StringWriter fWriter = null;
-
- /**
- * Constructs an operation to export breakpoints to a file.
- *
- * @param breakpoints the breakpoints to export
- * @param fileName absolute path of file to export breakpoints to - the file
- * will be overwritten if it already exists
- */
- public ExportBreakpointsOperation(IBreakpoint[] breakpoints, String fileName) {
- fBreakpoints = breakpoints;
- fFileName = fileName;
- }
-
- /**
- * Constructs an operation to export breakpoints to a string buffer. The buffer
- * is available after the operation is run via {@link #getBuffer()}.
- *
- * @param breakpoints the breakpoints to export
- * @since 3.5
- */
- public ExportBreakpointsOperation(IBreakpoint[] breakpoints) {
- fBreakpoints = breakpoints;
- fWriter = new StringWriter();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void run(IProgressMonitor monitor) throws InvocationTargetException {
- SubMonitor localmonitor = SubMonitor.convert(monitor, ImportExportMessages.ExportOperation_0, fBreakpoints.length);
- XMLMemento memento = XMLMemento.createWriteRoot(IImportExportConstants.IE_NODE_BREAKPOINTS);
- Writer writer = fWriter;
- try {
- for (int i = 0; i < fBreakpoints.length; i++) {
- if(localmonitor.isCanceled()) {
- return;
- }
- IBreakpoint breakpoint = fBreakpoints[i];
- //in the event we are in working set view, we can have multiple selection of the same breakpoint
- //so do a simple check for it
- IMarker marker = breakpoint.getMarker();
- IMemento root = memento.createChild(IImportExportConstants.IE_NODE_BREAKPOINT);
- root.putString(IImportExportConstants.IE_BP_ENABLED, Boolean.toString(breakpoint.isEnabled()));
- root.putString(IImportExportConstants.IE_BP_REGISTERED, Boolean.toString(breakpoint.isRegistered()));
- root.putString(IImportExportConstants.IE_BP_PERSISTANT, Boolean.toString(breakpoint.isPersisted()));
- //write out the resource information
- IResource resource = marker.getResource();
- IMemento child = root.createChild(IImportExportConstants.IE_NODE_RESOURCE);
- child.putString(IImportExportConstants.IE_NODE_PATH, resource.getFullPath().toPortableString());
- child.putInteger(IImportExportConstants.IE_NODE_TYPE, resource.getType());
- //a generalized (name, value) pairing for attributes each stored as an ATTRIB element
- root = root.createChild(IImportExportConstants.IE_NODE_MARKER);
- root.putString(IImportExportConstants.IE_NODE_TYPE, marker.getType());
- Object val = marker.getAttribute(IMarker.LINE_NUMBER);
- root.putString(IMarker.LINE_NUMBER, (val != null) ? val.toString() : null);
- val = marker.getAttribute(IImportExportConstants.CHARSTART);
- root.putString(IImportExportConstants.CHARSTART, (val != null) ? val.toString() : null);
- String value = null;
- boolean wsattrib = false;
- for(java.util.Iterator iter = marker.getAttributes().keySet().iterator(); iter.hasNext();) {
- String iterval = iter.next().toString();
- value = marker.getAttribute(iterval).toString();
- if(!iterval.equals(IMarker.LINE_NUMBER)) {
- child = root.createChild(IImportExportConstants.IE_NODE_ATTRIB);
- if(iterval.equals(IInternalDebugUIConstants.WORKING_SET_NAME)) {
- wsattrib = true;
- value = getWorkingSetsAttribute(breakpoint);
- }
- child.putString(IImportExportConstants.IE_NODE_NAME, iterval);
- child.putString(IImportExportConstants.IE_NODE_VALUE, value);
- }
- }
- if(!wsattrib) {
- //ensure the working set infos are present if not previously updated
- child = root.createChild(IImportExportConstants.IE_NODE_ATTRIB);
- child.putString(IImportExportConstants.IE_NODE_NAME, IInternalDebugUIConstants.WORKING_SET_NAME);
- child.putString(IImportExportConstants.IE_NODE_VALUE, getWorkingSetsAttribute(breakpoint));
- child = root.createChild(IImportExportConstants.IE_NODE_ATTRIB);
- child.putString(IImportExportConstants.IE_NODE_NAME, IInternalDebugUIConstants.WORKING_SET_ID);
- child.putString(IImportExportConstants.IE_NODE_VALUE, IDebugUIConstants.BREAKPOINT_WORKINGSET_ID);
- }
- localmonitor.worked(1);
- }
- if (writer == null) {
- writer = new OutputStreamWriter(new FileOutputStream(fFileName), "UTF-8"); //$NON-NLS-1$
- }
- memento.save(writer);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- } catch (IOException e) {
- throw new InvocationTargetException(e,
- MessageFormat.format("There was a problem writing file: {0}", new String[] {fFileName})); //$NON-NLS-1$
- }
- finally {
- localmonitor.done();
- if(writer != null) {
- try {
- writer.close();
- } catch (IOException e) {
- throw new InvocationTargetException(e);
- }
- }
- }
- }
-
- /**
- * Collects all of the breakpoint working sets that contain the given {@link IBreakpoint}
- * in the given list
- *
- * @param breakpoint
- * @param collector
- * @since 3.5
- */
- private String getWorkingSetsAttribute(IBreakpoint breakpoint) {
- IWorkingSetManager mgr = PlatformUI.getWorkbench().getWorkingSetManager();
- StringBuffer buffer = new StringBuffer();
- IWorkingSet[] sets = mgr.getWorkingSets();
- for (int i = 0; i < sets.length; i++) {
- if(IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(sets[i].getId()) &&
- containsBreakpoint(sets[i], breakpoint)) {
- buffer.append(IImportExportConstants.DELIMITER).append(sets[i].getName());
- }
- }
- return buffer.toString();
- }
-
- /**
- * Method to ensure markers and breakpoints are not both added to the working set
- * @param set the set to check
- * @param breakpoint the breakpoint to check for existence
- * @return true if it is present false otherwise
- * @since 3.5
- */
- private boolean containsBreakpoint(IWorkingSet set, IBreakpoint breakpoint) {
- IAdaptable[] elements = set.getElements();
- for (int i = 0; i < elements.length; i++) {
- if (elements[i].equals(breakpoint)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns a string buffer containing a memento of the exported breakpoints
- * or <code>null</code> if the operation was configured to export to a file.
- * The memento can be used to import breakpoints into the workspace using an
- * {@link ImportBreakpointsOperation}.
- *
- * @return a string buffer containing a memento of the exported breakpoints
- * or <code>null</code> if the operation was configured to export to a file
- * @since 3.5
- */
- public StringBuffer getBuffer() {
- if (fWriter != null) {
- return fWriter.getBuffer();
- }
- return null;
- }
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IAddMemoryBlocksTarget.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IAddMemoryBlocksTarget.java
deleted file mode 100644
index aad493cb1..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IAddMemoryBlocksTarget.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * An adapter for an "add memory block" operation. The Memory View provides
- * a retargettable "add memory block" action that debuggers may plug into
- * by providing an adapter (see <code>IAdaptable</code>) of this type.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.2
- */
-public interface IAddMemoryBlocksTarget {
-
- /**
- * Returns whether an add memory block operation can be performed from the specified
- * part and the given selection.
- *
- * @param part the part on which the action has been invoked
- * @param selection the selection on which the action has been invoked
- * @throws CoreException if unable to perform the action
- */
- public boolean canAddMemoryBlocks(IWorkbenchPart part, ISelection selection) throws CoreException;
-
- /**
- * Returns whether this target will support adding memory block from the specified
- * part.
- * @param part
- * @return true if the target wants to support adding memory block from the given
- * part, false otherwise.
- */
- public boolean supportsAddMemoryBlocks(IWorkbenchPart part);
-
-
- /**
- * Perform an add memory block on the given element that is
- * currently selected in the Debug view. If a memory block can be successfully
- * created, implementations must add the resulted memory block to <code>IMemoryBlockManager</code>
- * In addition, implementations must query to see if default renderings should be created
- * for the given memory block and add these renderings accordingly.
- *
- * @param part the part on which the action has been invoked
- * @param selection the selection on which the action has been invoked
- * @throws CoreException if unable to perform the action
- *
- * @see org.eclipse.debug.core.model.IMemoryBlockRetrieval
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingManager
- * @see org.eclipse.debug.core.IMemoryBlockManager
- */
- public void addMemoryBlocks(IWorkbenchPart part, ISelection selection) throws CoreException;
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IAddMemoryRenderingsTarget.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IAddMemoryRenderingsTarget.java
deleted file mode 100644
index 5d912ffa6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IAddMemoryRenderingsTarget.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.ui.memory.IMemoryRenderingType;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Adapter for the platform's retargettable "add memory rendering" action.
- * Clients implementing this adapter are expected to add the necessary memory blocks
- * and renderings when the adapter is invoked.
- * <p>
- * Typically, to add a memory rendering, client needs to do the following:
- * <ol>
- * <li>Create a new memory block</li>
- * <li>Add the new memory block to the Memory Block Manager. (<code>IMemoryBlockManager</code>)</li>
- * <li>Create the new rendering from <code>IMemoryRenderingTypeDelegate</code></li>
- * <li>Bring the required memory view to the top. (<code>IMemoryRenderingSite</code>)</li>
- * <li>Find the container from the memory view to host the new memory rendering.
- * (<code>IMemoryRenderingContainer</code>)</li>
- * <li>Initialize the new rendering with the appropriate memory block and container.</li>
- * <li>Add the new rendering to the container.</li>
- * </ol>
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.2
- * @see AddMemoryRenderingActionDelegate
- */
-public interface IAddMemoryRenderingsTarget {
- /**
- * Returns whether a memory rendering can be added from the specified
- * part, based on the the given selection, which is the active debug context
- * in the current workbench window.
- *
- * @param part the part on which the action has been invoked
- * @param selection the active debug context in the active workbench window
- * @throws CoreException if an error has occurred
- */
- public boolean canAddMemoryRenderings(IWorkbenchPart part, ISelection selection);
-
- /**
- * Adds memory renderings. Based on the part and selection (active debug context), this
- * adapter does the following:
- * <ol>
- * <li>creates and adds the required memory block to the memory block manager</li>
- * <li>creates the specified renderings and add the them
- * to the appropriate memory rendering containers</li>
- * </ol>
- * @param part the part on which the action has been invoked
- * @param selection the active debug context
- * @param renderingTypes renderings to add
- * @throws CoreException if unable to perform the action
- *
- * @see org.eclipse.debug.core.model.IMemoryBlockRetrieval
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingManager
- * @see org.eclipse.debug.core.IMemoryBlockManager
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingSite
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingContainer
- */
- public void addMemoryRenderings(IWorkbenchPart part, ISelection selection, IMemoryRenderingType[] renderingTypes) throws CoreException;
-
- /**
- * Returns a list of rendering types that can be added from the given workbench part and active
- * debug context, possibly empty.
- *
- * @param part the part on which the action has been invoked
- * @param selection the active debug context
- * @return a list of rendering types that can be added, possibly empty
- */
- public IMemoryRenderingType[] getMemoryRenderingTypes(IWorkbenchPart part, ISelection selection);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ILaunchable.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ILaunchable.java
deleted file mode 100644
index 1fa3abc19..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ILaunchable.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-/**
- * Interface used to tag objects as launchable. Objects that provide
- * an adapter of this type will be considered by the contextual
- * launch support.
- * <p>
- * Clients may contribute an adapter of this type for launchable objects
- * via the <code>org.eclipse.core.runtime.adapters</code> extension
- * point. A factory and implementation of this interface are not actually
- * required.
- * </p>
- * @see org.eclipse.debug.ui.actions.ContextualLaunchAction
- * @since 3.0
- */
-public interface ILaunchable {
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IRunToLineTarget.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IRunToLineTarget.java
deleted file mode 100644
index 234c6fde8..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IRunToLineTarget.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.ISuspendResume;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * An adapter for a "run to line" operation. The debug platform provides
- * a retargettable "run to line" action that debuggers may plug into
- * by providing an adapter (see <code>IAdaptable</code>) of this type.
- * This allows the platform to provide one command and key binding for
- * the "run to line" function to be shared by many debuggers.
- * <p>
- * When a part is activated, a retargettable action asks the part
- * for its <code>IRunToLineTarget</code> adapter. If one exists,
- * that adapter is delegated to to perform "run to line" operations when
- * the user invokes an associated action. If an adapter does not exist
- * for the part, the retargettable actions asks selected objects in the
- * active part for an adapter. Generally, a debug implementation will
- * provide breakpoint adapters for relevant editors and model objects.
- * </p>
- * <p>
- * Clients are intended to implement this interface and provide instances as
- * an adapter on applicable parts (for example, editors) that support the
- * operation.
- * </p>
- * @since 3.0
- */
-public interface IRunToLineTarget {
-
- /**
- * Perform a run to line operation on the given element that is
- * currently selected and suspended in the Debug view. Implementations
- * must honor the user preference of whether to skip breakpoints
- * during the operation -
- * see <code>IDebugUIConstants.PREF_SKIP_BREAKPOINTS_DURING_RUN_TO_LINE</code>.
- *
- * @param part the part on which the action has been invoked
- * @param selection the selection on which the action has been invoked
- * @param target suspended element to perform the "run to line" action on
- * @throws CoreException if unable to perform the action
- */
- public void runToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) throws CoreException;
-
- /**
- * Returns whether a run to line operation can be performed on the given
- * element that is currently selected and suspended in the Debug view.
- *
- * @param part the part on which the action has been invoked
- * @param selection the selection on which the action has been invoked
- * @param target suspended element to perform the "run to line" action on
- * @throws CoreException if unable to perform the action
- */
- public boolean canRunToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTarget.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTarget.java
deleted file mode 100644
index c0f9c8bf7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTarget.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * An adapter to support breakpoint creation/deletion for an active part
- * or selection within an active part. The debug platform provides
- * retargettable actions for toggling line breakpoints, method breakpoints,
- * and watchpoints. A debug implementation can plug into the global actions
- * by providing an adapter of this type on relevant parts and objects.
- * The debug platform provides one command and key binding for each breakpoint
- * operation.
- * <p>
- * When a part is activated, a retargettable action asks the part
- * for its <code>IToggleBreakpointTarget</code> adapter. If one exists,
- * that adapter is delegated to to perform breakpoint operations when
- * the user invokes an associated action. If an adapter does not exist
- * for the part, the retargettable actions asks selected objects in the
- * active part for an adapter. Generally, a debug implementation will
- * provide breakpoint adapters for relevant editors and model objects.
- * </p>
- * <p>
- * Clients are intended to implement this interface and provide instances as
- * an adapter on applicable parts (for example, editors) and objects (for
- * example, methods and fields) that support breakpoint toggling.
- * </p>
- * @since 3.0
- */
-public interface IToggleBreakpointsTarget {
-
- /**
- * Creates new line breakpoints or removes existing breakpoints.
- * The selection varies depending on the given part. For example,
- * a text selection is provided for text editors, and a structured
- * selection is provided for tree views, and may be a multi-selection.
- *
- * @param part the part on which the action has been invoked
- * @param selection selection on which line breakpoints should be toggled
- * @throws CoreException if unable to perform the action
- */
- public void toggleLineBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException;
-
- /**
- * Returns whether line breakpoints can be toggled on the given selection.
- * The selection varies depending on the given part. For example,
- * a text selection is provided for text editors, and a structured
- * selection is provided for tree views, and may be a multi-selection.
- *
- * @param part the part on which the action has been invoked
- * @param selection selection on which line breakpoints may be toggled
- * @return whether line breakpoints can be toggled on the given selection
- */
- public boolean canToggleLineBreakpoints(IWorkbenchPart part, ISelection selection);
-
- /**
- * Creates new method breakpoints or removes existing breakpoints.
- * The selection varies depending on the given part. For example,
- * a text selection is provided for text editors, and a structured
- * selection is provided for tree views, and may be a multi-selection.
- *
- * @param part the part on which the action has been invoked
- * @param selection selection on which method breakpoints should be toggled
- * @throws CoreException if unable to perform the action
- */
- public void toggleMethodBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException;
-
- /**
- * Returns whether method breakpoints can be toggled on the given selection.
- * The selection varies depending on the given part. For example,
- * a text selection is provided for text editors, and a structured
- * selection is provided for tree views, and may be a multi-selection.
- *
- * @param part the part on which the action has been invoked
- * @param selection selection on which method breakpoints may be toggled
- * @return whether method breakpoints can be toggled on the given selection
- */
- public boolean canToggleMethodBreakpoints(IWorkbenchPart part, ISelection selection);
-
- /**
- * Creates new watchpoints or removes existing breakpoints.
- * The selection varies depending on the given part. For example,
- * a text selection is provided for text editors, and a structured
- * selection is provided for tree views, and may be a multi-selection.
- *
- * @param part the part on which the action has been invoked
- * @param selection selection on which watchpoints should be toggled
- * @throws CoreException if unable to perform the action
- */
- public void toggleWatchpoints(IWorkbenchPart part, ISelection selection) throws CoreException;
-
- /**
- * Returns whether watchpoints can be toggled on the given selection.
- * The selection varies depending on the given part. For example,
- * a text selection is provided for text editors, and a structured
- * selection is provided for tree views, and may be a multi-selection.
- *
- * @param part the part on which the action has been invoked
- * @param selection selection on which watchpoints may be toggled
- * @return whether watchpoints can be toggled on the given selection
- */
- public boolean canToggleWatchpoints(IWorkbenchPart part, ISelection selection);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetExtension.java
deleted file mode 100644
index 99e7e0879..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetExtension.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Extension interface for {@link org.eclipse.debug.ui.actions.IToggleBreakpointsTarget}.
- * This interface provides the ability to selectively create any type of breakpoint
- * when invoked, rather than a specific type of breakpoint (for example, a line
- * breakpoint). This allows targets to choose the type of breakpoint to create
- * when the user double-clicks in the vertical ruler.
- * <p>
- * Clients implementing <code>IToggleBreakpointsTarget</code> may optionally
- * implement this interface.
- * </p>
- * @since 3.1
- * @see org.eclipse.debug.ui.actions.ToggleBreakpointAction
- */
-public interface IToggleBreakpointsTargetExtension extends IToggleBreakpointsTarget {
-
- /**
- * Creates new line breakpoints or removes existing breakpoints.
- * The selection varies depending on the given part. For example,
- * a text selection is provided for text editors, and a structured
- * selection is provided for tree views, and may be a multi-selection.
- *
- * @param part the part on which the action has been invoked
- * @param selection selection on which line breakpoints should be toggled
- * @throws CoreException if unable to perform the action
- */
- public void toggleBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException;
-
- /**
- * Returns whether line breakpoints can be toggled on the given selection.
- * The selection varies depending on the given part. For example,
- * a text selection is provided for text editors, and a structured
- * selection is provided for tree views, and may be a multi-selection.
- *
- * @param part the part on which the action has been invoked
- * @param selection selection on which line breakpoints may be toggled
- * @return whether line breakpoints can be toggled on the given selection
- */
- public boolean canToggleBreakpoints(IWorkbenchPart part, ISelection selection);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetFactory.java
deleted file mode 100644
index cb644d3e0..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetFactory.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - adapted to use with IToggleBreakpiontsTargetFactory extension
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import java.util.Set;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * A toggle breakpoints target factory creates one or more toggle breakpoint
- * targets. The toggle breakpoints targets are used by toggle breakpoint actions
- * to create breakpoints appropriate for the active editor, debug session, project,
- * or selection.
- *
- * <p>
- * Toggle breakpoints target factories are contributed via the
- * <code>org.eclipse.debug.ui.toggleBreakpointsTargetFactories</code>
- * extension point. Following is an example of a detail pane factory extension:
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.toggleBreakpointsTargetFactories"&gt;
- * &lt;toggleTargetFactory
- * id="com.example.ExampleBreakpointToggleTargetFactory"
- * class="com.example.BreakpointToggleTargetFactory"&gt;
- * &lt;enablement&gt;
- * &lt;!-- Test the active debug context. Enable only if the active context
- * is an element from "Example" debugger, or if there is no debug context
- * associated with the context element. Also enable if debug context is
- * empty --&gt;
- * &lt;with variable="debugContext"&gt;
- * &lt;iterate&gt;
- * &lt;or&gt;
- * &lt;test property="org.eclipse.debug.ui.getModelIdentifier" value="com.example.model"/&gt;
- * &lt;test property="org.eclipse.debug.ui.getModelIdentifier" value=""/&gt;
- * &lt;/or&gt;
- * &lt;/iterate&gt;
- * &lt;/with&gt;
- * &lt;!-- If there is no active debug context. Enable the breakpoint toggle for
- * the "Example" editors --&gt;
- * &lt;instanceof value="com.example.Editor"/&gt;
- * &lt;/enablement&gt;
- * &lt;/toggleTargetFactory&gt;
- * &lt;/extension&gt;
- * </pre>
- * </p>
- * <p>
- * <p>
- * Clients contributing a toggle breakpoints target factory are intended to
- * implement this interface.
- *
- * @see IToggleBreakpointsTarget
- * @see IToggleBreakpointsTargetExtension
- * @see org.eclipse.debug.internal.ui.actions.ToggleBreakpointsTargetManager
- * @since 3.5
- */
-public interface IToggleBreakpointsTargetFactory {
- /**
- * Returns all possible types of toggle breakpoints targets that this
- * factory can create for the given selection and part, possibly empty.
- * Toggle breakpoints targets are returned as a set of IDs.
- *
- * @param part The active part.
- * @param selection The current selection
- * @return Set of <code>String</code> IDs for possible toggle breakpoint
- * targets, possibly empty
- */
- public Set getToggleTargets(IWorkbenchPart part, ISelection selection);
-
- /**
- * Returns the identifier of the default toggle breakpoints target to use
- * for the given selection, or <code>null</code> if this factory has no
- * preference.
- *
- * @param part The active part.
- * @param selection The current selection
- * @return a breakpoint toggle target identifier or <code>null</code>
- */
- public String getDefaultToggleTarget(IWorkbenchPart part, ISelection selection);
-
- /**
- * Creates and returns a toggle breakpoint target corresponding to the
- * given identifier that this factory can produce (according to
- * {@link #getToggleTargets}).
- *
- * @param targetID The id of the toggle target to be created
- * @return toggle target or <code>null</code> if one could not be created
- */
- public IToggleBreakpointsTarget createToggleTarget(String targetID);
-
- /**
- * Returns a human readable name for the breakpoint toggle target associated with the
- * given ID. Used to populate the context menu with meaningful names of the types of
- * breakpoints created by the given target.
- *
- * @param targetID toggle breakpoints target identifier
- * @return toggle target name
- */
- public String getToggleTargetName(String targetID);
-
- /**
- * Returns a description for the breakpoint toggle target associated with the
- * given ID or <code>null</code> if none.
- *
- * @param targetID toggle breakpoints target identifier
- * @return toggle target name or <code>null</code> if none
- */
- public String getToggleTargetDescription(String targetID);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IVariableValueEditor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IVariableValueEditor.java
deleted file mode 100644
index 0fc8f9813..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IVariableValueEditor.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.debug.core.model.IVariable;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * A variable value editor allows the user to edit a variable's value.
- * Variable value editors are contributed for a debug model via the
- * <code>org.eclipse.debug.ui.variableValueEditors</code> extension point.
- * <p>
- * Following is example plug-in XML for contributing a variable value editor.
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.variableValueEditors"&gt;
- * &lt;variableEditor
- * modelId="com.examples.myDebugModel"
- * class="com.examples.variables.MyVariableValueEditor"/&gt;
- * &lt;/extension&gt;
- * </pre>
- * The attributes are specified as follows:
- * <ul>
- * <li><code>modelId</code> the debug model identifier for which the given
- * variable value editor is applicable</li>
- * <li><code>class</code> fully qualified name of a class that implements
- * {@link IVariableValueEditor}</li>
- * </ul>
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.1
- */
-public interface IVariableValueEditor {
-
- /**
- * Edits the given variable, if appropriate. If this editor does not apply to
- * the given variable this method returns false, which indicates that the
- * Debug Platform's default variable edit dialog should be used.
- *
- * @param variable the variable to edit
- * @param shell the currently active shell, which can be used to open a dialog
- * for the user
- * @return whether this editor has completed the edit operation for the given variable.
- * <code>true</code> if no more work should be done, <code>false</code> if the debug
- * platform should prompt the user to edit the given variable using the default
- * variable editor
- */
- public boolean editVariable(IVariable variable, Shell shell);
-
- /**
- * Saves the given expression to the given variable, if appropriate. If this
- * editor does not set the given variable's value from the given expression, this
- * method returns false. Returning false indicates that the Debug Platform should
- * perform the default operation to set a variable's value based on a String.
- *
- * @param variable the variable to edit
- * @param expression the expression to assign to the given variable
- * @param shell the currently active shell, which can be used to report errors to the
- * user. May be <code>null</code> if no active shell could be found.
- * @return whether this editor has completed the save operation for the given variable.
- * <code>true</code> if no more work should be done, <code>false</code> if the debug
- * platform should perform the default save operation
- */
- public boolean saveVariable(IVariable variable, String expression, Shell shell);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapter.java
deleted file mode 100644
index d6199cdfb..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapter.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IVariable;
-
-/**
- * An optional adapter used to create a watch expression for a selected variable.
- * <p>
- * The 'Create Watch Expression' action is enabled for instances of
- * {@link org.eclipse.debug.core.model.IVariable} that have an associated
- * {@link org.eclipse.debug.core.model.IWatchExpressionDelegate} registered
- * for that debug model.
- * When a watch expression factory adapter is available for a variable, the factory is
- * consulted to create a watch expression for that variable. When no adapter is provided,
- * the watch expression is generated based on the variable's name.
- * </p>
- * <p>
- * Also see the optional interface {@link IWatchExpressionFactoryAdapterExtension}.
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.2
- */
-public interface IWatchExpressionFactoryAdapter {
-
- /**
- * Creates and returns an expression for the specified variable
- * which is used to created an {@link org.eclipse.debug.core.model.IWatchExpression}.
- *
- * @param variable variable a watch expression is required for
- * @return text used to create a watch expression
- * @exception org.eclipse.core.runtime.CoreException if unable to create a watch
- * expression
- */
- public String createWatchExpression(IVariable variable) throws CoreException;
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapter2.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapter2.java
deleted file mode 100644
index 552d1eb8b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapter2.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - integration with non-standard debug models (Bug 209883)
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * An optional adapter used to create a watch expression for a selected element.
- * <p>
- * The 'Create Watch Expression' action is enabled for an adaptable element
- * that have an associated <code>IWatchExpressionFactoryAdapter2</code>.
- *
- * When a watch expression factory adapter is available for an element, the factory is
- * consulted to create a watch expression for that element.
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.4
- */
-public interface IWatchExpressionFactoryAdapter2 {
-
- /**
- * Creates and returns an expression for the specified variable
- * which is used to created an {@link org.eclipse.debug.core.model.IWatchExpression}.
- *
- * @param element element a watch expression is required for
- * @return text used to create a watch expression
- * @exception org.eclipse.core.runtime.CoreException if unable to create a watch
- * expression
- */
- public String createWatchExpression(Object element) throws CoreException;
-
- /**
- * Returns whether a watch expression can be created for the specified variable.
- *
- * @param variable the specified variable
- * @return whether an expression can be created
- * @exception org.eclipse.core.runtime.CoreException if unable to create a watch
- * expression
- */
- public boolean canCreateWatchExpression(Object variable);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapterExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapterExtension.java
deleted file mode 100644
index fd277f1aa..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IWatchExpressionFactoryAdapterExtension.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.debug.core.model.IVariable;
-
-/**
- * Optional extension to the watch expression factory adapter to dynamically enable the
- * 'Create Watch Expression' action, based on the selected variable.
- * <p>
- * By default, the 'Create Watch Expression' action is enabled for instances of
- * {@link org.eclipse.debug.core.model.IVariable} that have an associated
- * {@link org.eclipse.debug.core.model.IWatchExpressionDelegate} registered
- * for that debug model.
- * When a watch expression factory adapter is available for a variable that implements
- * this interface, the factory is consulted to enable the action.
- * </p>
- * <p>
- * Clients may implementing {@link IWatchExpressionFactoryAdapter} may also implement
- * this interface.
- * </p>
- * @since 3.3
- */
-public interface IWatchExpressionFactoryAdapterExtension extends IWatchExpressionFactoryAdapter {
-
- /**
- * Returns whether a watch expression can be created for the specified variable.
- *
- * @param variable variable a watch expression is required for
- * @return whether an expression can be created
- * @exception org.eclipse.core.runtime.CoreException if unable to create a watch
- * expression
- */
- public boolean canCreateWatchExpression(IVariable variable);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java
deleted file mode 100644
index b858f583f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java
+++ /dev/null
@@ -1,409 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.ui.actions;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.IBreakpointImportParticipant;
-import org.eclipse.debug.internal.core.BreakpointManager;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.importexport.breakpoints.IImportExportConstants;
-import org.eclipse.debug.internal.ui.importexport.breakpoints.ImportExportMessages;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.XMLMemento;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Imports breakpoints from a file or string buffer into the workspace.
- * <p>
- * This class may be instantiated.
- * <p>
- * @since 3.2
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class ImportBreakpointsOperation implements IRunnableWithProgress {
-
- private boolean fOverwriteAll = false;
-
- private String fFileName = null;
-
- private boolean fCreateWorkingSets = false;
-
- private ArrayList fAdded = new ArrayList();
-
- private String fCurrentWorkingSetProperty = null;
-
- private BreakpointManager fManager = (BreakpointManager) DebugPlugin.getDefault().getBreakpointManager();
-
- /**
- * When a buffer is specified, a file is not used.
- */
- private StringBuffer fBuffer = null;
-
- /**
- * Constructs an operation to import breakpoints.
- *
- * @param fileName the file to read breakpoints from - the file should have been
- * created from an export operation
- * @param overwrite whether imported breakpoints will overwrite existing equivalent breakpoints
- * @param createWorkingSets whether breakpoint working sets should be created. Breakpoints
- * are exported with information about the breakpoint working sets they belong to. Those
- * working sets can be optionally re-created on import if they do not already exist in the
- * workspace.
- */
- public ImportBreakpointsOperation(String fileName, boolean overwrite, boolean createWorkingSets) {
- fFileName = fileName;
- fOverwriteAll = overwrite;
- fCreateWorkingSets = createWorkingSets;
- }
-
- /**
- * Constructs an operation to import breakpoints from a string buffer. The buffer
- * must contain a memento created an {@link ExportBreakpointsOperation}.
- *
- * @param buffer the string buffer to read breakpoints from - the file should have been
- * created from an export operation
- * @param overwrite whether imported breakpoints will overwrite existing equivalent breakpoints
- * @param createWorkingSets whether breakpoint working sets should be created. Breakpoints
- * are exported with information about the breakpoint working sets they belong to. Those
- * working sets can be optionally re-created on import if they do not already exist in the
- * workspace.
- * @since 3.5
- */
- public ImportBreakpointsOperation(StringBuffer buffer, boolean overwrite, boolean createWorkingSets) {
- fBuffer = buffer;
- fOverwriteAll = overwrite;
- fCreateWorkingSets = createWorkingSets;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void run(final IProgressMonitor monitor) throws InvocationTargetException {
- SubMonitor localmonitor = SubMonitor.convert(monitor, ImportExportMessages.ImportOperation_0, 1);
- Reader reader = null;
- try {
- if (fBuffer == null) {
- reader = new InputStreamReader(new FileInputStream(fFileName), "UTF-8"); //$NON-NLS-1$
- } else {
- reader = new StringReader(fBuffer.toString());
- }
- XMLMemento memento = XMLMemento.createReadRoot(reader);
- IMemento[] nodes = memento.getChildren(IImportExportConstants.IE_NODE_BREAKPOINT);
- IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot();
- localmonitor.setWorkRemaining(nodes.length);
- Map attributes = null;
- IBreakpointImportParticipant[] participants = null;
- for(int i = 0; i < nodes.length; i++) {
- if(localmonitor.isCanceled()) {
- return;
- }
- attributes = collectBreakpointProperties(nodes[i]);
- IResource resource = workspace.findMember((String) attributes.get(IImportExportConstants.IE_NODE_PATH));
- // filter resource breakpoints that do not exist in this workspace
- if(resource != null) {
- try {
- participants = fManager.getImportParticipants((String) attributes.get(IImportExportConstants.IE_NODE_TYPE));
- }
- catch(CoreException ce) {}
- IMarker marker = findExistingMarker(attributes, participants);
- if(marker == null) {
- marker = resource.createMarker((String) attributes.get(IImportExportConstants.IE_NODE_TYPE));
- restoreBreakpoint(marker, attributes, participants);
- }
- else {
- if(fOverwriteAll) {
- marker.setAttributes(null);
- restoreBreakpoint(marker, attributes, participants);
- }
- }
- }
- fCurrentWorkingSetProperty = null;
- localmonitor.worked(1);
- }
- if(fAdded.size() > 0) {
- fManager.addBreakpoints((IBreakpoint[])fAdded.toArray(new IBreakpoint[fAdded.size()]));
- }
- }
- catch(FileNotFoundException e) {
- throw new InvocationTargetException(e,
- MessageFormat.format("Breakpoint import file not found: {0}", new String[]{fFileName})); //$NON-NLS-1$
- }
- catch (UnsupportedEncodingException e) {
- throw new InvocationTargetException(e,
- MessageFormat.format("The import file was written in non-UTF-8 encoding.", new String[]{fFileName})); //$NON-NLS-1$
- }
- catch(CoreException ce) {
- throw new InvocationTargetException(ce,
- MessageFormat.format("There was a problem importing breakpoints from: {0}", new String[] {fFileName})); //$NON-NLS-1$
- }
- finally {
- localmonitor.done();
- if(reader != null) {
- try {
- reader.close();
- }
- catch (IOException e) {
- throw new InvocationTargetException(e);
- }
- }
- }
- }
-
- /**
- * Returns a marker backing an existing breakpoint based on the given set of breakpoint attributes
- * @param attributes
- * @param participants
- * @return the marker for an existing breakpoint or <code>null</code> if one could not be located
- * @since 3.5
- */
- protected IMarker findExistingMarker(Map attributes, IBreakpointImportParticipant[] participants) {
- IBreakpoint[] bps = fManager.getBreakpoints();
- for(int i = 0; i < bps.length; i++) {
- for(int j = 0; j < participants.length; j++) {
- try {
- if(participants[j].matches(attributes, bps[i])) {
- return bps[i].getMarker();
- }
- }
- catch(CoreException ce) {}
- }
- }
- return null;
- }
-
- /**
- * Collects all of the properties for a breakpoint from the memento describing it.
- * The values in the map will be one of:
- * <ul>
- * <li>{@link String}</li>
- * <li>{@link Integer}</li>
- * <li>{@link Boolean}</li>
- * </ul>
- * @param memento
- * @return a new map of all of the breakpoint attributes from the given memento.
- * @since 3.5
- */
- protected Map collectBreakpointProperties(IMemento memento) {
- HashMap map = new HashMap();
-
- //collect attributes from the 'breakpoint' node
- map.put(IImportExportConstants.IE_BP_ENABLED, memento.getBoolean(IImportExportConstants.IE_BP_ENABLED));
- map.put(IImportExportConstants.IE_BP_PERSISTANT, memento.getBoolean(IImportExportConstants.IE_BP_PERSISTANT));
- map.put(IImportExportConstants.IE_BP_REGISTERED, memento.getBoolean(IImportExportConstants.IE_BP_REGISTERED));
-
- //collect attributes from the 'marker' node
- IMemento child = memento.getChild(IImportExportConstants.IE_NODE_MARKER);
- map.put(IImportExportConstants.IE_NODE_TYPE, child.getString(IImportExportConstants.IE_NODE_TYPE));
- map.put(IMarker.LINE_NUMBER, child.getInteger(IMarker.LINE_NUMBER));
-
- //copy all the marker attributes to the map
- IMemento[] children = child.getChildren(IImportExportConstants.IE_NODE_ATTRIB);
- for(int i = 0; i < children.length; i++) {
- readAttribute(children[i], map);
- }
-
- //collect attributes from the 'resource' node
- child = memento.getChild(IImportExportConstants.IE_NODE_RESOURCE);
- map.put(IImportExportConstants.IE_NODE_PATH, child.getString(IImportExportConstants.IE_NODE_PATH));
- return map;
- }
-
- /**
- * Collects the 'name' and 'value' key / attribute from the given memento and places it in the specified map
- * @param memento
- * @param map
- */
- private void readAttribute(IMemento memento, Map map) {
- String name = memento.getString(IImportExportConstants.IE_NODE_NAME),
- value = memento.getString(IImportExportConstants.IE_NODE_VALUE);
- if (value != null && name != null) {
- if (name.equals(IInternalDebugUIConstants.WORKING_SET_NAME)) {
- fCurrentWorkingSetProperty = value;
- }
- Object val = value;
- try {
- val = Integer.valueOf(value);
- } catch (NumberFormatException e) {
- if (value.equalsIgnoreCase("false") || value.equalsIgnoreCase("true")) { //$NON-NLS-1$ //$NON-NLS-2$
- val = Boolean.valueOf(value);
- }
- }
- if(val != null) {
- map.put(name, val);
- }
- }
- }
-
- /**
- * restores all of the attributes back into the given marker, recreates the breakpoint in the
- * breakpoint manager, and optionally recreates any working set(s) the breakpoint belongs to.
- * @param marker
- * @param attributes
- * @param participants
- * @since 3.5
- */
- protected void restoreBreakpoint(IMarker marker, final Map attributes, IBreakpointImportParticipant[] participants) {
- String key = null;
- for(Iterator iter = attributes.keySet().iterator(); iter.hasNext();) {
- key = (String) iter.next();
- try {
- marker.setAttribute(key, attributes.get(key));
- }
- catch(CoreException ce) {}
- }
- IBreakpoint breakpoint = null;
- try {
- // create the breakpoint
- breakpoint = fManager.createBreakpoint(marker);
- breakpoint.setEnabled(((Boolean)attributes.get(IImportExportConstants.IE_BP_ENABLED)).booleanValue());
- breakpoint.setPersisted(((Boolean)attributes.get(IImportExportConstants.IE_BP_PERSISTANT)).booleanValue());
- breakpoint.setRegistered(((Boolean)attributes.get(IImportExportConstants.IE_BP_REGISTERED)).booleanValue());
- fAdded.add(breakpoint);
- if (fCreateWorkingSets && fCurrentWorkingSetProperty != null) {
- String[] names = fCurrentWorkingSetProperty.split("\\" + IImportExportConstants.DELIMITER); //$NON-NLS-1$
- updateWorkingSets(names, breakpoint);
- }
- if(participants != null) {
- for(int i = 0; i < participants.length; i++) {
- participants[i].verify(breakpoint);
- }
- }
- }
- catch(CoreException ce) {
- //Something bad happened while trying to restore the breakpoint, remove it from the cached list and delete the marker
- //to ensure the manager does not hold bogus breakpoints
- if(breakpoint != null) {
- try {
- fAdded.remove(breakpoint);
- marker.delete();
- } catch (CoreException e) {}
- }
- }
- }
-
- /**
- * Updates the working sets the given breakpoint belongs to
- * @param wsnames
- * @param breakpoint
- * @since 3.5
- */
- private void updateWorkingSets(String[] wsnames, IBreakpoint breakpoint) {
- IWorkingSetManager mgr = PlatformUI.getWorkbench().getWorkingSetManager();
- IWorkingSet set = null;
- ArrayList sets = new ArrayList();
- collectContainingWorkingsets(breakpoint, sets);
- for (int i = 0; i < wsnames.length; i++) {
- if("".equals(wsnames[i])) { //$NON-NLS-1$
- continue;
- }
- set = mgr.getWorkingSet(wsnames[i]);
- if(set == null) {
- //create working set
- set = mgr.createWorkingSet(wsnames[i], new IAdaptable[] {});
- set.setId(IDebugUIConstants.BREAKPOINT_WORKINGSET_ID);
- mgr.addWorkingSet(set);
- }
- if(!sets.contains(set)) {
- IAdaptable[] elements = set.getElements();
- IAdaptable[] newElements = new IAdaptable[elements.length + 1];
- newElements[newElements.length - 1] = breakpoint;
- System.arraycopy(elements, 0, newElements, 0, elements.length);
- set.setElements(newElements);
- }
- sets.remove(set);
- }
- ArrayList items = null;
- for(Iterator iter = sets.iterator(); iter.hasNext();) {
- set = (IWorkingSet) iter.next();
- items = new ArrayList(Arrays.asList(set.getElements()));
- if(items.remove(breakpoint)) {
- set.setElements((IAdaptable[]) items.toArray(new IAdaptable[items.size()]));
- }
- }
- }
-
- /**
- * Collects all of the breakpoint working sets that contain the given {@link IBreakpoint}
- * in the given list
- *
- * @param breakpoint
- * @param collector
- * @since 3.5
- */
- private void collectContainingWorkingsets(IBreakpoint breakpoint, List collector) {
- IWorkingSetManager mgr = PlatformUI.getWorkbench().getWorkingSetManager();
- IWorkingSet[] sets = mgr.getWorkingSets();
- for (int i = 0; i < sets.length; i++) {
- if(IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(sets[i].getId()) &&
- containsBreakpoint(sets[i], breakpoint)) {
- collector.add(sets[i]);
- }
- }
- }
-
- /**
- * Method to ensure markers and breakpoints are not both added to the working set
- * @param set the set to check
- * @param breakpoint the breakpoint to check for existence
- * @return true if it is present false otherwise
- */
- private boolean containsBreakpoint(IWorkingSet set, IBreakpoint breakpoint) {
- IAdaptable[] elements = set.getElements();
- for (int i = 0; i < elements.length; i++) {
- if (elements[i].equals(breakpoint)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns the breakpoints that were imported by this operation, possibly
- * an empty list.
- *
- * @return breakpoints imported by this operation
- * @since 3.5
- */
- public IBreakpoint[] getImportedBreakpoints() {
- return (IBreakpoint[])fAdded.toArray(new IBreakpoint[fAdded.size()]);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAction.java
deleted file mode 100644
index 800be2f96..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAction.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Launches a launch configuration in a specific mode.
- * <p>
- * Clients may instantiate this class.
- * </p>
- * @since 2.1
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class LaunchAction extends Action {
-
- /**
- * The configuration to launch.
- */
- private ILaunchConfiguration fConfiguration;
- /**
- * The mode to launch in
- */
- private String fMode;
-
- /**
- * Constructs an action that launches the specified launch configuration
- * in the specified mode.
- *
- * @param configuration launch configuration
- * @param mode launch mode - one of <code>ILaunchManager.RUN_MODE</code> or
- * <code>ILaunchManager.DEBUG_MODE</code>
- */
- public LaunchAction(ILaunchConfiguration configuration, String mode) {
- fConfiguration = configuration;
- fMode = mode;
- setText(configuration.getName());
- setImageDescriptor(DebugUITools.getDefaultImageDescriptor(configuration));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(
- this,
- IDebugHelpContextIds.RELAUNCH_HISTORY_ACTION);
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- DebugUITools.launch(fConfiguration, fMode);
- }
-
- /**
- * If the user has control-clicked the launch history item, open the launch
- * configuration dialog on the launch configuration, rather than running it.
- *
- * @see org.eclipse.jface.action.IAction#runWithEvent(org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(Event event) {
- if ((event.stateMask & SWT.MOD1) > 0 && (event.stateMask & SWT.MOD2) > 0){
- ILaunchGroup[] groups = getAllGroupsForConfiguration(fConfiguration);
- if(groups.length > 0) {
- //prompt based on pref
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
- if(store.getBoolean(IInternalDebugUIConstants.PREF_REMOVE_FROM_LAUNCH_HISTORY)) {
- MessageDialogWithToggle mdwt = MessageDialogWithToggle.openYesNoQuestion(DebugUIPlugin.getShell(),
- ActionMessages.LaunchAction_0,
- MessageFormat.format(ActionMessages.LaunchAction_1, new String[] {fConfiguration.getName()}),
- ActionMessages.LaunchAction_2,
- false,
- null,
- null);
- int ret = mdwt.getReturnCode();
- if(ret == IDialogConstants.YES_ID) {
- removeFromLaunchHistories(fConfiguration, groups);
- store.setValue(IInternalDebugUIConstants.PREF_REMOVE_FROM_LAUNCH_HISTORY, !mdwt.getToggleState());
- }
- }
- else {
- removeFromLaunchHistories(fConfiguration, groups);
- }
- }
- }
- else if ((event.stateMask & SWT.MOD1) > 0) {
- ILaunchGroup group = DebugUITools.getLaunchGroup(fConfiguration, fMode);
- if(group != null) {
- DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUIPlugin.getShell(), new StructuredSelection(fConfiguration), group.getIdentifier());
- }
- else {
- run();
- }
- }
- else {
- run();
- }
- }
-
- /**
- * Removes the specified <code>ILaunchConfiguration</code> from the launch histories associated
- * with the specified listing of <code>ILaunchGroup</code>s.
- * @param config
- * @param groups
- *
- * @since 3.4
- */
- private void removeFromLaunchHistories(ILaunchConfiguration config, ILaunchGroup[] groups) {
- LaunchHistory history = null;
- for(int i = 0; i < groups.length; i++) {
- history = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchHistory(groups[i].getIdentifier());
- if(history != null) {
- history.removeFromHistory(fConfiguration);
- } else {
- DebugUIPlugin.logErrorMessage(MessageFormat.format("Unable to remove configuration [{0}] from launch history. The launch history for mode [{1}] does not exist.", new String[] {config.getName(), groups[i].getMode()})); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * Collects all of the launch groups associated with the specified <code>ILaunchConfiguration</code>
- * @param config the config to collect launch groups for
- * @return the listing of associated <code>ILaunchGroup</code>s for the specified <code>ILaunchConfiguration</code>, or
- * an empty listing, never <code>null</code>
- * @since 3.4
- */
- private ILaunchGroup[] getAllGroupsForConfiguration(ILaunchConfiguration config) {
- ArrayList list = new ArrayList();
- try {
- ILaunchConfigurationType type = config.getType();
- Set modes = type.getSupportedModeCombinations();
- String mode = null;
- ILaunchGroup group = null;
- Set modesets = null;
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- modesets = (Set) iter.next();
- if(modesets.size() == 1) {
- mode = (String) modesets.toArray()[0];
- group = DebugUITools.getLaunchGroup(config, mode);
- if(group != null && !list.contains(group)) {
- list.add(group);
- }
- }
- }
- }
- catch(CoreException ce) {}
- return (ILaunchGroup[]) list.toArray(new ILaunchGroup[list.size()]);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java
deleted file mode 100644
index f5af9d3fa..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java
+++ /dev/null
@@ -1,310 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchMode;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.LaunchShortcutAction;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchGroupExtension;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.activities.WorkbenchActivityHelper;
-
-/**
- * A cascading sub-menu that shows all launch shortcuts pertinent to a
- * launch group.
- * <p>
- * Clients may instantiate this class.
- * </p>
- * @since 2.1
- * @deprecated The use of perspective based launch shortcuts has been deprecated
- * in the 3.1 release. Instead, selection sensitive launch is supported in the top level
- * menus. Use <code>LaunchShorcutsAction</code> instead.
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class LaunchAsAction extends Action implements IMenuCreator, IWorkbenchWindowPulldownDelegate2 {
-
- /**
- * Cascading menu
- */
- private Menu fCreatedMenu;
-
- /**
- * Launch group identifier
- */
- private String fLaunchGroupIdentifier;
-
- /**
- * Presentation wrapper for this action
- */
- private IAction fAction;
-
- /**
- * Creates a cascading menu action to populate with shortcuts in the given
- * launch group.
- *
- * @param launchGroupIdentifier launch group identifier
- */
- public LaunchAsAction(String launchGroupIdentifier) {
- super();
- fLaunchGroupIdentifier = launchGroupIdentifier;
- ILaunchMode launchMode = DebugPlugin.getDefault().getLaunchManager().getLaunchMode(getMode());
- setText(launchMode.getLaunchAsLabel());
- setMenuCreator(this);
- }
-
- /**
- * Returns the launch group associated with this action.
- *
- * @return the launch group associated with this action
- */
- private LaunchGroupExtension getLaunchGroup() {
- return getLaunchConfigurationManager().getLaunchGroup(fLaunchGroupIdentifier);
- }
-
- /**
- * @see IAction#run()
- */
- public void run() {
- //do nothing, this action just creates a cascading menu.
- }
-
- private void createAction(Menu parent, IAction action, int count) {
- StringBuffer label= new StringBuffer();
- //add the numerical accelerator
- if (count < 10) {
- label.append('&');
- label.append(count);
- label.append(' ');
- }
- label.append(action.getText());
- action.setText(label.toString());
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(parent, -1);
- }
-
- /**
- * @see IMenuCreator#dispose()
- */
- public void dispose() {
- if (getCreatedMenu() != null) {
- getCreatedMenu().dispose();
- }
- }
-
- /**
- * @see IMenuCreator#getMenu(Control)
- */
- public Menu getMenu(Control parent) {
- return null;
- }
-
- /**
- * @see IMenuCreator#getMenu(Menu)
- */
- public Menu getMenu(Menu parent) {
- if (getCreatedMenu() != null) {
- getCreatedMenu().dispose();
- }
- setCreatedMenu(new Menu(parent));
- fillMenu();
- initMenu();
- return getCreatedMenu();
- }
-
- private void fillMenu() {
- //Retrieve the current perspective and the registered shortcuts
- List shortcuts = null;
- String activePerspID = getActivePerspectiveID();
- if (activePerspID != null) {
- shortcuts = getLaunchConfigurationManager().getLaunchShortcuts(activePerspID, getCategory());
- }
-
- // If NO shortcuts are listed in the current perspective, add ALL shortcuts
- // to avoid an empty cascading menu
- if (shortcuts == null || shortcuts.isEmpty()) {
- shortcuts = getLaunchConfigurationManager().getLaunchShortcuts(getCategory());
- }
-
- int menuCount = 1;
-
- Iterator iter = shortcuts.iterator();
- String mode = getMode();
- while (iter.hasNext()) {
- LaunchShortcutExtension ext = (LaunchShortcutExtension) iter.next();
- if (ext.getModes().contains(mode) && !WorkbenchActivityHelper.filterItem(ext)) {
- populateMenu(mode, ext, getCreatedMenu(), menuCount);
- menuCount++;
- }
- }
- }
-
- /**
- * Creates the menu for the action
- */
- private void initMenu() {
- // Add listener to re-populate the menu each time
- // it is shown to reflect changes in selection or active perspective
- fCreatedMenu.addMenuListener(new MenuAdapter() {
- public void menuShown(MenuEvent e) {
- Menu m = (Menu)e.widget;
- MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
- }
- fillMenu();
- }
- });
- }
-
- /**
- * Add the shortcut to the menu.
- */
- private void populateMenu(String mode, LaunchShortcutExtension ext, Menu menu, int menuCount) {
- LaunchShortcutAction action = new LaunchShortcutAction(mode, ext);
- action.setActionDefinitionId(ext.getId() + "." + mode); //$NON-NLS-1$
- String helpContextId = ext.getHelpContextId();
- if (helpContextId != null) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(action, helpContextId);
- }
- /*if (fKeyBindingService != null) {
- fKeyBindingService.registerGlobalAction(action);
- }*/
- createAction(menu, action, menuCount);
- }
-
- /**
- * Return the ID of the currently active perspective, or <code>null</code>
- * if there is none.
- */
- private String getActivePerspectiveID() {
- IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IPerspectiveDescriptor persp = page.getPerspective();
- if (persp != null) {
- return persp.getId();
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the mode of this action - run or debug
- *
- * @return the mode of this action - run or debug
- */
- private String getMode() {
- return getLaunchGroup().getMode();
- }
-
- /**
- * Returns the category of this action - possibly <code>null</code>
- *
- * @return the category of this action - possibly <code>null</code>
- */
- private String getCategory() {
- return getLaunchGroup().getCategory();
- }
-
- private Menu getCreatedMenu() {
- return fCreatedMenu;
- }
-
- private void setCreatedMenu(Menu createdMenu) {
- fCreatedMenu = createdMenu;
- }
-
- /**
- * Returns the launch configuration manager.
- *
- * @return launch configuration manager
- */
- private LaunchConfigurationManager getLaunchConfigurationManager() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
-// if (window instanceof WorkbenchWindow) {
-// fKeyBindingService= ((WorkbenchWindow)window).getKeyBindingService();
-// }
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- // do nothing - this is just a menu
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- if (fAction == null) {
- initialize(action);
- }
- }
-
- /**
- * Set the enabled state of the underlying action based on whether there are any
- * registered launch shortcuts for this launch mode.
- */
- private void initialize(IAction action) {
- fAction = action;
- action.setEnabled(existsShortcutsForMode());
- }
-
- /**
- * Return whether there are any registered launch shortcuts for
- * the mode of this action.
- *
- * @return whether there are any registered launch shortcuts for
- * the mode of this action
- */
- private boolean existsShortcutsForMode() {
- List shortcuts = getLaunchConfigurationManager().getLaunchShortcuts(getCategory());
- Iterator iter = shortcuts.iterator();
- while (iter.hasNext()) {
- LaunchShortcutExtension ext = (LaunchShortcutExtension) iter.next();
- if (ext.getModes().contains(getMode())) {
- return true;
- }
- }
- return false;
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java
deleted file mode 100644
index 620654db4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.expressions.EvaluationContext;
-import org.eclipse.core.expressions.Expression;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchMode;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.actions.LaunchConfigurationAction;
-import org.eclipse.debug.internal.ui.actions.LaunchShortcutAction;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension;
-import org.eclipse.debug.internal.ui.stringsubstitution.SelectedResourceManager;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.activities.WorkbenchActivityHelper;
-
-/**
- * A cascading sub-menu that shows all launch shortcuts pertinent to a
- * selection. This action is similar to <code>ContextualLaunchAction</code>
- * except this action is an <code>IAction</code> rather than an action
- * delegate.
- * <p>
- * This action appears in the main Run menu
- * </p>
- * <p>
- * Clients may subclass this class.
- * </p>
- * @since 3.1
- */
-public class LaunchShortcutsAction extends Action implements IMenuCreator, IWorkbenchWindowPulldownDelegate2 {
-
- /**
- * Cascading menu
- */
- private Menu fCreatedMenu;
-
- /**
- * Launch group
- */
- private ILaunchGroup fGroup;
-
- /**
- * Whether this actions enablement has been initialized
- */
- private boolean fInitialized = false;
-
- /**
- * Creates a cascading menu action to populate with shortcuts in the given
- * launch group.
- *
- * @param launchGroupIdentifier launch group identifier
- */
- public LaunchShortcutsAction(String launchGroupIdentifier) {
- super();
- fGroup = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(launchGroupIdentifier);
- ILaunchMode mode = DebugPlugin.getDefault().getLaunchManager().getLaunchMode(fGroup.getMode());
- setText(mode.getLaunchAsLabel());
- setMenuCreator(this);
- setEnabled(existsConfigTypesForMode());
- }
-
- /**
- * @see IAction#run()
- */
- public void run() {
- //do nothing, this action just creates a cascading menu.
- }
-
- /**
- * @see IMenuCreator#dispose()
- */
- public void dispose() {
- if (fCreatedMenu != null) {
- fCreatedMenu.dispose();
- }
- }
-
- /**
- * @see IMenuCreator#getMenu(Control)
- */
- public Menu getMenu(Control parent) {
- return null;
- }
-
- /**
- * @see IMenuCreator#getMenu(Menu)
- */
- public Menu getMenu(Menu parent) {
- if (fCreatedMenu != null) {
- fCreatedMenu.dispose();
- }
- fCreatedMenu = new Menu(parent);
- initMenu();
- return fCreatedMenu;
- }
-
- /**
- * @return an Evaluation context with default variable = selection
- */
- private IEvaluationContext createContext() {
- IStructuredSelection ss = SelectedResourceManager.getDefault().getCurrentSelection();
- Object o = ss.getFirstElement();
- List list = new ArrayList(0);
- if(o instanceof IEditorPart) {
- list.add(((IEditorPart)o).getEditorInput());
- }
- else {
- list.addAll(ss.toList());
- }
- IEvaluationContext context = new EvaluationContext(null, list);
- context.setAllowPluginActivation(true);
- context.addVariable("selection", list); //$NON-NLS-1$
- return context;
- }
-
- /**
- * Fills the fly-out menu
- */
- private void fillMenu() {
- IEvaluationContext context = createContext();
- int accelerator = 1;
- List allShortCuts = getLaunchConfigurationManager().getLaunchShortcuts(fGroup.getCategory());
- Iterator iter = allShortCuts.iterator();
- List filteredShortCuts = new ArrayList(10);
- while (iter.hasNext()) {
- LaunchShortcutExtension ext = (LaunchShortcutExtension) iter.next();
- try {
- if (!WorkbenchActivityHelper.filterItem(ext) && isApplicable(ext, context)) {
- filteredShortCuts.add(ext);
- }
- } catch (CoreException e) {/*not supported*/}
- }
- //first add the launch config if it is one
- String mode = getMode();
- try {
- ILaunchConfiguration config = getLaunchConfigurationManager().isSharedConfig(getSelection(context));
- if(config != null && config.exists() && config.supportsMode(mode)) {
- IAction action = new LaunchConfigurationAction(config, mode, config.getName(), DebugUITools.getDefaultImageDescriptor(config), accelerator++);
- ActionContributionItem item = new ActionContributionItem(action);
- item.fill(fCreatedMenu, -1);
- if(!filteredShortCuts.isEmpty()) {
- new MenuItem(fCreatedMenu, SWT.SEPARATOR);
- }
- }
- }
- catch(CoreException ce) {DebugUIPlugin.log(ce);}
- //second add the launch shortcuts if any
- iter = filteredShortCuts.iterator();
- while (iter.hasNext()) {
- LaunchShortcutExtension ext = (LaunchShortcutExtension) iter.next();
- Set modes = ext.getModes(); // supported launch modes
- Iterator modeIter = modes.iterator();
- while (modeIter.hasNext()) {
- String modee = (String) modeIter.next();
- if (modee.equals(mode)) {
- populateMenuItem(modee, ext, fCreatedMenu, accelerator++);
- }
- }
- }
- if (accelerator == 1) {
- // No shortcuts added. Add "none available" action.
- IAction action= new Action(ActionMessages.LaunchShortcutsAction_1) {};
- action.setEnabled(false);
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(fCreatedMenu, -1);
- }
- }
-
- /**
- * Returns the first element of the current selection
- * @param context the current evaluation context
- * @return the first item in the selection, or <code>null</code> if none
- * @since 3.3
- */
- private Object getSelection(IEvaluationContext context) {
- List list = (List) context.getVariable("selection"); //$NON-NLS-1$
- return (list.isEmpty() ? null : list.get(0));
- }
-
- /**
- * Add the shortcut to the context menu's launch sub-menu.
- */
- private void populateMenuItem(String mode, LaunchShortcutExtension ext, Menu menu, int accelerator) {
- LaunchShortcutAction action = new LaunchShortcutAction(mode, ext);
- action.setActionDefinitionId(ext.getId() + "." + mode); //$NON-NLS-1$
- String helpContextId = ext.getHelpContextId();
- if (helpContextId != null) {
- PlatformUI.getWorkbench().getHelpSystem().setHelp(action, helpContextId);
- }
- StringBuffer label= new StringBuffer();
- if (accelerator >= 0 && accelerator < 10) {
- //add the numerical accelerator
- label.append('&');
- label.append(accelerator);
- label.append(' ');
- }
- String contextLabel= ext.getContextLabel(mode);
- // replace default action label with context label if specified.
- label.append((contextLabel != null) ? contextLabel : action.getText());
- action.setText(label.toString());
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(menu, -1);
- }
-
- /**
- * Evaluate the enablement logic in the contextualLaunch
- * element description. A true result means that we should
- * include this shortcut in the context menu.
- * @return true iff shortcut should appear in context menu
- */
- private boolean isApplicable(LaunchShortcutExtension ext, IEvaluationContext context) throws CoreException {
- Expression expr = ext.getContextualLaunchEnablementExpression();
- return ext.evalEnablementExpression(context, expr);
- }
-
- /**
- * Creates the menu for the action
- */
- private void initMenu() {
- // Add listener to re-populate the menu each time
- // it is shown to reflect changes in selection or active perspective
- fCreatedMenu.addMenuListener(new MenuAdapter() {
- public void menuShown(MenuEvent e) {
- Menu m = (Menu)e.widget;
- MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
- }
- fillMenu();
- }
- });
- }
-
- /**
- * Returns the mode of this action - run or debug
- *
- * @return the mode of this action - run or debug
- */
- protected String getMode() {
- return fGroup.getMode();
- }
-
- /**
- * Returns the launch configuration manager.
- *
- * @return launch configuration manager
- */
- private LaunchConfigurationManager getLaunchConfigurationManager() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {}
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- // do nothing - this is just a menu
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- if (!fInitialized) {
- action.setEnabled(existsConfigTypesForMode());
- fInitialized = true;
- }
- }
-
- /**
- * Return whether there are any registered launch configuration types for
- * the mode of this action.
- *
- * @return whether there are any registered launch configuration types for
- * the mode of this action
- */
- private boolean existsConfigTypesForMode() {
- ILaunchConfigurationType[] configTypes = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes();
- for (int i = 0; i < configTypes.length; i++) {
- ILaunchConfigurationType configType = configTypes[i];
- if (configType.supportsMode(getMode())) {
- return true;
- }
- }
- return false;
- }
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java
deleted file mode 100644
index 7f97c39cb..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.ILaunchGroup;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.eclipse.ui.PlatformUI;
-
-import com.ibm.icu.text.MessageFormat;
-
-/**
- * Opens the launch configuration dialog in the context of a launch group.
- * <p>
- * Clients may instantiate this class.
- * </p>
- * @since 2.1
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class OpenLaunchDialogAction extends Action implements IActionDelegate2, IWorkbenchWindowActionDelegate {
-
- /**
- * Launch group identifier
- */
- private String fIdentifier;
-
- /**
- * Constructs an action that opens the launch configuration dialog in
- * the context of the specified launch group.
- *
- * @param identifier unique identifier of a launch group extension
- */
- public OpenLaunchDialogAction(String identifier) {
- fIdentifier = identifier;
- ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(fIdentifier);
- if(group != null) {
- String lbl = group.getLabel();
- String actionLabel = MessageFormat.format(ActionMessages.OpenLaunchDialogAction_1, new String[] {lbl});
- setText(DebugUIPlugin.adjustDBCSAccelerator(actionLabel));
- }
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.OPEN_LAUNCH_CONFIGURATION_ACTION);
- }
-
- /**
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- LaunchHistory history = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchHistory(fIdentifier);
- ILaunchConfiguration configuration = history.getRecentLaunch();
- IStructuredSelection selection = null;
- if (configuration == null) {
- selection = new StructuredSelection();
- } else {
- selection = new StructuredSelection(configuration);
- }
- int result = DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUIPlugin.getShell(), selection, fIdentifier);
- notifyResult(result == Window.OK);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- run();
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {}
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- if(action != null) {
- action.setEnabled(existsConfigTypesForMode());
- }
- }
-
- /**
- * Return whether there are any registered launch configuration types for
- * the mode of this action.
- *
- * @return whether there are any registered launch configuration types for
- * the mode of this action
- */
- private boolean existsConfigTypesForMode() {
- ILaunchConfigurationType[] configTypes = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes();
- for (int i = 0; i < configTypes.length; i++) {
- ILaunchConfigurationType configType = configTypes[i];
- if (configType.supportsMode(getMode())) {
- return true;
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {}
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {}
-
- /**
- * Returns the launch mode for this action.
- *
- * @return launch mode
- */
- private String getMode() {
- return DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(fIdentifier).getMode();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointAction.java
deleted file mode 100644
index 62ab35d21..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointAction.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.IVerticalRulerInfo;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.SimpleMarkerAnnotation;
-
-/**
- * Abstract action that works on breakpoints in the vertical ruler.
- * <p>
- * This class may be subclassed.
- * </p>
- * @since 3.2
- */
-public abstract class RulerBreakpointAction extends Action {
-
- private ITextEditor fEditor;
- private IVerticalRulerInfo fRulerInfo;
-
- /**
- * Constructs an action to work on breakpoints in the specified
- * text editor with the specified vertical ruler information.
- *
- * @param editor text editor
- * @param info vertical ruler information
- */
- public RulerBreakpointAction(ITextEditor editor, IVerticalRulerInfo info) {
- fEditor = editor;
- fRulerInfo = info;
- }
-
- /**
- * Returns the breakpoint at the last line of mouse activity in the ruler
- * or <code>null</code> if none.
- *
- * @return breakpoint associated with activity in the ruler or <code>null</code>
- */
- protected IBreakpoint getBreakpoint() {
- IAnnotationModel annotationModel = fEditor.getDocumentProvider().getAnnotationModel(fEditor.getEditorInput());
- IDocument document = fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput());
- if (annotationModel != null) {
- Iterator iterator = annotationModel.getAnnotationIterator();
- while (iterator.hasNext()) {
- Object object = iterator.next();
- if (object instanceof SimpleMarkerAnnotation) {
- SimpleMarkerAnnotation markerAnnotation = (SimpleMarkerAnnotation) object;
- IMarker marker = markerAnnotation.getMarker();
- try {
- if (marker.isSubtypeOf(IBreakpoint.BREAKPOINT_MARKER)) {
- Position position = annotationModel.getPosition(markerAnnotation);
- int line = document.getLineOfOffset(position.getOffset());
- if (line == fRulerInfo.getLineOfLastMouseButtonActivity()) {
- IBreakpoint breakpoint = DebugPlugin.getDefault().getBreakpointManager().getBreakpoint(marker);
- if (breakpoint != null) {
- return breakpoint;
- }
- }
- }
- } catch (CoreException e) {
- } catch (BadLocationException e) {
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the editor this action was created for.
- *
- * @return editor
- */
- protected ITextEditor getEditor() {
- return fEditor;
- }
-
- /**
- * Returns the vertical ruler information this action was created for.
- *
- * @return vertical ruler information
- */
- protected IVerticalRulerInfo getVerticalRulerInfo() {
- return fRulerInfo;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java
deleted file mode 100644
index f3fa71d6a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - adapted action to use for breakpoint types
-******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.debug.internal.ui.actions.ToggleBreakpointsTargetManager;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.text.source.IVerticalRulerInfo;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorExtension;
-
-/**
- * Breakpoint ruler pop-up action that creates a sub-menu to select the currently
- * active breakpoint type. This action delegate can be contributed to an editor
- * with the <code>editorActions</code> extension point. The breakpoint types are
- * calculated based on the toggle breakpoint target factories contributed through
- * the <code>toggleBreakpointsTargetFactories</code> extension point.
- * <p>
- * Following is example plug-in XML used to contribute this action to an editor's
- * vertical ruler context menu. It uses the <code>popupMenus</code> extension
- * point, by referencing the ruler's context menu identifier in the
- * <code>targetID</code> attribute.
- * <pre>
- * &lt;extension point="org.eclipse.ui.popupMenus"&gt;
- * &lt;viewerContribution
- * targetID="example.rulerContextMenuId"
- * id="example.RulerPopupActions"&gt;
- * &lt;action
- * label="Toggle Breakpoint"
- * class="org.eclipse.debug.ui.actions.RulerBreakpointTypesActionDelegate"
- * menubarPath="additions"
- * id="example.rulerContextMenu.breakpointTypesAction"&gt;
- * &lt;/action&gt;
- * &lt;/viewerContribution&gt;
- * </pre>
- * </p>
- * <p>
- * Clients may refer to this class as an action delegate in plug-in XML. This class
- * is not intended to be subclassed.
- * </p>
- * @see ToggleBreakpointsTargetManager
- * @see IToggleBreakpointsTargetFactory
- * @noextend This class is not intended to be subclassed by clients.
- * @since 3.5
- *
- */
-public class RulerBreakpointTypesActionDelegate implements IEditorActionDelegate, IMenuListener, IMenuCreator {
- private ITextEditor fEditor = null;
- private IAction fCallerAction = null;
- private IVerticalRulerInfo fRulerInfo;
- private ISelection fSelection;
-
- /**
- * The menu created by this action
- */
- private Menu fMenu;
-
- private class SelectTargetAction extends Action {
- private final Set fPossibleIDs;
- private final String fID;
- SelectTargetAction(String name, Set possibleIDs, String ID) {
- super(name, AS_RADIO_BUTTON);
- fID = ID;
- fPossibleIDs = possibleIDs;
- }
-
- public void run() {
- if (isChecked()) {
- ToggleBreakpointsTargetManager.getDefault().setPreferredTarget(fPossibleIDs, fID);
- }
- }
- }
-
-
- public void selectionChanged(IAction action, ISelection selection) {
- // In the editor we're not using the selection.
- }
-
- public void run(IAction action) {
- // Do nothing, this is a pull-down menu.
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart)
- */
- public void setActiveEditor(IAction callerAction, IEditorPart targetEditor) {
- // Clean up old editor data.
- if (fCallerAction != null) {
- fCallerAction.setMenuCreator(null);
- }
- if (fEditor instanceof ITextEditorExtension) {
- ((ITextEditorExtension) fEditor).removeRulerContextMenuListener(this);
- }
- fRulerInfo = null;
-
- // Set up new editor data.
- fCallerAction = callerAction;
- fCallerAction.setMenuCreator(this);
-
- fEditor= (ITextEditor)(targetEditor == null ? null : targetEditor.getAdapter(ITextEditor.class));
-
- if (fEditor != null) {
- if (fEditor instanceof ITextEditorExtension) {
- ((ITextEditorExtension) fEditor).addRulerContextMenuListener(this);
- }
-
- fRulerInfo= (IVerticalRulerInfo) fEditor.getAdapter(IVerticalRulerInfo.class);
- }
-
- }
-
- public void dispose() {
- if (fCallerAction != null) {
- fCallerAction.setMenuCreator(null);
- }
- if (fEditor instanceof ITextEditorExtension) {
- ((ITextEditorExtension) fEditor).removeRulerContextMenuListener(this);
- }
- fRulerInfo = null;
- }
-
- public void menuAboutToShow(IMenuManager manager) {
- fSelection = StructuredSelection.EMPTY;
- if (fEditor != null && fRulerInfo != null) {
-
- IDocumentProvider provider = fEditor.getDocumentProvider();
- if (provider != null) {
- IDocument document = provider.getDocument(fEditor.getEditorInput());
- int line = fRulerInfo.getLineOfLastMouseButtonActivity();
- if (line > -1) {
- try {
- IRegion region = document.getLineInformation(line);
- fSelection = new TextSelection(document, region.getOffset(), 0);
- } catch (BadLocationException e) {}
- }
- }
- ToggleBreakpointsTargetManager toggleTargetManager = ToggleBreakpointsTargetManager.getDefault();
- Set enabledIDs = toggleTargetManager.getEnabledToggleBreakpointsTargetIDs(fEditor, fSelection);
- fCallerAction.setEnabled(enabledIDs.size() > 0);
- } else {
- fCallerAction.setEnabled(false);
- }
-
- }
-
- /**
- * Sets this action's drop-down menu, disposing the previous menu.
- *
- * @param menu the new menu
- */
- private void setMenu(Menu menu) {
- if (fMenu != null) {
- fMenu.dispose();
- }
- fMenu = menu;
- }
-
- public Menu getMenu(Menu parent) {
- setMenu(new Menu(parent));
- fillMenu(fMenu);
- initMenu();
- return fMenu;
- }
-
- public Menu getMenu(Control parent) {
- setMenu(new Menu(parent));
- fillMenu(fMenu);
- initMenu();
- return fMenu;
- }
-
- /**
- * Fills the drop-down menu with enabled toggle breakpoint targets
- *
- * @param menu the menu to fill
- */
- private void fillMenu(Menu menu) {
- ToggleBreakpointsTargetManager manager = ToggleBreakpointsTargetManager.getDefault();
- Set enabledIDs = manager.getEnabledToggleBreakpointsTargetIDs(fEditor, fSelection);
- String preferredId = manager.getPreferredToggleBreakpointsTargetID(fEditor, fSelection);
-
- for (Iterator itr = enabledIDs.iterator(); itr.hasNext();) {
- String id = (String)itr.next();
- SelectTargetAction action= new SelectTargetAction(manager.getToggleBreakpointsTargetName(id), enabledIDs, id);
-
- if (id.equals(preferredId)){
- action.setChecked(true);
- }
-
- ActionContributionItem item= new ActionContributionItem(action);
- item.fill(menu, -1);
- }
- }
-
- /**
- * Creates the menu for the action
- */
- private void initMenu() {
- // Add listener to re-populate the menu each time
- // it is shown because of dynamic history list
- fMenu.addMenuListener(new MenuAdapter() {
- public void menuShown(MenuEvent e) {
- Menu m = (Menu)e.widget;
- MenuItem[] items = m.getItems();
- for (int i=0; i < items.length; i++) {
- items[i].dispose();
- }
- fillMenu(m);
- }
- });
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerEnableDisableBreakpointActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerEnableDisableBreakpointActionDelegate.java
deleted file mode 100644
index 0b17e2a89..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerEnableDisableBreakpointActionDelegate.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.debug.internal.ui.actions.breakpoints.RulerEnableDisableBreakpointAction;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.source.IVerticalRulerInfo;
-import org.eclipse.ui.texteditor.AbstractRulerActionDelegate;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * Toggles enablement of a breakpoint in a vertical ruler.
- * This action can be contributed to a vertical ruler context menu via the
- * <code>popupMenus</code> extension point, by referencing the ruler's context
- * menu identifier in the <code>targetID</code> attribute.
- * <pre>
- * &lt;extension point="org.eclipse.ui.popupMenus"&gt;
- * &lt;viewerContribution
- * targetID="example.rulerContextMenuId"
- * id="example.RulerPopupActions"&gt;
- * &lt;action
- * label="Enable Breakpoint"
- * class="org.eclipse.debug.ui.actions.RulerEnableDisableBreakpointActionDelegate"
- * menubarPath="additions"
- * id="example.rulerContextMenu.toggleBreakpointAction"&gt;
- * &lt;/action&gt;
- * &lt;/viewerContribution&gt;
- * </pre>
- * </p>
- * <p>
- * Clients may refer to this class as an action delegate in plug-in XML.
- * </p>
- * @since 3.2
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- *
- */
-public class RulerEnableDisableBreakpointActionDelegate extends AbstractRulerActionDelegate {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.AbstractRulerActionDelegate#createAction(org.eclipse.ui.texteditor.ITextEditor, org.eclipse.jface.text.source.IVerticalRulerInfo)
- */
- protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
- return new RulerEnableDisableBreakpointAction(editor, rulerInfo);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerToggleBreakpointActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerToggleBreakpointActionDelegate.java
deleted file mode 100644
index 54380ed3a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerToggleBreakpointActionDelegate.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.swt.widgets.Event;
-
-import org.eclipse.jface.action.IAction;
-
-import org.eclipse.jface.text.source.IVerticalRulerInfo;
-
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.texteditor.AbstractRulerActionDelegate;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * Toggles a breakpoint when ruler is double-clicked. This action delegate can be
- * contributed to an editor with the <code>editorActions</code> extension point.
- * This action is as a factory that creates another action that performs the
- * actual breakpoint toggling. The created action acts on the editor's
- * <code>IToggleBreakpointsTagret</code> to toggle breakpoints.
- * <p>
- * Following is example plug-in XML used to contribute this action to an editor.
- * Note that the label attribute of this action is not displayed in the editor.
- * Instead, the label of the created action is displayed.
- * <pre>
- * &lt;extension point="org.eclipse.ui.editorActions"&gt;
- * &lt;editorContribution
- * targetID="example.editor"
- * id="example.rulerActions"&gt;
- * &lt;action
- * label="Not Used"
- * class="org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate"
- * style="push"
- * actionID="RulerDoubleClick"
- * id="example.doubleClickBreakpointAction"/&gt;
- * &lt;/editorContribution&gt;
- * &lt;/extension&gt;
- * </pre>
- * </p>
- * <p>
- * This action can also be contributed to a vertical ruler context menu via the
- * <code>popupMenus</code> extension point, by referencing the ruler's context
- * menu identifier in the <code>targetID</code> attribute.
- * <pre>
- * &lt;extension point="org.eclipse.ui.popupMenus"&gt;
- * &lt;viewerContribution
- * targetID="example.rulerContextMenuId"
- * id="example.RulerPopupActions"&gt;
- * &lt;action
- * label="Toggle Breakpoint"
- * class="org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate"
- * menubarPath="additions"
- * id="example.rulerContextMenu.toggleBreakpointAction"&gt;
- * &lt;/action&gt;
- * &lt;/viewerContribution&gt;
- * </pre>
- * </p>
- * <p>
- * Clients may refer to this class as an action delegate in plug-in XML.
- * </p>
- * @since 3.1
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- */
-public class RulerToggleBreakpointActionDelegate extends AbstractRulerActionDelegate implements IActionDelegate2 {
-
- private IEditorPart fEditor = null;
- private ToggleBreakpointAction fDelegate = null;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.AbstractRulerActionDelegate#createAction(org.eclipse.ui.texteditor.ITextEditor, org.eclipse.jface.text.source.IVerticalRulerInfo)
- */
- protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
- fDelegate = new ToggleBreakpointAction(editor, null, rulerInfo);
- return fDelegate;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart)
- */
- public void setActiveEditor(IAction callerAction, IEditorPart targetEditor) {
- if (fEditor != null) {
- if (fDelegate != null) {
- fDelegate.dispose();
- fDelegate = null;
- }
- }
- fEditor = targetEditor;
- super.setActiveEditor(callerAction, targetEditor);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#dispose()
- */
- public void dispose() {
- if (fDelegate != null) {
- fDelegate.dispose();
- }
- fDelegate = null;
- fEditor = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunAction.java
deleted file mode 100644
index 32145272f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunAction.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.internal.ui.actions.ExecutionAction;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Action to launch the last launch configuration that was successfully
- * launched, in run mode. If no configurations have been launched, the launch
- * configuration dialog is opened.
- * </p>
- * <p>
- * This class may be instantiated.
- * </p>
- * @since 2.0
- */
-public final class RunAction extends ExecutionAction {
-
- public RunAction() {
- super(IDebugUIConstants.ID_RUN_LAUNCH_GROUP);
- }
-
- /**
- * @see ExecutionAction#getMode()
- */
- protected String getMode() {
- return ILaunchManager.RUN_MODE;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java
deleted file mode 100644
index c08b0ad4d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Mikhail Khodjaiants (QNX) - https://bugs.eclipse.org/bugs/show_bug.cgi?id=83464
- * Wind River - Pawel Piech - Added use of adapters to support non-standard models (bug 213074)
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdapterManager;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.ISuspendResume;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.contexts.DebugContextEvent;
-import org.eclipse.debug.ui.contexts.IDebugContextListener;
-import org.eclipse.debug.ui.contexts.IDebugContextManager;
-import org.eclipse.debug.ui.contexts.IDebugContextService;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IActionDelegate2;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * A run to line action that can be contributed to a an editor or view. The action
- * will perform the "run to line" operation for parts that provide
- * an appropriate <code>IRunToLineTarget</code> adapter.
- * <p>
- * Clients may reference/contribute this class as an action delegate
- * in plug-in XML.
- * </p>
- * <p>
- * Since 3.1, this action also implements {@link org.eclipse.ui.IViewActionDelegate}.
- * </p>
- * @since 3.0
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- */
-public class RunToLineActionDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate {
-
- private IWorkbenchPart fActivePart = null;
- private IRunToLineTarget fPartTarget = null;
- private IAction fAction = null;
- private DebugContextListener fContextListener = new DebugContextListener();
- private ISuspendResume fTargetElement = null;
-
- class DebugContextListener implements IDebugContextListener {
-
- protected void contextActivated(ISelection selection) {
- fTargetElement = null;
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection) selection;
- if (ss.size() == 1) {
- fTargetElement = (ISuspendResume)
- DebugPlugin.getAdapter(ss.getFirstElement(), ISuspendResume.class);
- }
- }
- update();
- }
-
- public void debugContextChanged(DebugContextEvent event) {
- contextActivated(event.getContext());
- }
-
- }
-
- /*(non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#dispose()
- */
- public void dispose() {
- DebugUITools.getDebugContextManager().getContextService(fActivePart.getSite().getWorkbenchWindow()).removeDebugContextListener(fContextListener);
- fActivePart = null;
- fPartTarget = null;
-
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- if (fPartTarget != null && fTargetElement != null) {
- try {
- fPartTarget.runToLine(fActivePart, fActivePart.getSite().getSelectionProvider().getSelection(), fTargetElement);
- } catch (CoreException e) {
- DebugUIPlugin.errorDialog(fActivePart.getSite().getWorkbenchWindow().getShell(), ActionMessages.RunToLineAction_0, ActionMessages.RunToLineAction_1, e.getStatus()); //
- }
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- this.fAction = action;
- update();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
- public void update() {
- if (fAction == null) {
- return;
- }
- Runnable r = new Runnable() {
- public void run() {
- boolean enabled = false;
- if (fPartTarget != null && fTargetElement != null) {
- IWorkbenchPartSite site = fActivePart.getSite();
- if (site != null) {
- ISelectionProvider selectionProvider = site.getSelectionProvider();
- if (selectionProvider != null) {
- ISelection selection = selectionProvider.getSelection();
- enabled = fTargetElement.isSuspended() && fPartTarget.canRunToLine(fActivePart, selection, fTargetElement);
- }
- }
- }
- fAction.setEnabled(enabled);
- }
- };
- DebugUIPlugin.getStandardDisplay().asyncExec(r);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
- */
- public void init(IAction action) {
- this.fAction = action;
- if (action != null) {
- action.setText(ActionMessages.RunToLineActionDelegate_4);
- action.setImageDescriptor(DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_RUN_TO_LINE));
- action.setDisabledImageDescriptor(DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_RUN_TO_LINE));
- }
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
- */
- public void runWithEvent(IAction action, Event event) {
- run(action);
- }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart)
- */
- public void setActiveEditor(IAction action, IEditorPart targetEditor) {
- init(action);
- bindTo(targetEditor);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
- */
- public void init(IViewPart view) {
- bindTo(view);
- }
-
- /**
- * Binds this action to operate on the given part's run to line adapter.
- *
- * @param part
- */
- private void bindTo(IWorkbenchPart part) {
- IDebugContextManager manager = DebugUITools.getDebugContextManager();
- if (fActivePart != null && !fActivePart.equals(part)) {
- manager.getContextService(fActivePart.getSite().getWorkbenchWindow()).removeDebugContextListener(fContextListener);
- }
- fPartTarget = null;
- fActivePart = part;
- if (part != null) {
- IWorkbenchWindow workbenchWindow = part.getSite().getWorkbenchWindow();
- IDebugContextService service = manager.getContextService(workbenchWindow);
- service.addDebugContextListener(fContextListener);
- fPartTarget = (IRunToLineTarget) part.getAdapter(IRunToLineTarget.class);
- if (fPartTarget == null) {
- IAdapterManager adapterManager = Platform.getAdapterManager();
- // TODO: we could restrict loading to cases when the debugging context is on
- if (adapterManager.hasAdapter(part, IRunToLineTarget.class.getName())) {
- fPartTarget = (IRunToLineTarget) adapterManager.loadAdapter(part, IRunToLineTarget.class.getName());
- }
- }
- ISelection activeContext = service.getActiveContext();
- fContextListener.contextActivated(activeContext);
- }
- update();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java
deleted file mode 100644
index d0d5dd1e4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugEvent;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.IBreakpointManagerListener;
-import org.eclipse.debug.core.IDebugEventSetListener;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.ISuspendResume;
-import org.eclipse.debug.core.model.IThread;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Handles a run to line operation. Clients implementing a run to line action
- * can use this handler to carry out a run to line operation implemented with
- * a breakpoint. Handles the user preference to skip breakpoints while performing
- * a run to line operation, and cancelling the run to line operation if another
- * breakpoint is encountered before the operation is completed.
- * <p>
- * Clients may instantiate this class.
- * </p>
- * @since 3.1
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class RunToLineHandler implements IDebugEventSetListener, IBreakpointManagerListener, IWorkspaceRunnable {
-
- private IDebugTarget fTarget;
- private ISuspendResume fResumee;
- private IBreakpoint fBreakpoint;
- private boolean fAutoSkip = false;
-
- /**
- * Constructs a handler to perform a run to line operation.
- *
- * @param target the debug target in which the operation is to be performed
- * @param suspendResume the element to be resumed to begin the operation
- * @param breakpoint the run to line breakpoint
- */
- public RunToLineHandler(IDebugTarget target, ISuspendResume suspendResume, IBreakpoint breakpoint) {
- fResumee = suspendResume;
- fTarget = target;
- fBreakpoint = breakpoint;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
- */
- public void handleDebugEvents(DebugEvent[] events) {
- for (int i = 0; i < events.length; i++) {
- DebugEvent event= events[i];
- Object source= event.getSource();
- if (source instanceof IThread && event.getKind() == DebugEvent.SUSPEND &&
- event.getDetail() == DebugEvent.BREAKPOINT) {
- IThread thread = (IThread) source;
- IDebugTarget suspendee = (IDebugTarget) thread.getAdapter(IDebugTarget.class);
- if (fTarget.equals(suspendee)) {
- // cleanup if the breakpoint was hit or not
- cancel();
- }
- } else if (source instanceof IDebugTarget && event.getKind() == DebugEvent.TERMINATE) {
- if (source.equals(fTarget)) {
- // Clean up if the debug target terminates without
- // hitting the breakpoint.
- cancel();
- }
- }
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IBreakpointManagerListener#breakpointManagerEnablementChanged(boolean)
- */
- public void breakpointManagerEnablementChanged(boolean enabled) {
- // if the user changes the breakpoint manager enablement, don't restore it
- fAutoSkip = false;
- }
-
- private IBreakpointManager getBreakpointManager() {
- return getDebugPlugin().getBreakpointManager();
- }
-
- private DebugPlugin getDebugPlugin() {
- return DebugPlugin.getDefault();
- }
-
- /**
- * Cancels the run to line operation.
- */
- public void cancel() {
- IBreakpointManager manager = getBreakpointManager();
- try {
- getDebugPlugin().removeDebugEventListener(this);
- manager.removeBreakpointManagerListener(this);
- fTarget.breakpointRemoved(fBreakpoint, null);
- } finally {
- if (fAutoSkip) {
- manager.setEnabled(true);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void run(IProgressMonitor monitor) throws CoreException {
- getDebugPlugin().addDebugEventListener(this);
- IBreakpointManager breakpointManager = getBreakpointManager();
- fAutoSkip = DebugUITools.getPreferenceStore().getBoolean(IDebugUIConstants.PREF_SKIP_BREAKPOINTS_DURING_RUN_TO_LINE) && breakpointManager.isEnabled();
- if (fAutoSkip) {
- getBreakpointManager().setEnabled(false);
- breakpointManager.addBreakpointManagerListener(this);
- }
- Job job = new Job(ActionMessages.RunToLineHandler_0) {
- protected IStatus run(IProgressMonitor jobMonitor) {
- if (!jobMonitor.isCanceled()) {
- fTarget.breakpointAdded(fBreakpoint);
- try {
- fResumee.resume();
- } catch (DebugException e) {
- cancel();
- return e.getStatus();
- }
- }
- return Status.OK_STATUS;
- }
- };
- job.schedule();
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java
deleted file mode 100644
index d67ffa51f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River Systems - added support for IToggleBreakpointsTargetFactory
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.actions.IToggleBreakpointsTargetManagerListener;
-import org.eclipse.debug.internal.ui.actions.ToggleBreakpointsTargetManager;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.text.source.IVerticalRulerInfo;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.IUpdate;
-
-/**
- * Action to toggle a breakpoint in a vertical ruler of a workbench part
- * containing a document. The part must provide an <code>IToggleBreakpointsTarget</code>
- * adapter which may optionally be an instance of an
- * <code>IToggleBreakpointsTargetExtension</code>.
- * <p>
- * Clients may instantiate this class.
- * </p>
- * @since 3.1
- * @see org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class ToggleBreakpointAction extends Action implements IUpdate {
-
- private IWorkbenchPart fPart;
- private IDocument fDocument;
- private IVerticalRulerInfo fRulerInfo;
- private IToggleBreakpointsTargetManagerListener fListener = new IToggleBreakpointsTargetManagerListener() {
- public void preferredTargetsChanged() {
- update();
- }
- };
-
- /**
- * Constructs a new action to toggle a breakpoint in the given
- * part containing the given document and ruler.
- *
- * @param part the part in which to toggle the breakpoint - provides
- * an <code>IToggleBreakpointsTarget</code> adapter
- * @param document the document breakpoints are being set in or
- * <code>null</code> when the document should be derived from the
- * given part
- * @param rulerInfo specifies location the user has double-clicked
- */
- public ToggleBreakpointAction(IWorkbenchPart part, IDocument document, IVerticalRulerInfo rulerInfo) {
- super(ActionMessages.ToggleBreakpointAction_0);
- fPart = part;
- fDocument = document;
- fRulerInfo = rulerInfo;
- ToggleBreakpointsTargetManager.getDefault().addChangedListener(fListener);
- }
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- IDocument document= getDocument();
- if (document == null) {
- return;
- }
-
- int line = fRulerInfo.getLineOfLastMouseButtonActivity();
-
- // Test if line is valid
- if (line == -1)
- return;
-
- try {
- ITextSelection selection = getTextSelection(document, line);
- IToggleBreakpointsTarget toggleTarget =
- ToggleBreakpointsTargetManager.getDefault().getToggleBreakpointsTarget(fPart, selection);
- if (toggleTarget == null) {
- return;
- }
-
- if (toggleTarget instanceof IToggleBreakpointsTargetExtension) {
- IToggleBreakpointsTargetExtension extension = (IToggleBreakpointsTargetExtension) toggleTarget;
- if (extension.canToggleBreakpoints(fPart, selection)) {
- extension.toggleBreakpoints(fPart, selection);
- return;
- }
- }
- if (toggleTarget.canToggleLineBreakpoints(fPart, selection)) {
- toggleTarget.toggleLineBreakpoints(fPart, selection);
- } else if (toggleTarget.canToggleWatchpoints(fPart, selection)) {
- toggleTarget.toggleWatchpoints(fPart, selection);
- } else if (toggleTarget.canToggleMethodBreakpoints(fPart, selection)) {
- toggleTarget.toggleMethodBreakpoints(fPart, selection);
- }
- } catch (BadLocationException e) {
- reportException(e);
- } catch (CoreException e) {
- reportException(e);
- }
- }
-
- /**
- * Report an error to the user.
- *
- * @param e underlying exception
- */
- private void reportException(Exception e) {
- DebugUIPlugin.errorDialog(fPart.getSite().getShell(), ActionMessages.ToggleBreakpointAction_1, ActionMessages.ToggleBreakpointAction_2, e); //
- }
-
- /**
- * Disposes this action. Clients must call this method when
- * this action is no longer needed.
- */
- public void dispose() {
- fDocument = null;
- fPart = null;
- fRulerInfo = null;
- ToggleBreakpointsTargetManager.getDefault().removeChangedListener(fListener);
- }
-
- /**
- * Returns the document on which this action operates.
- *
- * @return the document or <code>null</code> if none
- */
- private IDocument getDocument() {
- if (fDocument != null)
- return fDocument;
-
- if (fPart instanceof ITextEditor) {
- ITextEditor editor= (ITextEditor)fPart;
- IDocumentProvider provider = editor.getDocumentProvider();
- if (provider != null)
- return provider.getDocument(editor.getEditorInput());
- }
-
- IDocument doc = (IDocument) fPart.getAdapter(IDocument.class);
- if (doc != null) {
- return doc;
- }
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.texteditor.IUpdate#update()
- */
- public void update() {
- IDocument document= getDocument();
- if (document != null) {
- int line = fRulerInfo.getLineOfLastMouseButtonActivity();
- if (line > -1) {
- try {
- ITextSelection selection = getTextSelection(document, line);
-
- IToggleBreakpointsTarget adapter =
- ToggleBreakpointsTargetManager.getDefault().getToggleBreakpointsTarget(fPart, selection);
- if (adapter == null) {
- setEnabled(false);
- return;
- }
- if (adapter instanceof IToggleBreakpointsTargetExtension) {
- IToggleBreakpointsTargetExtension extension = (IToggleBreakpointsTargetExtension) adapter;
- if (extension.canToggleBreakpoints(fPart, selection)) {
- setEnabled(true);
- return;
- }
- }
- if (adapter.canToggleLineBreakpoints(fPart, selection) ||
- adapter.canToggleWatchpoints(fPart, selection) ||
- adapter.canToggleMethodBreakpoints(fPart, selection))
- {
- setEnabled(true);
- return;
- }
- } catch (BadLocationException e) {
- reportException(e);
- }
- }
- }
- setEnabled(false);
- }
-
- /**
- * Determines the text selection for the breakpoint action. If clicking on the ruler inside
- * the highlighted text, return the text selection for the highlighted text. Otherwise,
- * return a text selection representing the start of the line.
- *
- * @param document The IDocument backing the Editor.
- * @param line The line clicked on in the ruler.
- * @return An ITextSelection as described.
- * @throws BadLocationException If underlying operations throw.
- */
- private ITextSelection getTextSelection(IDocument document, int line) throws BadLocationException {
- IRegion region = document.getLineInformation(line);
- ITextSelection textSelection = new TextSelection(document, region.getOffset(), 0);
- ISelectionProvider provider = fPart.getSite().getSelectionProvider();
- if (provider != null){
- ISelection selection = provider.getSelection();
- if (selection instanceof ITextSelection
- && ((ITextSelection) selection).getStartLine() <= line
- && ((ITextSelection) selection).getEndLine() >= line) {
- textSelection = (ITextSelection) selection;
- }
- }
- return textSelection;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleMethodBreakpointActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleMethodBreakpointActionDelegate.java
deleted file mode 100644
index 4b3db6ff7..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleMethodBreakpointActionDelegate.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.internal.ui.actions.breakpoints.ToggleBreakpointObjectActionDelegate;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * A toggle method breakpoint action that can be contributed an object
- * contribution. The action will toggle method breakpoints on objects
- * that provide an <code>IToggleBreakpointsTarget</code> adapter.
- * <p>
- * Clients may reference/contribute this class as an object contribution
- * action delegate in plug-in XML.
- * </p>
- * @since 3.0
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- */
-public class ToggleMethodBreakpointActionDelegate extends ToggleBreakpointObjectActionDelegate {
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.ToggleBreakpointObjectActionDelegate#performAction(org.eclipse.debug.internal.ui.actions.IToggleBreakpointsTarget, org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- protected void performAction(IToggleBreakpointsTarget target, IWorkbenchPart part, ISelection selection) throws CoreException {
- target.toggleMethodBreakpoints(part, selection);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleWatchpointActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleWatchpointActionDelegate.java
deleted file mode 100644
index c5ebd55ec..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleWatchpointActionDelegate.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.internal.ui.actions.breakpoints.ToggleBreakpointObjectActionDelegate;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * A toggle watchpoint action that can be contributed an object
- * contribution. The action will toggle watchpoints on objects
- * that provide an <code>IToggleBreakpointsTarget</code> adapter.
- * <p>
- * Clients may reference/contribute this class as an object contribution
- * action delegate in plug-in XML.
- * </p>
- * @since 3.0
- * @noextend This class is not intended to be subclassed by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
- */
-public class ToggleWatchpointActionDelegate extends ToggleBreakpointObjectActionDelegate {
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.ToggleBreakpointObjectActionDelegate#performAction(org.eclipse.debug.internal.ui.actions.IToggleBreakpointsTarget, org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- */
- protected void performAction(IToggleBreakpointsTarget target, IWorkbenchPart part, ISelection selection) throws CoreException {
- target.toggleWatchpoints(part, selection);
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/package.html b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/package.html
deleted file mode 100644
index ea275ff7e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/package.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Debug UI Actions</title>
-</head>
-
-<body link="#0000FF" vlink="#800080">
-
-<p align="left">Provides a set of actions related to running and debugging applications.</p>
-
-<h2 align="left">Package Specification</h2>
-
-<p>This package provides a set of actions related to running and debugging applications.</p>
-</body>
-</html>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/ConsoleColorProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/ConsoleColorProvider.java
deleted file mode 100644
index 27ca96d60..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/ConsoleColorProvider.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.console;
-
-
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.IStreamsProxy;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * Default console color provider for a process. Colors output to standard
- * out, in, and error, as specified by user preferences.
- * <p>
- * Clients implementing a console color provider should subclass this class.
- * </p>
- * @since 2.1
- */
-public class ConsoleColorProvider implements IConsoleColorProvider {
-
- private IProcess fProcess;
- private IConsole fConsole;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsoleColorProvider#connect(org.eclipse.debug.core.model.IProcess, org.eclipse.debug.ui.console.IConsole)
- */
- public void connect(IProcess process, IConsole console) {
- fProcess = process;
- fConsole = console;
- IStreamsProxy streamsProxy = fProcess.getStreamsProxy();
- if (streamsProxy != null) {
- fConsole.connect(streamsProxy);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsoleColorProvider#disconnect()
- */
- public void disconnect() {
- fConsole = null;
- fProcess = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsoleColorProvider#isReadOnly()
- */
- public boolean isReadOnly() {
- return fProcess == null || fProcess.isTerminated();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsoleColorProvider#getColor(java.lang.String)
- */
- public Color getColor(String streamIdentifer) {
- if (IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM.equals(streamIdentifer)) {
- return DebugUIPlugin.getPreferenceColor(IDebugPreferenceConstants.CONSOLE_SYS_OUT_COLOR);
- }
- if (IDebugUIConstants.ID_STANDARD_ERROR_STREAM.equals(streamIdentifer)) {
- return DebugUIPlugin.getPreferenceColor(IDebugPreferenceConstants.CONSOLE_SYS_ERR_COLOR);
- }
- if (IDebugUIConstants.ID_STANDARD_INPUT_STREAM.equals(streamIdentifer)) {
- return DebugUIPlugin.getPreferenceColor(IDebugPreferenceConstants.CONSOLE_SYS_IN_COLOR);
- }
- return null;
- }
-
- /**
- * Returns the process this color provider is providing color for, or
- * <code>null</code> if none.
- *
- * @return the process this color provider is providing color for, or
- * <code>null</code> if none
- */
- protected IProcess getProcess() {
- return fProcess;
- }
-
- /**
- * Returns the console this color provider is connected to, or
- * <code>null</code> if none.
- *
- * @return IConsole the console this color provider is connected to, or
- * <code>null</code> if none
- */
- protected IConsole getConsole() {
- return fConsole;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java
deleted file mode 100644
index 5bf3cc8a9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.console;
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorRegistry;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * A hyperlink that opens a file in a text editor and selects a range of text.
- * This hyperlink action will un-zoom the workbench as needed to show the editor
- * for the associated link.
- * <p>
- * Clients may instantiate this class.
- * </p>
- * @since 2.1
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class FileLink implements IConsoleHyperlink {
-
- private IFile fFile;
- private int fFileOffset;
- private int fFileLength;
- private int fFileLineNumber;
- private String fEditorId;
-
- /**
- * Constructs a hyperlink to the specified file.
- *
- * @param file the file to open when activated
- * @param editorId the identifier of the editor to open the file in, or
- * <code>null</code> if the default editor should be used
- * @param fileOffset the offset in the file to select when activated, or -1
- * @param fileLength the length of text to select in the file when activated
- * or -1
- * @param fileLineNumber the line number to select in the file when
- * activated, or -1
- */
- public FileLink(IFile file, String editorId, int fileOffset, int fileLength, int fileLineNumber) {
- fFile = file;
- fFileOffset = fileOffset;
- fFileLength = fileLength;
- fFileLineNumber = fileLineNumber;
- fEditorId = editorId;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsoleHyperlink#linkActivated()
- */
- public void linkActivated() {
- IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- try {
- IEditorPart editorPart = page.openEditor(new FileEditorInput(fFile), getEditorId() , true);
- if (fFileLineNumber > 0) {
- ITextEditor textEditor = null;
- if (editorPart instanceof ITextEditor) {
- textEditor = (ITextEditor) editorPart;
- } else {
- textEditor = (ITextEditor) editorPart.getAdapter(ITextEditor.class);
- }
- if (textEditor != null) {
- IEditorInput input = editorPart.getEditorInput();
- if (fFileOffset < 0) {
- IDocumentProvider provider = textEditor.getDocumentProvider();
- try {
- provider.connect(input);
- } catch (CoreException e) {
- // unable to link
- DebugUIPlugin.log(e);
- return;
- }
- IDocument document = provider.getDocument(input);
- try {
- IRegion region= document.getLineInformation(fFileLineNumber - 1);
- fFileOffset = region.getOffset();
- fFileLength = region.getLength();
- } catch (BadLocationException e) {
- // unable to link
- DebugUIPlugin.log(e);
- }
- provider.disconnect(input);
- }
- if (fFileOffset >= 0 && fFileLength >=0) {
- textEditor.selectAndReveal(fFileOffset, fFileLength);
- }
- }
- }
- } catch (PartInitException e) {
- DebugUIPlugin.log(e);
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsoleHyperlink#linkEntered()
- */
- public void linkEntered() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.console.IConsoleHyperlink#linkExited()
- */
- public void linkExited() {
- }
-
- private String getEditorId() {
- if (fEditorId == null) {
- IWorkbench workbench= DebugUIPlugin.getDefault().getWorkbench();
- // If there is a registered editor for the file use it.
- IEditorDescriptor desc = workbench.getEditorRegistry().getDefaultEditor(fFile.getName(), getFileContentType());
- if (desc == null) {
- //default editor
- desc= workbench.getEditorRegistry().findEditor(IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID);
- }
- fEditorId= desc.getId();
- }
- return fEditorId;
- }
-
- private IContentType getFileContentType() {
- try {
- IContentDescription description= fFile.getContentDescription();
- if (description != null) {
- return description.getContentType();
- }
- } catch (CoreException e) {
- }
- return null;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsole.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsole.java
deleted file mode 100644
index d81b0eb32..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsole.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.console;
-
-
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.core.model.IStreamMonitor;
-import org.eclipse.debug.core.model.IStreamsProxy;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.ui.console.IHyperlink;
-import org.eclipse.ui.console.IOConsoleOutputStream;
-import org.eclipse.ui.console.IPatternMatchListener;
-
-/**
- * A console that displays output and writes input to a process. Implementors of
- * <code>IConsoleColorProvider</code> should connect streams to a console
- * document when connected to.
- * @see org.eclipse.debug.ui.console.IConsoleColorProvider
- * @since 2.1
- * @noimplement This interface is not intended to be implemented by clients.
- * @noextend This interface is not intended to be extended by clients.
- */
-public interface IConsole {
-
- /**
- * Connects this console to the given streams proxy. This associates the
- * standard in, out, and error streams with the console. Keyboard input will
- * be written to the given proxy.
- *
- * @param streamsProxy
- */
- public void connect(IStreamsProxy streamsProxy);
-
- /**
- * Connects this console to the given stream monitor, uniquely identified by
- * the given identifier. This allows for more than the standard (in, out,
- * error) streams to be connected to the console.
- *
- * @param streamMonitor
- * @param streamIdentifer
- */
- public void connect(IStreamMonitor streamMonitor, String streamIdentifer);
-
- /**
- * Adds the given hyperlink to this console. The link will be notified when
- * entered, exited, and activated.
- * <p>
- * If the link's region (offset/length) is within the console's document
- * current bounds, it is added immediately. Otherwise, the link is added
- * when the console's document grows to contain the link's region.
- * </p>
- * @param link the hyperlink to add
- * @param offset the character offset within the console document where the
- * text associated with the hyperlink begins
- * @param length the length of the associated hyperlink text
- * @deprecated replaced with addLink(IHyperlink link, int offset, int length)
- */
- public void addLink(IConsoleHyperlink link, int offset, int length);
-
- /**
- * Adds the given hyperlink to this console. The link will be notified when
- * entered, exited, and activated.
- * <p>
- * If the link's region (offset/length) is within the console's document
- * current bounds, it is added immediately. Otherwise, the link is added
- * when the console's document grows to contain the link's region.
- * </p>
- * @param link the hyperlink to add
- * @param offset the character offset within the console document where the
- * text associated with the hyperlink begins
- * @param length the length of the associated hyperlink text
- * @since 3.1
- */
- public void addLink(IHyperlink link, int offset, int length);
-
- /**
- * Returns the region of text associated with the given hyperlink, or
- * <code>null</code> if the given hyperlink is not contained in this
- * console.
- *
- * @param link a console hyperlink
- * @return region of text associated with the hyperlink, or <code>null</code>
- * @deprecated replaced with getRegion(IHyperlink link) instead
- */
- public IRegion getRegion(IConsoleHyperlink link);
-
- /**
- * Returns the region of text associated with the given hyperlink, or
- * <code>null</code> if the given hyperlink is not contained in this
- * console.
- *
- * @param link a console hyperlink
- * @return region of text associated with the hyperlink, or <code>null</code>
- * @since 3.1
- */
- public IRegion getRegion(IHyperlink link);
-
- /**
- * Returns the document associated with this console.
- *
- * @return document
- */
- public IDocument getDocument();
-
- /**
- * Returns the process associated with this console.
- *
- * @return the process associated with this console
- */
- public IProcess getProcess();
-
- /**
- * Adds the given pattern match listener to this console. The listener will
- * be connected and receive match notifications.
- * @param matchListener the listener to add
- * @since 3.1
- */
- public void addPatternMatchListener(IPatternMatchListener matchListener);
-
- /**
- * Removes the given pattern match listener from this console. The listener will be
- * disconnected and will no longer receive match notifications.
- * @param matchListener the pattern match listener to remove.
- * @since 3.1
- */
- public void removePatternMatchListener(IPatternMatchListener matchListener);
-
- /**
- * Returns the stream associated with the specified stream identifier.
- * @param streamIdentifier Uniquely identifies the required stream
- * @return The stream or <code>null</code> if none found with matching streamIdentifier
- * @since 3.1
- */
- public IOConsoleOutputStream getStream(String streamIdentifier);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleColorProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleColorProvider.java
deleted file mode 100644
index aa81dd793..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleColorProvider.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.console;
-
-
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * Provides coloring for a console document. When a process is added to a
- * registered launch the debug plug-in creates a console document for the
- * process. By default, a document is created which is connected to the standard
- * input, output, and error streams associated with the process. A client may
- * override the default coloring by specifying a custom content provider for a
- * process type. A process type is defined via the process attribute
- * <code>IProcess. ATTR_PROCESS_TYPE</code>.
- * <p>
- * A console color provider extension is defined in <code>plugin.xml</code>.
- * Following is an example definition of a console color
- * provider extension.
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.consoleColorProviders"&gt;
- * &lt;consoleColorProvider
- * id="com.example.ExampleConsoleColorProvider"
- * class="com.example.ExampleConsoleColorProviderClass"
- * processType="ExampleProcessType"&gt;
- * &lt;/consoleColorProvider&gt;
- * &lt;/extension&gt;
- * </pre>
- * The attributes are specified as follows:
- * <ul>
- * <li><code>id</code> specifies a unique identifier for this color provider.</li>
- * <li><code>class</code> specifies a fully qualified name of a Java class
- * that implements <code>IConsoleColorProvider</code>.</li>
- * <li><code>processType</code> specifies the identifier of the process type
- * this content provider is associated with (which corresponds to the
- * <code>ATTR_PROCESS_TYPE</code> attribute on a process).</li>
- * </ul>
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 2.1
- */
-
-public interface IConsoleColorProvider {
-
- /**
- * Returns whether the console associated with this color provider's
- * process can currently accept keyboard input. This attribute is dynamic
- * and may change over the lifetime of a process/document.
- *
- * @return whether the console associated with this color provider's
- * process can currently accept keyboard input
- */
- public boolean isReadOnly();
-
- /**
- * Returns the color to draw output associated with the given stream.
- *
- * @param streamIdentifer the identifier of the stream
- * @return Color
- */
- public Color getColor(String streamIdentifer);
-
- /**
- * Connects this color provider to the given process and console.
- * This color provider should connect its streams to the given console
- * document.
- *
- * @param process the process to connect this color provider to
- * @param console the console to connect this color provider to
- */
- public void connect(IProcess process, IConsole console);
-
- /**
- * Disconnects this color provider.
- */
- public void disconnect();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleHyperlink.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleHyperlink.java
deleted file mode 100644
index b735fac78..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleHyperlink.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.console;
-
-import org.eclipse.ui.console.IHyperlink;
-
-
-/**
- * A hyperlink in the console. Link behavior is implementation dependent.
- * <p>
- * Clients may implement this interface.
- * </p>
- * <p>
- * Since 3.1, this interface now extends {@link org.eclipse.ui.console.IHyperlink}.
- * </p>
- * @since 2.1
- * @deprecated replaced by org.eclipse.ui.console.IHyperlink
- */
-public interface IConsoleHyperlink extends IHyperlink {
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleLineTracker.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleLineTracker.java
deleted file mode 100644
index a518818c9..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleLineTracker.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.console;
-
-
-import org.eclipse.jface.text.IRegion;
-
-/**
- * Notified of lines appended to the console. A line tracker is defined in
- * <code>plugin.xml</code>. A line tracker is associated with a type of
- * process. Following is an example definition of a console line tracker
- * extension.
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.consoleLineTrackers"&gt;
- * &lt;consoleLineTracker
- * id="com.example.ExampleConsoleLineTracker"
- * class="com.example.ExampleConsoleLineTrackerClass"
- * processType="ExampleProcessType"&gt;
- * &lt;/consoleLineTracker&gt;
- * &lt;/extension&gt;
- * </pre>
- * The attributes are specified as follows:
- * <ul>
- * <li><code>id</code> specifies a unique identifier for this line tracker.</li>
- * <li><code>class</code> specifies a fully qualified name of a Java class
- * that implements <code>IConsoleLineTracker</code>.</li>
- * <li><code>processType</code> specifies the identifier of the process type
- * this line tracker is associated with (which corresponds to the
- * <code>ATTR_PROCESS_TYPE</code> attribute on a process).</li>
- * </ul>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 2.1
- */
-public interface IConsoleLineTracker {
-
- /**
- * Notification that a console document has been created for which this
- * listener is registered.
- *
- * @param console console that has been created
- */
- public void init(IConsole console);
-
- /**
- * Notification that a line of text has been appended to the console. The
- * given region describes the offset and length of the line appended to the
- * console, excluding the line delimiter.
- *
- * @param line region describing the offset and length of line appended to
- * the console, excluding the line delimiter
- */
- public void lineAppended(IRegion line);
-
- /**
- * Disposes this console line tracker.
- */
- public void dispose();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleLineTrackerExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleLineTrackerExtension.java
deleted file mode 100644
index e8c61ad90..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleLineTrackerExtension.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.console;
-
-/**
- * An extension to the console line tracker interface that console line
- * trackers may implement to be notified when output from the console is complete.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.0
- */
-public interface IConsoleLineTrackerExtension extends IConsoleLineTracker {
-
- /**
- * Notification that all output streams connected to the console have been
- * closed. No more lines will be appended after this method is called.
- */
- public void consoleClosed();
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/package.html b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/package.html
deleted file mode 100644
index 1e27d958f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/package.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Debug Console</title>
-</head>
-
-<body link="#0000FF" vlink="#800080">
-
-<p align="left">Provides a set of interfaces and classes for rendering and annotating text in the debug console.</p>
-
-<h2 align="left">Package Specification</h2>
-
-<p>This package provides a set interfaces and classses for coloring streams of
- text, parsing output, and creating hyperlinks in the debug console.</p>
-<h3>Coloring Console Output</h3>
-<p>A process may have standard input, output, and error streams associated with,
- as defined by <b>org.eclipse.debug.core.model.IProcess</b>
- and <b>org.eclipse.debug.core.model.IStreamsProxy</b>.
- When a process is registered with the debug plug-in, a document is created to
- display the output of that process, and to provide input to the process via
- the keyboard. A console document is displayed in the Console View. By default,
- the output, error, and input streams are rendered in colors specified by user
- preferences.</p>
-<p>A client can specialize coloring for a process's streams by defining an <b>IConsoleColorProvider</b>
- extension (using the <b>org.eclipse.debug.ui.consoleColorProviders</b>
- extension point). A console color provider is defined for a <i>type</i> of process.
- A process type is defined by the creator of a process, and is specified on an
- <b>IProcess</b> via the <b>ATTR_PROCESS_TYPE</b>
- attribute. When a process is registered with the debug plug-in, a console color
- provider associated with the process type is instantiated, and connected to
- the process (<b>IProcess</b>) and a
- console (<b>IConsole</b>). The console
- color provider then connects its streams to the console (<b>IConsole</b>),
- via the console methods <b>connect(IStreamsProxy)</b>
- and <b>connect(IStreamMonitor, String)</b>.
- The color provider will then be consulted to provide a color when the console
- needs to render output from a stream.</p>
-<h3>Parsing Console Output</h3>
-<p>A client can be notified of output appended to a process's console document,
- by defining an <b>IConsoleLineTracker</b>
- extension (using the <b>org.eclipse.debug.ui.consoleLineTrackers</b>
- extension point). A console line tracker is defined for a <i>type</i> of process.
- When a process is registered with the debug plug-in, a console document is created
- for that process, and output is appended to that document. As output is written
- to the document, each console line tracker extension defined for that process
- type is notified of output, line by line. This support is most commonly used
- to annotate output with hyperlinks.</p>
-</body>
-</html>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/AbstractDebugContextProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/AbstractDebugContextProvider.java
deleted file mode 100644
index ec983e352..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/AbstractDebugContextProvider.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.contexts;
-
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Abstract implementation of a debug context provider.
- * <p>
- * Clients implementing context providers should subclass this class.
- * </p>
- * @since 3.3
- */
-public abstract class AbstractDebugContextProvider implements IDebugContextProvider {
-
- /**
- * Event listeners
- */
- private ListenerList fListeners = new ListenerList();
-
- /**
- * Part or <code>null</code>
- */
- private IWorkbenchPart fPart;
-
- /**
- * Constructs a context provider for the specified part, possibly <code>null</code>.
- *
- * @param part workbench part or <code>null</code>
- */
- public AbstractDebugContextProvider(IWorkbenchPart part) {
- fPart = part;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextProvider#addDebugContextEventListener(org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextEventListener)
- */
- public void addDebugContextListener(IDebugContextListener listener) {
- fListeners.add(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextProvider#getPart()
- */
- public IWorkbenchPart getPart() {
- return fPart;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextProvider#removeDebugContextEventListener(org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextEventListener)
- */
- public void removeDebugContextListener(IDebugContextListener listener) {
- fListeners.remove(listener);
- }
-
- /**
- * Fires the given context event to all registered listeners.
- *
- * @param event debug context event
- */
- protected void fire(final DebugContextEvent event) {
- Object[] listeners = fListeners.getListeners();
- for (int i = 0; i < listeners.length; i++) {
- final IDebugContextListener listener = (IDebugContextListener) listeners[i];
- SafeRunner.run(new ISafeRunnable() {
- public void run() throws Exception {
- listener.debugContextChanged(event);
- }
- public void handleException(Throwable exception) {
- DebugUIPlugin.log(exception);
- }
- });
-
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/DebugContextEvent.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/DebugContextEvent.java
deleted file mode 100644
index 7cc2787d5..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/DebugContextEvent.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.contexts;
-
-import java.util.EventObject;
-
-import org.eclipse.jface.viewers.ISelection;
-
-/**
- * A debug context event. Debug context events are generated by debug context
- * providers. A debug context is represented by a selection and flags
- * (bit mask) describing how the context has changed.
- * <p>
- * Clients may instantiate this class.
- * </p>
- * @see IDebugContextListener
- * @see IDebugContextProvider
- * @since 3.3
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class DebugContextEvent extends EventObject {
-
- /**
- * The context
- */
- private ISelection fContext;
-
- /**
- * Change flags.
- */
- private int fFlags;
-
- /**
- * Change constant (bit mask) indicating a context has been activated.
- */
- public static final int ACTIVATED = 0x01;
-
- /**
- * Change constant (bit mask) indicating the state of a context has changed.
- * State changes are only broadcast for previously activated contexts.
- */
- public static final int STATE = 0x10;
-
- /**
- * Generated serial version UID for this class.
- */
- private static final long serialVersionUID = 3395172504615255524L;
-
- /**
- * Constructs a new debug context event.
- *
- * @param source source of the event - a debug context provider
- * @param context the relevant context
- * @param flags bit mask indicating how the context has changed - see change constants
- * defined in this class
- */
- public DebugContextEvent(IDebugContextProvider source, ISelection context, int flags) {
- super(source);
- fContext = context;
- fFlags = flags;
- }
-
- /**
- * Returns the debug context associated with this event.
- *
- * @return debug context, possible an empty selection
- */
- public ISelection getContext() {
- return fContext;
- }
-
- /**
- * Returns flags which describe in more detail how a context has changed.
- * See change constants defined in this class.
- *
- * @return event flags
- */
- public int getFlags() {
- return fFlags;
- }
-
- /**
- * Returns the context provider that initiated this event.
- *
- * @return context provider
- */
- public IDebugContextProvider getDebugContextProvider() {
- return (IDebugContextProvider) getSource();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextListener.java
deleted file mode 100644
index c55cfc83d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextListener.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.contexts;
-
-
-/**
- * A debug context listener is notified of debug context events.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see DebugContextEvent
- * @see IDebugContextManager
- * @see IDebugContextService
- * @see IDebugContextProvider
- * @since 3.3
- */
-public interface IDebugContextListener {
-
- /**
- * Notification the debug context has changed as specified by the given event.
- *
- * @param event debug context event
- */
- public void debugContextChanged(DebugContextEvent event);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextManager.java
deleted file mode 100644
index 61f12e46d..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextManager.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.contexts;
-
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * Manages debug context services. There is a debug context service
- * for each workbench window. Clients interested in context change
- * notification for all windows can register with the manager. Clients
- * interested in context change notification for a specific window
- * can register with the context service specific to that window.
- * <p>
- * Clients register debug context providers with a context service - i.e.
- * for a specific window.
- * </p>
- * @see IDebugContextProvider
- * @see IDebugContextListener
- * @see IDebugContextService
- * @since 3.3
- * @noimplement This interface is not intended to be implemented by clients.
- * @noextend This interface is not intended to be extended by clients.
- */
-public interface IDebugContextManager {
-
- /**
- * Registers the given listener for debug context notification in all windows.
- *
- * @param listener debug context listener
- */
- public void addDebugContextListener(IDebugContextListener listener);
-
- /**
- * Unregisters the given listener for context notification in all windows.
- *
- * @param listener debug context listener
- */
- public void removeDebugContextListener(IDebugContextListener listener);
-
- /**
- * Returns the debug context service for the specified window.
- *
- * @param window workbench window
- * @return debug context service
- */
- public IDebugContextService getContextService(IWorkbenchWindow window);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextProvider.java
deleted file mode 100644
index f8a22f6db..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextProvider.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.contexts;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Interface common to all objects that provide a debug context. A context provider
- * is registered with a debug context service associated with a specific window.
- * <p>
- * A context provider can provide context information for a specific workbench part.
- * There can only be one context provider registered per part with a context
- * service. When there is more than one context provider per window, the context provider
- * associated with the most recently active part provides the context for that window.
- * </p>
- * <p>
- * A context provider does not have to be associated with a part. In this case the provider
- * specifies <code>null</code> for its part, and provides context information for the window.
- * There can only be one context provider without an associated part registered per context
- * service (i.e. per window). A context provider that provides context without an associated
- * part is only active (i.e. used to provide context information) when there are no other
- * context providers with associated parts registered with that service.
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see IDebugContextManager
- * @see IDebugContextService
- * @see IDebugContextListener
- * @since 3.3
- */
-public interface IDebugContextProvider {
-
- /**
- * Returns the part associated with this context provider or <code>null</code>
- * if none.
- *
- * @return part associated with this context provider or <code>null</code>
- */
- public IWorkbenchPart getPart();
-
- /**
- * Registers the given listener for debug context events.
- *
- * @param listener event listener
- */
- public void addDebugContextListener(IDebugContextListener listener);
-
- /**
- * Unregisters the given listener for debug context events.
- *
- * @param listener event listener
- */
- public void removeDebugContextListener(IDebugContextListener listener);
-
- /**
- * Returns the currently active context, possibly empty or <code>null</code>.
- *
- * @return active context, possibly empty or <code>null</code>.
- */
- public ISelection getActiveContext();
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextService.java
deleted file mode 100644
index 0d2eac26c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/IDebugContextService.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.contexts;
-
-import org.eclipse.jface.viewers.ISelection;
-
-
-/**
- * Debug context service for a window. Clients may register for debug context
- * notification with this service. A context service is obtained from the
- * debug context manager.
- * @see IDebugContextManager
- * @since 3.3
- * @noimplement This interface is not intended to be implemented by clients.
- * @noextend This interface is not intended to be extended by clients.
- */
-public interface IDebugContextService {
-
- /**
- * Registers for the given listener for debug context change notification
- * in this service's window.
- *
- * @param listener debug context listener
- */
- public void addDebugContextListener(IDebugContextListener listener);
- /**
- * Unregisters for the given listener for debug context change notification
- * in this service's window.
- *
- * @param listener debug context listener
- */
- public void removeDebugContextListener(IDebugContextListener listener);
-
- /**
- * Registers for the given debug context listener for context notification
- * from the specified part in this service's window.
- *
- * @param listener debug context listener
- * @param partId part identifier
- */
- public void addDebugContextListener(IDebugContextListener listener, String partId);
-
- /**
- * Unregisters the given debug context listener for context change notification
- * from the specified part in this service's window.
- *
- * @param listener debug context listener
- * @param partId part identifier
- */
- public void removeDebugContextListener(IDebugContextListener listener, String partId);
-
- /**
- * Returns the active context in this service's window
- * or <code>null</code>.
- *
- * @return active context or <code>null</code>
- */
- public ISelection getActiveContext();
-
- /**
- * Returns the active context in the specified part of this service's window
- * or <code>null</code> if none.
- *
- * @param partId part identifier
- * @return active context or <code>null</code>
- */
- public ISelection getActiveContext(String partId);
-
- /**
- * Registers the given debug context listener for post context change notification
- * in this service's window. Post listeners are notified of context changes after all
- * non-post listeners are notified.
- *
- * @param listener debug context listener
- */
- public void addPostDebugContextListener(IDebugContextListener listener);
-
- /**
- * Unregisters the given debug context listener for post context change notification
- * in this service's window.
- *
- * @param listener debug context listener.
- */
- public void removePostDebugContextListener(IDebugContextListener listener);
-
- /**
- * Registers the given debug context listener for post context change notification
- * in the specified part of this service's window. Post listeners are notified of
- * context changes after all non-post listeners are notified.
- *
- * @param listener debug context listener
- * @param partId part identifier
- */
- public void addPostDebugContextListener(IDebugContextListener listener, String partId);
-
- /**
- * Unregisters the given debug context listener for post context change notification
- * in the specified part of this service's window.
- *
- * @param listener debug context listener
- * @param partId part identifier
- */
- public void removePostDebugContextListener(IDebugContextListener listener, String partId);
-
- /**
- * Registers the given debug context provider with this service.
- *
- * @param provider debug context provider
- */
- public void addDebugContextProvider(IDebugContextProvider provider);
-
- /**
- * Unregisters the given debug context provider from this service.
- *
- * @param provider debug context provider
- */
- public void removeDebugContextProvider(IDebugContextProvider provider);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISuspendTrigger.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISuspendTrigger.java
deleted file mode 100644
index 02477bf82..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISuspendTrigger.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.contexts;
-
-/**
- * A suspend trigger notifies listeners when a launch suspends at a context
- * where debugging should begin. For example, when a breakpoint is encountered.
- * <p>
- * The debug platform retrieves a suspend trigger from each registered launch
- * and listens to suspend notifications in order to initiate debug sessions - i.e.
- * switch to the desired perspective, activate the debug view, etc., based on user
- * preferences. The debug platform asks each registered launch for its suspend
- * trigger adapter or registers with the launch itself if it implements
- * <code>ISuspendTrigger</code>.
- * </p>
- * <p>
- * It is important that the same instance of a suspend trigger adapter is
- * returned each time it is asked for the same object, such that listeners
- * can be added and removed from the same instance. When a listener is removed
- * and no more listeners are registered, this trigger can be disposed or replaced
- * with a new adapter the next time one is requested.
- * </p>
- * <p>
- * Clients may implement this interface. The debug platform provides a suspend trigger
- * adapter for implementations of <code>ILaunch</code>. The implementation provided by
- * the platform is based on a standard debug model that fires debug events. Clients
- * wishing to provide their own implementation must also provide their own implementation
- * of <code>ILaunch</code> (or subclass of <code>Launch</code>), in order to register
- * their suspend trigger adapter.
- * </p>
- * @see ISuspendTriggerListener
- * @since 3.3
- */
-public interface ISuspendTrigger {
-
- /**
- * Registers the given listener for suspend notifications.
- *
- * @param listener suspend listener
- */
- public void addSuspendTriggerListener(ISuspendTriggerListener listener);
-
- /**
- * Unregisters the given listener for suspend notifications.
- *
- * @param listener suspend listener
- */
- public void removeSuspendTriggerListener(ISuspendTriggerListener listener);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISuspendTriggerListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISuspendTriggerListener.java
deleted file mode 100644
index b42b65581..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/ISuspendTriggerListener.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.contexts;
-
-import org.eclipse.debug.core.ILaunch;
-
-/**
- * Listeners are notified when a launch has suspended at a context
- * where debugging should begin. For example, in a stack frame where
- * a breakpoint has been encountered.
- * <p>
- * Generally, clients implement <code>ISuspendTrigger</code> and the debug platform registers
- * as a suspend trigger listener.
- * </p>
- * @see ISuspendTrigger
- * @since 3.3
- * @noimplement This interface is not intended to be implemented by clients.
- * @noextend This interface is not intended to be extended by clients.
- */
-public interface ISuspendTriggerListener {
-
- /**
- * Notification the given launch has suspended at the
- * specified context.
- *
- * @param launch
- * @param context
- */
- public void suspended(ILaunch launch, Object context);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/package.html b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/package.html
deleted file mode 100644
index a0cececcf..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/package.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Debug Contexts</title>
-</head>
-
-<body link="#0000FF" vlink="#800080">
-
-<p align="left">Provides a set of interfaces and classes for debug context management.</p>
-
-<h2 align="left">Package Specification</h2>
-
-<p>This package provides a set interfaces and classes to manage debug contexts.</p>
-<p>A debug context represents an active state of a program being debugged. The
- active debug context drives the enabled state of debug actions (step, terminate,
- etc.), source lookup, visible variables, watch expression values, etc. The debug
- platform allows clients to register for context change notification in order
- to respond to changes in the active debug state, as well as register context
- providers that drive the active debug state. The debug platform has context
- listeners and providers itself. For example, the debug platform's stepping actions
- register for context change notification to update enabled state and the Debug
- view registers as a context provider.</p>
-<p>There can be any number of debug contexts within a workbench window, but at
- any one time there is only one active debug context within a part and one active
- context within a workbench window. The debug platform provides a debug context
- service per window (<code>IDebugContextService</code>) that allows clients to
- register context providers for that window, and register for change notification
- within the window or a specific part in the window. If there is only one context
- provider in a window, it provides the context for the entire window as well
- as its part. If there is more than one context provider for a window, the context
- provider associated with the most recently active part provides the context
- for that window. It is possible to register a context provider that has no associated
- part. Only one such context provider can be registered with each service (window).
- A context provider that has no associated part provides context for its window
- only if there are no other context providers registered for that window.</p>
-<p>A debug context is represented by a selection (<code>ISelection</code>). This
- allows for single or multi-element selections as well as text selections to
- provide context. Listeners are notified of context changes with debug context
- events (<code>DebugContextEvent</code>) . An event specifies the context that
- has changed and a bit mask describing how the context has changed. The platform
- defines two types of changes - activation and state change. An activated state
- indicates a new context - for example a thread suspending at a breakpoint or
- after a step. An activation triggers variables to refresh, source lookup, etc.
- A state change indicates that a previously activated state has changed. For
- example, a stack frame or thread that was activated has completed an implicit
- evaluation. A state change triggers action enabled states to update.</p>
-</body>
-</html>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java
deleted file mode 100644
index a6227f6bf..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java
+++ /dev/null
@@ -1,404 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Wind River - Bug 206407 AbstractMemoryRendering connect()s the wrong "this"
- *******************************************************************************/
-package org.eclipse.debug.ui.memory;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.views.memory.PropertyChangeNotifier;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ILabelDecorator;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IWorkbenchActionConstants;
-
-/**
- * Abstract implementation of a memory rendering.
- * <p>
- * To contribute an action to a rendering, an <code>objectContribution</code> can
- * be used on a rendering implementation class itself using a
- * <code>popupMenus</code> extension. Additionally, the context menu created
- * by <code>createPopupMenu()</code> is registered with an identifier of this
- * rendering's container identifier. Actions may also be contributed to the
- * container's context menu specifically by using a <code>viewerContribution</code>
- * on a <code>popupMenus</code> extension that has a <code>targetID</code> referring
- * to this rendering container's identifier.
- * </p>
- * <p>
- * Clients implementing memory renderings must subclass this class.
- * </p>
- * @since 3.1
- */
-public abstract class AbstractMemoryRendering extends PlatformObject implements IMemoryRendering{
-
- private IMemoryBlock fMemoryBlock;
- private IMemoryRenderingContainer fContainer;
- private ListenerList fPropertyListeners;
- private boolean fVisible = true;
- private MenuManager fPopupMenuMgr;
- private String fRenderingId;
-
- private class ConnectionJob extends Job
- {
- Runnable fRunnable;
- ConnectionJob(Runnable runnable)
- {
- super("Connect/Disconnect MemoryBlock"); //$NON-NLS-1$
- fRunnable = runnable;
- setSystem(true);
- }
-
- protected IStatus run(IProgressMonitor monitor) {
- fRunnable.run();
- return Status.OK_STATUS;
- }
- }
-
- /**
- * Client may provide a label decorator adapter from its memory block
- * to decorate the label of a rendering.
- * @since 3.2
- */
- private ILabelDecorator fLabelDecorator;
- private IMenuListener fMenuListener;
-
- /**
- * Constructs a new rendering of the given type.
- *
- * @param renderingId memory rendering type identifier
- */
- public AbstractMemoryRendering(String renderingId)
- {
- fRenderingId = renderingId;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#init(org.eclipse.debug.ui.memory.IMemoryRenderingSite, org.eclipse.debug.core.model.IMemoryBlock)
- */
- public void init(IMemoryRenderingContainer container, IMemoryBlock block) {
- fContainer = container;
- fMemoryBlock = block;
-
- fLabelDecorator = (ILabelDecorator)fMemoryBlock.getAdapter(ILabelDecorator.class);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#dispose()
- */
- public void dispose()
- {
- // disconnect from memory block when rendering is disposed
- if (fMemoryBlock instanceof IMemoryBlockExtension)
- {
- Runnable runnable = new Runnable(){
- public void run() {
- ((IMemoryBlockExtension)fMemoryBlock).disconnect(AbstractMemoryRendering.this);
- }};
- new ConnectionJob(runnable).schedule();
- }
-
- if (fPopupMenuMgr != null)
- {
- fPopupMenuMgr.removeMenuListener(fMenuListener);
- fPopupMenuMgr.removeAll();
- fPopupMenuMgr.dispose();
- fPopupMenuMgr = null;
- }
-
- if (fPropertyListeners != null)
- fPropertyListeners = null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#activated()
- */
- public void activated() {
- if (fContainer.getMemoryRenderingSite().getSynchronizationService() != null)
- fContainer.getMemoryRenderingSite().getSynchronizationService().setSynchronizationProvider(this);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#deactivated()
- */
- public void deactivated() {
- // do nothing when deactivated
- // we do not want to set the sync provider from rendering site
- // to null because Linux GTK unexpectedly fires deactivated event.
- // If we reset the sync provider upon a deactivated event, it screws
- // up synchronization on Linux GTK.
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#becomesVisible()
- */
- public void becomesVisible() {
- fVisible = true;
-
- if (fMemoryBlock instanceof IMemoryBlockExtension)
- {
- Runnable runnable = new Runnable(){
- public void run() {
- ((IMemoryBlockExtension)fMemoryBlock).connect(AbstractMemoryRendering.this);
- }};
- new ConnectionJob(runnable).schedule();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#becomesHidden()
- */
- public void becomesHidden() {
- fVisible = false;
- if (fMemoryBlock instanceof IMemoryBlockExtension)
- {
- Runnable runnable = new Runnable(){
- public void run() {
- ((IMemoryBlockExtension)fMemoryBlock).disconnect(AbstractMemoryRendering.this);
- }};
- new ConnectionJob(runnable).schedule();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#getMemoryBlock()
- */
- public IMemoryBlock getMemoryBlock() {
- return fMemoryBlock;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#getRenderingId()
- */
- public String getRenderingId()
- {
- return fRenderingId;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener) {
-
- if (fPropertyListeners == null)
- fPropertyListeners = new ListenerList();
-
- fPropertyListeners.add(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener) {
-
- if (fPropertyListeners == null)
- return;
- fPropertyListeners.remove(listener);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#getImage()
- */
- public Image getImage() {
- return decorateImage(null);
- }
-
- /**
- * Decorates and returns this rendering's image.
- *
- * @param image base image
- * @return decorated image
- * @since 3.2
- */
- protected Image decorateImage(Image image) {
- if (fLabelDecorator != null)
- return fLabelDecorator.decorateImage(image, this);
- return image;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#getLabel()
- */
- public String getLabel()
- {
- if (fMemoryBlock == null)
- return IInternalDebugCoreConstants.EMPTY_STRING;
-
- StringBuffer label = new StringBuffer(IInternalDebugCoreConstants.EMPTY_STRING);
-
- if (fMemoryBlock instanceof IMemoryBlockExtension)
- {
- String expression = ((IMemoryBlockExtension)fMemoryBlock).getExpression();
-
- if (expression == null)
- expression = IInternalDebugCoreConstants.EMPTY_STRING;
-
- label.append(expression);
-
- if (expression.startsWith("&")) //$NON-NLS-1$
- label.insert(0, "&"); //$NON-NLS-1$
-
- // show full address if the rendering is visible
- // hide address if the rendering is invisible
- try {
- if (fVisible && ((IMemoryBlockExtension)fMemoryBlock).getBigBaseAddress() != null)
- {
- label.append(" : 0x"); //$NON-NLS-1$
- label.append(((IMemoryBlockExtension)fMemoryBlock).getBigBaseAddress().toString(16).toUpperCase());
- }
- } catch (DebugException e) {
- // do nothing... the label will not show memory block's address
- }
- }
- else
- {
- long address = fMemoryBlock.getStartAddress();
- label.append(Long.toHexString(address).toUpperCase());
- }
-
- IMemoryRenderingType type = DebugUITools.getMemoryRenderingManager().getRenderingType(getRenderingId());
-
- if (type != null)
- {
- String preName = type.getLabel();
-
- if (preName != null)
- {
- label.append(" <"); //$NON-NLS-1$
- label.append(preName);
- label.append(">"); //$NON-NLS-1$
- }
- }
-
- return decorateLabel(label.toString());
- }
-
- /**
- * Decorates and returns this rendering's label.
- *
- * @param label base label
- * @return decorated label
- * @since 3.2
- */
- protected String decorateLabel(String label) {
- if (fLabelDecorator != null)
- return fLabelDecorator.decorateText(label.toString(), this);
- return label.toString();
- }
-
- /**
- * Helper method for creating a pop up menu in the rendering for a control.
- * Call this method when a context menu is required for a control
- * in a rendering.
- * <p>
- * To contribute an action to a rendering, an <code>objectContribution</code> can
- * be used on a rendering implementation class itself using a
- * <code>popupMenus</code> extension. Additionally, the context menu created
- * by this method is registered with an identifier of this rendering's container.
- * Actions may also be contributed to the context menu specifically by using a
- * <code>viewerContribution</code> on a <code>popupMenus</code> extension
- * that has a <code>targetID</code> referring to this rendering container's identifier.
- * </p>
- * <p>
- * Clients are expected to become a menu listener for their pop up
- * menu if they require to fill the context menu for the rendering.
- * </p>
- * @param control - control to create the pop up menu for
- */
- protected void createPopupMenu(Control control)
- {
- if (fPopupMenuMgr == null)
- {
- fPopupMenuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
- fPopupMenuMgr.setRemoveAllWhenShown(true);
- IMemoryRenderingSite site = fContainer.getMemoryRenderingSite();
- String menuId = fContainer.getId();
-
- ISelectionProvider selProvider = site.getSite().getSelectionProvider();
-
- fMenuListener = new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }};
- fPopupMenuMgr.addMenuListener(fMenuListener);
-
- site.getSite().registerContextMenu(menuId, fPopupMenuMgr, selProvider);
- }
-
- Menu popupMenu = fPopupMenuMgr.createContextMenu(control);
- control.setMenu(popupMenu);
- }
-
- /**
- * Returns the pop up menu manager for this rendering, or <code>null</code>
- * if none.
- *
- * @return the pop up menu manager for this rendering, or <code>null</code>
- */
- protected MenuManager getPopupMenuManager()
- {
- return fPopupMenuMgr;
- }
-
- /**
- * Fires the given event to all registered listeners.
- *
- * @param event the event to fire
- */
- protected void firePropertyChangedEvent(PropertyChangeEvent event)
- {
- if (fPropertyListeners == null)
- return;
-
- Object[] listeners = fPropertyListeners.getListeners();
-
- for (int i=0; i<listeners.length; i++)
- {
- PropertyChangeNotifier notifier = new PropertyChangeNotifier((IPropertyChangeListener)listeners[i], event);
- SafeRunner.run(notifier);
- }
- }
-
- /**
- * Returns the container hosting this memory rendering.
- *
- * @return the container hosting this memory rendering
- */
- public IMemoryRenderingContainer getMemoryRenderingContainer()
- {
- return fContainer;
- }
-
- /**
- * Returns whether this rendering is currently visible.
- *
- * @return whether this rendering is currently visible
- */
- public boolean isVisible() {
- return fVisible;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRenderingBindingsProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRenderingBindingsProvider.java
deleted file mode 100644
index 7c1c50675..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRenderingBindingsProvider.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.memory;
-
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.ListenerList;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-
-/**
- * Common function for a dynamic memory rendering bindings provider.
- * <p>
- * Clients may subclass this class.
- * </p>
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider
- * @since 3.1
- */
-public abstract class AbstractMemoryRenderingBindingsProvider implements IMemoryRenderingBindingsProvider {
-
- // list of binding listeners
- private ListenerList fListeners;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#addListener(org.eclipse.debug.ui.memory.IMemoryRenderingBindingsListener)
- */
- public void addListener(IMemoryRenderingBindingsListener listener) {
- if (fListeners == null) {
- fListeners = new ListenerList();
- }
- fListeners.add(listener);
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#removeListener(org.eclipse.debug.ui.memory.IMemoryRenderingBindingsListener)
- */
- public void removeListener(IMemoryRenderingBindingsListener listener) {
- if (fListeners != null) {
- fListeners.remove(listener);
- }
- }
-
- /**
- * Notifies all registered listeners that bindings have changed.
- */
- protected void fireBindingsChanged() {
- if (fListeners == null) {
- return;
- }
-
- Object[] listeners = fListeners.getListeners();
-
- for (int i=0; i<listeners.length; i++) {
- if (listeners[i] instanceof IMemoryRenderingBindingsListener) {
- final IMemoryRenderingBindingsListener listener = (IMemoryRenderingBindingsListener)listeners[i];
- ISafeRunnable runnable = new ISafeRunnable () {
- public void handleException(Throwable exception) {
- DebugUIPlugin.log(exception);
- }
- public void run() throws Exception {
- listener.memoryRenderingBindingsChanged();
- }};
- SafeRunner.run(runnable);
- }
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java
deleted file mode 100644
index c2eec7ffc..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java
+++ /dev/null
@@ -1,3814 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.ui.memory;
-
-import java.math.BigInteger;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.core.model.IMemoryBlockExtension;
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIMessages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.memory.IMemoryBlockConnection;
-import org.eclipse.debug.internal.ui.memory.IPersistableDebugElement;
-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants;
-import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
-import org.eclipse.debug.internal.ui.views.memory.renderings.AbstractBaseTableRendering;
-import org.eclipse.debug.internal.ui.views.memory.renderings.CopyTableRenderingToClipboardAction;
-import org.eclipse.debug.internal.ui.views.memory.renderings.FormatTableRenderingAction;
-import org.eclipse.debug.internal.ui.views.memory.renderings.FormatTableRenderingDialog;
-import org.eclipse.debug.internal.ui.views.memory.renderings.GoToAddressAction;
-import org.eclipse.debug.internal.ui.views.memory.renderings.PrintTableRenderingAction;
-import org.eclipse.debug.internal.ui.views.memory.renderings.ReformatAction;
-import org.eclipse.debug.internal.ui.views.memory.renderings.ResetToBaseAddressAction;
-import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingCellModifier;
-import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingContentInput;
-import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingContentProvider;
-import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingLabelProvider;
-import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingLabelProviderEx;
-import org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingLine;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.TextViewer;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.IBasicPropertyConstants;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.jface.viewers.IFontProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.custom.TableCursor;
-import org.eclipse.swt.custom.TableEditor;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseTrackAdapter;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.ScrollBar;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PropertyDialogAction;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * Abstract implementation of a table rendering.
- * <p>
- * Clients should subclass from this class if they wish to provide a
- * table rendering.
- * </p>
- * <p>
- *
- * The label of the rendering is constructed by retrieving the expression from
- * <code>IMemoryBlockExtension</code>. For IMemoryBlock, the label is constructed
- * using the memory block's start address.
- *
- * This rendering manages the change states of its memory bytes if the memory
- * block does not opt to manage the change states. For IMemoryBlockExtension, if
- * the memory block returns false when #supportsChangeManagement() is called, this
- * rendering will calculate the change state for each byte when its content is updated.
- * Clients may manages the change states of its memory block by returning true when
- * #supportsChangeManagement() is called. This will cause this rendering to stop
- * calculating the change states of the memory block. Instead it would rely on the
- * attributes returned in the MemoryByte array to determine if a byte has changed.
- * For IMemoryBlock, this rendering will manage the change states its content.
- *
- * When firing change event, be aware of the following:
- * - whenever a change event is fired, the content provider for Memory View
- * view checks to see if memory has actually changed.
- * - If memory has actually changed, a refresh will commence. Changes to the memory block
- * will be computed and will be shown with the delta icons.
- * - If memory has not changed, content will not be refreshed. However, previous delta information
- * will be erased. The screen will be refreshed to show that no memory has been changed. (All
- * delta icons will be removed.)
- *
- * Please note that these APIs will be called multiple times by the Memory View.
- * To improve performance, debug adapters need to cache the content of its memory block and only
- * retrieve updated data when necessary.
- * </p>
-
- * @since 3.1
- */
-public abstract class AbstractTableRendering extends AbstractBaseTableRendering implements IPropertyChangeListener, IResettableMemoryRendering{
-
- /**
- * Property identifier for the selected address in a table rendering
- * This property is used for synchronization between renderings.
- */
- public static final String PROPERTY_SELECTED_ADDRESS = "selectedAddress"; //$NON-NLS-1$
-
- /**
- * Property identifier for the column size in a table rendering
- * This property is used for synchronization between renderings.
- */
- public static final String PROPERTY_COL_SIZE = "columnSize"; //$NON-NLS-1$
-
- /**
- * Property identifier for the top row address in a table rendering.
- * This property is used for synchronization between renderings.
- */
- public static final String PROPERTY_TOP_ADDRESS = "topAddress"; //$NON-NLS-1$
-
- /**
- * Property identifier for the row size in a table rendering
- * This property is used for synchronization between renderings.
- * @since 3.2
- */
- public static final String PROPERTY_ROW_SIZE = "rowSize"; //$NON-NLS-1$
-
- private static final int BUFFER_THRESHOLD = 1; // threshold value
- private static final int BUFFER_START = 0; // flag to indicate asking for threshold at buffer start
- private static final int BUFFER_END = 1; // flat to indicate asking for threshold at buffer end
-
- private PageBook fPageBook;
- private TableViewer fTableViewer;
- private TextViewer fTextViewer;
-
- private int fBytePerLine; // number of bytes per line: 16
- private int fColumnSize; // number of bytes per column: 1,2,4,8
- private int fAddressableSize;
-
- private boolean fIsShowingErrorPage;
-
- private TableRenderingContentProvider fContentProvider;
- private BigInteger fSelectedAddress;
- private TableRenderingContentInput fContentInput;
- private TableRenderingCellModifier fCellModifier;
- private boolean fIsCreated;
- private CellEditor[] fEditors;
- private String fLabel;
- private TableCursor fTableCursor;
- private boolean fIsDisposed;
- private TraverseListener fCursorTraverseListener;
- private KeyAdapter fCursorKeyAdapter;
- private BigInteger fTopRowAddress;
-
- private CopyTableRenderingToClipboardAction fCopyToClipboardAction;
- private GoToAddressAction fGoToAddressAction;
- private ResetToBaseAddressAction fResetMemoryBlockAction;
- private PrintTableRenderingAction fPrintViewTabAction;
- private ReformatAction fReformatAction;
- private ToggleAddressColumnAction fToggleAddressColumnAction;
- private EventHandleLock fEvtHandleLock = new EventHandleLock();
- private TableEditor fCursorEditor;
- private FocusAdapter fEditorFocusListener;
- private MouseAdapter fCursorMouseListener;
- private KeyAdapter fEditorKeyListener;
- private SelectionAdapter fCursorSelectionListener;
- private IWorkbenchAdapter fWorkbenchAdapter;
- private IMemoryBlockConnection fConnection;
-
- private boolean fIsShowAddressColumn = true;
- private SelectionAdapter fScrollbarSelectionListener;
-
- private PropertyDialogAction fPropertiesAction;
-
- private int fPageSize;
- private NextPageAction fNextAction;
- private PrevPageAction fPrevAction;
-
- private Shell fToolTipShell;
- private FormatTableRenderingAction fFormatRenderingAction;
-
- private IMenuListener fMenuListener;
-
- private int fPreBuffer;
- private int fPostBuffer;
-
- private class EventHandleLock
- {
- Object fOwner;
-
- public boolean acquireLock(Object client)
- {
- if (fOwner == null)
- {
- fOwner = client;
- return true;
- }
- return false;
- }
-
- public boolean releaseLock(Object client)
- {
- if (fOwner == client)
- {
- fOwner = null;
- return true;
- }
- return false;
- }
-
- }
-
-
- private class ToggleAddressColumnAction extends Action {
-
- public ToggleAddressColumnAction() {
- super();
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID
- + ".ShowAddressColumnAction_context"); //$NON-NLS-1$
- updateActionLabel();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
- fIsShowAddressColumn = !fIsShowAddressColumn;
- resizeColumnsToPreferredSize();
- updateActionLabel();
- }
-
- /**
- *
- */
- private void updateActionLabel() {
- if (fIsShowAddressColumn) {
- setText(DebugUIMessages.ShowAddressColumnAction_0);
- } else {
- setText(DebugUIMessages.ShowAddressColumnAction_1);
- }
- }
- }
-
-
- private class NextPageAction extends Action
- {
- private NextPageAction()
- {
- super();
- setText(DebugUIMessages.AbstractTableRendering_4);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".NextPageAction_context"); //$NON-NLS-1$
- }
-
- public void run() {
- BigInteger address = fContentInput.getLoadAddress();
- address = address.add(BigInteger.valueOf(getPageSizeInUnits()));
- handlePageStartAddressChanged(address);
- }
- }
-
- private class PrevPageAction extends Action
- {
- private PrevPageAction()
- {
- super();
- setText(DebugUIMessages.AbstractTableRendering_6);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".PrevPageAction_context"); //$NON-NLS-1$
- }
-
- public void run() {
- BigInteger address = fContentInput.getLoadAddress();
- address = address.subtract(BigInteger.valueOf(getPageSizeInUnits()));
- handlePageStartAddressChanged(address);
- }
- }
-
- /**
- * Constructs a new table rendering of the specified type.
- *
- * @param renderingId memory rendering type identifier
- */
- public AbstractTableRendering(String renderingId) {
- super(renderingId);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- // if memory view table font has changed
- if (event.getProperty().equals(IInternalDebugUIConstants.FONT_NAME))
- {
- if (!fIsDisposed)
- {
- Font memoryViewFont = JFaceResources.getFont(IInternalDebugUIConstants.FONT_NAME);
- setFont(memoryViewFont);
- }
- return;
- }
-
- if (event.getProperty().equals(IDebugUIConstants.PREF_PADDED_STR) ||
- event.getProperty().equals(IDebugUIConstants.PREF_MEMORY_HISTORY_KNOWN_COLOR) ||
- event.getProperty().equals(IDebugUIConstants.PREF_MEMORY_HISTORY_UNKNOWN_COLOR))
- {
- if (!fIsDisposed)
- {
- fTableViewer.refresh();
- fTableCursor.redraw();
- }
- return;
- }
-
- Object evtSrc = event.getSource();
-
- if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE) ||
- event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PRE_BUFFER_SIZE) ||
- event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_POST_BUFFER_SIZE)) {
- // always update page size, only refresh if the table is visible
- getPageSizeFromPreference();
- }
-
- // do not handle event if the rendering is displaying an error
- if (isDisplayingError())
- return;
-
- // do not handle property change event if the rendering is not visible
- if (!isVisible())
- return;
-
- if (event.getProperty().equals(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM)) {
- handleDyanicLoadChanged();
- return;
- }
-
- if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE)) {
- if (!isDynamicLoad())
- {
- // only refresh if in non-autoload mode
- refresh();
- }
- return;
- }
-
- if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PRE_BUFFER_SIZE) ||
- event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_POST_BUFFER_SIZE)) {
- if (isDynamicLoad())
- {
- // only refresh if in non-autoload mode
- refresh();
- }
- return;
- }
-
- if (evtSrc == this)
- return;
-
- if (!(evtSrc instanceof IMemoryRendering))
- return;
-
- IMemoryRendering rendering = (IMemoryRendering)evtSrc;
- IMemoryBlock memoryBlock = rendering.getMemoryBlock();
-
- // do not handle event from renderings displaying other memory blocks
- if (memoryBlock != getMemoryBlock())
- return;
-
- String propertyName = event.getProperty();
- Object value = event.getNewValue();
-
- if (propertyName.equals(AbstractTableRendering.PROPERTY_SELECTED_ADDRESS) && value instanceof BigInteger)
- {
- selectedAddressChanged((BigInteger)value);
- }
- else if (propertyName.equals(AbstractTableRendering.PROPERTY_COL_SIZE) && value instanceof Integer)
- {
- columnSizeChanged(((Integer)value).intValue());
- }
- else if (propertyName.equals(AbstractTableRendering.PROPERTY_ROW_SIZE) && value instanceof Integer)
- {
- rowSizeChanged(((Integer)value).intValue());
- }
- else if (propertyName.equals(AbstractTableRendering.PROPERTY_TOP_ADDRESS) && value instanceof BigInteger)
- {
- if (needMoreLines())
- {
- if (isDynamicLoad())
- reloadTable(getTopVisibleAddress(), false);
- }
- topVisibleAddressChanged((BigInteger)value, false);
- }
- else if (propertyName.equals(IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS) && value instanceof BigInteger)
- {
- handlePageStartAddressChanged((BigInteger)value);
- }
- }
-
- private void handleDyanicLoadChanged() {
-
- // if currently in dynamic load mode, update page
- // start address
- updateSyncPageStartAddress();
-
- updateDynamicLoadProperty();
- if (isDynamicLoad())
- {
- refresh();
- }
- else
- {
- BigInteger pageStart = (BigInteger)getSynchronizedProperty(IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS);
- if (pageStart == null)
- pageStart = fTopRowAddress;
- handlePageStartAddressChanged(pageStart);
- }
- }
-
- private void updateDynamicLoadProperty() {
-
- boolean value = DebugUIPlugin
- .getDefault()
- .getPreferenceStore()
- .getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM);
-
- if (value != isDynamicLoad())
- {
- fContentProvider.setDynamicLoad(value);
-
- if (!fIsDisposed) {
- if (isDynamicLoad()) {
- fContentInput.setPostBuffer(20);
- fContentInput.setPreBuffer(20);
- fContentInput.setNumLines(getNumberOfVisibleLines());
-
- } else {
- fContentInput.setPostBuffer(0);
- fContentInput.setPreBuffer(0);
- fContentInput.setNumLines(fPageSize);
- }
- }
- }
- }
-
- /**
- * Handle top visible address change event from synchronizer
- * @param address
- */
- private void topVisibleAddressChanged(final BigInteger address, boolean force)
- {
- // do not handle event if rendering is not visible
- // continue to handle event if caller decides to force the rendering
- // to move to the top visible address even when the rendering
- // is not visible
- if (!isVisible() && !force)
- return;
-
- // do not handle event if the base address of the memory
- // block has changed, wait for debug event to update to
- // new location
- if (isBaseAddressChanged())
- return;
-
- if (!address.equals(fTopRowAddress))
- {
- fTopRowAddress = address;
- updateSyncTopAddress();
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
-
- handleTopAddressChangedforExtended(address);
- }
- else
- {
- handleTopAddressChangedForSimple(address);
- }
- }
- }
-
- /**
- * @param address
- */
- private void handleTopAddressChangedForSimple(final BigInteger address) {
- // IMemoryBlock support
- int index = findAddressIndex(address);
- Table table = fTableViewer.getTable();
- if (index >= 0)
- {
- setTopIndex(table, index);
- }
-
- if (isAddressVisible(fSelectedAddress))
- fTableCursor.setVisible(true);
- else
- fTableCursor.setVisible(false);
-
- }
-
- /**
- * @param address
- */
- private void handleTopAddressChangedforExtended(final BigInteger address) {
-
- Object evtLockClient = new Object();
- try
- {
- if (!fEvtHandleLock.acquireLock(evtLockClient))
- return;
-
- if (!isAddressOutOfRange(address))
- {
- Table table = fTableViewer.getTable();
- int index = findAddressIndex(address);
- int startThreshold = getBufferThreshold(BUFFER_START);
- int endThrreshold = getBufferThreshold(BUFFER_END);
- if (index >= startThreshold && table.getItemCount() - (index+getNumberOfVisibleLines()) >= endThrreshold)
- {
- // update cursor position
- setTopIndex(table, index);
- }
- else
- {
- int numInBuffer = table.getItemCount();
- if (index < getBufferThreshold(BUFFER_START))
- {
- if(isAtTopLimit())
- {
- setTopIndex(table, index);
- }
- else
- {
- if (isDynamicLoad() && getBufferThreshold(BUFFER_START) > 0)
- reloadTable(address, false);
- else
- setTopIndex(table, index);
- }
- }
- else if ((numInBuffer-(index+getNumberOfVisibleLines())) <= getBufferThreshold(BUFFER_END))
- {
- if (!isAtBottomLimit() && isDynamicLoad() && getBufferThreshold(BUFFER_END) > 0)
- reloadTable(address, false);
- else
- setTopIndex(table, index);
- }
- }
- }
- else
- {
- // approaching limit, reload table
- reloadTable(address, false);
- }
-
- if (isAddressVisible(fSelectedAddress))
- fTableCursor.setVisible(true);
- else
- fTableCursor.setVisible(false);
- }
- finally
- {
- fEvtHandleLock.releaseLock(evtLockClient);
- }
- }
-
- /**
- * @param value
- */
- private void selectedAddressChanged(BigInteger value) {
-
- // do not handle event if the base address of the memory
- // block has changed, wait for debug event to update to
- // new location
- if (isBaseAddressChanged())
- return;
-
- try {
- // do not handle event if the event is out of range and the
- // rendering is in non-dynamic-load mode, otherwise, will
- // cause rendering to continue to scroll when it shouldn't
- if (isDynamicLoad())
- goToAddress(value);
- else if (!isAddressOutOfRange(value))
- goToAddress(value);
- } catch (DebugException e) {
- // do nothing
- }
- }
-
- private void handlePageStartAddressChanged(BigInteger address)
- {
- // do not handle if in dynamic mode
- if (isDynamicLoad())
- return;
-
- if (fContentInput == null)
- return;
-
- if (!(getMemoryBlock() instanceof IMemoryBlockExtension))
- return;
-
- // do not handle event if the base address of the memory
- // block has changed, wait for debug event to update to
- // new location
- if (isBaseAddressChanged())
- return;
-
- if(fContentProvider.getBufferTopAddress().equals(address))
- return;
-
- BigInteger start = fContentInput.getStartAddress();
- BigInteger end = fContentInput.getEndAddress();
-
- // smaller than start address, load at start address
- if (address.compareTo(start) < 0)
- {
- if (isAtTopLimit())
- return;
-
- address = start;
- }
-
- // bigger than end address, no need to load, already at top
- if (address.compareTo(end) > 0)
- {
- if (isAtBottomLimit())
- return;
-
- address = end.subtract(BigInteger.valueOf(getPageSizeInUnits()));
- }
-
- fContentInput.setLoadAddress(address);
- refresh();
- updateSyncPageStartAddress();
- setTopIndex(fTableViewer.getTable(), 0);
- fTopRowAddress = address;
- updateSyncTopAddress();
-
- BigInteger selectedAddress = (BigInteger)getSynchronizedProperty(AbstractTableRendering.PROPERTY_SELECTED_ADDRESS);
- if (selectedAddress != null)
- {
- fSelectedAddress = selectedAddress;
- if (!isAddressOutOfRange(fSelectedAddress))
- {
- setCursorAtAddress(fSelectedAddress);
- fTableCursor.setVisible(true);
- }
- else
- {
- fTableCursor.setVisible(false);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#createControl(org.eclipse.swt.widgets.Composite)
- */
- public Control createControl(Composite parent) {
-
- fPageBook = new PageBook(parent, SWT.NONE);
- createErrorPage(fPageBook);
- createTableViewer(fPageBook);
-
- fTableViewer.getTable().redraw();
- createToolTip();
-
- return fPageBook;
- }
-
- /**
- * Create the table viewer and other support controls
- * for this rendering.
- *
- * @param parent parent composite
- */
- private void createTableViewer(Composite parent) {
-
- fTableViewer= new TableViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.HIDE_SELECTION | SWT.BORDER);
-
- TableRenderingLabelProvider labelProvider;
- if (hasCustomizedDecorations())
- labelProvider = new TableRenderingLabelProviderEx(this);
- else
- labelProvider = new TableRenderingLabelProvider(this);
-
- fTableViewer.setLabelProvider(labelProvider);
-
- fContentProvider = new TableRenderingContentProvider();
- fContentProvider.setDynamicLoad(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM));
-
- fTableViewer.setContentProvider(fContentProvider);
- fContentProvider.setViewer(fTableViewer);
-
- ScrollBar scroll = ((Table)fTableViewer.getControl()).getVerticalBar();
- scroll.setMinimum(-100);
- scroll.setMaximum(200);
-
- fTableViewer.getTable().setHeaderVisible(true);
- fTableViewer.getTable().setLinesVisible(true);
-
-
- // set up addressable size and figure out number of bytes required per line
- fAddressableSize = -1;
- try {
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- fAddressableSize = ((IMemoryBlockExtension)getMemoryBlock()).getAddressableSize();
- } catch (DebugException e1) {
- // log error and default to 1
- fAddressableSize = 1;
- displayError(e1);
- return;
-
- }
- if (getAddressableSize() < 1)
- fAddressableSize = 1;
-
-// set up initial format
- setupInitialFormat();
-
-// set up selected address
- setupSelectedAddress();
-
- // figure out top visible address
- BigInteger topVisibleAddress = getInitialTopVisibleAddress();
-
- getPageSizeFromPreference();
-
-
- if (isDynamicLoad())
- {
- int numLines = getNumberOfVisibleLines();
- if (numLines <= 0)
- {
- // add listener to reload when we know the number of lines to load
- fTableViewer.getTable().addPaintListener(new PaintListener() {
- public void paintControl(PaintEvent e) {
- fTableViewer.getTable().removePaintListener(this);
- fContentInput.setNumLines(getNumberOfVisibleLines());
- reloadTable(fContentInput.getLoadAddress(), false);
- resizeColumnsToPreferredSize();
- setCursorAtAddress(fSelectedAddress);
- fTableCursor.setVisible(true);
- }});
- }
- fContentInput = new TableRenderingContentInput(this, fPreBuffer, fPostBuffer, topVisibleAddress, numLines, false, null);
- }
- else
- {
- BigInteger addressToLoad = topVisibleAddress;
-
- // check synchronization service to see if we need to sync with another rendering
- Object obj = getSynchronizedProperty(IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS);
- if (obj != null && obj instanceof BigInteger)
- {
- addressToLoad = (BigInteger)obj;
- }
- fContentInput = new TableRenderingContentInput(this, 0, 0, addressToLoad, fPageSize, false, null);
- }
-
- fTableViewer.setInput(fContentInput);
-
- // set up cell modifier
- fCellModifier = new TableRenderingCellModifier(this);
- fTableViewer.setCellModifier(fCellModifier);
-
- // SET UP FONT
- // set to a non-proportional font
- fTableViewer.getTable().setFont(JFaceResources.getFont(IInternalDebugUIConstants.FONT_NAME));
- if (!(getMemoryBlock() instanceof IMemoryBlockExtension))
- {
- // If not extended memory block, do not create any buffer
- // no scrolling
- fContentInput.setPreBuffer(0);
- fContentInput.setPostBuffer(0);
- }
-
- // set up table cursor
- createCursor(fTableViewer.getTable(), fSelectedAddress);
- fTableViewer.getTable().addMouseListener(new MouseAdapter() {
- public void mouseDown(MouseEvent e) {
- handleTableMouseEvent(e);
- }});
-
- // create pop up menu for the rendering
- createActions();
- createPopupMenu(fTableViewer.getControl());
- createPopupMenu(fTableCursor);
-
- fMenuListener = new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- fillContextMenu(manager);
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }};
- getPopupMenuManager().addMenuListener(fMenuListener);
-
- // now the rendering is successfully created
- fIsCreated = true;
-
- //synchronize
- addRenderingToSyncService();
- synchronize();
-
- fTopRowAddress = getTopVisibleAddress();
- // Need to resize column after content is filled in
- // Pack function does not work unless content is not filled in
- // since the table is not able to compute the preferred size.
- resizeColumnsToPreferredSize();
- try {
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- if(((IMemoryBlockExtension)getMemoryBlock()).getBigBaseAddress() == null)
- {
- DebugException e = new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.AbstractTableRendering_1, null));
- displayError(e);
- }
- }
- } catch (DebugException e1) {
- displayError(e1);
- }
-
- // add font change listener and update font when the font has been changed
- JFaceResources.getFontRegistry().addListener(this);
- fScrollbarSelectionListener = new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent event) {
- handleScrollBarSelection();
-
- }};
- scroll.addSelectionListener(fScrollbarSelectionListener);
- DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
- }
-
- private boolean validateInitialFormat()
- {
- int rowSize = getDefaultRowSize();
- int columnSize = getDefaultColumnSize();
-
- if (rowSize < columnSize || rowSize % columnSize != 0 || rowSize == 0 || columnSize == 0)
- {
- return false;
- }
- return true;
- }
-
- private BigInteger getInitialTopVisibleAddress() {
- BigInteger topVisibleAddress = (BigInteger) getSynchronizedProperty(AbstractTableRendering.PROPERTY_TOP_ADDRESS);
- if (topVisibleAddress == null)
- {
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- try {
- topVisibleAddress = ((IMemoryBlockExtension)getMemoryBlock()).getBigBaseAddress();
- } catch (DebugException e1) {
- topVisibleAddress = new BigInteger("0"); //$NON-NLS-1$
- }
- }
- else
- {
- topVisibleAddress = BigInteger.valueOf(getMemoryBlock().getStartAddress());
- }
- }
- return topVisibleAddress;
- }
-
- private void setupSelectedAddress() {
- // figure out selected address
- BigInteger selectedAddress = (BigInteger) getSynchronizedProperty(AbstractTableRendering.PROPERTY_SELECTED_ADDRESS);
- if (selectedAddress == null)
- {
- if (getMemoryBlock() instanceof IMemoryBlockExtension) {
- try {
- selectedAddress = ((IMemoryBlockExtension) getMemoryBlock())
- .getBigBaseAddress();
- } catch (DebugException e1) {
- selectedAddress = new BigInteger("0"); //$NON-NLS-1$
- }
- if (selectedAddress == null) {
- selectedAddress = new BigInteger("0"); //$NON-NLS-1$
- }
-
- } else {
- long address = getMemoryBlock().getStartAddress();
- selectedAddress = BigInteger.valueOf(address);
- }
- }
- setSelectedAddress(selectedAddress);
- }
-
- private void setupInitialFormat() {
-
- boolean validated = validateInitialFormat();
-
- if (!validated)
- {
- // pop up dialog to ask user for default values
- StringBuffer msgBuffer = new StringBuffer(DebugUIMessages.AbstractTableRendering_20);
- msgBuffer.append(" "); //$NON-NLS-1$
- msgBuffer.append(this.getLabel());
- msgBuffer.append("\n\n"); //$NON-NLS-1$
- msgBuffer.append(DebugUIMessages.AbstractTableRendering_16);
- msgBuffer.append("\n"); //$NON-NLS-1$
- msgBuffer.append(DebugUIMessages.AbstractTableRendering_18);
- msgBuffer.append("\n\n"); //$NON-NLS-1$
-
- int bytePerLine = fBytePerLine;
- int columnSize = fColumnSize;
-
- // initialize this value to populate the dialog properly
- fBytePerLine = getDefaultRowSize() / getAddressableSize();
- fColumnSize = getDefaultColumnSize() / getAddressableSize();
-
- FormatTableRenderingDialog dialog = new FormatTableRenderingDialog(this, DebugUIPlugin.getShell());
- dialog.openError(msgBuffer.toString());
-
- // restore to original value before formatting
- fBytePerLine = bytePerLine;
- fColumnSize = columnSize;
-
- bytePerLine = dialog.getRowSize() * getAddressableSize();
- columnSize = dialog.getColumnSize() * getAddressableSize();
-
- format(bytePerLine, columnSize);
- }
- else
- {
- // Row size is stored as number of addressable units in preference store
- int bytePerLine = getDefaultRowSize();
- // column size is now stored as number of addressable units
- int columnSize = getDefaultColumnSize();
-
- // format memory block with specified "bytesPerLine" and "columnSize"
- boolean ok = format(bytePerLine, columnSize);
-
- if (!ok)
- {
- // this is to ensure that the rest of the rendering can be created
- // and we can recover from a format error
- format(bytePerLine, bytePerLine);
- }
- }
- }
-
- private int getDefaultColumnSize() {
-
- // default to global preference store
- IPreferenceStore prefStore = DebugUITools.getPreferenceStore();
- int columnSize = prefStore.getInt(IDebugPreferenceConstants.PREF_COLUMN_SIZE);
- // actual column size is number of addressable units * size of the addressable unit
- columnSize = columnSize * getAddressableSize();
-
- // check synchronized column size
- Integer colSize = (Integer)getSynchronizedProperty(AbstractTableRendering.PROPERTY_COL_SIZE);
- if (colSize != null)
- {
- // column size is stored as actual number of bytes in synchronizer
- int syncColSize = colSize.intValue();
- if (syncColSize > 0)
- {
- columnSize = syncColSize;
- }
- }
- else
- {
- IPersistableDebugElement elmt = (IPersistableDebugElement)getMemoryBlock().getAdapter(IPersistableDebugElement.class);
- int defaultColSize = -1;
-
- if (elmt != null)
- {
- if (elmt.supportsProperty(this, IDebugPreferenceConstants.PREF_COL_SIZE_BY_MODEL))
- defaultColSize = getDefaultFromPersistableElement(IDebugPreferenceConstants.PREF_COL_SIZE_BY_MODEL);
- }
-
- if (defaultColSize <= 0)
- {
- // if not provided, get default by model
- defaultColSize = getDefaultColumnSizeByModel(getMemoryBlock().getModelIdentifier());
- }
-
- if (defaultColSize > 0)
- columnSize = defaultColSize * getAddressableSize();
- }
- return columnSize;
- }
-
- private int getDefaultRowSize() {
-
- int rowSize = DebugUITools.getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_ROW_SIZE);
- int bytePerLine = rowSize * getAddressableSize();
-
- // check synchronized row size
- Integer size = (Integer)getSynchronizedProperty(AbstractTableRendering.PROPERTY_ROW_SIZE);
- if (size != null)
- {
- // row size is stored as actual number of bytes in synchronizer
- int syncRowSize = size.intValue();
- if (syncRowSize > 0)
- {
- bytePerLine = syncRowSize;
- }
- }
- else
- {
- int defaultRowSize = -1;
- IPersistableDebugElement elmt = (IPersistableDebugElement)getMemoryBlock().getAdapter(IPersistableDebugElement.class);
- if (elmt != null)
- {
- if (elmt.supportsProperty(this, IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL))
- {
- defaultRowSize = getDefaultFromPersistableElement(IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL);
- return defaultRowSize * getAddressableSize();
- }
- }
-
- if (defaultRowSize <= 0)
- // no synchronized property, ask preference store by id
- defaultRowSize = getDefaultRowSizeByModel(getMemoryBlock().getModelIdentifier());
-
- if (defaultRowSize > 0)
- bytePerLine = defaultRowSize * getAddressableSize();
- }
- return bytePerLine;
- }
-
- private int getDefaultFromPersistableElement(String propertyId) {
- int defaultValue = -1;
- IPersistableDebugElement elmt = (IPersistableDebugElement)getMemoryBlock().getAdapter(IPersistableDebugElement.class);
- if (elmt != null)
- {
- try {
- Object valueMB = elmt.getProperty(this, propertyId);
- if (valueMB != null && !(valueMB instanceof Integer))
- {
- IStatus status = DebugUIPlugin.newErrorStatus("Model returned invalid type on " + propertyId, null); //$NON-NLS-1$
- DebugUIPlugin.log(status);
- }
-
- if (valueMB != null)
- {
- Integer value = (Integer)valueMB;
- defaultValue = value.intValue();
- }
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- return defaultValue;
- }
-
- private void getPageSizeFromPreference()
- {
- fPageSize = DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE);
- fPreBuffer = DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PRE_BUFFER_SIZE);
- fPostBuffer = DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_TABLE_RENDERING_POST_BUFFER_SIZE);
- }
-
- private void createCursor(Table table, BigInteger address)
- {
- fTableCursor = new TableCursor(table, SWT.NONE);
- Display display = fTableCursor.getDisplay();
-
- // set up cursor color
- fTableCursor.setBackground(display.getSystemColor(SWT.COLOR_LIST_SELECTION));
- fTableCursor.setForeground(display.getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT));
-
- fTableCursor.setFont(JFaceResources.getFont(IInternalDebugUIConstants.FONT_NAME));
- fTableCursor.setVisible(true);
-
- fCursorKeyAdapter = new KeyAdapter() {
- public void keyPressed(KeyEvent e)
- {
- handleCursorKeyPressed(e);
- }
- };
- fTableCursor.addKeyListener(fCursorKeyAdapter);
-
- fCursorTraverseListener = new TraverseListener() {
- public void keyTraversed(TraverseEvent e) {
- handleCursorTraverseEvt(e);
- }};
-
- fTableCursor.addTraverseListener(fCursorTraverseListener);
-
- fCursorMouseListener = new MouseAdapter() {
- public void mouseDown(MouseEvent e) {
- handleCursorMouseEvent(e);
- }};
- fTableCursor.addMouseListener(fCursorMouseListener);
-
- // cursor may be disposed before disposed is called
- // remove listeners whenever the cursor is disposed
- fTableCursor.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- if (fTableCursor == null)
- return;
- fTableCursor.removeTraverseListener(fCursorTraverseListener);
- fTableCursor.removeKeyListener(fCursorKeyAdapter);
- fTableCursor.removeMouseListener(fCursorMouseListener);
- fTableCursor.removeSelectionListener(fCursorSelectionListener);
- }});
-
- fCursorSelectionListener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
-
- if (!fEvtHandleLock.acquireLock(this))
- return;
-
- handleCursorMoved();
-
- fEvtHandleLock.releaseLock(this);
-
- }
- };
- fTableCursor.addSelectionListener(fCursorSelectionListener);
-
-
- setCursorAtAddress(address);
-
- fCursorEditor = new TableEditor (fTableViewer.getTable());
- }
-
- private void handleCursorTraverseEvt(TraverseEvent e){
-
- if (fTableCursor.getRow() == null)
- return;
-
- Table table = (Table)fTableCursor.getParent();
- int row = table.indexOf(fTableCursor.getRow());
- int col = fTableCursor.getColumn();
- if (col == getNumCol() && e.keyCode == SWT.ARROW_RIGHT)
- {
- if (row + 1>= table.getItemCount())
- {
- return;
- }
-
- row = row +1;
- col = 0;
- fTableCursor.setSelection(row, col);
- }
- if (col <= 1 && e.keyCode == SWT.ARROW_LEFT)
- {
- if (row-1 < 0)
- {
- return;
- }
-
- row = row - 1;
- col = getNumCol()+1;
- fTableCursor.setSelection(row, col);
- }
-
- Object evtLockClient = new Object();
- if (!fEvtHandleLock.acquireLock(evtLockClient))
- return;
-
- handleCursorMoved();
-
- fEvtHandleLock.releaseLock(evtLockClient);
-
- }
-
- /**
- * Update selected address.
- * Load more memory if required.
- */
- private void handleCursorMoved()
- {
- if (fIsDisposed)
- return;
-
- BigInteger selectedAddress = getSelectedAddressFromCursor(fTableCursor);
-
- // when the cursor is moved, the selected address is changed
- if (selectedAddress != null && !selectedAddress.equals(fSelectedAddress))
- {
- setSelectedAddress(selectedAddress);
- updateSyncSelectedAddress();
- }
-
- // now check to see if the cursor is approaching buffer limit
- TableItem item = fTableCursor.getRow();
- if (item == null)
- return;
-
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- int row = fTableViewer.getTable().indexOf(item);
-
- if (row < getBufferThreshold(BUFFER_START))
- {
- if (!isAtTopLimit() && getBufferThreshold(BUFFER_START) > 0)
- {
- if (isDynamicLoad())
- {
- refresh();
- setCursorAtAddress(fSelectedAddress);
- }
- }
- }
- else if (row >= fTableViewer.getTable().getItemCount() - getBufferThreshold(BUFFER_END))
- {
- if (!isAtBottomLimit() && getBufferThreshold(BUFFER_END) > 0)
- {
- if (isDynamicLoad())
- {
- refresh();
- setCursorAtAddress(fSelectedAddress);
- }
- }
- }
- }
-
- // if the cursor has moved, the top index of the table may change
- // just update the synchronization service
- BigInteger address = getTopVisibleAddress();
- if (!address.equals(fTopRowAddress))
- {
- fTopRowAddress = address;
- updateSyncTopAddress();
- }
- }
-
- private void handleCursorKeyPressed(KeyEvent event)
- {
- // allow edit if user hits return
- if (event.character == '\r' && event.getSource() instanceof TableCursor)
- {
- activateCellEditor(null);
- return;
- }
-
- if (MemoryViewUtil.isValidEditEvent(event.keyCode))
- {
- // activate edit as soon as user types something at the cursor
- if (event.getSource() instanceof TableCursor)
- {
- String initialValue = String.valueOf(event.character);
- activateCellEditor(initialValue);
- return;
- }
- }
- }
-
- /**
- * Calculate selected address based on cursor's current position
- * @param cursor
- * @return the selected address
- */
- private BigInteger getSelectedAddressFromCursor(TableCursor cursor)
- {
- TableItem row = cursor.getRow();
- int col = cursor.getColumn();
-
- return getAddressFromTableItem(row, col);
- }
-
- private BigInteger getAddressFromTableItem(TableItem row, int col) {
- if (row == null)
- return null;
-
- // get row address
- String temp = ((TableRenderingLine)row.getData()).getAddress();
- BigInteger rowAddress = new BigInteger(temp, 16);
-
- int offset;
- if (col > 0)
- {
- // get address offset
- int addressableUnit = getAddressableUnitPerColumn();
- offset = (col-1) * addressableUnit;
- }
- else
- {
- offset = 0;
- }
-
- return rowAddress.add(BigInteger.valueOf(offset));
- }
-
-
- /**
- * Sets the cursor at the specified address
- * @param address
- * @return true if successful, false otherwise
- */
- private boolean setCursorAtAddress(BigInteger address)
- {
- if (fContentProvider.getBufferTopAddress() == null)
- return false;
-
- // selected address is out of range, simply return false
- if (address.compareTo(fContentProvider.getBufferTopAddress()) < 0)
- return false;
-
- // calculate selected row address
- int addressableUnit = getAddressableUnitPerLine();
- int numOfRows = address.subtract(fContentProvider.getBufferTopAddress()).intValue()/addressableUnit;
- BigInteger rowAddress = fContentProvider.getBufferTopAddress().add(BigInteger.valueOf(numOfRows * addressableUnit));
-
- // try to find the row of the selected address
- int row = findAddressIndex(address);
-
- if (row == -1)
- {
- return false;
- }
-
- // calculate offset to the row address
- BigInteger offset = address.subtract(rowAddress);
-
- // locate column
- int colAddressableUnit = getAddressableUnitPerColumn();
- int col = ((offset.intValue()/colAddressableUnit)+1);
-
- if (col == 0)
- col = 1;
-
- fTableCursor.setSelection(row, col);
-
- return true;
- }
-
-
- /**
- * Format view tab based on the bytes per line and column.
- *
- * @param bytesPerLine - number of bytes per line, possible values: (1 / 2 / 4 / 8 / 16 / 32 / 64 / 128) * addressableSize
- * @param columnSize - number of bytes per column, possible values: (1 / 2 / 4 / 8 / 16 / 32 / 64 / 128) * addressableSize
- * @return true if format is successful, false, otherwise
- *
- */
- public boolean format(int bytesPerLine, int columnSize)
- {
-
- // selected address gets changed as the cursor is moved
- // during the reformat.
- // Back up the address and restore it later.
- BigInteger selectedAddress = fSelectedAddress;
-
- // bytes per cell must be divisible to bytesPerLine
- if (bytesPerLine % columnSize != 0)
- {
- return false;
- }
-
- if (bytesPerLine < columnSize)
- {
- return false;
- }
-
- // do not format if the view tab is already in that format
- if(fBytePerLine == bytesPerLine && fColumnSize == columnSize){
- return false;
- }
-
- fBytePerLine = bytesPerLine;
- fColumnSize = columnSize;
-
- Object evtLockClient = new Object();
- if (!fEvtHandleLock.acquireLock(evtLockClient))
- return false;
-
- // if the tab is already created and is being reformatted
- if (fIsCreated)
- {
- if (fTableViewer == null)
- return false;
-
- if (fTableViewer.getTable() == null)
- return false;
-
- // clean up old columns
- TableColumn[] oldColumns = fTableViewer.getTable().getColumns();
-
- for (int i=0; i<oldColumns.length; i++)
- {
- oldColumns[i].dispose();
- }
-
- // clean up old cell editors
- CellEditor[] oldCellEditors = fTableViewer.getCellEditors();
-
- for (int i=0; i<oldCellEditors.length; i++)
- {
- oldCellEditors[i].dispose();
- }
- }
-
- TableColumn column0 = new TableColumn(fTableViewer.getTable(),SWT.LEFT,0);
- column0.setText(DebugUIMessages.AbstractTableRendering_2);
-
- // create new byte columns
- TableColumn [] byteColumns = new TableColumn[bytesPerLine/columnSize];
-
- String[] columnLabels = new String[0];
- IMemoryBlockTablePresentation presentation = getTablePresentationAdapter();
- if (presentation != null)
- {
- columnLabels = presentation.getColumnLabels(getMemoryBlock(), bytesPerLine, getNumCol());
- }
-
- // check that column labels are not null
- if (columnLabels == null)
- columnLabels = new String[0];
-
- for (int i=0;i<byteColumns.length; i++)
- {
- TableColumn column = new TableColumn(fTableViewer.getTable(), SWT.LEFT, i+1);
-
- // if the number of column labels returned is correct
- // use supplied column labels
- if (columnLabels.length == byteColumns.length)
- {
- column.setText(columnLabels[i]);
- }
- else
- {
- // otherwise, use default
- int addressableUnit = columnSize/getAddressableSize();
- if (getAddressableUnitPerColumn() >= 4)
- {
- column.setText(Integer.toHexString(i*addressableUnit).toUpperCase() +
- " - " + Integer.toHexString(i*addressableUnit+addressableUnit-1).toUpperCase()); //$NON-NLS-1$
- }
- else
- {
- column.setText(Integer.toHexString(i*addressableUnit).toUpperCase());
- }
- }
- }
-
- //Empty column for cursor navigation
- TableColumn emptyCol = new TableColumn(fTableViewer.getTable(),SWT.LEFT,byteColumns.length+1);
- emptyCol.setText(" "); //$NON-NLS-1$
- emptyCol.setWidth(1);
- emptyCol.setResizable(false);
-
- // +2 to include properties for address and navigation column
- String[] columnProperties = new String[byteColumns.length+2];
- columnProperties[0] = TableRenderingLine.P_ADDRESS;
-
- int addressableUnit = columnSize / getAddressableSize();
-
- // use column beginning offset to the row address as properties
- for (int i=1; i<columnProperties.length-1; i++)
- {
- // column properties are stored as number of addressable units from the
- // the line address
- columnProperties[i] = Integer.toHexString((i-1)*addressableUnit);
- }
-
- // Empty column for cursor navigation
- columnProperties[columnProperties.length-1] = " "; //$NON-NLS-1$
-
- fTableViewer.setColumnProperties(columnProperties);
-
-
- Table table = fTableViewer.getTable();
- fEditors = new CellEditor[table.getColumnCount()];
- for (int i=0; i<fEditors.length; i++)
- {
- fEditors[i] = new TextCellEditor(table);
- }
-
- // create and set cell editors
- fTableViewer.setCellEditors(fEditors);
-
- if (fIsCreated)
- {
- fTableViewer.refresh();
- }
-
- resizeColumnsToPreferredSize();
- updateSyncRowSize();
- updateSyncColSize();
-
- if (fIsCreated)
- {
- // for Linux GTK, this must happen after table viewer is refreshed
- int i = findAddressIndex(fTopRowAddress);
-
- if (i >= 0)
- setTopIndex(fTableViewer.getTable(), i);
-
- if (isAddressVisible(selectedAddress))
- // after refresh, make sure the cursor is at the correct position
- setCursorAtAddress(selectedAddress);
- }
-
- fEvtHandleLock.releaseLock(evtLockClient);
-
- return true;
- }
-
- /**
- * Create the error page for this rendering.
- * The error page is used to report any error resulted from
- * getting memory from a memory block.
- * @param parent
- */
- private void createErrorPage(Composite parent)
- {
- if (fTextViewer == null)
- {
- fTextViewer = new TextViewer(parent, SWT.WRAP);
- fTextViewer.setDocument(new Document());
- StyledText styleText = fTextViewer.getTextWidget();
- styleText.setEditable(false);
- styleText.setEnabled(false);
- }
- }
-
- /**
- * Displays the content of the table viewer.
- */
- public void displayTable()
- {
- fIsShowingErrorPage = false;
- fPageBook.showPage(fTableViewer.getControl());
- }
-
- /**
- * Displays an error message for the given exception.
- *
- * @param e exception to display
- */
- public void displayError(DebugException e)
- {
- StyledText styleText = null;
- fIsShowingErrorPage = true;
-
- styleText = fTextViewer.getTextWidget();
-
- if (styleText != null)
- styleText.setText(DebugUIMessages.AbstractTableRendering_3 + e.getMessage());
- fPageBook.showPage(fTextViewer.getControl());
-
- // clear content cache if we need to display error
- fContentProvider.clearContentCache();
- }
-
- /**
- * Returns whether the error page is displayed.
- *
- * @return whether the error page is displayed
- */
- public boolean isDisplayingError()
- {
- return fIsShowingErrorPage;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#getControl()
- */
- public Control getControl() {
- return fPageBook;
- }
-
- /**
- * Returns the addressable size of this rendering's memory block in bytes.
- *
- * @return the addressable size of this rendering's memory block in bytes
- */
- public int getAddressableSize() {
- return fAddressableSize;
- }
-
- private Object getSynchronizedProperty(String propertyId)
- {
- IMemoryRenderingSynchronizationService syncService = getMemoryRenderingContainer().getMemoryRenderingSite().getSynchronizationService();
-
- if (syncService == null)
- return null;
-
- return syncService.getProperty(getMemoryBlock(), propertyId);
- }
-
- /**
- * This method estimates the number of visible lines in the rendering
- * table.
- * @return estimated number of visible lines in the table
- */
- private int getNumberOfVisibleLines()
- {
- if(fTableViewer == null)
- return -1;
-
- Table table = fTableViewer.getTable();
- int height = fTableViewer.getTable().getSize().y;
-
- // when table is not yet created, height is zero
- if (height == 0)
- {
- // make use of the table viewer to estimate table size
- height = fTableViewer.getTable().getParent().getSize().y;
- }
-
- int numberOfLines = doGetNumberOfVisibleLines(table, height);
-
- if (numberOfLines <= 0)
- {
- return 0;
- }
-
- return numberOfLines;
- }
-
- /**
- * @param table
- * @param height
- * @return
- */
- private int doGetNumberOfVisibleLines(Table table, int height) {
- // height of border
- int border = fTableViewer.getTable().getHeaderHeight();
-
- // height of scroll bar
- int scroll = fTableViewer.getTable().getHorizontalBar().getSize().y;
-
- // height of table is table's area minus border and scroll bar height
- height = height-border-scroll;
-
- // calculate number of visible lines
- int lineHeight = getMinTableItemHeight(table);
-
- int numberOfLines = height/lineHeight;
- return numberOfLines;
- }
-
- private static void setTopIndex(Table table, int index)
- {
- table.setTopIndex(index);
- }
-
- private void addRenderingToSyncService()
- {
- IMemoryRenderingSynchronizationService syncService = getMemoryRenderingContainer().getMemoryRenderingSite().getSynchronizationService();
-
- if (syncService == null)
- return;
-
- syncService.addPropertyChangeListener(this, null);
-
- // we could be in a format error even though the error is not yet displayed
- // do not update sync property in this case
- if (!isDisplayingError())
- {
- if (syncService.getSynchronizationProvider() == null)
- syncService.setSynchronizationProvider(this);
-
- // check if there is already synchronization info available
- Object selectedAddress =getSynchronizedProperty( AbstractTableRendering.PROPERTY_SELECTED_ADDRESS);
- Object rowSize = getSynchronizedProperty(AbstractTableRendering.PROPERTY_ROW_SIZE);
- Object colSize =getSynchronizedProperty( AbstractTableRendering.PROPERTY_COL_SIZE);
- Object topAddress =getSynchronizedProperty( AbstractTableRendering.PROPERTY_TOP_ADDRESS);
-
- if (!isDynamicLoad())
- {
- Object pageStartAddress = getSynchronizedProperty(IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS);
- if (pageStartAddress == null)
- updateSyncPageStartAddress();
- }
-
- // if info is available, some other view tab has already been
- // created
- // do not overwrite info in the synchronizer if that's the case
- if (selectedAddress == null) {
- updateSyncSelectedAddress();
- }
-
- if (rowSize == null)
- {
- updateSyncRowSize();
- }
-
- if (colSize == null) {
- updateSyncColSize();
- }
- if (topAddress == null) {
- updateSyncTopAddress();
- }
- }
- }
-
- /**
- * Get properties from synchronizer and synchronize settings
- */
- private void synchronize()
- {
- if (!isDynamicLoad())
- {
- BigInteger pageStart = (BigInteger)getSynchronizedProperty(IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS);
- if (pageStart != null && fContentInput != null && fContentInput.getLoadAddress() != null)
- {
- if (!fContentInput.getLoadAddress().equals(pageStart))
- handlePageStartAddressChanged(pageStart);
- }
- else if (pageStart != null)
- {
- handlePageStartAddressChanged(pageStart);
- }
- }
-
- Integer rowSize = (Integer) getSynchronizedProperty(AbstractTableRendering.PROPERTY_ROW_SIZE);
- Integer columnSize = (Integer) getSynchronizedProperty(AbstractTableRendering.PROPERTY_COL_SIZE);
- BigInteger selectedAddress = (BigInteger)getSynchronizedProperty(AbstractTableRendering.PROPERTY_SELECTED_ADDRESS);
- BigInteger topAddress = (BigInteger)getSynchronizedProperty(AbstractTableRendering.PROPERTY_TOP_ADDRESS);
-
- if (rowSize != null)
- {
- int rSize = rowSize.intValue();
- if (rSize > 0 && rSize != fBytePerLine) {
- rowSizeChanged(rSize);
- }
- }
-
- if (columnSize != null) {
- int colSize = columnSize.intValue();
- if (colSize > 0 && colSize != fColumnSize) {
- columnSizeChanged(colSize);
- }
- }
- if (topAddress != null) {
- if (!topAddress.equals(getTopVisibleAddress())) {
- if (selectedAddress != null) {
- if (!fSelectedAddress.equals(selectedAddress)) {
- selectedAddressChanged(selectedAddress);
- }
- }
- topVisibleAddressChanged(topAddress, false);
- }
- }
- if (selectedAddress != null) {
- if (selectedAddress.compareTo(fSelectedAddress) != 0) {
- selectedAddressChanged(selectedAddress);
- }
- }
- }
-
- /**
- * Resize column to the preferred size.
- */
- public void resizeColumnsToPreferredSize() {
- // pack columns
- Table table = fTableViewer.getTable();
- TableColumn[] columns = table.getColumns();
-
- for (int i=0 ;i<columns.length-1; i++)
- {
- columns[i].pack();
- }
-
- if (!fIsShowAddressColumn)
- {
- columns[0].setWidth(0);
- }
- }
-
- /**
- * update selected address in synchronizer if update is true.
- */
- private void updateSyncSelectedAddress() {
-
- if (!fIsCreated)
- return;
- PropertyChangeEvent event = new PropertyChangeEvent(this, AbstractTableRendering.PROPERTY_SELECTED_ADDRESS, null, fSelectedAddress);
- firePropertyChangedEvent(event);
- }
-
- /**
- * update column size in synchronizer
- */
- private void updateSyncColSize() {
-
- if (!fIsCreated)
- return;
-
- PropertyChangeEvent event = new PropertyChangeEvent(this, AbstractTableRendering.PROPERTY_COL_SIZE, null, new Integer(fColumnSize));
- firePropertyChangedEvent(event);
- }
-
- /**
- * update column size in synchronizer
- */
- private void updateSyncRowSize() {
-
- if (!fIsCreated)
- return;
-
- PropertyChangeEvent event = new PropertyChangeEvent(this, AbstractTableRendering.PROPERTY_ROW_SIZE, null, new Integer(fBytePerLine));
- firePropertyChangedEvent(event);
- }
-
- /**
- * update top visible address in synchronizer
- */
- private void updateSyncTopAddress() {
-
- if (!fIsCreated)
- return;
-
- PropertyChangeEvent event = new PropertyChangeEvent(this, AbstractTableRendering.PROPERTY_TOP_ADDRESS, null, fTopRowAddress);
- firePropertyChangedEvent(event);
- }
-
- private void updateSyncPageStartAddress() {
-
- if (!fIsCreated)
- return;
-
- if (isBaseAddressChanged())
- return;
-
- BigInteger pageStart;
- if (isDynamicLoad())
- {
- // if dynamic loading, the page address should be the top
- // row address
- pageStart = fTopRowAddress;
- }
- else
- {
- // otherwise, the address is the buffer's start address
- pageStart = fContentProvider.getBufferTopAddress();
- }
-
- PropertyChangeEvent event = new PropertyChangeEvent(this, IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS, null, pageStart);
- firePropertyChangedEvent(event);
- }
-
- /**
- * Fills the context menu for this rendering
- *
- * @param menu menu to fill
- */
- protected void fillContextMenu(IMenuManager menu) {
-
- menu.add(new Separator("topMenu")); //$NON-NLS-1$
- menu.add(fResetMemoryBlockAction);
- menu.add(fGoToAddressAction);
-
- menu.add(new Separator());
-
- menu.add(fFormatRenderingAction);
-
- if (!isDynamicLoad() && getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- menu.add(new Separator());
- menu.add(fPrevAction);
- menu.add(fNextAction);
- }
-
- menu.add(new Separator());
- menu.add(fReformatAction);
- menu.add(fToggleAddressColumnAction);
- menu.add(new Separator());
- menu.add(fCopyToClipboardAction);
- menu.add(fPrintViewTabAction);
- if (fPropertiesAction != null)
- {
- menu.add(new Separator());
- menu.add(fPropertiesAction);
- }
-
- }
-
- /**
- * Returns the number of addressable units per row.
- *
- * @return number of addressable units per row
- */
- public int getAddressableUnitPerLine() {
- return fBytePerLine / getAddressableSize();
- }
-
- /**
- * Returns the number of addressable units per column.
- *
- * @return number of addressable units per column
- */
- public int getAddressableUnitPerColumn() {
- return fColumnSize / getAddressableSize();
- }
-
- /**
- * Returns the number of bytes displayed in a single column cell.
- *
- * @return the number of bytes displayed in a single column cell
- */
- public int getBytesPerColumn()
- {
- return fColumnSize;
- }
-
- /**
- * Returns the number of bytes displayed in a row.
- *
- * @return the number of bytes displayed in a row
- */
- public int getBytesPerLine()
- {
- return fBytePerLine;
- }
-
- /**
- * Updates labels of this rendering.
- */
- public void updateLabels()
- {
- // update tab labels
- updateRenderingLabel(true);
-
- if (fTableViewer != null)
- {
- // update column labels
- setColumnHeadings();
- fTableViewer.refresh();
- }
- }
-
-
- /* Returns the label of this rendering.
- *
- * @return label of this rendering
- */
- public String getLabel() {
- if (fLabel == null)
- fLabel = buildLabel(true);
-
- return fLabel;
- }
-
-
- /**
- * Updates the label of this rendering, optionally displaying the
- * base address of this rendering's memory block.
- *
- * @param showAddress whether to display the base address of this
- * rendering's memory block in this rendering's label
- */
- protected void updateRenderingLabel(boolean showAddress)
- {
- fLabel = buildLabel(showAddress);
- firePropertyChangedEvent(new PropertyChangeEvent(this, IBasicPropertyConstants.P_TEXT, null, fLabel));
- }
-
- private String buildLabel(boolean showAddress) {
- String label = IInternalDebugCoreConstants.EMPTY_STRING;
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- label = ((IMemoryBlockExtension)getMemoryBlock()).getExpression();
-
- if (label.startsWith("&")) //$NON-NLS-1$
- label = "&" + label; //$NON-NLS-1$
-
- if (label == null)
- {
- label = DebugUIMessages.AbstractTableRendering_8;
- }
-
- try {
- if (showAddress && ((IMemoryBlockExtension)getMemoryBlock()).getBigBaseAddress() != null)
- {
- label += " : 0x"; //$NON-NLS-1$
- label += ((IMemoryBlockExtension)getMemoryBlock()).getBigBaseAddress().toString(16).toUpperCase();
- }
- } catch (DebugException e) {
- // do nothing, the label will not show the address
- }
- }
- else
- {
- long address = getMemoryBlock().getStartAddress();
- label = Long.toHexString(address).toUpperCase();
- }
-
- String preName = DebugUITools.getMemoryRenderingManager().getRenderingType(getRenderingId()).getLabel();
-
- if (preName != null)
- label += " <" + preName + ">"; //$NON-NLS-1$ //$NON-NLS-2$
-
- return decorateLabel(label);
- }
-
- private void setColumnHeadings()
- {
- String[] columnLabels = new String[0];
-
- IMemoryBlockTablePresentation presentation = getTablePresentationAdapter();
- if (presentation != null)
- {
- columnLabels = presentation.getColumnLabels(getMemoryBlock(), fBytePerLine, getNumCol());
- }
-
- // check that column labels returned are not null
- if (columnLabels == null)
- columnLabels = new String[0];
-
- int numByteColumns = fBytePerLine/fColumnSize;
-
- TableColumn[] columns = fTableViewer.getTable().getColumns();
-
- int j=0;
- for (int i=1; i<columns.length-1; i++)
- {
- // if the number of column labels returned is correct
- // use supplied column labels
- if (columnLabels.length == numByteColumns)
- {
- columns[i].setText(columnLabels[j]);
- j++;
- }
- else
- {
- // otherwise, use default
- if (fColumnSize >= 4)
- {
- columns[i].setText(Integer.toHexString(j*fColumnSize).toUpperCase() +
- " - " + Integer.toHexString(j*fColumnSize+fColumnSize-1).toUpperCase()); //$NON-NLS-1$
- }
- else
- {
- columns[i].setText(Integer.toHexString(j*fColumnSize).toUpperCase());
- }
- j++;
- }
- }
- }
-
- /**
- * Refresh the table viewer with the current top visible address.
- * Update labels in the memory rendering.
- */
- public void refresh()
- {
- // refresh at start address of this memory block
- // address may change if expression is evaluated to a different value
- IMemoryBlock mem = getMemoryBlock();
- BigInteger address;
-
- if (mem instanceof IMemoryBlockExtension)
- {
- try {
- address = ((IMemoryBlockExtension)mem).getBigBaseAddress();
- if (address == null)
- {
- DebugException e = new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.AbstractTableRendering_10, null));
- displayError(e);
- return;
- }
- updateRenderingLabel(true);
- // base address has changed
- if (address.compareTo(fContentProvider.getContentBaseAddress()) != 0)
- {
- // get to new address
- setSelectedAddress(address);
- updateSyncSelectedAddress();
-
- reloadTable(address, true);
-
- if (!isDynamicLoad())
- {
- updateSyncPageStartAddress();
- setTopIndex(fTableViewer.getTable(), 0);
- }
-
- fTopRowAddress = getTopVisibleAddress();
- updateSyncTopAddress();
-
- fContentInput.updateContentBaseAddress();
- }
- else
- {
- // reload at top of table
- if (isDynamicLoad())
- address = getTopVisibleAddress();
- else
- address = fContentInput.getLoadAddress();
- reloadTable(address, true);
- }
- } catch (DebugException e) {
- displayError(e);
- return;
- }
- }
- else
- {
- address = BigInteger.valueOf(mem.getStartAddress());
- reloadTable(address, true);
- }
- }
-
- synchronized private void reloadTable(BigInteger topAddress, boolean updateDelta){
-
- if (fTableViewer == null)
- return;
-
- try
- {
- Table table = (Table)fTableViewer.getControl();
-
- TableRenderingContentInput input;
- if (isDynamicLoad())
- input = new TableRenderingContentInput(this, fPreBuffer, fPostBuffer, topAddress, getNumberOfVisibleLines(), updateDelta, null);
- else
- input = new TableRenderingContentInput(this, fContentInput.getPreBuffer(), fContentInput.getPostBuffer(), topAddress, fPageSize, updateDelta, null);
-
- fContentInput = input;
- fTableViewer.setInput(fContentInput);
-
- if (isDynamicLoad())
- {
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- int topIdx = findAddressIndex(topAddress);
-
- if (topIdx != -1)
- {
- setTopIndex(table, topIdx);
- }
- }
-
- // cursor needs to be refreshed after reload
- if (isAddressVisible(fSelectedAddress))
- setCursorAtAddress(fSelectedAddress);
- }
- else
- {
- if (!isAddressOutOfRange(fSelectedAddress))
- {
- setCursorAtAddress(fSelectedAddress);
- fTableCursor.setVisible(true);
- }
- else
- {
- fTableCursor.setVisible(false);
- }
- }
- }
- finally
- {
- }
- }
-
- private BigInteger getTopVisibleAddress() {
-
- if (fTableViewer == null)
- return BigInteger.valueOf(0);
-
- Table table = fTableViewer.getTable();
- int topIndex = getTopVisibleIndex(table);
-
- if (topIndex < 1) { topIndex = 0; }
-
- if (table.getItemCount() > topIndex)
- {
- TableRenderingLine topItem = (TableRenderingLine)table.getItem(topIndex).getData();
-
- String calculatedAddress = null;
- if (topItem == null)
- {
- calculatedAddress = table.getItem(topIndex).getText();
- }
- else
- {
- calculatedAddress = topItem.getAddress();
- }
-
- BigInteger bigInt = new BigInteger(calculatedAddress, 16);
- return bigInt;
- }
- return BigInteger.valueOf(0);
- }
-
- private int findAddressIndex(BigInteger address)
- {
- TableItem items[] = fTableViewer.getTable().getItems();
-
- for (int i=0; i<items.length; i++){
-
- // Again, when the table resizes, the table may have a null item
- // at then end. This is to handle that.
- if (items[i] != null)
- {
- TableRenderingLine line = (TableRenderingLine)items[i].getData();
- BigInteger lineAddress = new BigInteger(line.getAddress(), 16);
- int addressableUnit = getAddressableUnitPerLine();
- BigInteger endLineAddress = lineAddress.add(BigInteger.valueOf(addressableUnit));
-
- if (lineAddress.compareTo(address) <= 0 && endLineAddress.compareTo(address) > 0)
- {
- return i;
- }
- }
- }
-
- return -1;
- }
-
- private static int getTopVisibleIndex(Table table)
- {
- int index = table.getTopIndex();
-
- TableItem item;
- try {
- item = table.getItem(index);
- } catch (IllegalArgumentException e) {
- return 0;
- }
- int cnt = table.getItemCount();
-
- while (item.getBounds(0).y < 0)
- {
- index++;
- if (index >= cnt)
- {
- index--;
- break;
- }
- item = table.getItem(index);
- }
-
- return index;
- }
-
- /**
- * Returns this rendering's table viewer.
- */
- public TableViewer getTableViewer()
- {
- return fTableViewer;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#dispose()
- */
- public void dispose() {
- try {
- // prevent rendering from being disposed again
- if (fIsDisposed)
- return;
-
- fIsDisposed = true;
-
- if (fContentProvider != null)
- fContentProvider.dispose();
-
- ScrollBar scroll = ((Table)fTableViewer.getControl()).getVerticalBar();
- if (scroll != null && !scroll.isDisposed())
- scroll.removeSelectionListener(fScrollbarSelectionListener);
-
- if (!fTableCursor.isDisposed())
- {
- fTableCursor.removeTraverseListener(fCursorTraverseListener);
- fTableCursor.removeKeyListener(fCursorKeyAdapter);
- fTableCursor.removeMouseListener(fCursorMouseListener);
- }
-
- fCursorEditor.dispose();
-
- fTextViewer = null;
- fTableViewer = null;
- fTableCursor = null;
-
- // clean up cell editors
- for (int i=0; i<fEditors.length; i++)
- {
- fEditors[i].dispose();
- }
-
- // remove font change listener when the view tab is disposed
- JFaceResources.getFontRegistry().removeListener(this);
-
- // remove the view tab from the synchronizer
- IMemoryRenderingSynchronizationService syncService = getMemoryRenderingContainer().getMemoryRenderingSite().getSynchronizationService();
- if (syncService != null)
- syncService.removePropertyChangeListener(this);
-
- DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
-
- fToolTipShell.dispose();
-
- if (getPopupMenuManager() != null)
- {
- getPopupMenuManager().removeMenuListener(fMenuListener);
- }
-
- super.dispose();
-
- } catch (Exception e) {}
- }
-
- private int getNumCol() {
-
- int bytesPerLine = getBytesPerLine();
- int columnSize = getBytesPerColumn();
-
- return bytesPerLine/columnSize;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IMemoryViewTab#setFont(org.eclipse.swt.graphics.Font)
- */
- private void setFont(Font font)
- {
- int oldIdx = getTopVisibleIndex(fTableViewer.getTable());
-
- // BUG in table, if font is changed when table is not starting
- // from the top, causes table grid-line to be misaligned.
- setTopIndex(fTableViewer.getTable(), 0);
-
- // set font
- fTableViewer.getTable().setFont(font);
- fTableCursor.setFont(font);
-
- setTopIndex(fTableViewer.getTable(), oldIdx);
-
- resizeColumnsToPreferredSize();
-
- // update table cursor and force redraw
- setCursorAtAddress(fSelectedAddress);
- }
-
-
- /**
- * Moves the cursor to the specified address.
- * Will load more memory if the address is not currently visible.
- *
- * @param address address to position cursor at
- * @throws DebugException if an exception occurs
- */
- public void goToAddress(BigInteger address) throws DebugException {
- Object evtLockClient = new Object();
- try
- {
- if (!fEvtHandleLock.acquireLock(evtLockClient))
- return;
-
- // if address is within the range, highlight
- if (!isAddressOutOfRange(address))
- {
- setSelectedAddress(address);
- updateSyncSelectedAddress();
- setCursorAtAddress(fSelectedAddress);
-
- // force the cursor to be shown
- if (!isAddressVisible(fSelectedAddress))
- {
- int i = findAddressIndex(fSelectedAddress);
- fTableViewer.getTable().showItem(fTableViewer.getTable().getItem(i));
- }
- }
- else
- {
- // if not extended memory block
- // do not allow user to go to an address that's out of range
- if (!(getMemoryBlock() instanceof IMemoryBlockExtension))
- {
- Status stat = new Status(
- IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(),
- DebugException.NOT_SUPPORTED, DebugUIMessages.AbstractTableRendering_11, null
- );
- DebugException e = new DebugException(stat);
- throw e;
- }
-
- BigInteger startAdd = fContentInput.getStartAddress();
- BigInteger endAdd = fContentInput.getEndAddress();
-
- if (address.compareTo(startAdd) < 0 ||
- address.compareTo(endAdd) > 0)
- {
- Status stat = new Status(
- IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(),
- DebugException.NOT_SUPPORTED, DebugUIMessages.AbstractTableRendering_11, null
- );
- DebugException e = new DebugException(stat);
- throw e;
- }
-
- setSelectedAddress(address);
- updateSyncSelectedAddress();
-
- reloadTable(address, false);
-
- if (!isDynamicLoad())
- {
- updateSyncPageStartAddress();
- }
-
- // if the table is reloaded, the top address is changed in this case
- fTopRowAddress = address;
- updateSyncTopAddress();
-
- // set the cursor at the selected address after reload
- setCursorAtAddress(address);
- }
- fTableCursor.setVisible(true);
- }
- catch (DebugException e)
- {
- throw e;
- }
- finally
- {
- fEvtHandleLock.releaseLock(evtLockClient);
- }
- }
-
- /**
- * Check if address provided is out of buffered range
- * @param address
- * @return if address is out of buffered range
- */
- private boolean isAddressOutOfRange(BigInteger address)
- {
- return fContentProvider.isAddressOutOfRange(address);
- }
-
- /**
- * Check if address is visible
- * @param address
- * @return if the given address is visible
- */
- private boolean isAddressVisible(BigInteger address)
- {
- // if view tab is not yet created
- // cursor should always be visible
- if (!fIsCreated)
- return true;
-
- BigInteger topVisible = getTopVisibleAddress();
- int addressableUnit = getAddressableUnitPerLine();
- BigInteger lastVisible = getTopVisibleAddress().add(BigInteger.valueOf((getNumberOfVisibleLines() * addressableUnit) + addressableUnit));
-
- if (topVisible.compareTo(address) <= 0 && lastVisible.compareTo(address) > 0)
- {
- return true;
- }
- return false;
- }
-
- /**
- * Create actions for this rendering
- */
- protected void createActions() {
- fCopyToClipboardAction = new CopyTableRenderingToClipboardAction(this, fTableViewer);
- fGoToAddressAction = new GoToAddressAction(this);
- fResetMemoryBlockAction = new ResetToBaseAddressAction(this);
- fPrintViewTabAction = new PrintTableRenderingAction(this, fTableViewer);
-
- fFormatRenderingAction = new FormatTableRenderingAction(this);
- fReformatAction = new ReformatAction(this);
- fToggleAddressColumnAction = new ToggleAddressColumnAction();
-
- IMemoryRenderingSite site = getMemoryRenderingContainer().getMemoryRenderingSite();
- if (site.getSite().getSelectionProvider() != null)
- {
- fPropertiesAction = new PropertyDialogAction(site.getSite(),site.getSite().getSelectionProvider());
- }
-
- fNextAction = new NextPageAction();
- fPrevAction = new PrevPageAction();
- }
-
- /**
- * Handle scrolling and reload table if necessary
- * @param event
- */
- private synchronized void handleScrollBarSelection()
- {
- Object evtLockClient = new Object();
- try
- {
- if (fIsDisposed)
- return;
-
- BigInteger address = getTopVisibleAddress();
-
- if (!fTopRowAddress.equals(address))
- {
- fTopRowAddress = address;
- updateSyncTopAddress();
- }
-
- if (!fEvtHandleLock.acquireLock(evtLockClient))
- return;
-
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
-
- if (isDynamicLoad())
- {
- if (!isAddressOutOfRange(address))
- {
- Table table = fTableViewer.getTable();
- int numInBuffer = table.getItemCount();
- int index = findAddressIndex(address);
- if (index < getBufferThreshold(BUFFER_START))
- {
- if (isAtTopLimit())
- {
- setTopIndex(table, index);
- }
- else if (getBufferThreshold(BUFFER_START) > 0)
- {
- reloadTable(address, false);
- }
- }
- else if (getBufferThreshold(BUFFER_END) != 0 &&
- (numInBuffer-(index+getNumberOfVisibleLines())) <= getBufferThreshold(BUFFER_END))
- {
- if (!isAtBottomLimit() && getBufferThreshold(BUFFER_END) > 0)
- reloadTable(address, false);
- }
- }
- else
- {
- // approaching limit, reload table
- reloadTable(address, false);
- }
- }
-
- if (isAddressVisible(fSelectedAddress))
- fTableCursor.setVisible(true);
- else
- fTableCursor.setVisible(false);
- }
- }
- finally
- {
- fEvtHandleLock.releaseLock(evtLockClient);
- }
- }
-
-
- private boolean isAtTopLimit()
- {
- BigInteger startAddress = fContentInput.getStartAddress();
- startAddress = MemoryViewUtil.alignToBoundary(startAddress, getAddressableUnitPerLine() );
-
- BigInteger startBufferAddress = fContentProvider.getBufferTopAddress();
- startBufferAddress = MemoryViewUtil.alignToBoundary(startBufferAddress, getAddressableUnitPerLine());
-
- if (startAddress.compareTo(startBufferAddress) == 0)
- return true;
-
- return false;
- }
-
- private boolean isAtBottomLimit()
- {
- BigInteger endAddress = fContentInput.getEndAddress();
- endAddress = MemoryViewUtil.alignToBoundary(endAddress, getAddressableUnitPerLine());
-
- BigInteger endBufferAddress = fContentProvider.getBufferEndAddress();
- endBufferAddress = MemoryViewUtil.alignToBoundary(endBufferAddress, getAddressableUnitPerLine());
-
- if (endAddress.compareTo(endBufferAddress) == 0)
- return true;
-
- return false;
- }
-
- private boolean needMoreLines()
- {
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- Table table = fTableViewer.getTable();
- TableItem firstItem = table.getItem(0);
- TableItem lastItem = table.getItem(table.getItemCount()-1);
-
- if (firstItem == null || lastItem == null)
- return true;
-
- TableRenderingLine first = (TableRenderingLine)firstItem.getData();
- TableRenderingLine last = (TableRenderingLine) lastItem.getData();
-
- if (first == null ||last == null)
- {
- // For some reason, the table does not return the correct number
- // of table items in table.getItemCount(), causing last to be null.
- // This check is to ensure that we don't get a null pointer exception.
- return true;
- }
-
- BigInteger startAddress = new BigInteger(first.getAddress(), 16);
- BigInteger lastAddress = new BigInteger(last.getAddress(), 16);
- int addressableUnit = getAddressableUnitPerLine();
- lastAddress = lastAddress.add(BigInteger.valueOf(addressableUnit));
-
- BigInteger topVisibleAddress = getTopVisibleAddress();
- long numVisibleLines = getNumberOfVisibleLines();
- long numOfBytes = numVisibleLines * addressableUnit;
-
- BigInteger lastVisibleAddrss = topVisibleAddress.add(BigInteger.valueOf(numOfBytes));
-
- // if there are only 3 lines left at the top, refresh
- BigInteger numTopLine = topVisibleAddress.subtract(startAddress).divide(BigInteger.valueOf(addressableUnit));
- if (numTopLine.compareTo(BigInteger.valueOf(getBufferThreshold(BUFFER_START))) <= 0 && (startAddress.compareTo(BigInteger.valueOf(0)) != 0))
- {
- if (!isAtTopLimit() && getBufferThreshold(BUFFER_START) > 0)
- return true;
- }
-
- // if there are only 3 lines left at the bottom, refresh
- BigInteger numBottomLine = lastAddress.subtract(lastVisibleAddrss).divide(BigInteger.valueOf(addressableUnit));
- if (numBottomLine.compareTo(BigInteger.valueOf(getBufferThreshold(BUFFER_END))) <= 0)
- {
- if (!isAtBottomLimit() && getBufferThreshold(BUFFER_END) > 0)
- return true;
- }
-
- return false;
- }
-
- return false;
- }
-
- private void handleTableMouseEvent(MouseEvent e) {
- // figure out new cursor position based on here the mouse is pointing
- TableItem[] tableItems = fTableViewer.getTable().getItems();
- TableItem selectedRow = null;
- int colNum = -1;
- int numCol = fTableViewer.getColumnProperties().length;
-
- for (int j=0; j<tableItems.length; j++)
- {
- TableItem item = tableItems[j];
- for (int i=0; i<numCol; i++)
- {
- Rectangle bound = item.getBounds(i);
- if (bound.contains(e.x, e.y))
- {
- colNum = i;
- selectedRow = item;
- break;
- }
- }
- }
-
- // if column position cannot be determined, return
- if (colNum < 1)
- return;
-
- // handle user mouse click onto table
- // move cursor to new position
- if (selectedRow != null)
- {
- int row = fTableViewer.getTable().indexOf(selectedRow);
- fTableCursor.setVisible(true);
- fTableCursor.setSelection(row, colNum);
-
- // manually call this since we don't get an event when
- // the table cursor changes selection.
- handleCursorMoved();
-
- fTableCursor.setFocus();
- }
- }
-
- /**
- * Handle column size changed event from synchronizer
- * @param newColumnSize
- */
- private void columnSizeChanged(final int newColumnSize) {
- // ignore event if view tab is disabled
- if (!isVisible())
- return;
-
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- format(getBytesPerLine(), newColumnSize);
- }
- });
- }
-
- /**
- * @param newRowSize - new row size in number of bytes
- */
- private void rowSizeChanged(final int newRowSize)
- {
- // ignore event if view tab is disabled
- if (!isVisible())
- return;
-
- int bytesPerLine = newRowSize;
- int col = getBytesPerColumn();
- if (bytesPerLine < getBytesPerColumn())
- col = bytesPerLine;
-
- final int columnSize = col;
- final int rowSize = bytesPerLine;
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- format(rowSize, columnSize);
- }
- });
- }
-
- private void handleCursorMouseEvent(MouseEvent e){
- if (e.button == 1)
- {
- int col = fTableCursor.getColumn();
- if (col > 0 && col <= (getNumCol()))
- activateCellEditor(null);
- }
- }
-
- /**
- * Activate cell editor and pre-fill it with initial value.
- * If initialValue is null, use cell content as initial value
- * @param initialValue
- */
- private void activateCellEditor(String initialValue) {
-
- int col = fTableCursor.getColumn();
- int row = findAddressIndex(fSelectedAddress);
-
- if (row < 0)
- return;
- // do not allow user to edit address column
- if (col == 0 || col > getNumCol())
- {
- return;
- }
-
- ICellModifier cellModifier = null;
-
- if (fTableViewer == null)
- {
- return;
- }
- cellModifier = fTableViewer.getCellModifier();
-
- TableItem tableItem = fTableViewer.getTable().getItem(row);
-
- Object element = tableItem.getData();
- Object property = fTableViewer.getColumnProperties()[col];
- Object value = cellModifier.getValue(element, (String)property);
-
- // The cell modifier canModify function always returns false if the edit action
- // is not invoked from here. This is to prevent data to be modified when
- // the table cursor loses focus from a cell. By default, data will
- // be changed in a table when the cell loses focus. This is to workaround
- // this default behavior and only change data when the cell editor
- // is activated.
- ((TableRenderingCellModifier)cellModifier).setEditActionInvoked(true);
- boolean canEdit = cellModifier.canModify(element, (String)property);
- ((TableRenderingCellModifier)cellModifier).setEditActionInvoked(false);
-
- if (!canEdit)
- return;
-
- // activate based on current cursor position
- TextCellEditor selectedEditor = (TextCellEditor)fTableViewer.getCellEditors()[col];
-
-
- if (fTableViewer != null && selectedEditor != null)
- {
- // The control that will be the editor must be a child of the Table
- Text text = (Text)selectedEditor.getControl();
-
- String cellValue = null;
-
- if (initialValue != null)
- {
- cellValue = initialValue;
- }
- else
- {
- cellValue = ((String)value);
- }
-
- text.setText(cellValue);
-
- fCursorEditor.horizontalAlignment = SWT.LEFT;
- fCursorEditor.grabHorizontal = true;
-
- // Open the text editor in selected column of the selected row.
- fCursorEditor.setEditor (text, tableItem, col);
-
- // Assign focus to the text control
- selectedEditor.setFocus();
-
- if (initialValue != null)
- {
- text.clearSelection();
- }
-
- text.setFont(JFaceResources.getFont(IInternalDebugUIConstants.FONT_NAME));
-
- // add listeners for the text control
- addListeners(text);
-
- // move cursor below text control
- fTableCursor.moveBelow(text);
- }
- }
-
- /**
- * @param text
- */
- private void addListeners(Text text) {
- fEditorFocusListener = new FocusAdapter() {
- public void focusLost(FocusEvent e)
- {
- handleTableEditorFocusLost(e);
- }
- };
- text.addFocusListener(fEditorFocusListener);
-
- fEditorKeyListener = new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- handleKeyEventInEditor(e);
- }
- };
-
- text.addKeyListener(fEditorKeyListener);
- }
-
- /**
- * @param text
- */
- private void removeListeners(Text text) {
-
- text.removeFocusListener(fEditorFocusListener);
- text.removeKeyListener(fEditorKeyListener);
- }
-
- private void handleTableEditorFocusLost(FocusEvent event)
- {
- final FocusEvent e = event;
-
- Display.getDefault().syncExec(new Runnable() {
-
- public void run()
- {
- try
- {
- int row = findAddressIndex(fSelectedAddress);
- int col = fTableCursor.getColumn();
-
- Text text = (Text)e.getSource();
- removeListeners(text);
-
- // get new value
- String newValue = text.getText();
-
- // modify memory at fRow and fCol
- modifyValue(row, col, newValue);
-
- // show cursor after modification is completed
- setCursorAtAddress(fSelectedAddress);
- fTableCursor.moveAbove(text);
- fTableCursor.setVisible(false);
- fTableCursor.setVisible(true);
- }
- catch (NumberFormatException e1)
- {
- MemoryViewUtil.openError(DebugUIMessages.MemoryViewCellModifier_failure_title,
- DebugUIMessages.MemoryViewCellModifier_data_is_invalid, null);
- }
- }
- });
- }
-
- /**
- * @param event
- */
- private void handleKeyEventInEditor(KeyEvent event) {
- final KeyEvent e = event;
- Display.getDefault().asyncExec(new Runnable()
- {
- public void run()
- {
- Text text = (Text)e.getSource();
- int row = findAddressIndex(fSelectedAddress);
- int col = fTableCursor.getColumn();
-
- try
- {
- switch (e.keyCode)
- {
- case SWT.ARROW_UP :
-
- // move text editor box up one row
- if (row-1 < 0)
- return;
-
- // modify value for current cell
- modifyValue(row, col, text.getText());
-
- row--;
-
- // update cursor location and selection in table
- fTableCursor.setSelection(row, col);
- handleCursorMoved();
-
- // remove listeners when focus is lost
- removeListeners(text);
- activateCellEditor(null);
- break;
- case SWT.ARROW_DOWN :
-
- // move text editor box down one row
-
- if (row+1 >= fTableViewer.getTable().getItemCount())
- return;
-
- // modify value for current cell
- modifyValue(row, col, text.getText());
-
- row++;
-
- // update cursor location and selection in table
- fTableCursor.setSelection(row, col);
- handleCursorMoved();
-
- // remove traverse listener when focus is lost
- removeListeners(text);
- activateCellEditor(null);
- break;
- case 0:
-
- // if user has entered the max number of characters allowed in a cell, move to next cell
- // Extra changes will be used as initial value for the next cell
- int numCharsPerByte = getNumCharsPerByte();
- if (numCharsPerByte > 0)
- {
- if (text.getText().length() > getBytesPerColumn()*numCharsPerByte)
- {
- String newValue = text.getText();
- text.setText(newValue.substring(0, getBytesPerColumn()*numCharsPerByte));
-
- modifyValue(row, col, text.getText());
-
- // if cursor is at the end of a line, move to next line
- if (col >= getNumCol())
- {
- col = 1;
- row++;
- }
- else
- {
- // move to next column
- row++;
- }
-
- // update cursor position and selected address
- fTableCursor.setSelection(row, col);
- handleCursorMoved();
-
- removeListeners(text);
-
- // activate text editor at next cell
- activateCellEditor(newValue.substring(getBytesPerColumn()*numCharsPerByte));
- }
- }
- break;
- case SWT.ESC:
-
- // if user has pressed escape, do not commit the changes
- // that's why "modifyValue" is not called
- fTableCursor.setSelection(row, col);
- handleCursorMoved();
-
- removeListeners(text);
-
- // cursor needs to have focus to remove focus from cell editor
- fTableCursor.setFocus();
- break;
- default :
- numCharsPerByte = getNumCharsPerByte();
- if (numCharsPerByte > 0)
- {
- if (text.getText().length()> getBytesPerColumn()* numCharsPerByte)
- {
- String newValue = text.getText();
- text.setText(newValue.substring(0,getBytesPerColumn()* numCharsPerByte));
- modifyValue(row, col, text.getText());
- // if cursor is at the end of a line, move to next line
- if (col >= getNumCol())
- {
- col = 1;
- row++;
- }
- else
- {
- col++;
- }
-
- fTableCursor.setSelection(row, col);
- handleCursorMoved();
-
- removeListeners(text);
-
- activateCellEditor(newValue.substring(getBytesPerColumn()*numCharsPerByte));
- }
- }
- break;
- }
- }
- catch (NumberFormatException e1)
- {
- MemoryViewUtil.openError(DebugUIMessages.MemoryViewCellModifier_failure_title,
- DebugUIMessages.MemoryViewCellModifier_data_is_invalid, null);
-
- fTableCursor.setSelection(row, col);
- handleCursorMoved();
-
- removeListeners(text);
- }
- }
- });
- }
-
-
- /**
- * Modify value and send new value to debug adapter
- * @param row
- * @param col
- * @param newValue
- * @throws NumberFormatException
- */
- private void modifyValue(int row, int col, String newValue) throws NumberFormatException
- {
- if (newValue.length() == 0)
- {
- // do not do anything if user has not entered anything
- return;
- }
-
- TableItem tableItem = fTableViewer.getTable().getItem(row);
-
- Object property = fTableViewer.getColumnProperties()[col];
- fTableViewer.getCellModifier().modify(tableItem, (String)property, newValue);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#becomesHidden()
- */
- public void becomesHidden() {
-
- if (isVisible() == false)
- {
- // super should always be called
- super.becomesHidden();
- return;
- }
-
- super.becomesHidden();
-
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- updateRenderingLabel(false);
- }
-
- // once the view tab is disabled, all deltas information becomes invalid.
- // reset changed information and recompute if data has really changed when
- // user revisits the same tab.
- fContentProvider.resetDeltas();
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRendering#becomesVisible()
- */
- public void becomesVisible() {
-
- // do not do anything if already visible
- if (isVisible() == true)
- {
- // super should always be called
- super.becomesVisible();
- return;
- }
-
- super.becomesVisible();
-
- boolean value = DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM);
- if (value != isDynamicLoad())
- // this call will cause a reload
- handleDyanicLoadChanged();
- else
- refresh();
-
- synchronize();
- updateRenderingLabel(true);
- }
-
- /**
- * Resets this memory rendering.
- * The cursor will be moved to the base address of the memory block.
- * The table will be positioned to have the base address
- * at the top.
- *
- * @deprecated use <code>resetRendering</code> to reset this rendering.
- */
- public void reset()
- {
- try {
- resetToBaseAddress();
- } catch (DebugException e) {
- MemoryViewUtil.openError(DebugUIMessages.AbstractTableRendering_12, DebugUIMessages.AbstractTableRendering_13, e); //
- }
- }
-
- /**
- * Reset this rendering to the base address.
- * The cursor will be moved to the base address of the memory block.
- * The table will be positioned to have the base address
- * at the top.
- * @throws DebugException
- */
- private void resetToBaseAddress() throws DebugException
- {
- BigInteger baseAddress;
-
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- baseAddress = ((IMemoryBlockExtension)getMemoryBlock()).getBigBaseAddress();
- }
- else
- {
- baseAddress = BigInteger.valueOf(getMemoryBlock().getStartAddress());
- }
-
- goToAddress(baseAddress);
- topVisibleAddressChanged(baseAddress, true);
- }
-
- /**
- * Returns the currently selected address in this rendering.
- *
- * @return the currently selected address in this rendering
- */
- public BigInteger getSelectedAddress() {
- return fSelectedAddress;
- }
-
- /**
- * Returns the currently selected content in this rendering as a String.
- *
- * @return the currently selected content in this rendering
- */
- public String getSelectedAsString() {
-
- if (isAddressOutOfRange(fSelectedAddress))
- return IInternalDebugCoreConstants.EMPTY_STRING;
-
- int col = fTableCursor.getColumn();
- TableItem rowItem = fTableCursor.getRow();
- int row = fTableViewer.getTable().indexOf(rowItem);
-
- if (col == 0)
- {
- return rowItem.getText(0);
- }
-
- // check precondition
- if (col > getBytesPerLine()/getBytesPerColumn())
- {
- return IInternalDebugCoreConstants.EMPTY_STRING;
- }
-
- TableItem tableItem = getTableViewer().getTable().getItem(row);
-
- return tableItem.getText(col);
- }
-
- /**
- * Returns the currently selected content in this rendering as MemoryByte.
- *
- * @return the currently selected content in array of MemoryByte.
- * Returns an empty array if the selected address is out of buffered range.
- */
- public MemoryByte[] getSelectedAsBytes()
- {
- if (isAddressOutOfRange(fSelectedAddress))
- return new MemoryByte[0];
-
- int col = fTableCursor.getColumn();
- TableItem rowItem = fTableCursor.getRow();
-
- // check precondition
- if (col == 0 || col > getBytesPerLine()/getBytesPerColumn())
- {
- return new MemoryByte[0];
- }
-
- Object data = rowItem.getData();
- if (data == null || !(data instanceof TableRenderingLine))
- return new MemoryByte[0];
-
- TableRenderingLine line = (TableRenderingLine)data;
- int offset = (col-1)*(getAddressableUnitPerColumn()*getAddressableSize());
- int end = offset + (getAddressableUnitPerColumn()*getAddressableSize());
-
- // make a copy of the bytes to ensure that data cannot be changed
- // by caller
- MemoryByte[] bytes = line.getBytes(offset, end);
- MemoryByte[] retBytes = new MemoryByte[bytes.length];
-
- System.arraycopy(bytes, 0, retBytes, 0, bytes.length);
-
- return retBytes;
- }
-
- /**
- * Returns the number of characters a byte will convert to
- * or -1 if unknown.
- *
- * @return the number of characters a byte will convert to
- * or -1 if unknown
- */
- public int getNumCharsPerByte()
- {
- return -1;
- }
-
- private int getMinTableItemHeight(Table table){
-
- // Hack to get around Linux GTK problem.
- // On Linux GTK, table items have variable item height as
- // carriage returns are actually shown in a cell. Some rows will be
- // taller than others. When calculating number of visible lines, we
- // need to find the smallest table item height. Otherwise, the rendering
- // underestimates the number of visible lines. As a result the rendering
- // will not be able to get more memory as needed.
- if (MemoryViewUtil.isLinuxGTK())
- {
- // check each of the items and find the minimum
- TableItem[] items = table.getItems();
- int minHeight = table.getItemHeight();
- for (int i=0; i<items.length; i++)
- {
- minHeight = Math.min(items[i].getBounds(0).height, minHeight);
- }
-
- return minHeight;
-
- }
- return table.getItemHeight();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
-
- if (adapter == IColorProvider.class)
- return getColorProviderAdapter();
-
- if (adapter == ILabelProvider.class)
- return getLabelProviderAdapter();
-
- if (adapter == IFontProvider.class)
- return getFontProviderAdapter();
-
- if (adapter == IMemoryBlockTablePresentation.class)
- return getTablePresentationAdapter();
-
- if (adapter == IWorkbenchAdapter.class)
- {
- // needed workbench adapter to fill the title of property page
- if (fWorkbenchAdapter == null) {
- fWorkbenchAdapter = new IWorkbenchAdapter() {
- public Object[] getChildren(Object o) {
- return new Object[0];
- }
-
- public ImageDescriptor getImageDescriptor(Object object) {
- return null;
- }
-
- public String getLabel(Object o) {
- return AbstractTableRendering.this.getLabel();
- }
-
- public Object getParent(Object o) {
- return null;
- }
- };
- }
- return fWorkbenchAdapter;
- }
-
- if (adapter == IMemoryBlockConnection.class) {
- if (fConnection == null) {
- fConnection = new IMemoryBlockConnection() {
- public void update() {
- try {
- fContentProvider.takeContentSnapshot();
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- BigInteger address = ((IMemoryBlockExtension)getMemoryBlock()).getBigBaseAddress();
- if (address.compareTo(fContentProvider.getContentBaseAddress()) != 0)
- {
- // get to new address
- setSelectedAddress(address);
- updateSyncSelectedAddress();
- fTopRowAddress = address;
- fContentInput.updateContentBaseAddress();
- fContentInput.setLoadAddress(address);
- }
- fContentProvider.loadContentForExtendedMemoryBlock();
- }
- else
- fContentProvider.loadContentForSimpleMemoryBlock();
-
- // update UI asynchronously
- Display display = DebugUIPlugin.getDefault().getWorkbench().getDisplay();
- display.asyncExec(new Runnable() {
- public void run() {
- updateLabels();
-
- if (getMemoryBlock() instanceof IMemoryBlockExtension) {
- int topIdx = findAddressIndex(fTopRowAddress);
- if (topIdx != -1) {
- setTopIndex(fTableViewer.getTable(),topIdx);
- }
- }
-
- // cursor needs to be refreshed after reload
- if (isAddressVisible(fSelectedAddress))
- {
- setCursorAtAddress(fSelectedAddress);
- fTableCursor.setVisible(true);
- fTableCursor.redraw();
- }
- else
- {
- fTableCursor.setVisible(false);
- }
-
- if (!isDynamicLoad())
- updateSyncPageStartAddress();
-
- updateSyncTopAddress();
- }
- });
- } catch (DebugException e) {
- displayError(e);
- }
- }
- };
- }
- return fConnection;
- }
-
- return super.getAdapter(adapter);
- }
-
- private boolean hasCustomizedDecorations()
- {
- if (getFontProviderAdapter() == null &&
- getColorProviderAdapter() == null &&
- getLabelProviderAdapter() == null)
- return false;
- return true;
- }
-
- private boolean isBaseAddressChanged()
- {
- try {
- IMemoryBlock mb = getMemoryBlock();
- if (mb instanceof IMemoryBlockExtension)
- {
- BigInteger baseAddress = ((IMemoryBlockExtension)mb).getBigBaseAddress();
- if (baseAddress != null)
- {
- if (!baseAddress.equals(fContentInput.getContentBaseAddress()))
- return true;
- }
- }
- } catch (DebugException e1) {
- return false;
- }
- return false;
- }
-
- /**
- * Returns the color provider for this rendering's memory block or
- * <code>null</code> if none.
- * <p>
- * By default a color provider is obtained by asking this rendering's
- * memory block for its {@link IColorProvider} adapter. When the color
- * provider is queried for color information, it is provided with a
- * {@link MemoryRenderingElement} as an argument.
- * </p>
- * @return the color provider for this rendering's memory block,
- * or <code>null</code>
- */
- protected IColorProvider getColorProviderAdapter()
- {
- return (IColorProvider)getMemoryBlock().getAdapter(IColorProvider.class);
- }
-
- /**
- * Returns the label provider for this rendering's memory block or
- * <code>null</code> if none.
- * <p>
- * By default a label provider is obtained by asking this rendering's
- * memory block for its {@link ILabelProvider} adapter. When the label
- * provider is queried for label information, it is provided with a
- * {@link MemoryRenderingElement} as an argument.
- * </p>
- * @return the label provider for this rendering's memory block,
- * or <code>null</code>
- */
- protected ILabelProvider getLabelProviderAdapter()
- {
- return (ILabelProvider)getMemoryBlock().getAdapter(ILabelProvider.class);
- }
-
- /**
- * Returns the font provider for this rendering's memory block or
- * <code>null</code> if none.
- * <p>
- * By default a font provider is obtained by asking this rendering's
- * memory block for its {@link IFontProvider} adapter. When the font
- * provider is queried for font information, it is provided with a
- * {@link MemoryRenderingElement} as an argument.
- * </p>
- * @return the font provider for this rendering's memory block,
- * or <code>null</code>
- */
- protected IFontProvider getFontProviderAdapter()
- {
- return (IFontProvider)getMemoryBlock().getAdapter(IFontProvider.class);
- }
-
- /**
- * Returns the table presentation for this rendering's memory block or
- * <code>null</code> if none.
- * <p>
- * By default a table presentation is obtained by asking this rendering's
- * memory block for its {@link IMemoryBlockTablePresentation} adapter.
- * </p>
- * @return the table presentation for this rendering's memory block,
- * or <code>null</code>
- */
- protected IMemoryBlockTablePresentation getTablePresentationAdapter()
- {
- return (IMemoryBlockTablePresentation)getMemoryBlock().getAdapter(IMemoryBlockTablePresentation.class);
- }
-
- private boolean isDynamicLoad()
- {
- return fContentProvider.isDynamicLoad();
- }
-
- private int getPageSizeInUnits()
- {
- return fPageSize * getAddressableUnitPerLine();
- }
-
- private void setSelectedAddress(BigInteger address)
- {
- fSelectedAddress = address;
- }
-
- /**
- * Setup the viewer so it supports hovers to show the offset of each field
- */
- private void createToolTip() {
-
- fToolTipShell = new Shell(DebugUIPlugin.getShell(), SWT.ON_TOP | SWT.RESIZE );
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 1;
- gridLayout.marginWidth = 2;
- gridLayout.marginHeight = 0;
- fToolTipShell.setLayout(gridLayout);
- fToolTipShell.setBackground(fTableViewer.getTable().getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
-
- final Control toolTipControl = createToolTipControl(fToolTipShell);
-
- if (toolTipControl == null)
- {
- // if client decide not to use tooltip support
- fToolTipShell.dispose();
- return;
- }
-
- MouseTrackAdapter listener = new MouseTrackAdapter(){
-
- private TableItem fTooltipItem = null;
- private int fCol = -1;
-
- public void mouseExit(MouseEvent e){
-
- if (!fToolTipShell.isDisposed())
- fToolTipShell.setVisible(false);
- fTooltipItem = null;
- }
-
- public void mouseHover(MouseEvent e){
-
- Point hoverPoint = new Point(e.x, e.y);
- Control control = null;
-
- if (e.widget instanceof Control)
- control = (Control)e.widget;
-
- if (control == null)
- return;
-
- hoverPoint = control.toDisplay(hoverPoint);
- TableItem item = getItem(hoverPoint);
- int column = getColumn(hoverPoint);
-
- //Only if there is a change in hover
- if(this.fTooltipItem != item || fCol != column){
-
- //Keep Track of the latest hover
- fTooltipItem = item;
- fCol = column;
-
- if(item != null){
- toolTipAboutToShow(toolTipControl, fTooltipItem, column);
-
- //Setting location of the tooltip
- Rectangle shellBounds = fToolTipShell.getBounds();
- shellBounds.x = hoverPoint.x;
- shellBounds.y = hoverPoint.y + item.getBounds(0).height;
-
- fToolTipShell.setBounds(shellBounds);
- fToolTipShell.pack();
-
- fToolTipShell.setVisible(true);
- }
- else {
- fToolTipShell.setVisible(false);
- }
- }
- }
- };
-
- fTableViewer.getTable().addMouseTrackListener(listener);
- fTableCursor.addMouseTrackListener(listener);
- }
-
- /**
- * Bug with table widget,BUG 113015, the widget is not able to return the correct
- * table item if SWT.FULL_SELECTION is not on when the table is created.
- * Created the following function to work around the problem.
- * We can remove this method when the bug is fixed.
- * @param point
- * @return the table item where the point is located, return null if the item cannot be located.
- */
- private TableItem getItem(Point point)
- {
- TableItem[] items = fTableViewer.getTable().getItems();
- for (int i=0; i<items.length; i++)
- {
- Point start = new Point(items[i].getBounds(0).x, items[i].getBounds(0).y);
- start = fTableViewer.getTable().toDisplay(start);
- Point end = new Point(start.x + items[i].getBounds(0).width, start.y + items[i].getBounds(0).height);
-
- if (start.y < point.y && point.y < end.y)
- return items[i];
- }
- return null;
- }
-
- /**
- * Method for figuring out which column the point is located.
- * @param point
- * @return the column index where the point is located, return -1 if column is not found.
- */
- private int getColumn(Point point) {
- int colCnt = fTableViewer.getTable().getColumnCount();
- if(fTableViewer.getTable().getItemCount() > 0) {
- TableItem item = fTableViewer.getTable().getItem(0);
- Point start, end;
- for (int i=0; i<colCnt; i++) {
- start = new Point(item.getBounds(i).x, item.getBounds(i).y);
- start = fTableViewer.getTable().toDisplay(start);
- end = new Point(start.x + item.getBounds(i).width, start.y + item.getBounds(i).height);
- if (start.x < point.x && end.x > point.x) {
- return i;
- }
- }
- }
- return -1;
- }
-
- /**
- * Creates the control used to display tool tips for cells in this table. By default
- * a label is used to display the address of the cell. Clients may override this
- * method to create custom tooltip controls.
- * <p>
- * Also see the methods <code>getToolTipText(...)</code> and
- * <code>toolTipAboutToShow(...)</code>.
- * </p>
- * @param composite parent for the tooltip control
- * @return the tooltip control to be displayed
- * @since 3.2
- */
- protected Control createToolTipControl(Composite composite) {
- Control fToolTipLabel = new Label(composite, SWT.NONE);
- fToolTipLabel.setForeground(fTableViewer.getTable().getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
- fToolTipLabel.setBackground(fTableViewer.getTable().getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
- fToolTipLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL |
- GridData.VERTICAL_ALIGN_CENTER));
- return fToolTipLabel;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IResettableMemoryRendering#resetRendering()
- */
- public void resetRendering() throws DebugException {
- resetToBaseAddress();
- }
-
- /**
- * Called when the tool tip is about to show in this rendering.
- * Clients who overrides <code>createTooltipControl</code> may need to
- * also override this method to ensure that the tooltip shows up properly
- * in their customized control.
- * <p>
- * By default a text tooltip is displayed, and the contents for the tooltip
- * are generated by the <code>getToolTipText(...)</code> method.
- * </p>
- * @param toolTipControl - the control for displaying the tooltip
- * @param item - the table item where the mouse is pointing.
- * @param col - the column at which the mouse is pointing.
- * @since 3.2
- */
- protected void toolTipAboutToShow(Control toolTipControl, TableItem item,
- int col) {
- if (toolTipControl instanceof Label) {
- BigInteger address = getAddressFromTableItem(item, col);
- if (address != null) {
- Object data = item.getData();
- if (data instanceof TableRenderingLine) {
- TableRenderingLine line = (TableRenderingLine) data;
-
- if (col > 0) {
- int start = (col - 1) * getBytesPerColumn();
- int end = start + getBytesPerColumn();
- MemoryByte[] bytes = line.getBytes(start, end);
-
- String str = getToolTipText(address, bytes);
-
- if (str != null)
- ((Label) toolTipControl).setText(str);
- } else {
- String str = getToolTipText(address,
- new MemoryByte[] {});
-
- if (str != null)
- ((Label) toolTipControl).setText(str);
- }
- }
- }
- }
- }
-
- /**
- * Returns the text to display in a tool tip at the specified address
- * for the specified bytes. By default the address of the bytes is displayed.
- * Subclasses may override.
- *
- * @param address address of cell that tool tip is displayed for
- * @param bytes the bytes in the cell
- * @return the tooltip text for the memory bytes located at the specified
- * address
- * @since 3.2
- */
- protected String getToolTipText(BigInteger address, MemoryByte[] bytes)
- {
- StringBuffer buf = new StringBuffer("0x"); //$NON-NLS-1$
- buf.append(address.toString(16).toUpperCase());
-
- return buf.toString();
- }
-
-
- private String getRowPrefId(String modelId) {
- String rowPrefId = IDebugPreferenceConstants.PREF_ROW_SIZE + ":" + modelId; //$NON-NLS-1$
- return rowPrefId;
- }
-
- private String getColumnPrefId(String modelId) {
- String colPrefId = IDebugPreferenceConstants.PREF_COLUMN_SIZE + ":" + modelId; //$NON-NLS-1$
- return colPrefId;
- }
-
- /**
- * @param modelId
- * @return default number of addressable units per line for the model
- */
- private int getDefaultRowSizeByModel(String modelId)
- {
- int row = DebugUITools.getPreferenceStore().getInt(getRowPrefId(modelId));
- if (row == 0)
- {
- DebugUITools.getPreferenceStore().setValue(getRowPrefId(modelId), IDebugPreferenceConstants.PREF_ROW_SIZE_DEFAULT);
- }
-
- row = DebugUITools.getPreferenceStore().getInt(getRowPrefId(modelId));
- return row;
-
- }
-
- /**
- * @param modelId
- * @return default number of addressable units per column for the model
- */
- private int getDefaultColumnSizeByModel(String modelId)
- {
- int col = DebugUITools.getPreferenceStore().getInt(getColumnPrefId(modelId));
- if (col == 0)
- {
- DebugUITools.getPreferenceStore().setValue(getColumnPrefId(modelId), IDebugPreferenceConstants.PREF_COLUMN_SIZE_DEFAULT);
- }
-
- col = DebugUITools.getPreferenceStore().getInt(getColumnPrefId(modelId));
- return col;
- }
-
- private int getBufferThreshold(int startOrEnd)
- {
- if (startOrEnd == BUFFER_START)
- {
- if (BUFFER_THRESHOLD > fPreBuffer)
- return fPreBuffer;
- return BUFFER_THRESHOLD;
- }
-
- if (BUFFER_THRESHOLD > fPostBuffer)
- return fPostBuffer;
-
- return BUFFER_THRESHOLD;
- }
-
-
- /**
- * Returns text for the given memory bytes at the specified address for the specified
- * rendering type. This is called by the label provider for.
- * Subclasses must override.
- *
- * @param renderingTypeId rendering type identifier
- * @param address address where the bytes belong to
- * @param data the bytes
- * @return a string to represent the memory. Cannot not return <code>null</code>.
- * Returns a string to pad the cell if the memory cannot be converted
- * successfully.
- */
- abstract public String getString(String renderingTypeId, BigInteger address, MemoryByte[] data);
-
- /**
- * Returns bytes for the given text corresponding to bytes at the given
- * address for the specified rendering type. This is called by the cell modifier
- * when modifying bytes in a memory block.
- * Subclasses must convert the string value to an array of bytes. The bytes will
- * be passed to the debug adapter for memory block modification.
- * Returns <code>null</code> if the bytes cannot be formatted properly.
- *
- * @param renderingTypeId rendering type identifier
- * @param address address the bytes begin at
- * @param currentValues current values of the data in bytes format
- * @param newValue the string to be converted to bytes
- * @return the bytes converted from a string
- */
- abstract public byte[] getBytes(String renderingTypeId, BigInteger address, MemoryByte[] currentValues, String newValue);
-
-
-}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTextRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTextRendering.java
deleted file mode 100644
index 97c7fbb70..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTextRendering.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.memory;
-
-import java.io.UnsupportedEncodingException;
-import java.math.BigInteger;
-
-import org.eclipse.debug.core.model.MemoryByte;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
-
-/**
- * Abstract implementation of a rendering that translates memory into
- * text, displayed in a table.
- * <p>
- * Clients should subclass from this class if they wish to provide a table
- * text rendering with a specific code page.
- * </p>
- * @since 3.1
- */
-abstract public class AbstractTextRendering extends AbstractTableRendering {
-
- private String fCodePage;
-
- /**
- * Constructs a text rendering of the specified type.
- *
- * @param renderingId memory rendering type identifier
- */
- public AbstractTextRendering(String renderingId)
- {
- super(renderingId);
- }
-
- /**
- * Constructs a text rendering of the specified type on the given
- * code page.
- *
- * @param renderingId memory rendering type identifier
- * @param codePage the name of a supported
- * {@link java.nio.charset.Charset </code>charset<code>}, for
- * example <code>CP1252</code>
- */
- public AbstractTextRendering(String renderingId, String codePage)
- {
- super(renderingId);
- fCodePage = codePage;
- }
-
- /**
- * Sets the code page for this rendering. This does not cause
- * the rendering to be updated with the new code page. Clients need
- * to update the rendering manually when the code page is changed.
- *
- * @param codePage the name of a supported
- * {@link java.nio.charset.Charset </code>charset<code>}, for
- * example <code>CP1252</code>
- */
- public void setCodePage(String codePage)
- {
- fCodePage = codePage;
- }
-
- /**
- * Returns the current code page used by this rendering. Returns null
- * if not set.
- * @return Returns the current code page used by this rendering. Returns null
- * if not set.
- */
- public String getCodePage()
- {
- return fCodePage;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.AbstractTableRendering#getString(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[])
- */
- public String getString(String dataType, BigInteger address, MemoryByte[] data) {
- try {
- String paddedStr = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR);
- if(fCodePage == null)
- return IInternalDebugCoreConstants.EMPTY_STRING;
-
- boolean[] invalid = new boolean[data.length];
- boolean hasInvalid = false;
- byte byteArray[] = new byte[data.length];
- for (int i=0; i<data.length; i++)
- {
- if (!data[i].isReadable())
- {
- invalid[i] = true;
- hasInvalid = true;
- }
- byteArray[i] = data[i].getValue();
- }
-
- if (hasInvalid)
- {
- StringBuffer strBuf = new StringBuffer();
- for (int i=0; i<data.length; i++)
- {
- if (invalid[i])
- strBuf.append(paddedStr);
- else
- strBuf.append(new String(new byte[]{byteArray[i]}, fCodePage));
- }
- return strBuf.toString();
- }
-
- return new String(byteArray, fCodePage);
-
- } catch (UnsupportedEncodingException e) {
- return "-- error --"; //$NON-NLS-1$
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.AbstractTableRendering#getBytes(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[], java.lang.String)
- */
- public byte[] getBytes(String dataType, BigInteger address, MemoryByte[] currentValues, String data) {
- try {
-
- if (fCodePage == null)
- return new byte[0];
-
- byte[] bytes = data.getBytes(fCodePage);
- return bytes;
-
- } catch (UnsupportedEncodingException e) {
- return new byte[0];
- }
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryBlockTablePresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryBlockTablePresentation.java
deleted file mode 100644
index ff860039a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryBlockTablePresentation.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-
-package org.eclipse.debug.ui.memory;
-
-import java.math.BigInteger;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-
-
-/**
- * Allows debug models to customize the rendering of addresses for its memory blocks
- * in table and text based renderings provided by the debug platform.
- * <p>
- * To contribute a memory block table presentation, implement your debug model
- * presentation as documented in <code>org.eclipse.debug.ui.IDebugModelPresentation</code>.
- * In addition, implement this interface in your debug model presentation. Your model
- * presentation will be called when <code>org.eclipse.debug.ui.memory.AbstractTableRendering</code>
- * constructs its column and row labels.
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.1
- */
-public interface IMemoryBlockTablePresentation extends IDebugModelPresentation
-{
-
- /**
- * Returns a collection of labels to head columns in a <code>AbstractTableRendering</code>
- * rendering, or <code>null</code> if default labels should be used.
- *
- * @param blk memory block
- * @param bytesPerLine the number if bytes to be displayed
- * @param numColumns the number of columns the bytes are divided into
- * @return a collection of labels to head columns in a <code>AbstractTableRendering</code>
- * rendering, or <code>null</code> if default labels should be used
- */
- public String[] getColumnLabels(IMemoryBlock blk, int bytesPerLine, int numColumns);
-
-
- /**
- * Renders and returns a label for a row starting at the given address within the given
- * memory block, or <code>null</code> if default rendering should be used.
- *
- * @param blk memory block
- * @param address an address in the memory block
- * @return a label for a row starting at the given address within the given
- * memory block, or <code>null</code> if default rendering should be used
- */
- public String getRowLabel(IMemoryBlock blk, BigInteger address);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRendering.java
deleted file mode 100644
index e1a769f58..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRendering.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.memory;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * An arbitrary rendering of a memory block. A memory rendering is contributed
- * via the <code>memoryRenderings</code> extension point.
- * <p>
- * Following is an example definition of a memory renderings extension.
- * <pre>
- * &lt;extension point="org.eclipse.debug.ui.memoryRenderings"&gt;
- * &lt;memoryRenderingType
- * id="com.example.asciiRendering"
- * name="ASCII"
- * class="com.example.RenderingFactory"&gt;
- * &lt;/memoryRenderingType&gt;
- * &lt;/extension&gt;
- * </pre>
- * The attributes are specified as follows:
- * <ul>
- * <li><code>id</code> specifies a unique identifier for a type of memory rendering</li>
- * <li><code>name</code> specifies a human readable label for a rendering type</li>
- * <li><code>class</code> specifies the fully qualified name of the Java class
- * that implements <code>IMemoryRenderingTypeDelegate</code>. Renderings are created
- * via this factory.</li>
- * </ul>
- * </p>
- * <p>
- * A rendering provides an image and label. To support dynamic labels and images, property
- * change notification is used with the following property constants defined in
- * <code>IBasicPropertyConstants</code>:
- * <ul>
- * <li><code>P_TEXT</code> - indicates a label change</li>
- * <li><code>P_IMAGE</code> - indicates a image change</li>
- * </ul>
- * </p>
- * <p>
- * Renderings needing to synchronize with other renderings are intended to use
- * property change notifications via its synchronization service. For example, when a
- * rendering becomes visible, it can register for property change events with its rendering
- * site's synchronization service, and when it becomes hidden it can unregister. When a
- * rendering is activated, it should set itself as the synchrnoization provider in its
- * rendering site and fire property change events to communicate information to
- * interested listeners.
- * </p>
- * <p>
- * Clients contributing a memory rendering type are intended to implement this interface
- * and <code>IMemoryRenderingTypeDelegate</code>. The factory will be used to create instances
- * of <code>IMemoryRendering</code>.
- * </p>
- * @since 3.1
- */
-public interface IMemoryRendering extends IAdaptable{
-
- /**
- * Initializes this rendering to be hosted in the given container, displaying
- * the given memory block. This method is called before this rendering's control
- * has been created.
- *
- * @param container container hosting this rendering
- * @param block the memory block to render
- */
- public void init(IMemoryRenderingContainer container, IMemoryBlock block);
-
- /**
- * Creates the top level control for this rendering under the given parent composite.
- * This method is called after this rendering's <code>init</code> method has been
- * called.
- * <p>
- * Implementors are responsible for ensuring that
- * the created control can be accessed via <code>getControl</code>
- * </p>
- * @param parent the parent composite
- */
- public Control createControl(Composite parent);
-
- /**
- * Returns the top level control for this rendering.
- * <p>
- * May return <code>null</code> if the control
- * has not been created yet.
- * </p>
- * @return the top level control or <code>null</code>
- */
- public Control getControl();
-
- /**
- * Disposes this rendering.
- */
- public void dispose();
-
- /**
- * Notification this rendering has become the active rendering. Only one
- * rendering can be active at once. Generally, the active rendering is
- * visible and has focus.
- */
- public void activated();
-
- /**
- * Notification this rendering is no longer the active rendering.
- */
- public void deactivated();
-
- /**
- * Notification this rendering has become visible in its container.
- * Note that a rendering does not have to be active to be visible.
- */
- public void becomesVisible();
-
- /**
- * Notification this rendering has become hidden in its container.
- */
- public void becomesHidden();
-
- /**
- * Returns the memory block displayed by this rendering.
- *
- * @return the memory block displayed by this rendering
- */
- public IMemoryBlock getMemoryBlock();
-
- /**
- * Returns the identifier associated with this rendering's type.
- *
- * @return the identifier associated with this rendering's type
- * @see IMemoryRenderingType
- */
- public String getRenderingId();
-
- /**
- * Adds a listener for property changes to this rendering.
- * Has no effect if an identical listener is already registered.
- *
- * @param listener a property change listener
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener);
-
- /**
- * Removes the given property change listener from this rendering.
- * Has no effect if the identical listener is not registered.
- *
- * @param listener a property change listener
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener);
-
- /**
- * Returns an image for this rendering. Clients should not dispose
- * this image. This rendering will dispose the image if required when
- * this rendering is disposed.
- *
- * @return an image for this rendering
- */
- public Image getImage();
-
- /**
- * Returns a label for this rendering.
- *
- * @return a label for this rendering
- */
- public String getLabel();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingBindingsListener.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingBindingsListener.java
deleted file mode 100644
index 6e5ab8c43..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingBindingsListener.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.ui.memory;
-
-/**
- * A rendering bindings listener is notified of changes in the renderings provided by
- * a rendering bindings provider. When bindings change, a memory block may be bound
- * to a different set of renderings.
- * <p>
- * Clients who wish to detect changes to a dynamic bindings provider should
- * implement this interface and register as a listener with the
- * {@link org.eclipse.debug.ui.memory.IMemoryRenderingManager}.
- * </p>
- * @since 3.1
- * @see IMemoryRenderingBindingsProvider#addListener
- * @see IMemoryRenderingBindingsProvider#removeListener
- */
-public interface IMemoryRenderingBindingsListener {
-
- /**
- * Notification that the bindings provided by a rendering bindings
- * provider have changed.
- */
- void memoryRenderingBindingsChanged();
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingBindingsProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingBindingsProvider.java
deleted file mode 100644
index 68455f34e..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingBindingsProvider.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.memory;
-
-import org.eclipse.debug.core.model.IMemoryBlock;
-
-
-/**
- * A rendering bindings provider provides rendering type bindings for a memory block.
- * <p>
- * By default, bindings for a memory block are provided by the memory rendering
- * manager. However, a client can provide dynamic renderings for a memory block
- * by contributing a dynamic rendering binding in the <code>renderingBindings</code>
- * element of a <code>memoryRenderings</code> extension.
- * </p>
- * <p>
- * Clients contributing dynamic rendering bindings are intended to implement this
- * interface.
- * </p>
- * @since 3.1
- */
-public interface IMemoryRenderingBindingsProvider {
-
- /**
- * Returns all rendering types bound to the given memory block.
- * This includes default and primary rendering types.
- *
- * @param block memory block
- * @return all rendering types bound to the given memory block
- */
- public IMemoryRenderingType[] getRenderingTypes(IMemoryBlock block);
-
- /**
- * Returns default rendering types bound to the given memory block,
- * possibly empty.
- *
- * @param block memory block
- * @return default rendering types bound to the given memory block,
- * possibly empty
- */
- public IMemoryRenderingType[] getDefaultRenderingTypes(IMemoryBlock block);
-
- /**
- * Returns the primary rendering type bound to the given memory block,
- * or <code>null</code> if none.
- *
- * @param block memory block
- * @return the primary rendering type bound to the given memory block,
- * or <code>null</code> if none
- */
- public IMemoryRenderingType getPrimaryRenderingType(IMemoryBlock block);
-
- /**
- * Adds a listener to this binding provider. The listener will be notified
- * when rendering bindings change.
- * <p>
- * Has no affect if an identical listener is already registered.
- * </p>
- * @param listener listener to add
- */
- public void addListener(IMemoryRenderingBindingsListener listener);
-
- /**
- * Removes a listener from this binding provider.
- * <p>
- * Has no affect if an identical listener is not already registered.
- * </p>
- * @param listener listener to remove
- */
- public void removeListener(IMemoryRenderingBindingsListener listener);
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingContainer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingContainer.java
deleted file mode 100644
index 9b5717d93..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingContainer.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.memory;
-
-
-
-/**
- * A memory rendering container is a container within a memory rendering site
- * for hosting a memory renderings.
- * <p>
- * Clients hosting memory renderings may implement this interface.
- * </p>
- * @since 3.1
- */
-public interface IMemoryRenderingContainer {
- /**
- * Returns the rendering site hosting this container.
- *
- * @return the rendering site hosting this container
- */
- public IMemoryRenderingSite getMemoryRenderingSite();
-
- /**
- * Returns the identifier of this container. Identifiers
- * are unique within a container.
- *
- * @return the identifier of this container
- */
- public String getId();
-
- /**
- * Adds the given rendering to this container. A rendering must be
- * initialized before it is added to a container. This causes
- * the rendering's control to be created.
- *
- * @param rendering the rendering to add
- */
- public void addMemoryRendering(IMemoryRendering rendering);
-
- /**
- * Removes the given rendering from this container. This
- * causes the rendering to be disposed.
- *
- * @param rendering the rendering to remove
- */
- public void removeMemoryRendering(IMemoryRendering rendering);
-
- /**
- * Returns all renderings currently hosted by this container.
- *
- * @return all renderings currently hosted by this container
- */
- public IMemoryRendering[] getRenderings();
-
- /**
- * Returns the active rendering in this container, or <code>null</code>
- * if none.
- *
- * @return the active rendering in this container, or <code>null</code>
- * if none
- */
- public IMemoryRendering getActiveRendering();
-
- /**
- * Returns the label for this container.
- *
- * @return the label for this container
- */
- public String getLabel();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingManager.java
deleted file mode 100644
index be00945f3..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingManager.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.memory;
-
-
-
-/**
- * Manager for memory renderings. Provides facilities for creating
- * renderings and retrieving memory rendering bindings.
- * @since 3.1
- * @noimplement This interface is not intended to be implemented by clients.
- * @noextend This interface is not intended to be extended by clients.
- */
-public interface IMemoryRenderingManager extends IMemoryRenderingBindingsProvider {
-
-
- /**
- * Returns all contributed memory rendering types.
- *
- * @return all contributed memory rendering types
- */
- public IMemoryRenderingType[] getRenderingTypes();
-
- /**
- * Returns the memory rendering type with the given identifier, or
- * <code>null</code> if none. The memory rendering manager will
- * search through rendering types that are contributed via explicit
- * rendering bindings. (i.e. rendering types contributed via the
- * memoryRenderings extension point). This method will not return
- * rendering types that are contributed by a memory binding provider.
- *
- * @param id memory rendering type identifier
- * @return the memory rendering type with the given identifier, or
- * <code>null</code> if none
- */
- public IMemoryRenderingType getRenderingType(String id);
-
-}
-
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingSite.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingSite.java
deleted file mode 100644
index 027cf5121..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingSite.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.memory;
-
-import org.eclipse.ui.IWorkbenchPartSite;
-
-/**
- * A workbench site that hosts memory renderings and provides
- * synchronization services for memory renderings.
- * <p>
- * A rendering site has an optional synchronization provider at any one time. If a
- * rendering provides synchronization information it should set itself as the synchronization
- * provider for its memory rendering site when it is activated.
- * </p>
- * <p>
- * Clients hosting memory rendering may implement this interface.
- * </p>
- * @since 3.1
- */
-public interface IMemoryRenderingSite {
-
- /**
- * Returns the workbench part site hosting memory renderings for this rendering site.
- *
- * @return the view site hosting memory renderings for this rendering site
- */
- public IWorkbenchPartSite getSite();
-
- /**
- * Returns the syncrhonization service for this rendering site
- * or <code>null</code> if none.
- *
- * @return the syncrhonization service for this rendering site or <code>null</code>
- */
- public IMemoryRenderingSynchronizationService getSynchronizationService();
-
- /**
- * Returns all the memory rendering containers within this rendering site.
- *
- * @return all the memory rendering containers within this rendering site
- */
- public IMemoryRenderingContainer[] getMemoryRenderingContainers();
-
- /**
- * Returns the rendering container with the given id or <code>null</code>
- * if none.
- *
- * @param id identifier of the container being requested
- * @return the rendering container with the given id or <code>null</code>
- * if none
- */
- public IMemoryRenderingContainer getContainer(String id);
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingSynchronizationService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingSynchronizationService.java
deleted file mode 100644
index 9a3de4368..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingSynchronizationService.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.memory;
-
-import org.eclipse.debug.core.model.IMemoryBlock;
-import org.eclipse.jface.util.IPropertyChangeListener;
-
-
-/**
- * Provides facilities related to the synchronization of memory renderings.
- * <p>
- * Clients hosting renderings may implement this interface.
- * </p>
- * @since 3.1
- */
-public interface IMemoryRenderingSynchronizationService {
-
- /**
- * Adds a listener for property changes notification for the specified properties.
- * Specifying <code>null</code> indicates that the listener is interested in all
- * properties. If an identical listener is already registered, the properties
- * it is registered to listen for are updated.
- *
- * @param listener a property change listener
- * @param properties properties the listener is interested in, or <code>null</code>
- * to indicate all properties.
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener, String[] properties);
-
- /**
- * Removes the given listener for property change notification.
- * Has no effect if the identical listener is not registered.
- *
- * @param listener a property change listener
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener);
-
- /**
- * Returns the current value of the specified property for the given memory block, or
- * <code>null</code> if none.
- *
- * @param block memory block for which a property is requested
- * @param property the name of the property
- * @return the property value or <code>null</code>
- */
- public Object getProperty(IMemoryBlock block, String property);
-
- /**
- * Sets the rendering currently providing sychronization information for
- * this synchronization service, or <code>null</code> if none.
- *
- * @param rendering active rendering providing synchronization information or
- * <code>null</code>
- */
- public void setSynchronizationProvider(IMemoryRendering rendering);
-
- /**
- * Returns the rendering currently providing synchronization information for
- * this synchronization service, or <code>null</code if none.
- *
- * @return rendering providing synchronization information or <code>null</code>
- */
- public IMemoryRendering getSynchronizationProvider();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingType.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingType.java
deleted file mode 100644
index 3fff87eee..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingType.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.memory;
-
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * Represents a type of memory rendering contributed via the <code>memoryRenderings</code>
- * extension point.
- * <p>
- * Clients contributing a rendering usually
- * implement {@link org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate}
- * and {@link org.eclipse.debug.ui.memory.IMemoryRendering}. Clients providing
- * dynamic rendering bindings via an
- * {@link org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider}
- * may implement this interface.
- * </p>
- * @since 3.1
- */
-public interface IMemoryRenderingType {
-
- /**
- * Returns a label for this type of memory rendering.
- *
- * @return a label for this type of memory rendering
- */
- public String getLabel();
-
- /**
- * Returns the unique identifier for this rendering type.
- *
- * @return the unique identifier for this rendering type
- */
- public String getId();
-
- /**
- * Creates and returns a new rendering of this type or <code>null</code>
- * if none.
- *
- * @return a new rendering of this type
- * @exception CoreException if an exception occurs creating
- * the rendering
- */
- public IMemoryRendering createRendering() throws CoreException;
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingTypeDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingTypeDelegate.java
deleted file mode 100644
index 94291240b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IMemoryRenderingTypeDelegate.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.memory;
-
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * A factory that creates memory renderings.
- * <p>
- * Clients contributing a memory rendering type are intended to implement this
- * interface. This factory will be used to create renderings.
- * </p>
- * @since 3.1
- * @see org.eclipse.debug.ui.memory.IMemoryRendering
- */
-public interface IMemoryRenderingTypeDelegate {
-
- /**
- * Creates and returns a rendering of the specified type, or <code>null</code>
- * if none.
- *
- * @param id unique identifier of a memory rendering type
- * @return a new rendering of the given type or <code>null</code>
- * @exception CoreException if unable to create the rendering
- */
- public IMemoryRendering createRendering(String id) throws CoreException;
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IRepositionableMemoryRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IRepositionableMemoryRendering.java
deleted file mode 100644
index ff755edcd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IRepositionableMemoryRendering.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.memory;
-
-import java.math.BigInteger;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.model.MemoryByte;
-
-/**
- * A memory rendering that can be repositioned. Reposition behavior is rendering
- * specific. Typically, reposition means that the rendering should move its
- * cursor/current selection to the given address. However, clients may define
- * its reposition behavior that is suitable for the rendering.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.3
- *
- */
-public interface IRepositionableMemoryRendering extends IMemoryRendering{
-
- /**
- * Returns the currently selected address of this rendering or <code>null</code> if none
- * @return the currently selected address of this rendering or <code>null</code> if none
- */
- public BigInteger getSelectedAddress();
-
- /**
- * Returns the currently selected content as <code>MemoryByte</code> array.
- * Returns an empty array if there is no selection.
- * @return the currently selected as <code>MemoryByte</code> array or empty if there is
- * no selection.
- */
- public MemoryByte[] getSelectedAsBytes();
-
- /**
- * Position the rendering to the given address.
- *
- * @param address the address to go to
- * @throws DebugException when there is a problem repositioning the rendering to the
- * address
- */
- public void goToAddress(BigInteger address) throws DebugException ;
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IResettableMemoryRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IResettableMemoryRendering.java
deleted file mode 100644
index 100f7429b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/IResettableMemoryRendering.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.ui.memory;
-
-import org.eclipse.debug.core.DebugException;
-
-/**
- * A memory rendering that can be reset. Reset behavior is rendering
- * specific. Typically, reset means that the rendering would position
- * itself back to the base address of its memory block. However, clients
- * may define its reset behavior that is suitable for its rendering.
- * <p>
- * Clients may implement this interface.
- * </p>
- * @since 3.2
- *
- */
-public interface IResettableMemoryRendering extends IMemoryRendering {
-
- /**
- * Reset this memory rendering.
- *
- * @throws DebugException when there is a problem resetting this memory rendering.
- */
- public void resetRendering() throws DebugException;
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/MemoryRenderingElement.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/MemoryRenderingElement.java
deleted file mode 100644
index 7629ec1a4..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/MemoryRenderingElement.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.debug.ui.memory;
-
-import java.math.BigInteger;
-
-import org.eclipse.debug.core.model.MemoryByte;
-
-/**
- * A memory rendering element represents a set of memory bytes being
- * rendered in a memory rendering. Instances of this class are passed
- * to a rendering's label provider, color provider, and font provider
- * to be rendered.
- * <p>
- * Clients may instantiate this class. Clients may subclass this class to add
- * other members / settings as required by a rendering.
- * </p>
- * @since 3.1
- */
-public class MemoryRenderingElement {
- private IMemoryRendering fRendering;
- private BigInteger fAddress;
- private MemoryByte[] fBytes;
-
- /**
- * Constructs a new memory rendering element for the given rendering
- * and specified bytes.
- *
- * @param rendering the rendering containing the memory block being rendered
- * @param address the address at which the rendering is taking place
- * @param bytes the memory bytes being rendered
- */
- public MemoryRenderingElement(IMemoryRendering rendering, BigInteger address, MemoryByte[] bytes)
- {
- fRendering = rendering;
- fAddress = address;
- fBytes = bytes;
- }
-
- /**
- * Returns the memory rendering in which bytes are being rendered.
- *
- * @return the memory rendering in which bytes are being rendered
- */
- public IMemoryRendering getRendering()
- {
- return fRendering;
- }
-
- /**
- * Returns the address at which bytes are being rendered.
- *
- * @return the address at which bytes are being rendered
- */
- public BigInteger getAddress() {
- return fAddress;
- }
-
-
- /**
- * Returns the memory bytes being rendered.
- *
- * @return the memory bytes being rendered
- */
- public MemoryByte[] getBytes() {
- return fBytes;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/package.html b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/package.html
deleted file mode 100644
index 773c1176c..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/package.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Eclipse Debug Platform</title>
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<p>Provides classes and interfaces to render memory blocks in the memory view.</p>
-
-<h2>Package Specification</h2>
-
-<p>This package provides classes and interfaces to support rendering memory blocks
- in the memory view.</p>
-<blockquote>&nbsp;</blockquote>
-</body>
-</html>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/package.html b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/package.html
deleted file mode 100644
index 6950f14a2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/package.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Eclipse Debug Tools</title>
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<p>Provides a generic debugger user interface that clients may customize via standard
-workbench extension points.</p>
-
-<h2>Package Specification</h2>
-
-<p>The Eclipse platform debug UI plug-in provides a set of classes and interfaces to
-support a language independent debugger user interface. A generic debug perspective is provided with a common
-set of views. Clients contribute actions to the debug views via the
-standard workbench extension points.</p>
-
-<h4>The Debug View</h4>
-
-<p>The debug view presents a tree of launched programs in debug and non-debug (run) mode.
-The view provides support for standard interactions such as terminating, stepping, suspending, and resuming
-threads, debug targets, and processes. The debug view is linked to an editor view, variable view, and
-console. The editor view is used to display source code for stack frames. A selection in
-the debug view causes the line of code being executed to be highlighted in the editor
-view. The variable view shows the visible variables in the selected stack frame, and the
-console view handles I/O for the debuggable process.</p>
-
-<h4>The Variables View</h4>
-
-<p>The variables view presents a tree of variables for the currently selected stack frame.
-A "details" area may be hidden/shown which provides a detailed description of
-the selected variable. For example, the Java debugger displays the result of
-invoking 'toString()' on the selected variable in this area.</p>
-
-<h4>The Breakpoints View</h4>
-
-<p>The breakpoints view presents a list of all breakpoints currently defined in the
-workspace. It supports enabling/disabling and breakpoint removal.</p>
-
-<h4>The Expression View</h4>
-
-<p>The expression view presents a tree of expressions and their corresponding values.</p>
-
-<h4>Debug Model Presentation</h4>
-
-<p>The debug UI plug-in defines an extension (<b>org.eclipse.debug.ui.debugModelPresentations</b>)
-point to allow implementations of debug models to provide custom rendering and
-presentation of its debug elements. Extensions are registered for a specific debug
-model. It is intended that an implementation of a debug model will also provide an
-implementation of a debug model presentation. The presentation provides:
-
-<ul>
- <li>an image for a debug element or breakpoint</li>
- <li>a label for a debug element or breakpoint</li>
- <li>an editor input and editor id used to display a debug element, breakpoint, or source element</li>
- <li>a detailed description of a variable value, used to display
- in the "details" section of the variables view</li>
-</ul>
-
-<h4>Launch Configuration Dialog</h4>
-
-<p>The debug UI plug-in provides a lanuch configuration dialog for
-creating and editing launch configurations. Clients may contribute
-tabs to the launch configuration dialog via the launchConfigurationTabGroup
-extension point.</p>
-
-
-</body>
-</html>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/AbstractSourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/AbstractSourceContainerBrowser.java
deleted file mode 100644
index 6a7a19fc6..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/AbstractSourceContainerBrowser.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.sourcelookup;
-
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Common implementation for source container browsers.
- * <p>
- * Clients implementing <code>ISourceContainerBrowser</code> should
- * subclass this class.
- * </p>
- * @since 3.0
- */
-public class AbstractSourceContainerBrowser implements ISourceContainerBrowser {
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#addSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.sourcelookup.ISourceLookupDirector)
- */
- public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
- return new ISourceContainer[0];
- }
- /* (non-Javadoc)
- *
- * Generally, a source container browser can add source containers. Subclasses
- * should override as required.
- *
- * @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#canAddSourceContainers(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector)
- */
- public boolean canAddSourceContainers(ISourceLookupDirector director) {
- return true;
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#editSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.sourcelookup.ISourceLookupDirector, org.eclipse.debug.core.sourcelookup.ISourceContainer[])
- */
- public ISourceContainer[] editSourceContainers(Shell shell, ISourceLookupDirector director, ISourceContainer[] containers) {
- return new ISourceContainer[0];
- }
- /* (non-Javadoc)
- *
- * Not all source containers can be edited. Subclasses should override
- * as required.
- *
- * @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#canEditSourceContainers(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector, org.eclipse.debug.core.sourcelookup.ISourceContainer[])
- */
- public boolean canEditSourceContainers(ISourceLookupDirector director, ISourceContainer[] containers) {
- return false;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java
deleted file mode 100644
index 5eb24d2fb..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.sourcelookup;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchesListener2;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.ISourceLocator;
-import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupManager;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupUIMessages;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.resource.JFaceColors;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IReusableEditor;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.EditorPart;
-
-/**
- * Default editor displayed when source is not found. Displays a button to modify
- * the source lookup path.
- * <p>
- * This editor's id is <code>IDebugUIConstants.ID_COMMON_SOURCE_NOT_FOUND_EDITOR</code>
- * (value <code>org.eclipse.debug.ui.sourcelookup.CommonSourceNotFoundEditor</code>).
- * </p>
- * <p>
- * This class may be instantiated and subclassed.
- * </p>
- * @see AbstractSourceLookupDirector
- * @see CommonSourceNotFoundEditorInput
- * @since 3.2
- */
-public class CommonSourceNotFoundEditor extends EditorPart implements IReusableEditor {
-
- /**
- * Text widgets used for this editor
- */
- private Text fText;
-
- /**
- * Launch listener to handle launch events, or <code>null</code> if none
- */
- private ILaunchesListener2 fLaunchesListener;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void doSave(IProgressMonitor monitor) {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#doSaveAs()
- */
- public void doSaveAs() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
- */
- public void init(IEditorSite site, IEditorInput input) throws PartInitException {
- setSite(site);
- setInput(input);
- initialize();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#isDirty()
- */
- public boolean isDirty() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
- */
- public boolean isSaveAsAllowed() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
- */
- public void createPartControl(Composite parent) {
- GridLayout topLayout = new GridLayout();
- GridData data = new GridData();
- topLayout.numColumns = 1;
- topLayout.verticalSpacing = 10;
- parent.setLayout(topLayout);
- parent.setLayoutData(data);
- parent.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
-
- fText = new Text(parent,SWT.READ_ONLY|SWT.WRAP);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.grabExcessHorizontalSpace = true;
- fText.setLayoutData(data);
- fText.setForeground(JFaceColors.getErrorText(fText.getDisplay()));
- fText.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
- if (getEditorInput() != null) {
- setInput(getEditorInput());
- }
-
- createButtons(parent);
-
- Dialog.applyDialogFont(parent);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugHelpContextIds.NO_SOURCE_EDITOR);
- }
-
- /**
- * Create buttons to be displayed in this editor
- *
- * @param parent composite to create the buttons in.
- */
- protected void createButtons(Composite parent) {
- GridData data;
- Button button = new Button(parent, SWT.PUSH);
- data = new GridData();
- data.grabExcessHorizontalSpace = false;
- data.grabExcessVerticalSpace = false;
- button.setLayoutData(data);
- button.setText(SourceLookupUIMessages.addSourceLocation_addButton2);
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- editSourceLookupPath();
- }
- });
- }
-
- /**
- * Edits the source lookup path associated with the active debug context.
- * After the path is edited, source lookup is performed again and this
- * editor is closed.
- */
- protected void editSourceLookupPath(){
- ISourceLocator locator = null;
- ILaunch launch = null;
- IAdaptable selection = DebugUITools.getDebugContext();
- if(selection == null) {
- new MessageDialog(getSite().getShell(),
- SourceLookupUIMessages.CommonSourceNotFoundEditor_0,
- null,
- SourceLookupUIMessages.CommonSourceNotFoundEditor_1,
- MessageDialog.INFORMATION,
- new String[] {IDialogConstants.OK_LABEL}, 0).open();
- return;
- }
- if (selection.getAdapter(ILaunch.class) != null ) {
- launch = (ILaunch) selection.getAdapter(ILaunch.class);
- locator = launch.getSourceLocator();
- }
- else if (selection.getAdapter(IDebugElement.class) != null ) {
- launch = ((IDebugElement)selection.getAdapter(IDebugElement.class)).getLaunch();
- locator = launch.getSourceLocator();
- }
- else {
- return; //should not occur
- }
- if (locator == null || !(locator instanceof AbstractSourceLookupDirector)) {
- return;
- }
- final SourceLookupDialog dialog = new SourceLookupDialog(DebugUIPlugin.getShell(),(AbstractSourceLookupDirector) locator);
- if(dialog.open() == Window.OK) {
- IWorkbenchPage page = getEditorSite().getPage();
- SourceLookupManager.getDefault().displaySource(getArtifact(), page, true);
- closeEditor();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
- */
- public void setFocus() {
- if (fText != null) {
- fText.setFocus();
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.EditorPart#setInput(org.eclipse.ui.IEditorInput)
- */
- public void setInput(IEditorInput input) {
- super.setInput(input);
- setPartName(input.getName());
- if (fText != null) {
- fText.setText(getText());
- }
- firePropertyChange(PROP_INPUT);
- }
-
- /**
- * Return the text to be displayed in this editor. The text is reset each time
- * the editor input is set.
- *
- * @return the text to be displayed in this editor
- */
- protected String getText() {
- return getEditorInput().getToolTipText() + "\n"; //$NON-NLS-1$
- }
-
- /**
- * Closes this editor.
- */
- protected void closeEditor()
- {
- final IEditorPart editor = this;
- DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
- public void run() {
- IWorkbenchWindow activeWorkbenchWindow = DebugUIPlugin.getActiveWorkbenchWindow();
- if (activeWorkbenchWindow != null) {
- IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
- if (activePage != null) {
- activePage.closeEditor(editor, false);
- }
- }
- }
- });
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IWorkbenchPart#dispose()
- */
- public void dispose() {
- if (fLaunchesListener != null)
- DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(fLaunchesListener);
- super.dispose();
- }
-
- /**
- * Returns the artifact this editor was opened for (i.e. the artifact that source
- * was not found for), or <code>null</code>
- *
- * @return artifact with associated source or <code>null</code>
- */
- protected Object getArtifact() {
- IEditorInput editorInput = getEditorInput();
- if (editorInput instanceof CommonSourceNotFoundEditorInput) {
- CommonSourceNotFoundEditorInput input = (CommonSourceNotFoundEditorInput) editorInput;
- return input.getArtifact();
- }
- return null;
- }
-
- /**
- * Initialize this editor.
- * Called after <code>init(IEditorSite, IEditorInput)</code>. By default, a launch
- * listener is added to close this editor when the associated launch terminates.
- * Subclasses may override.
- */
- protected void initialize()
- {
- fLaunchesListener = new ILaunchesListener2() {
- public void launchesTerminated(ILaunch[] launches) {
- Object artifact = getArtifact();
- if (artifact instanceof IDebugElement) {
- IDebugElement element = (IDebugElement)artifact;
- for (int i = 0; i < launches.length; i++) {
- ILaunch launch = launches[i];
- if (launch.equals(element.getLaunch())) {
- closeEditor();
- return;
- }
- }
- }
- }
-
- public void launchesRemoved(ILaunch[] launches) {
- launchesTerminated(launches);
- }
-
- public void launchesAdded(ILaunch[] launches) {
- }
-
- public void launchesChanged(ILaunch[] launches) {
- }};
-
- DebugPlugin.getDefault().getLaunchManager().addLaunchListener(fLaunchesListener);
- }
-}
-
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditorInput.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditorInput.java
deleted file mode 100644
index 1dc8eed64..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditorInput.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.sourcelookup;
-
-import com.ibm.icu.text.MessageFormat;
-
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupUIMessages;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPersistableElement;
-
-/**
- * Editor input for the <code>CommonSourceNotFoundEditor</code>. The editor
- * input can be created on an artifact that has a source association.
- * <p>
- * This class may be instantiated and subclassed.
- * </p>
- * @see CommonSourceNotFoundEditor
- * @since 3.2
- */
-public class CommonSourceNotFoundEditorInput extends PlatformObject implements IEditorInput {
-
- /**
- * input element label (cached on creation)
- */
- private String fLabel;
- /**
- * the artifact that the editor is being opened for
- */
- private Object fArtifact;
-
- /**
- * Constructs an editor input for the given artifact associated with source.
- *
- * @param artifact artifact associated with source
- */
- public CommonSourceNotFoundEditorInput(Object artifact) {
- fArtifact = artifact;
- if (artifact != null) {
- IDebugModelPresentation pres = DebugUITools.newDebugModelPresentation();
- fLabel = pres.getText(artifact);
- pres.dispose();
- }
- if (fLabel == null) {
- fLabel = IInternalDebugCoreConstants.EMPTY_STRING;
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#exists()
- */
- public boolean exists() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return DebugUITools.getDefaultImageDescriptor(fArtifact);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#getName()
- */
- public String getName() {
- return fLabel;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#getPersistable()
- */
- public IPersistableElement getPersistable() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IEditorInput#getToolTipText()
- */
- public String getToolTipText() {
- return MessageFormat.format(SourceLookupUIMessages.addSourceLocation_editorMessage, new String[] { fLabel });
- }
-
- /**
- * Returns the artifact that source was not found for.
- *
- * @return artifact that source was not found for
- */
- public Object getArtifact(){
- return fArtifact;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/ISourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/ISourceContainerBrowser.java
deleted file mode 100644
index 71688b0ee..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/ISourceContainerBrowser.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.sourcelookup;
-
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Creates and edits source containers for a source lookup director.
- * Contributed via a source container presentation extension for
- * a specific type of source container.
- * <p>
- * Following is an example source container presentation definition
- * that contributes a source container browser via the
- * <code>browserClass</code> attribute.
- * <pre>
- * &lt;extension point=&quot;org.eclipse.debug.ui.sourceContainerPresentations&quot;&gt;
- * &lt;sourceContainerPresentation
- * browserClass=&quot;org.eclipse.debug.internal.ui.sourcelookup.browsers.ProjectSourceContainerBrowser&quot;
- * containerTypeID=&quot;org.eclipse.debug.core.containerType.project&quot;
- * icon=&quot;icons/full/obj16/prj_obj.gif&quot;
- * id=&quot;org.eclipse.debug.ui.containerPresentation.project&quot;&gt;
- * &lt;/sourceContainerPresentation&gt;
- * &lt;/extension&gt;
- * </pre>
- * </p>
- * @since 3.0
- */
-public interface ISourceContainerBrowser {
- /**
- * Creates and returns new source containers to add to the given
- * source lookup director.
- *
- * @param shell the shell to use to parent any dialogs
- * @param director the director the new containers will be added to
- * @return the new source containers to add
- */
- public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director);
-
- /**
- * Returns whether this browser can add any source containers to the
- * given source lookup director.
- *
- * @param director source lookup director to potentially add source
- * containers to
- * @return whether this browser can add any source containers to the
- * given source lookup director
- */
- public boolean canAddSourceContainers(ISourceLookupDirector director);
-
- /**
- * Edits and returns source containers to replace the given source
- * containers.
- *
- * @param shell the shell to use to parent any dialogs
- * @param director the director the new containers will be added to
- * @param containers the source containers to be edited
- * @return the replacement source containers
- */
- public ISourceContainer[] editSourceContainers(Shell shell, ISourceLookupDirector director, ISourceContainer[] containers);
-
- /**
- * Returns whether this browser can edit the given source containers.
- *
- * @param director source lookup director to potentially edit source
- * containers for
- * @param containers the containers to edit
- * @return whether this browser can edit the given source containers
- */
- public boolean canEditSourceContainers(ISourceLookupDirector director, ISourceContainer[] containers);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/ISourceDisplay.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/ISourceDisplay.java
deleted file mode 100644
index 1cc942d6a..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/ISourceDisplay.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.sourcelookup;
-
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * Displays source for a debug model element. The debug platform displays
- * source whenever a debug context containing a single element is
- * activated (a structured selection with one element). The debug platform
- * displays source by asking an element for its <code>ISourceDisplay</code>
- * adapter or using the element directly if it implements <code>ISourceDisplay</code>.
- * <p>
- * The debug platform provides a source display adapter for instances
- * of <code>IStackFrame</code>. The standard adapter uses the source locator associated
- * with the stack frame's launch to lookup source. Clients may provide their own
- * source display adapters as required.
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- * @see org.eclipse.core.runtime.IAdaptable
- * @since 3.3
- */
-public interface ISourceDisplay {
-
- /**
- * Displays source for the given element in the specified page.
- *
- * @param element debug model element to display source for
- * @param page the page in which to display source
- * @param forceSourceLookup whether source lookup should be performed,
- * ignoring any previously cached results for the same element
- */
- public void displaySource(Object element, IWorkbenchPage page, boolean forceSourceLookup);
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/ISourceLookupResult.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/ISourceLookupResult.java
deleted file mode 100644
index 04fc81a16..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/ISourceLookupResult.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.sourcelookup;
-
-import org.eclipse.ui.IEditorInput;
-
-/**
- * The result of performing source lookup on a debug artifact.
- * The result contains the resolved source element and description
- * of an editor (editor id, and editor input) in which to display
- * the result.
- * @see org.eclipse.debug.ui.DebugUITools#lookupSource(Object, ISourceLocator)
- * @see org.eclipse.debug.ui.DebugUITools#displaySource(ISourceLookupResult, IWorkbenchPage)
- * @since 3.1
- * @noimplement This interface is not intended to be implemented by clients.
- * @noextend This interface is not intended to be extended by clients.
- */
-public interface ISourceLookupResult {
-
- /**
- * Returns the artifact for which source lookup was performed,
- * such as a stack frame.
- *
- * @return the artifact for which source lookup was performed
- */
- public Object getArtifact();
-
- /**
- * Returns the source element resolved during source lookup,
- * or <code>null</code> if a source element was not resolved.
- *
- * @return resolved source element or <code>null</code> if unknown
- */
- public Object getSourceElement();
-
- /**
- * Returns the identifier of an editor used to display this result,
- * or <code>null</code> if unknown.
- *
- * @return the identifier of an editor used to display this result,
- * or <code>null</code> if unknown
- */
- public String getEditorId();
-
- /**
- * Returns the editor input used to display result,
- * or <code>null</code> if unknown.
- *
- * @return the editor input used to display result,
- * or <code>null</code> if unknown
- */
- public IEditorInput getEditorInput();
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupDialog.java
deleted file mode 100644
index d795284f2..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupDialog.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.sourcelookup;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupPanel;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupUIMessages;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * A dialog for editing the source lookup path of a
- * source lookup director.
- * <p>
- * This class may be instantiated.
- * </p>
- * @since 3.0
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class SourceLookupDialog extends TitleAreaDialog {
-
- private SourceLookupPanel fPanel;
- private ISourceLookupDirector fDirector;
-
- /**
- * Constructs a dialog to edit the source lookup path managed by the
- * given source lookup director. Persists the resulting source lookup
- * path on the launch configuration associated with the given source
- * lookup director.
- *
- * @param shell shell to parent the dialog
- * @param director source lookup director managing the source lookup
- * path to be edited
- */
- public SourceLookupDialog(Shell shell, ISourceLookupDirector director) {
- super(shell);
- setShellStyle(getShellStyle() | SWT.RESIZE);
- fDirector = director;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- protected Control createDialogArea(Composite parent) {
- // create a composite with standard margins and spacing
- setTitle(SourceLookupUIMessages.manageSourceDialog_description);
- setTitleImage(DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_EDIT_SRC_LOC_WIZ));
- Composite composite = new Composite(parent, SWT.NONE);
-
- GridLayout layout = new GridLayout();
- layout.marginHeight =
- convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth =
- convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing =
- convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing =
- convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- GridData data = new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(data);
- composite.setFont(parent.getFont());
- fPanel = new SourceLookupPanel();
- fPanel.createControl(composite);
- fPanel.initializeFrom(fDirector);
- Dialog.applyDialogFont(composite);
- ILaunchConfiguration config = fDirector.getLaunchConfiguration();
- if(config != null && config.isReadOnly()) {
- setErrorMessage(SourceLookupUIMessages.SourceLookupDialog_0+config.getName()+SourceLookupUIMessages.SourceLookupDialog_1);
- }
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IDebugHelpContextIds.EDIT_SOURCELOOKUP_DIALOG);
-
- return composite;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- ILaunchConfiguration config = fDirector.getLaunchConfiguration();
- ILaunchConfigurationWorkingCopy copy = null;
- if(config != null) {
- try {
- copy = config.getWorkingCopy();
- fPanel.performApply(copy);
- copy.doSave();
- }
- catch (CoreException e) {DebugUIPlugin.log(e);}
- }
- super.okPressed();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
- */
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(SourceLookupUIMessages.manageSourceDialog_title);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#close()
- */
- public boolean close() {
- fPanel.dispose();
- return super.close();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
- * @since 3.2
- */
- protected IDialogSettings getDialogBoundsSettings() {
- IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(getClass().getName());
- if (section == null) {
- section = settings.addNewSection(getClass().getName());
- }
- return section;
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupTab.java
deleted file mode 100644
index c52d81c34..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupTab.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.sourcelookup;
-
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.internal.ui.DebugPluginImages;
-import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupPanel;
-import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupUIMessages;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * A launch configuration tab that displays and edits the source
- * lookup path for a launch configuration. This tab works with the
- * debug platform source lookup facilities - a source lookup director
- * with associated participants and source containers.
- * <p>
- * This tab may be instantiated.
- * </p>
- * @since 3.0
- * @noextend This class is not intended to be subclassed by clients.
- */
-
-public class SourceLookupTab extends AbstractLaunchConfigurationTab {
- //the panel displaying the containers
- private SourceLookupPanel fSourceLookupPanel;
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- Composite comp = new Composite(parent, SWT.NONE);
- setControl(comp);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.SOURCELOOKUP_TAB);
- GridLayout topLayout = new GridLayout();
- topLayout.marginWidth = 0;
- topLayout.marginHeight = 0;
- topLayout.numColumns = 1;
- comp.setLayout(topLayout);
- comp.setFont(parent.getFont());
-
- fSourceLookupPanel = new SourceLookupPanel();
- fSourceLookupPanel.setLaunchConfigurationDialog(
- getLaunchConfigurationDialog());
- fSourceLookupPanel.createControl(comp);
- GridData gd = (GridData) fSourceLookupPanel.getControl().getLayoutData();
- gd.heightHint = 200;
- gd.widthHint = 250;
- Dialog.applyDialogFont(comp);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration configuration) {
- fSourceLookupPanel.initializeFrom(configuration);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- fSourceLookupPanel.performApply(configuration);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId()
- */
- public String getId() {
- return "org.eclipse.debug.ui.sourceLookupTab"; //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return SourceLookupUIMessages.sourceTab_tabTitle;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
- */
- public Image getImage() {
- return DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_SRC_LOOKUP_TAB);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
- fSourceLookupPanel.activated(workingCopy);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose()
- */
- public void dispose() {
- if (fSourceLookupPanel != null) {
- if (fSourceLookupPanel.getDirector() != null) {
- fSourceLookupPanel.getDirector().dispose();
- }
- fSourceLookupPanel.dispose();
- }
- fSourceLookupPanel = null;
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getErrorMessage()
- */
- public String getErrorMessage() {
- if (fSourceLookupPanel != null) {
- return fSourceLookupPanel.getErrorMessage();
- }
- return super.getErrorMessage();
- }
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getMessage()
- */
- public String getMessage() {
- if (fSourceLookupPanel != null) {
- return fSourceLookupPanel.getMessage();
- }
- return super.getMessage();
- }
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java
deleted file mode 100644
index 5f8d0f05f..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.debug.ui.sourcelookup;
-
-import java.util.ArrayList;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.sourcelookup.ISourceContainer;
-import org.eclipse.debug.core.sourcelookup.ISourceContainerType;
-import org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer;
-import org.eclipse.debug.core.sourcelookup.containers.FolderSourceContainer;
-import org.eclipse.debug.core.sourcelookup.containers.ProjectSourceContainer;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.ui.IWorkingSet;
-
-/**
- * A working set in the workspace. Source is searched for in the projects (referenced
- * projects) and folders (sub-folders) that are part of the working set.
- * <p>
- * This class may be instantiated.
- * </p>
- * @since 3.0
- * @noextend This class is not intended to be subclassed by clients.
- */
-public class WorkingSetSourceContainer extends CompositeSourceContainer{
-
- private IWorkingSet fWorkingSet;
- /**
- * Unique identifier for the working set source container type
- * (value <code>org.eclipse.debug.ui.containerType.workingSet</code>.)
- */
- public static final String TYPE_ID = DebugUIPlugin.getUniqueIdentifier()+".containerType.workingSet"; //$NON-NLS-1$
-
- /**
- * Creates a source container for the working set.
- * @param workingSet the working set represented by this container
- */
- public WorkingSetSourceContainer(IWorkingSet workingSet) {
- fWorkingSet = workingSet;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getName()
- */
- public String getName() {
- return fWorkingSet.getName();
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- if (obj != null && obj instanceof WorkingSetSourceContainer) {
- return ((WorkingSetSourceContainer)obj).fWorkingSet.equals(fWorkingSet);
- }
- return false;
- }
-
- public int hashCode() {
- return fWorkingSet.hashCode();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getType()
- */
- public ISourceContainerType getType() {
- return getSourceContainerType(TYPE_ID);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer#createSourceContainers()
- */
- protected ISourceContainer[] createSourceContainers() throws CoreException {
- IAdaptable[] elements = fWorkingSet.getElements();
-
- if(elements == null)
- return new ISourceContainer[0];
-
- ArrayList locationList = new ArrayList();
- for (int i = 0; i < elements.length; i++) {
- IResource resource = (IResource) elements[i].getAdapter(IResource.class);
-
- if (resource != null) {
- switch (resource.getType()) {
- case IResource.FOLDER:
- locationList.add(new FolderSourceContainer((IFolder)resource, true));
- break;
- case IResource.PROJECT:
- locationList.add(new ProjectSourceContainer((IProject)resource, true));
- break;
- //if the element corresponds to an IFile, do nothing
- }
- }
- }
- return (ISourceContainer[])locationList.toArray(new ISourceContainer[locationList.size()]);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/package.html b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/package.html
deleted file mode 100644
index abf2aab9b..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/package.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>Eclipse Debug Platform</title>
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<p>Provides a user interface for debug platform source lookup facilities.</p>
-
-<h2>Package Specification</h2>
-
-<p>This package provides classes implementing a user interface for source lookup
- facilities based on the source lookup director architecture defined in <code>org.eclipse.debug.core.sourcelookup</code>.
- A source lookup tab and dialog are provided that allow the user to modify a
- source lookup path.</p>
-<blockquote>&nbsp;</blockquote>
-</body>
-</html>

Back to the top